This post, akin to a previous post, will be covering multiple weeks in development, as my time was spent on other, higher-priority tasks. An external project I am developing alongside this is a team-based project - SpiritSweeper. Our team had a string of crucial deadlines and meetings over the span of multiple weeks; it was crucial for the team that I reallocated time towards this project as best as I could. As such, my workflow dedicating to this project was required to take a momentary backseat. This isn't to say I didn't do anything, I was still able to find the time to work on this project occasionally.
Now, however, these meetings and deadlines are over, and I can continue to work on and dedicate time to this project to its maximum.
Over the course of the past multiple weeks, however, I came across a major roadblock with the mod. I went back to finish the Titan entity and found that, due to limiting scope, I will not be able to finish the Titans.
This is due to their behaviour, specifically dietary and hunger requirements. The main issue is, from the source material, the sole and only things Titans seek out to eat are human beings, animals and wildlife are left alone and ignored completely. However, this is not an option for the AI in RimWorld; for the portion of the AI that manages hunger and food, there is no distinction between humans and any other meat source.
This is because of how RimWorld handles dietary requirements. RimWorld has various food types, such as Corpses, Meat, Raw Vegetables, Kibble, Cooked Food, etc. All of these meal values have a corresponding value, that value always being a multiple or sum of 2, EG 1, 2, 4, 8. Dietary types are measured in other numbers, that is to say that if there was a diet type that only ate corpses, and the Corpses food value was 1, then the diet types food value would also be 1. If a diet type was more open, eg the <carnivourousAnimal> diet type, which would eat corpses, meat and cooked food, and the food type value for these were 1, 2, and 16 respectively, then the diet type value would be 19.
These numbers are not the correct numbers, but selected to showcase the issue here in a more simple way.
As there isn't a Food Type for Humans specifically, and by this system, it would be impossible to create one without completely re-writing the entirety of C# code that handles the food AI, then creating a diet type that specifically features humans would be impossible.
There were, however, other options for the Titans to hunt down humans - the cannibal trait, the manhunter status as well as the manhunter event.
The cannibal trait can be immediately written off for two reasons: Traits are based solely on random generation during a character's creation, that aspect of the game being handled by the games C# hard code. There is no way to have a creature listed as a cannibal by default, and increasing the chance of it being present for one creature would increase the chances for it in every creature that can have traits. This brings me to the second reason using the cannibal trait won't work, and an issue I massively overlooked: Non-Human creatures can not have Traits. This is because of the way the game handles its AI: <ThinkTrees>. These are how RimWorld manages its AI, each creature has a "ThinkTree" that call upon different nodes of itself depending on the situation. Creatures like animals, that the Titans take their AI from, are missing the necessary nodes to have Traits, as the Human <ThinkTree> is far more complex than any others. This means that in order to give Titans traits, I would have to completely recreate them, this time using a Human as a base for the modding. Even if this were an option scope-wise, it still wouldn't make this option possible, so this is ruled out.
The manhunter status effect was the next considered option, but this falls under a similar effect as the previous trait issue: you can not issue a status effect to a creature via its own XML file. As such, the next option is to use events to ensure that they are the only way they spawn: with the manhunter trait. This will result in me having to change how the Titans spawn, in order to prevent them from spawning naturally, and to create a custom event that spawns manhunting Titans. This, unfortunately, will have to be pushed to a stretch goal for now.
Next week I will begin working on Anti-Titan weaponry, as if only the Titans, Titan walls and ODM Gear are present in the mod, I can call it a relative success.