[Mod Request] Multiple raids

Started by MemeTurtle, September 19, 2017, 06:47:28 AM

Previous topic - Next topic

MemeTurtle

Existing storytellers spawn only one raid at a time, which is not really a problem for late game colonies. I am looking for storyteller that can spawn several raids during big threat event in a controlled manner.

I know that Randy can potentially spawn a couple of raids but I have not seen it myself. So what I would like to see is an advanced storyteller that can reliably(depending on settings) spawn 1-5 raids at the same time. Preferably, if those raids were of all different types.

MemeTurtle

#1
I have no modding experience in RimWorld, but after looking at how incidents are defined in XML files, I believe my requested mod can be easily implemented in 2 steps:
1)  Override workerClass for RaidEnemy in Incidents_Map_Threats.xml to a custom class: IncidentWorker_RaidEnemy_Custom.
2) Implement custom class IncidentWorker_RaidEnemy_Custom as follows(in C# pseudo-code):

public class IncidentWorker_RaidEnemy_Custom : IncidentWorker
    {
// Threshold for spawning an extra raid
const int SPAWN_THR = 50;

//Maximum number of extra raids
        const int NUM_RAIDS = 4;

        //This method is used to execute the incident.
        public override bool TryExecute(IncidentParms parms)
        {
             // Spawn raid using existing method
             IncidentWorker_RaidEnemy.TryExecute(parms);

             Random rng = new Random();
             for (int i = 0; i < NUM_RAIDS; i++) {
                 int spawnChance = rng.Next(1,101);
                 if (spawnChance >= SPAWN_THR)
                     IncidentWorker_RaidEnemy.TryExecute(parms);
                 else
                     break;
             }
        }
     }



So basically, existing raid spawn class is overridden with a custom wrapper, which will spawn extra raids depending on random chance: 50% for 2 raids, 25% for 3, and so on. Ideally, those constants should be parsed from a separate config file.

I would appreciate if one of the modders could compile and send the necessary dll file to me.

And most importantly why the need for such mod? In my playthroughs I have realized that no matter the difficulty settings and the number and strength of enemies spawned in raid it is still pretty easy for a late-game colony to deal with them. Mass mortars can saturate any area on the map with fire, so raid vanishes before it can even reach the base. Drop-pod raids can be still a problem, unless there are no defensive positions inside the colony. So having multiple raids happen at the same time should prevent the player from sniping all enemies with mortars or concentrate defenses in one place. This should make late game more challenging and fun.

CannibarRechter

And here we have the moment where that free copy of Sharp Develop that's been calling to you is finally downloaded. If you can write C# pseudocode, you can mod rimworld, man. Come on, now. ;-P
CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects

MemeTurtle

Well, in theory I could install Xamarin, create a solution, determine necessary classes and function calls and implement the mod. But. There are two problems:

1) Doing so will take almost an entire day. As I mentioned I have no experience in modding RimWorld, so setting up the design environment and finding out the right core functions will take me much more time than actually implementing the mod.

2) I can not mod and enjoy playing games at the same time. I quit playing KSP after I had to fix one of the mods I was using. I stopped playing X: Rebirth after the same reason. So, I would rather keep playing RimWorld and dealing with game problems using game mechanics rather than C#.