Extending behavior "cleanly" / "Ronin" Mod

I have this idea for a Ronin / Man with No Name mod. One thing that would be cool would be to have the lower level townspeople be afraid of her. With the intention based behavior this would be pretty easy to add, but will the AI system be set up in such a way that we don’t have to clobber files?

Will the AI process all of the observation in a directory for a specific unit, then all the intentions from another directory? Or will it look for specific files based on the json metadata?

Could you explain a bit more in detail the interaction you have in your mind between the Ronin and Townspeople?

I could imagine that there will be some behaviours which you might just “copy and paste”. E.g. it would make sense that Townspeople are afraid of animals in the wild, so once they are in their range, Townspeople try to avoid them and change the direction towards which they are heading. So if running away or avoiding would be enough expression of “being afraid”, that might be an easy way to achieve.

My question is more generic then the example I gave. I guess I am asking how mods interact and get combined, without cut and paste (I hate cute and paste code :wink: ) or clobbering each other.

For my specific case the townspeople would initially fear the Ronin (except soldiers or the more advanced tradesmen). Over time they would get used to the Ronin and not be fearful when he was around. I would want the fear-of-ronin-x, fear-of-ronin-y, and fear-of-large-animals to be tracked separately. Maybe this could be done by giving of a declining level of fear inducing messages to nearby townspeople, that would avoid changes to the townspeople, but I don’t think it would work quite right.

I see, but am not sure if someone else than our fellows from Radiant can already answer in this detail.

Based on the Mod-Stream, I could imagine that you could adjust the “Observer”-System of the Villager-Class to react on the Ronin. As each creature in the game should run as a separate thread, so they will have a separate list of variables once generated. You could add another variable into the Villager-Class which tracks his standing towards the Ronin (just like there will be a variable tracking hunger, etc.). Once the villager meets the Ronin, the “Observer” of the specific Villager-AI will has to fire a message to the “Intention”-System. Either the “Observer”- or “Intention”-System will have to check for the variable which tracks the standing towards your Ronin. Based on the standing you can fire the right activity-request to the “Action”-System and also adjust the variable (e.g. reduce threat-level each time your villager meets the Ronin).

I guess you can also expect that there is the possibility that one AI is sending messages (activities) to another AI. In this case you could implement the logic in your Ronin-Class and send activities to the villagers crossing his path. But here I do not think that it will be efficient to track the standing of each single villager in the Ronin-Class (might be quite some at the end of the day). However, if you want to have just one Standing (Townspeople vs. Ronin), that might be the better place to put the logic in.

1 Like

I figured that the folks from Radiant will have to figure it out, just want to get the idea out there so it has some simple support :smiley: