Back after a long brake with some mod plans

I have been playing CDDA on and off for a long time now (pre-kick-starter). After coming back to it a week ago I have decided I want to put my mostly completed CS degree to use and take a real stab at improving cataclysm. I have 2 mods partially planned out that I will (hopefully) be bringing to you soon. The first is a content addition mod adding a bunch of items and other stuff I want and will allow me to familiarize myself with CDDA’s code before moving on to my more complicated project: designating bases and a new @base AI for NPC followers.

Here is a brief overview of what i’m planning (Names subject to change). I’ll make new topics for each of them once I’m a little farther along but I wanted to go ahead and say hi and, let everyone know what I was thinking.

Personal Mobility Mod (Skates and Rollers)

Skater is one of my favorite starting professions however, rollerskates/rollerblades rapidly loose their value in the upon reaching mid-game and are nothing but a hindrance in the end-game. You can build a 10 ton death machine why are the options for putting wheels on yourself so small? This mod changes that. Highlights include:

[ul][li]Roller Flags - (different sizes) because the actual speed part of skates is not implemented logically right now. Easy moment on flat,hard surfaces; hard/impossible movement on others.[/li]
[li]Armoured Rollerskates - traditional skates just more metal.[/li]
[li]Rollerpons - basically crampons with wheels instead of spikes. Spring-loaded mechanism lets you switch between having skates or walking like normal[/li]
[li]Motorized Skates - Air gears for you anime buffs. (more realistic version) power them up and leave the zombies behind. (just don’t crash into something)[/li]
[li]Mobility Oriented Power Armour[/li]
[li]Police Tracker Profession - Cybernetic technology has opened up new doors for criminals trying to escape justice. So, how do the police manage to catch these super villans? Simple, they simply send you.[/li]
[li]Toy/RC Cars, Scooters - you gotta get the wheels and motors from somewhere right?[/li]
[li]Roller Bags, Rolling Drawers, Hand Truck, Swivel Chairs - I’m adding rollers so why not?[/li]
[li]Rocket Powered Skates/Boards - Again, why not? It’s an entertaining way to get rid of unwanted NPCs[/li][/ul]

Bases Mod

Allows the player to designate a location on the map as a base. This then acts as a springboard for improvements in the functionality and utility of follower NPCs. The goal is to create a user-friendly way to change NPC behavior depending on whether they are at home or in the field and enable “set it and forget it” NPC base defense. That is, you can tell followers to guard the base and they will arm themselves, defend it, eat, sleep, drink and leave your important stuff alone.

This can be accomplished by creating a new version of the NPC AI for base behavior and swapping the AIs when they are instructed to “Stay at the base and keep watch/rest/craft/be construction slave etc.” They would then stay at the base’s location and follow the rules of the new AI. (inside=safe NPC. outside=zombie food NPC) Later if the player needs something to distract the hoard while they sneak past, they just have to walk up to the NPC and say “come with me.” and the NPC will switch back to the normal AI.

Using paint or permanent markers, doors and stairs could be marked “no access” to block off rooms for the player’s junk and keep NPCs from wandering into dangerous places. Similarly, the NPC could claim a locker and/or bed as theirs giving a loyalty penalty if disregarded by the player. Finally, another locker/cabinet can be marked “communal.” The NPCs can deposit stuff they don’t want here and tale stuff they want/need from it. This facilitates trading among your followers and allows the player to keep his followers fed and loaded by just dumping a bunch of stuff in the painted box occasionally. This also makes a good spring board for independent NPC resource runs; they go out and scavenge for food or whatever and dump it in the communal locker.

You mentioned mobility oriented power armor, would there be a possibility of XCom style grappling hooks/jetpacks on that? Because that would be awesome. Especially if the grappling hook could be used as a weapon.

any improvement to the ai is welcome, I say

I agree that it would be awesome however, I would also be a lot of work since you would need to create the mechanics from scratch and I would much rather spend that time one the base AI.

