This week, I finalised my plans, created an extensive document on how exactly I can create each asset, and created the first XML asset in this project: Titan Walls.
Note:
This blog contains information relating to the show Attack On Titan, as that is where the content for the mod is being taken from. As such, every blog post after this one will contain spoilers for the original story content.
This page is a showcase of my research and planning on how to create the functionality for each asset. There are two parameters here that I kept track of when planning: the first is that having to write new C# code for the game will drastically increase my scope, and should be avoided. Using XML wherever possible, as I have spent a substantial amount of time learning this new system, is far preferred. This also ties into the second parameter: anything new that the XML calls on for mod functionality must be something that already exists in-game, whenever I list the plan for something, I will also specify what functionality I plan to take from what other asset.
Arguably the most iconic part of the show, Titans are giant, man-eating humanoids that are seemingly unkillable, healing at incredible speeds save for a weak spot at the back of their neck. They will be one of the most crucial parts of attaining the success of this mod; creating them properly has required a substantial amount of research into RimWorlds functionality. As such, the development of the Titans will be as follows: Take an existing carnivorous creature, copy it, and change its diet to specifically humans, increase the healing rate, and as a stretch goal, add a second point of hit detection to the back of the unit that has a direct weakness to specific weapon types.
For the Titans, I will take the Warg creature, a deadly, carnivorous creature, its stats rendering it as an apex predator- even RimWorld colonies with a substantial mark of progress in a playthrough may have a hard time dealing with these.
Constantly hungry with a diet specifically of humans - unable to be downed via hunger.
The first thing I will change for the titans is their diet. There are multiple ways to go around this, two being: change its diet as a <def>, or to assign them to always spawn as a <manHunter>, an effect that causes animals affected to attack humans. These would be the two best options to go for, but there are two more if these options for whatever reason, don't work. Option 3 is to have it set so that all titans spawn have the <cannibal> def assigned to them. When affected by the <cannibal> def, any animal assumes similar behaviour to one with <manHunter>, even if they are not a human. This is because in vanilla RimWorld, only humans can be affected with <cannibal>, and as such, the AI change works by not changing the diet to ones own species, but always humans. The last and least suitable option would only be used if all three of these options fall through, and that would be to only spawn Titans in a <manHunterEvent>. This event is what spawns <manHunter> animals, and if required, will be the option used for spawning these titans with the AI required to eat humans.
A group of Titans. Image taken from https://attackontitan.fandom.com/wiki/Titan_(Anime)
Healing rate is set to an absurd amount with the ability to regenerate limbs.
This will be an incredibly quick addition, all that is required is to add the <InjuryHealingFactor> def to the creature.
Strong enough to break through wooden walls instantly, stone and steel walls after a while - can’t break Titan Walls.
This component of the Titans functionality comes in two parts - the change to the Titans XML data, and a change to the Titan Walls XML data. The required part of the change to the Titan is to set the damage it deals to "Thump" damage. There are several damage types in RimWorld, such as Smoke, EMP, Burn, Explode, etc. Thump is one of these types, with the game coded so that thump damage can be set on walls as a damage modifier. There are set enemies (called Mechanoid Thumpers) that deal Thump damage by default. This is set by a <damageType> def in their data, which I will take and use here. The second change is for the Titan Walls, where I will set the damage multiplier for Thump to 0, meaning Titans can destroy all walls except Titan walls, as is the case in the original story.
Can spawn naturally (somewhat rarely depending on difficulty) or be spawned via SOY (Stretch Goal).
RimWorld as a game, handles spawning in two ways, with many affecting modifiers. There are two main methods of spawning in RimWorld <standing> and <dropPods>. Standing is at it seems, the entity appears at a set location, whereas Drop Pods spawn an entity at a set location after dropping them in from the air, with them flying down onto the map. The first is what will be used for normal Titan encounters, spawning them near the edge of the map, as most creatures are. The second is via Drop Pods, manmade flying machines. The second will be saved for a stretch goal, creating an event that has an enemy colony attacking your settlement with titans as a form of Titan warfare, as is done in the show, using Titans as weapons of war. This is also a combat option for the player, and fits in perfectly with Rimworlds gameplay and ethos, biological warfare being one of many options for players in the vanilla game, such as using Drop Pods to send bleeding-out Boomalopes (animals that explode when they die) into an enemy colony. This can be done by sending activated Subjects Of Ymir via drop pods into an enemy colony.
Within the story of Attack On Titan, there exist Subjects Of Ymir, those who are genetically able to turn into Titans, discriminated against in the story and often used as a part of Titan warfare. In the mod, being a Subject Of Ymir will exist as a health condition that characters can have, this condition having multiple aspects of functionality. The first is that Subjects Of Ymir (aka SOY) will be able to turn into Titans when affected by Activator Serum. This Serum will act as a damage type, and will be detailed later. The second is that SOY have a negative effect to other characters' opinions of them.
Subject Of Ymir Negative Opinion
This will be easily done by reusing the functionality of the <ugly> def. A pawn with the Ugly trait, and therefore<ugly> def, lowers the opinions of those around them about that pawn. By reusing the functionality of this trait and def, I will be able to create a health condition that results in any non-SOY pawns (and those who do not possess the <kind> trait/ def) to think lower of Subjects Of Ymir.
Subject Of Ymir Titan Spawning (Stretch Goal)
Titan spawning via the use of activated Subject Of Ymir is a common story element in the show, and can be done here. By creating a "titan gas" seen in the show that turns Subjects Of Ymir into Titans, this aspect of the story can be translated into RimWorld. This gas will act as a damage type, (eg a modified smoke damage type) that applies a specific health condition (as all damage does). Whilst high in scope, the following is planned: Have the game check for a pawn affected by both of these conditions (the game performs regular checks on pawn health in vanilla to adjust changing conditions eg spreading infections), and if it comes back positive, kill this pawn and spawn a Titan in its place. This spawn can also be accompanied by an explosion (creatures being a source of explosions is functionality that can be taken from the aforementioned Boomalope) as is done in the show.
Titan Walls in the show are another incredibly iconic and story-relevant component to Attack On Titan. These walls are what prevents the Titans from reaching those within the walls, and are incredibly high and nigh-impenetrable at all areas (other than the gate). RimWorld has walls, but these are actually incredibly unsuitable for use to create Titan Walls, as such, the method for developing them takes a roundabout way.
Walls in vanilla RimWorld are Atlas Objects, meaning that they can be placed repeatedly, in any order, continuously. This has huge benefits to the vanilla game, as the player can place walls however they like, and the code of the game, recognising that they are an Atlas Object, builds the texture accordingly to how they are placed.
This is an example of an Atlas Objects texture file, namely the barricade wall blueprint texture. Note how, in one texture file, there are actually 16 different textures, one for each position a wall can appear in dependent on its neighbouring walls. They are as follows: Left/Bottom Corner, Left T, Bottom T, Cross, Left End, Left/Top Corner, Horizontal Continuous, Top T, Top End, Vertical Continuous, Right/Bottom Corner, Right T, Single, Bottom End, Right End, Right/Top Corner. These textures are coded so that they change and flex depending on nearby assets. The same code is also used for floor textures and cable textures, which are also Atlas Objects.
If Atlas Objects are so great, then creating large walls with these in mind will be a great way in order to create efficient to use giant walls. However, there is one fatal flaw that prevents this: RimWorlds code does not support Atlas Objects larger than 1x1 unit. This means that in order for an object to work as an Atlas Object, it can only be 1x1 in size. As the titan walls are meant to be larger than one block wide, the only way to create these are by developing individual assets for the walls depending on their positioning. As such, I will have to create the Titan Walls as their own seperate object, intead of as an Atlas Object.
(Image taken from a freely provided source of in-game textures provided by the developer at https://ludeon.com/forums/index.php?topic=2325.0)
Image of the Titan Walls as shown by above, enclosing a city. Image taken from https://attackontitan.fandom.com/wiki/Locations
Expensive, but incredibly durable
The cost for an object in materials and its durability are incredibly easy to change, using the <costStuffCount> and <maxHitPoints> defs respectively.
Undamageable by Titans
In the show, Titans are unable to get through the wall - it is their service. As such, having walls in the mod that can be damaged by Titans would break the link between the original story and content, and its translated RimWorld counterpart- however, as mentioned, there exists multiple damage types in the game. There is a damage type specifically, that can be set that acts as a damage against walls multiplier - Thump damage. As the Titans will be set to deal thump damage, I can create a <damageMultiplier> def with a subdef for <damageDef>Thump</damageDef> damage and set it to 0, resulting in no thump damage being done to these walls.
Appears incredibly tall in a 2D game
RimWorld is a 2D game, with the camera showing a top-down perspective. Despite this, the Titan Walls near to appear giant, as in the original story they are 60 meters tall. As there is no way to have a 3D model to show this third dimension, RimWorld enables different object XML files to contain data for an object shadow. I can adjust the shadow values for this wall in-order to make it appear taller, creating a better translation between the original story and the mod. I can also use the <size> defs to adjust the actual physical size of the wall on a 2D space, making it whatever size I wish.
Anti-Titan Cannons, within the show, are one of two main ways to defeat Titans. They use Anti-Titan Shells, capable of piercing and destroying a Titans nape, their one weakspot.
Creating this type of weapon will be incredibly easy, as only two new assets need to be created: a new shell type, and a new damage type. The new damage type will be a damage for that can deal incredible amounts of damage to a Titan, though is little effective at anything else. This can be then used, similar to Thump damage, by creating modifiers that I can include in an assets XML file in order to have them take more damage from that particular source. That will be the more challenging aspect, as creating a new shell will be simply finding and reusing a suitable shell type and adapting it, as well as changing its damage type to Anti-Titan.
ODM Gear, (Omni-Directional Mobility Gear), also known as 3DM Gear (Three-Dimensional Maneuvering Gear) is a weapon in Attack On Titan that allows for enhanced mobility around certain environments by deploying a series of grapple hooks and gas boosting systems. As previously mentioned, RimWorld is a 2D game, so when translating this system over, immediately the "3D" portion is lost. Despite this, a suitable translation can be created, if create it correctly.
Increased mobility and agility
When in use, the ODM Gear grants its user incredibly high mobility and agility if used correctly. Thankfully, different equipped gear in RimWorld can grant different status effects. When equipped, the ODM Gear will drastically increase the move speed of the pawn using it, increase their <rangedDodgeChance>, as well as any other stats that can bring this item closer to the "power fantasy" of the original material.
Restricted area of use (Stretch goal)
Within Attack On Titan, it is a common point that ODM Gear is useless in flat open areas, such as fields, due to the grapple system being useless. Within RimWorld however, multiple structures, such as walls, buildings and towers can be built around the area. This area is a high-scope area, but can be considered a suitable stretch goal; by limiting the area of use for the ODM Gear, it can incentivise preparation (a key part of RimWorlds core gameplay loop) as well as create different strategies to counteract this downside. The main component of this mechanic will be using the roof detection system. Any object that can support a roof, when built, has an area around it that can support this roof; different objects can support a different size of roofing surrounding it. It is a stretch goal, but using this roof detection area, and limiting the use of ODM Gear to this area would be greatly beneficial in creating a suitable translation of this from the original content to the mod.
This image shows a highlighted roof allow-area around a collum, an object capable of supporting roofs. If I can repurpose this area and set it so that you can only be in these areas when using the ODM Gear, then that would be more than a suitable representation and translation of the original content in the mod.
Effective against Titans
The entire point of ODM Gear in the story is that it is incredibly effective against Titans. Within the source material, they are the most commonly used way of defeating Titans, and they are also one of the most iconic parts of the show. With this effectiveness against Titans comes the need to translate this into the Mod. This can be done by changing the damage type of the weapon from the default to the Anti-Titan damage type mentioned earlier. By then returning to the Titan XML and creating a massive weakness to this damage type, the same way I created a massive resistance to Titans on the Titan Walls to Thump damage, I can create a weapon capable of killing these entities.
Skill dependant (Stretch Goal)
An optional stretch goal that I can work for is to tie the aforementioned stat boosts to the character who is using it and their skills. EG, tying their speed to their shooting stat and their dodge change to their melee stat, in order to create a system where some pawns are more suitable for using ODM Gear than others. This also ties into the source material, as those who are unsuitable for using the ODM Gear find themselves failing to use it often, resulting in an increased chance of failure overall. This will in turn, however, mean that some colonists become more valuable as ODM Gear users, rewarding the player for training and maintaining their pawn's stats and wellbeing.
ODM Gear being used, and in storage. Images taken from https://attackontitan.fandom.com/wiki/Omni-directional_mobility_gear_(Anime)
This week, I was also able to complete the first major XML asset (placeholder art still in use) by manipulating pre-existing XML files to create new files acting to my specifications.
As previously mentioned in this weeks blog post, using the Vanilla RimWorld walls as a basis for creating the Titan Walls would be impossible, due to them being an Atlas Object. As such, I had to find a new alternative for creating these giant walls. I further researched into RimWorlds handling of XML files until I came across a column file. The default column was far off what I wanted to use, but as it was under the <Structure> class def, any <defs> that would apply to walls would also apply here. As such, I took several <defs> from the column file and replaced it with what the value would be on walls, such as changing <passability> to Impassable, its <fillPercent>, the value that determines how much of a grid space an object takes up from 0.25 to 1, and many, many other adjustments such as resource type and cost, health points, and how much work it would take to build it. These changes resulted in a normal, albeit slightly larger and far more expensive column.
In order to further translate the column into what I needed, I still had to make a few more changes. The first one being the <size> value. This value determines via an X and Y value the size of the object being placed (without this specific field, it defaults to 1x1). I changed this value to (10,2), so that a buildable portion of the wall is 10 units long and 2 units wide. I then also changed the <shadowData> values to meet this, setting the <volume> values to (10, 20, 2), as length, height and width, height here only changing the actual length of the shadow produced.
This is an in-game screenshot taken showcasing functional Titan Walls. These walls shown act accordingly to how I want them to, and this image showcases two variants of the wall: the main wall section as well as the corner portions of the wall. Using these, the player is able to build giant, continuous walls that can protect their colonists from Titan Attacks.
To add to this, I would create a Titan Wall Gate, a portion of the wall that acts as an entrance and exit to the area the player encloses with these walls. This will be done at a later date, once a decent level of completion has been achieved for all other areas of development.
This shows how this week, I have finished the planning stage for this project, as well as completed one of the major tasks set out for me.