Planet Map Generator Performance Suggestion

Planet Map Generator Performance Suggestion

Return to topic list

Tue Nov 24 23:28:47 2015   by   Toli Cuturicu
Hi! Thank you for this wonderful program.

I have one question / issue.

Since it is rather slow to compute the map, why does it re-compute the whole map every time I make one simple change like:
- Adding / removing / changing gridlines
- Adding / removing contour lines
- Changing the colour scheme
- Changing the sea level
- Changing the center meridian in a Square or Peters Projection

I think that the map should be kept in memory and the rendering process should be separate:
- Has the Random Seed changed (or other parameters which have an influence upon the terrain)? Recompute everything!
- Random Seed is the same, but has the Projection changed (except a simple translation)? Recompute just the Projection, not the Random generated altitudes!
- Random Seed and Projection the same? Compute nothing, just rerender as needed!

This will reduce very much the waiting time and possibly the server time / work.

Thank you.

Wed Nov 25 05:55:16 2015   by   Ron Vantreese
Are you talking about VPPlanetGenerator or the command-line planet.exe?

VPPlanetGenerator has this dependency on planet.exe, so it remembers nothing (indeed it is unable to).

The planet.exe is a command-line program (DOS program when run in Windows). There's no memory when the program exits. Or Torben should probably comment on this.

Wed Nov 25 12:23:03 2015   by   Torben
The program was originally made so it output the pixel values as they were generated, so it could handle maps larger than the memory.  Later versions store values in an array mainly to simplify contour-line generation etc., so it would be possible to reuse these, within limits.

Modifying the colour scheme, contour lines and shading should be relatively easy.  Moving the sea level slightly less so, since the non-linear altitude scaling would need to be recomputed.  And, as you say, cylindrical projections should be able to change centre longitude without recomputation.  In the other projections, the distortion depends on the centre point/axis, so you would need to recompute.

Changing the projection or magnification is more complex, as you may need more or just different samples.  Complete regeneration is probably needed.

In any case, as Ron said, the planet-generation program stops after generating one map.  The web interface and VPPlanetGenerator are just (somewhat) interactive interfaces that call the program that does the generation, and since that does not store anything between runs, you would need to change the generator program itself to be more interactive if you want to reuse data.  This is a major rewrite, so not something I plan to do in the immediate future.  The source code is available for anyone who want to give it a shot, though.
Wed Nov 25 12:48:00 2015   by   Toli Cuturicu
To Ron Vantreese:
1. I was talking about the online application.
2. This is the first time I hear of VPPlanetGenerator. If it remembers nothing, then it is not useful to me (I am fine with command-line).

To Torben:
1. I see.
2. Memory should not be problem these days, at least for reasonable sized maps.
3. Well, I did not use the non-linear altitude scaling anyway, because it removes the chance to get some Andes (high mountains near the coast).
4. Ok.
5. Solution: have the program write a temporary file with the array plus the command line parameters. On the next run, check if the new parameters permit to reuse the same array.

I would modify the program myself, but I do not know enough C. I can understand the mathematical calculations but not most of the other stuff and I surely do not know how to access the disk in C. And I do not use pointers.
I programme in C#. If you cannot / would not try to do this, I will have to try and port all the calculations in C# and then make a programme around them.
Thu Nov 26 09:34:46 2015   by   Torben
Hi Toli,

Your suggestion number 5 seems doable, and I will look at it.  Since it is a hobby project, I can't promise any deadline, though.  And to work for the online program, which several people can use at the same time, I will need to store multiple files, but that should also be doable.
Thu Nov 26 13:14:24 2015   by   Toli Cuturicu
Wow! Thank you very much!
Fri Nov 27 16:26:25 2015   by   Ron Vantreese
I will be looking forward (even supporting) this effort. One thing to consider, the temporary files should have state information. If you run with different configuration, program should detect that the state is different and not use the stored data, but re-render new data.
Fri Nov 27 21:53:05 2015   by   RGT
In the meantime, you could do as I do, I check for good maps in the online version, tweaking as I go, and since it's a small image, it renders fast.

Then once I have decided on a map, I tweak ocean levels and so.

Then, and only then I generate the 10kx10k map in the DOS command version, which takes like 20-30 minutes.

Return to topic list

New message:
Posted by:

Type the values of the dice shown below:

Return to topic list