some neat ideas :slight_smile:

Pull off the a good AI and you will be a legend here, I for one can’t stand how dumb NPCs are in the current version. Though they have gotten better in the past couple years!

After spending a few hours reading the source code I have reached the conclusion that adding items that alter player movement speed requires direct modification of the actual calculation code and therefore is impossible (or at least annoyingly difficult) to do in the form of a mod. (I haven’t done more than minor edits in c++ or lua but I have worked in C and so many other languages I can read them just fine) I have some ideas what to do but that is going to be a github discussion though.

On the other hand, i’ll have a project outline for the base AI in the next couple days. (assuming of course I stop actually playing cdda for a while and don’t decide to change everything… again)

I really like the idea of better NPC AI and base mechanics and am excited to see it get fleshed out, best of luck to you and thanks for contributing!

I agree that it would be awesome however, I would also be a lot of work since you would need to create the mechanics from scratch and I would much rather spend that time one the base AI.[/quote]
Would it be possible to use the grabbing mechanic from those zombies that grab you from a few tiles away and pull you toward them? You could try using teleporting for the getting around part, but I dunno if it would be possible to limit it to only near walls.

I agree that it would be awesome however, I would also be a lot of work since you would need to create the mechanics from scratch and I would much rather spend that time one the base AI.[/quote]
Would it be possible to use the grabbing mechanic from those zombies that grab you from a few tiles away and pull you toward them? You could try using teleporting for the getting around part, but I dunno if it would be possible to limit it to only near walls.[/quote]

Personally, I would go the route of using the firing mechanic to shoot the grapple and than the vehicle’s move mechanic for the pull. This way, you don’t need to worry about aiming as it will get auto updated (looking forward to z-level aiming… got my plans to build a tower) and you get the collision mechanic for all the Z’s (or other stuff) in the move path. A weight comparison possibly influence by terrain and MAYBE somewhat by strength would determine if you or the Z you shot the face moves. Later, someone could go back and use the fire animation to draw the chain and if they want to be really fancy make it so you fire once to shoot it and fire again to reel so you can use it as a trip rope/ barricade.

Your welcome to add it i’m going to spend my time playing or working on the AI and possibly overhauling the movement calculation to make it more flexible and streamlined.

I agree that it would be awesome however, I would also be a lot of work since you would need to create the mechanics from scratch and I would much rather spend that time one the base AI.[/quote]
Would it be possible to use the grabbing mechanic from those zombies that grab you from a few tiles away and pull you toward them? You could try using teleporting for the getting around part, but I dunno if it would be possible to limit it to only near walls.[/quote]

Personally, I would go the route of using the firing mechanic to shoot the grapple and than the vehicle’s move mechanic for the pull. This way, you don’t need to worry about aiming as it will get auto updated (looking forward to z-level aiming… got my plans to build a tower) and you get the collision mechanic for all the Z’s (or other stuff) in the move path. A weight comparison possibly influence by terrain and MAYBE somewhat by strength would determine if you or the Z you shot the face moves. Later, someone could go back and use the fire animation to draw the chain and if they want to be really fancy make it so you fire once to shoot it and fire again to reel so you can use it as a trip rope/ barricade.

Your welcome to add it i’m going to spend my time playing or working on the AI and possibly overhauling the movement calculation to make it more flexible and streamlined.[/quote]
I’m not a modder in the slightest, unfortunately. I was just helping to brainstorm.

Rollerpons

I want this so bad. Switching between rollerskates and hiking boots is a time consuming process that can easily kill a skater that gets cocky (assuming they even have enough inventory space for spare shoes)

Suggestion: wearable shoes. Tie shoes to your pack/belt using the laces. This would effectively make carrying normal shoes cost encumbrance and weight but not cost any volume. Vital, as a skater who doesn’t have a backpack yet really, really needs an easy way to carry a spare set of shoes around. This feature alone would add this mod to my must-haves list.

