Bug with MapGen, or did I do something wrong?

Started by ItchyFlea, April 19, 2014, 09:35:29 AM

Previous topic - Next topic

ItchyFlea

I'm trying to get the map generator to generate different types of rock, but have run into a problem of sorts. (Was first attempting to generate a different type of terrain where the mountain would have been, but that results in nothing happening.)

I'm basically taking over the mountain generator and using that to generate the 2nd type of rock. This is the code for it:
<li Class="Genner_FloatGridGrossFade">
<gridName>StoneGrid</gridName>
<possibleFadeSpans>
<li>0.43</li>
<li>0.43</li>
<li>0.43</li>
<li>0.1</li>
</possibleFadeSpans>
</li>
<li Class="Genner_ThingsFromGrid">
<gridName>StoneGrid</gridName>
<thresholds>
<li>
<thingDef>StoneWall</thingDef>
<maxGridVal>0.47</maxGridVal>
</li>
</thresholds>
</li>

But instead of what I'm expecting, which is a normal map with a mountain made from a different type of rock, I'm seeing this every time: http://i.imgur.com/VGuXNSa.png (Turned off Fog)

Am I misunderstanding the terrain generator and trying to make it do something it cannot do, or is this a bug?

I've also attached the mod itself in the attachments below if you need it.

[attachment deleted by admin: too old]
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created

Cala13er

You're using GridName StoneGrid, when there is no such thing in MapGenerator called StoneGrid. It has to be either TerrainIntensity or Sanctity.

Here is an image of it working when I changed the GridName back to TerrainIntensity.


Tynan

Using StoneGrid is okay; it'll just make another "virtual"grid.

I suspect the issue is that you're using GrossFade on a grid that doesn't exist. GrossFade modifies an existing gengrid, it doesn't create one. It's like multipling zero by anything. Still zero.

I suggest you add a first step that initializes StoneGrid. Maybe with a Perlin generator.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

ItchyFlea

Will having multiple grids affect each other, or will they be fine as long as they have their own gridnames? It is safe to assume that having multiple grids would slow down the initial world generation? And finally, is the game able to merge multiple grids into a single one, or would the game potentially generate a hill inside the mountain?
Is it possible to choose which side of the map the mountain generates on? I've just had a thought of having two on either side, creating a valley-type map.
I guess these questions will be answered in about 30 minutes on my end, but I figured I'd ask anyway.  :)

Cala13er: I wanting a world that has different rock types. My first intention was to create a shoreline, but failing that, I'm wanting a mountain made out of a rock type that cannot be mined, while still allowing the little scattered hills to be made out of something mineable.

I'm working on a neolithic-age mod, where the colonists will be basically thrown into the stone age, with no hope of advancing past it on their own. As such, mining out a home to live in in a huge mountain isn't believable, whereas mining out a hill is. (Basically I'm aiming for a real-world stone age in-game.)
Most of the basics are there, and all technology has been removed. I'm considering keeping the comms console and trade beacon, since other tribes in RimWorld also have comms tech.
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created

Tynan

Itchy:

1. Grids are separate as long as they have unique gridNames.

2. No, I would assume that it was significant. Best initial guess is one millisecond cost per grid. This is the kind of thing you should just ignore until you actually find a problem. Never optimize until you profile a problem.

3. There are no genners which merge grids. However, you could write one if you wished. The genner system is modular like that.

The grids are "virtual" grids of floats used for intermediate calculations in world gen. The way I use them, I generate a Perlin grid, maybe bias it on one side to make a mountain, then sample it to figure out where to put rocks, dirt, and sand.

4. There's no choice of side, but again, you could write your own genner and use it with the existing ones.

Your unmineable-mountain concept is perfectly feasible and you're on the right track.

PS. Tribes only have comms tech because I haven't implemented walking negotiators and traders yet :)
Tynan Sylvester - @TynanSylvester - Tynan's Blog

ItchyFlea

Didn't take long to find a suitable set of numbers for generating the separate mountain now that Tynan has explained how the mapgen works.

Screenshots for those interested: (The fog grid was removed to see the effects of two map grids.)
World 1: http://i.imgur.com/VzGZ6vL.png
World 2: http://i.imgur.com/SPBgao3.png
World 3: http://i.imgur.com/EeygbNU.png
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created