[A17] Prepare Landing

Started by neitsa, August 10, 2017, 11:08:41 AM

Previous topic - Next topic

neitsa

A few ongoing tests for my PrepareLanding mod.

note: this is not an update, just a few tests (if they are conclusive they will make it to the next release)

I'm currently doing a few test for world map overlays (at the moment only temperature for biomes).

I have hit a problem right now: I'm using a class inheriting from RimWorld.Planet.WorldLayer to draw the meshes over the map but it's damn slow (it takes around 30 seconds for a big biome on 30% planet coverage). I might be able to optimize the code but I doubt I'll be able to get below 15 seconds... Anyway, more tests to come.

Here's a preview:




SpaceDorf

Can you overwrite the draw class for the hex itself ?
So the hex places the hue on its own when drawn according to its own temperature..
Maxim 1   : Pillage, then burn
Maxim 37 : There is no overkill. There is only open fire and reload.
Rule 34 of Rimworld :There is a mod for that.
Avatar Made by Chickenplucker

neitsa

Quote from: SpaceDorf on August 10, 2017, 12:08:06 PM
Can you overwrite the draw class for the hex itself ?
So the hex places the hue on its own when drawn according to its own temperature..

Hi SpaceDorf  :)

This is, sort of, what I do: hexes on the world map are drawn on layers (biome, hilliness, road, rivers, etc) and they all ultimately inherit from the RimWorld.Planet.WorldLayer class, which is the class that draw things on the world map. There are two draw types: single tiles (e.g currently selected tile, tile under the mouse, etc.) or batch of tiles (biomes, etc.). I'm currently using the "batch of tiles" way of doing this.

In the end it's more or less the same thing, either you draw <number_of_tiles> time one "template" tile (just changing it's color, as you mentionned) or draw 1 time <number_of_tiles> in a batch process.

You question made me think that I could use one of those pre-existing batch to draw the color rather than drawing a new layer (e.g use the biome drawing and change the color of the biome tile), but the problem is that I need to patch the drawing algorithm and I really try to not patch the vanilla game as much as I can.

SpaceDorf

That was what I was thinking.
But I can understand if you prefer to add to the Vanilla algorithm than change it or make it do something it is not supposed to do .. this could have bad consequences later on.

for example when drawing the planet later in the game your method could still try to change things when it should not ..
I did not think about that .
Maxim 1   : Pillage, then burn
Maxim 37 : There is no overkill. There is only open fire and reload.
Rule 34 of Rimworld :There is a mod for that.
Avatar Made by Chickenplucker

DoctorVanGogh

I really hope it's the RegenerateNow call that's taking those 15 seconds, not the actual rendering itself...
Appreciate my mods? Buy me a coffee