How does tile generation work?

Started by DJRockXD, October 18, 2017, 10:58:27 AM

Previous topic - Next topic

DJRockXD

Let's say I want to make a mod that gives you the option to create a shaft "underground" through a ton of research and mining...
The "underground" part I am getting is pretty much a new tile, not viewed on the world map, which has pretty much 100% minerals, rocks (depending on the biome you're in), and ancient dangers, and will have 0 sunlight, with very few groves with sunlight in the upper levels and a 3x3 opening where you'r colonists land when they use the shaft (or lift possibly). The rarity depends on how low underground you dug and researched about.
I looked and searched through the core files of rimworld, and even found the XML files used to generate maps (MainMapGenerator and MapGeneration files I think they're called). I looked for any files that actually put that information to use and I found none. For this reason, I have no idea how to even start working on the mod, or if it's possible (that would be my first mod if it works).
So I am asking: Is it possible to do?
If it is, where do I find more info about how to actually do it? (pretty much info about how map generation works, and where I can find the files that will help me to figure it out).
I know there could be many balance problems with the mods, and performance issues, but I have a few ideas on how to fix them ... So please answer the questions above if possible. Thanks :)

P.S: Yes I searched through google and past threads. Found nothing. Then again I am known for being a "blind" person which has a hard time spotting details :P

CannibarRechter

> For this reason, I have no idea how to even start working on the mod, or if it's possible (that would be my first mod if it works).

Ambitious, for a first mod. My gut instinct is that this is a C# mod; you'd need to get ILSpy, decompile the core, read and understand the map generator, and possibly make significant changes.
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

dburgdorf

The biggest problem I can see at first glance is the "tile not showing on the world map" concept. I understand why you want that, but I'm not sure if it's even possible.

Beyond that, the kind of map you're looking for probably wouldn't be terribly difficult to produce, though to do everything you're looking for, you'd definitely need to do some C# coding.

Rikiki's "CaveBiome" mod has a similar concept, though open spaces in that mod aren't actually roofed, even though they're "flavored" as large caverns, and so you can still have rain, etc.

Altering map generation to add thick rock roofs everywhere would be pretty easy (using coding, not XML, of course), but the repercussions of doing so might be more complex.  At the very least, you'd have to also figure out a way to deal with the "cave-ins" that such roofing would inevitably produce.

Something else you need to be aware of is that the game code relies on "outside access" from map edges. Raiders, visitors and animals all enter and leave the map from edges, for example, and plant growth spawns from the edges. So if your maps are completely self-contained caverns with no edge access points, many game functions will break. (That's why my "Archipelagos" mod doesn't produce island maps entirely surrounded by deep ocean water.)

Your idea is definitely interesting, but as CannibarRechter said, it seems very ambitious for a first effort.
- Rainbeau Flambe (aka Darryl Burgdorf) -
Old. Short. Grumpy. Bearded. "Yeah, I'm a dorf."



Buy me a Dr Pepper?

CannibarRechter

>  I understand why you want that, but I'm not sure if it's even possible.

You could Harmony-replace all the the map drawing procedures. But: ugh.
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