NPC/Monster JSON Behavior Flags

…one of the unfortunate aspects of a game like this is that its easier to make suggestions then to implement them, heh. If you had a coder for even every 10 posts in this forum, this game would probably be self aware…

Sorry to add to the problem! I also apologize if what I’m asking is either already possible, or impossible to code. Its just inspired by me looking through the .json and trying to figure out what is possible or not possible.

Here’s my suggestion, then. I’ve been looking through the monster and npc json trying to understand them and figure out how to add in some interesting critters. But I’ve noticed that the number of behavior flags is rather limited. I’d like to suggest a few more. Like for instance, I was wondering … and I’m still trying to figure out enough to see how this would work or if its even possible … to set like, for monsters, a ‘preferred’ location by season/day and season/night, and have the monster path to it?

So for instance, you could have:

{
“type” : “MONSTER”,
“id” : “mon_bat”,
“name”: “bat”,
“species”:“MAMMAL”,
“default_faction”:“small_animal”,
“symbol”:“w”,
“color”:“brown”,
“size”:“TINY”,
“material”:“flesh”,
“diff”:4,
“aggression”:-25,
“morale”:5,
“speed”:230,
“melee_skill”:4,
“melee_dice”:1,
“melee_dice_sides”:1,
“melee_cut”:1,
“dodge”:8,
“armor_bash”:0,
“armor_cut”:0,
“vision_day”:20,
“vision_night”:20,
“luminance”:0,
“hp”:10,
“death_function”:“NORMAL”,
“special_attacks”:[[“BITE”, 0]],
“description”:“One of the vesper bats, a family of winged insect-eating mammals. It roosts in caves and other hollows, and uses a form of echolocation to aerially navigate through tricky terrain at rapid speeds.”,
“flags”:[“SEES”, “SMELLS”, “HEARS”, “GOODHEARING”, “WARM”, “FLIES”, “ANIMAL”, “BONES”, “LEATHER”],
“fear_triggers”:[“SOUND”, “PLAYER_CLOSE”],
“categories”:[“WILDLIFE”]
}

And then add a flag to it to have it set as pathing to the nearest forest in SUMMERNIGHT AUTUMNNIGHT and SPRINGNIGHT, and the nearest open interior location in SUMMERDAY AUTUMNDAY AND SPRINGDAY, and to path to the nearest cave in WINTERNIGHT AND WINTERDAY.

If there was an easy way to even make specific monsters path to specific ‘types’ of nearby locations in different times, modders, even stupid modders like me, could have bears seek out hibernation spots in the winter, for instance, or have wolves seek shelter inside at night. (imagine finding a bunch of wolves in a house on a raid). It would also make it possible to make more unique monsters, who might stay inside during the night and only come out during the day, for instance, or vice-versa. Depending on how the pathing was handled, you could see emergent behaviors coming out not currently possible, depending on whether they try to break into a sealed place that meets their parameters or path to another one.

It would probably make it possible to make npcs who seek out certain types of areas, even if they don’t do anything much in them.

As a secondary suggestion, or alternative suggestion, it would be nice to be able to have a flag that restricts a monster, npc or building from appearing before a certain period of time. So you could make ‘ruined’ versions of various buildings and have them show up after certain periods of times, so you could get what appears to be different levels of building decay, or ecologies forming. So someone could go in and modify each building for a year later, 2 years, 5 years, etc. You could go in and put a version of a mansion that shows up after two years where the zombies are cleared out, and it has wolves and squirrels living in it, and trees growing out of the dining room, for instance, which now has no roof, or whatever. Even if the above suggestion about behavior flags wasn’t possible, you could fake it (i think) with good enough time controls on building appearance/variations.

Ecologies etc. won’t happen for a loooonger while.
Wandering to locations also probably won’t happen soon, though it wouldn’t be hard to implement.

However preference for particular seasons at times of the day already exists, although in a rather simple form. It is implemented in data/json/monstergroups.json as conditions.
While conditions are pure binary, by making the animal spawn few times with different conditions you can make the spawn more probabilistic (say, one bat with condition: night, other with condition night, dusk and dawn and one without conditions).

I’ll have to check into your advice on season preferences. I’m not sure I entirely follow it, but perhaps with a bit of experimentation it’ll become more clear. I’ll take a look at it.

Kinda surprised on the ecologies bit. I mean - I wasn’t directly suggesting an actual implementation of ecologies, so much as an easy cheat, I thought. I mean, if you just look at linking world-generation building types to a time-dependent variable…wouldn’t that be as easy as shoving in a single time-dependent variable? Then the rest is just backended to a large number of variations on already-created buildings. Its been awhile since I coded anything, granted, but I would have guessed that was something planned for already, since there’s no building decay over time right now, and it allows for a lot of easy stuff being put in.

Oh you mean creature numbers increasing/decreasing with time based on the time alone.

That also is in. In the same monstergroups.json there are monster groups with “start” and “end” values. If current date is less than “start” or more than “end”, the monster is not considered for spawning. Not sure what are the units here.