Base AI

THIS is the way to make AI: divide, simplify, and conquer. If you can accomplish the following you will be put on must have list:

NPCs defend base (and no zombies/wildlife spawn inside base)
NPCs are automatically hostile to hostile NPCs (and hostile NPCs cannot spawn within 2 overmap tiles of base)
NPCs automatically “defend” my base from NON hostile NPC looters (non hostile NPCs cannot spawn in base, and never path into the base)
NPCs feed themselves from communal stockpile
NPCs heal themselves from communal stockpile (ESPECIALLY disinfect, radiation, and other status effects)
NPCs rearm from communal stockpile (Only for grabbing ammo/throwables, they shouldn’t grab weapons - I’ll manually give them appropriate weapons. There are MANY reasons they should use a weapon the AI considers “inferior” (ammo availability and ease of crafting, roleplay, weapons with special attributes like reach/range/block/martial arts, terrain, noise, common enemy types in current biome, and a dozen other variables that no AI could possibly take into account)).

The above is what I consider the bare minimum to make NPCs viable, and should be prioritized above everything else. Making a populated home that feels safe and sustainable would be an incredibly luxury in the Cataclysm (until a horde of worms invade but let’s try not to think about that…)

Secondary goals: NPCs repair/reinforce clothing, automatically crafting items as they run out (ex: if we have less than 200 arrows, craft more). This would turn NPCs from being attention hogs to a glorious convenience.

Stretch goals: Jobs, like producing loot on simulated hunting/scavenging trips (especially tedious stuff like gathering rocks, foraging bushes, hunting small game, fishing, etc), simulate looting tiles that you designate with overmap notes, tell follower(s) to pick up everything on a specific tile, tell follower(s) to dump all non essential loot into communal storage, large scale raids on your base (ideally give 1-2 day warning that “a giant horde/gang is coming”), etc.

Honestly, there are only two mistakes you can make here: Getting too ambitious and burning out, and trying to make the AI too smart instead of letting the player tell the NPCs what to do.

[quote=“RedPine, post:12, topic:14203”]> Rollerpons

I want this so bad. Switching between rollerskates and hiking boots is a time consuming process that can easily kill a skater that gets cocky (assuming they even have enough inventory space for spare shoes)[/quote]

I really do want them but I still can’t figure out how the rollerskates/blades movement is implemented (it’s not in the base move speed function or anywhere else logical). Hard coding them into the move speed function would be very straight forward but than your just asking for conflicts to happen if you can’t put all the movement items in one place. Personally, i’d like to overhaul the movement stuff to have a movement speed modifier(s) instead of a bunch of if statements. That way adding movement speed items would be easy, the game would run faster (take slightly more memory but eliminate need to redo calculation every turn) and most importantly, the @ screen could then show you, your action speed, movement speed and the base terrain movement cost so you can figure out if you will be able to run. However, I am still not familiar enough with the code to try attempting it as it probably has dependencies all over the place(ugg trying to explain code changes… I can give a more technical code explanation of my thoughts elsewhere if anyone’s interested)

Suggestion: wearable shoes. Tie shoes to your pack/belt using the laces. This would effectively make carrying normal shoes cost encumbrance and weight but not cost any volume. Vital, as a skater who doesn't have a backpack yet really, really needs an easy way to carry a spare set of shoes around. This feature alone would add this mod to my must-haves list.

That [SHOULD] be fairly straight forward as so many other things are wearable you just need to copy tags and what not. Better yet, see if you can have them put onto backpacks (sheath mechanic) with a small increase in encumbrance rather than taking up you “strapped” slot.

THIS is the way to make AI: divide, simplify, and conquer. If you can accomplish the following you will be put on must have list:

This is what i’m doing. I made an outline in word and kept adding layers until it reached methods and then copied them over as TODO methods. I was thinking about posting the higher levels of it (idea parts not the implementation part) to get feed back…

