1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

Tweaking Zombie Fortress Mode

Discussion in 'Requests' started by Frikman, Jun 22, 2016.

  1. Frikman

    Frikman Bison Rider

    Messages:
    162
    Since Eanmig has been missing for almost a year, I guess I need to ask for help and requests here. I really enjoy playing ZF on classic, and I got really excited when it got modded into the beta/release, but it has it's flaws. I've tried tweaking some stuff, but it's way too complicated for me in comparison to classic scripts, so I'm asking for help with the following things:

    General AI
    The AI of zombies in general is pretty dumb. Increasing their search radius does help, but it's still lacking. Most of the time zombies won't target structures, not even wraiths, unless there's a player nearby.

    Zombie
    The generic zombie feels way too fast. When trying to climb it'll normally do it at a faster speed than it's walking speed, which is obviously wrong. Their hitboxes are also weird, and their attacks do damage early on the animation. They also tend to jump really high when bumping on other mobs, up to 10 tiles some times.

    Skeleton
    Skeletons are the ones that suffer the most from the AI, rending them useless most of the time. They won't climb walls or ceillings, and of course won't target wood structures.

    Zombie Knight
    ZKnights are also faster than what they should, and just as zombies they can jump really high when bumping on zombies or walls. They also have a small knockback compared to their classic counterpart, and don't break stone blocks or structures as often. ZKnights are supposed to be tougher than normal zombies, but they really are just another mob.

    Wraith
    As I said earlier, wraiths rarely ever target structures. Their flying speed feels a little too fast, and they don't appear too often.

    Greg
    Gregs fly way too fast, and their movement is really erratic.

    Boss
    The current Zknight boss is alright, but sometimes it won't spawn. I believe it's because of the zombie limit per map. On my server I replaced the sprite he uses for this one (AltMonstrosity for kag classic, slightly modified by me). Feedback about the sprite would be appreciated.
    http://puu.sh/pCdnt/c6f882940b.png

    Migrants
    They never spawn. Other than that I don't know what could be fixed about them.

    Other Stuff
    Knight and Archer workshops should give the option to switch back to builder. I'd like to add some extra zombies, like Chickens, Bisons and maybe Sharks for water maps. I'd also like to add classic trap bridges for making ladders.

    If anyone is interested on making ZF greater than ever, reply to this post c:
     
    Sytoplasma and PUNK123 like this.
  2. Aphelion

    Aphelion Wunderkind Donator
    1. Aphelion's Roleplay

    Messages:
    180
    A long time ago...
    I'm not going to take the time to the entire mod working now, but the zombies are perfectly functional. So, here's my contribution. It's easily tweakable, and includes two new mobs (Ankou and Banshee).
     

    Attached Files:

    Last edited: Jun 22, 2016
  3. Frikman

    Frikman Bison Rider

    Messages:
    162
    That's awesome! Still, I have a few questions about it. How can I make ZFM load this? When I tried editing the rules to load a Chicken it just wouldn't work. Any help with it?
     
  4. Aphelion

    Aphelion Wunderkind Donator
    1. Aphelion's Roleplay

    Messages:
    180
    1. Create a new folder in the mods directory, name it SmartZombies, put the contents of the zip inside
    2. Edit mods.cfg to this:
    Code:
    SmartZombies
    Zombies_v1.071
    3. Delete the folder Entities/Natural/Animals from Zombies_v1.071
    4. Edit zombie_rules.as
    Go to line 399, replace:
    Code:
                    if (map.getDayTime()>0.8 || map.getDayTime()<0.1)
                    {
                        //Vec2f sp(XORRandom(4)*(map.tilemapwidth/4)*8+(90*8),(map.tilemapheight/2)*8);
                   
                        Vec2f sp = zombiePlaces[XORRandom(zombiePlaces.length)];
                        int r;
                        if (actdiff>9) r = XORRandom(9); else r = XORRandom(actdiff);
                        int rr = XORRandom(8);
                        if (r==8 && rr<wraiteRate)
                        server_CreateBlob( "Wraith", -1, sp);
                        else                                   
                        if (r==7 && rr<3)
                        server_CreateBlob( "Greg", -1, sp);
                        else               
                        if (r==6)
                        server_CreateBlob( "ZombieKnight", -1, sp);
                        else
                        if (r>=3)
                        server_CreateBlob( "Zombie", -1, sp);
                        else
                        server_CreateBlob( "Skeleton", -1, sp);
                        if (transition == 1 && (dayNumber % 5) == 0)
                        {
                            transition=0;
                            rules.set_s32("transition",0);
                            Vec2f sp = zombiePlaces[XORRandom(zombiePlaces.length)];
                            server_CreateBlob( "BossZombieKnight", -1, sp);
                        }
                   
                    }
    with this:
    Code:
                    if (map.getDayTime()>0.8 || map.getDayTime()<0.1)
                    {
                        //Vec2f sp(XORRandom(4)*(map.tilemapwidth/4)*8+(90*8),(map.tilemapheight/2)*8);
                   
                        Vec2f sp = zombiePlaces[XORRandom(zombiePlaces.length)];
                        int r;
                        if (actdiff>9) r = XORRandom(9); else r = XORRandom(actdiff);
                        int rr = XORRandom(8);
                        if (r==8 && rr<wraiteRate)
                        server_CreateBlob( "wraith", -1, sp);
                        else                                   
                        if (r==7 && rr<3)
                        server_CreateBlob( "greg", -1, sp);
                        else               
                        if (r==6)
                        server_CreateBlob( "zombie_knight", -1, sp);
                        else
                        if (r>=3)
                        server_CreateBlob( "zombie", -1, sp);
                        else
                        server_CreateBlob( "skeleton", -1, sp);
                        if (transition == 1 && (dayNumber % 5) == 0)
                        {
                            transition=0;
                            rules.set_s32("transition",0);
                            Vec2f sp = zombiePlaces[XORRandom(zombiePlaces.length)];
                            server_CreateBlob( "banshee", -1, sp);
                        }
                   
                    }
    Likely because you entered "Chicken" instead of "chicken"
     
    Last edited: Jun 23, 2016
  5. Frikman

    Frikman Bison Rider

    Messages:
    162
    It works! and thanks to you zombies are smarter than ever <3. I have two other questions now tho
    1. Is there any way to modify zombies maximum health? this guys are not only smart, but really tough, even for skeletons.
    2. How could I enable the ZFM boss without breaking the mods? Do I need to make a folder for it inside SmartZombies and edit zombie_rules.as to include it? If so, would this mean I'd be able to add any kind of custom zombie?

    [​IMG]
     
  6. Aphelion

    Aphelion Wunderkind Donator
    1. Aphelion's Roleplay

    Messages:
    180
    You can modify the health by editing the field at the bottom of .cfg files in each mob's folder. It's also possible to modify damage and attack frequency, among other things in each mob's main script. There wouldn't be much of a point in adding the ZFM boss, as you could easily recreate it by cloning the zombie knight and making some changes.

    To make custom zombies spawn, simply by modify the code I mentioned in the previous post.
     
  7. Frikman

    Frikman Bison Rider

    Messages:
    162
    So, I've been able to add zombies and tweak their damage, speed, etc. Pic related is a zombie bison (it was hard finding an old image concept of it). I was wondering a few things, what should I modify to make some zombies break stone blocks?
    Am I correctly setting the difficulty at which zombie types will spawn or using a value higher than 9 will break the game?
    How can I make flying enemies that attack you without picking you up or exploding?

    Code:
                    if (map.getDayTime()>0.8 || map.getDayTime()<0.1)
                    {
                        //Vec2f sp(XORRandom(4)*(map.tilemapwidth/4)*8+(90*8),(map.tilemapheight/2)*8);
                  
                        Vec2f sp = zombiePlaces[XORRandom(zombiePlaces.length)];
                        int r;
                        if (actdiff>9) r = XORRandom(9); else r = XORRandom(actdiff);
                        int rr = XORRandom(8);
                        if (r==8 && rr<wraiteRate)
                        server_CreateBlob( "wraith", -1, sp);
                        else                                  
                        if (r==9 && rr<4)
                        server_CreateBlob( "garg", -1, sp);
                        else
                        if (r==7 && rr<3)
                        server_CreateBlob( "greg", -1, sp);
                        else                   
                        if (r==20)
                        server_CreateBlob( "hell_knight", -1, sp);
                        else                   
                        if (r==14)
                        server_CreateBlob( "zombie_knight", -1, sp);
                        else
                        if (r>=10)
                        server_CreateBlob( "ankou", -1, sp);
                        else
                        if (r>=7)
                        server_CreateBlob( "zbison", -1, sp);
                        else                   
                        if (r>=3)
                        server_CreateBlob( "zombie", -1, sp);
                        else
                        if (r>=1)
                        server_CreateBlob( "skeleton", -1, sp);
                        else                   
                        server_CreateBlob( "zchiken", -1, sp);
                        if (transition == 1 && (dayNumber % 5) == 0)
                        {
                            transition=0;
                            rules.set_s32("transition",0);
                            Vec2f sp = zombiePlaces[XORRandom(zombiePlaces.length)];
                            server_CreateBlob( "banshee", -1, sp);
                        }

    [​IMG]
    --- Double Post Merged, Jun 26, 2016, Original Post Date: Jun 23, 2016 ---
    Update: After a few days of experimenting, I've managed to get a somewhat stable version of all this.
    If a caring soul would be willing to look at the code and tell me how can I set a delay for the start of the zombies's attacks (currently they start on the first frame, before their animation has even finished), a way to implement more of the Necromancer's animations (crouch, knocked, etc) and maybe add Gliders or any sort of flying vehicle, that'd be really great.

    Also, I'm trying to animate this dude. Some help and feedback would be appreciated c:
    [​IMG]
     

    Attached Files:

    SirDangalang likes this.