NPCs defend base (and no zombies/wildlife spawn inside base) NPCs are automatically hostile to hostile NPCs (and hostile NPCs cannot spawn within 2 overmap tiles of base) NPCs automatically "defend" my base from NON hostile NPC looters (non hostile NPCs cannot spawn in base, and never path into the base)
Hadn't specifically included these. Was just planning on copying IFF from normal npc AI. No spawning is a good Idea. Kill bandits as well. Kinda want to leave the personal issues hostility be though.
NPCs feed themselves from communal stockpile NPCs heal themselves from communal stockpile (ESPECIALLY disinfect, radiation, and other status effects) NPCs rearm from communal stockpile (Only for grabbing ammo/throwables, they shouldn't grab weapons - I'll manually give them appropriate weapons. There are MANY reasons they should use a weapon the AI considers "inferior" (ammo availability and ease of crafting, roleplay, weapons with special attributes like reach/range/block/martial arts, terrain, noise, common enemy types in current biome, and a dozen other variables that no AI could possibly take into account)).

automatically crafting items as they run out


Already in the plan except, the way i’m planning it you will get a lot more input into their load out decisions (Please don’t use X ammo, go for Y ammo if you can etc.) but at the end of the day, they are your followers, not your mind controlled drones. They have a will of their own and should act as they believe is best for their survival. If you stock piled guns and than handed me a cudgel, I wouldn’t try to beat down a Zombie Hulk, i’d pick up the biggest gun you had and shoot it in the face. Why shouldn’t the NPCs do the same? Maybe as a future goal have loyalty determine their willingness to follow orders/ increase weight of player wishes?

    if( is_wearing( "roller_blades" ) ) {
        if( on_road ) {
            movecost *= 0.5f;
        } else {
            movecost *= 1.5f;
        }
    }
    // Quad skates might be more stable than inlines,
    // but that also translates into a slower speed when on good surfaces.
    if( is_wearing( "rollerskates" ) ) {
        if( on_road ) {
            movecost *= 0.7f;
        } else {
            movecost *= 1.3f;
        }
    }

Speaking on NPCs, I’d like to add something if you haven’t already thought of it: I’d really like to be able to leave a pile of books somewhere and have NPCs automatically learn skills from them. Especially if I could separate NPCs into fighters (learn dodge, gun skills and melee skills), scavengers (Learn mechanics for lockpicking, survival, driving and some combat skills) and crafters (learn the crafting skills). This would let NPCs prioritise what you want them to learn and stop Steve the 13 strength 6 intelligence juggernaut from trying to learn electronics.

Once they’ve got their skills up, it’d be nice to give a set of stockpile instructions for crafters. For example, I want 10 poppy painkillers, 10 Prussian blues and 10 first aid kits at all times. Crafters would fulfill these instructions, scavengers could focus on raiding areas with these things and fighters might go to the effort of looting corpses for them.

[quote=“Zhilkin, post:14, topic:14203”]https://github.com/CleverRaven/Cataclysm-DDA/blob/44d7c843ff59601d058180700b7ae2058ceb09cd/src/player.cpp#L2009-L2024

if( is_wearing( "roller_blades" ) ) { if( on_road ) { movecost *= 0.5f; } else { movecost *= 1.5f; } } // Quad skates might be more stable than inlines, // but that also translates into a slower speed when on good surfaces. if( is_wearing( "rollerskates" ) ) { if( on_road ) { movecost *= 0.7f; } else { movecost *= 1.3f; } } [/quote]

I went and read that entire file… Apparently I missed it… now I feel like an idiot… still = wants an overhaul, they should make you go faster on floors as well.

EDIT: Their should be something about them in melee.cpp that I missed as well… I’m going to take a quick break from the AI and do the movement overhaul so to allow for stuff to be added. Shouldn’t take too long as I have it all planned out but c++ is a new language for me and i’m spending most of my day elsewhere.