News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

Cities and rivers placement with heightmaps

Started by mad_genius, April 23, 2012, 10:25:14 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dwachs

I do not see any advantage of XML over script. It is just another representation of data.

I dream rather of a different approach: Add a map-editor mode to simutrans, which records all the actions a player does (founding cities etc). If the player is satisfied with the result, then save these actions as script and the map as ppm-file.

Parsley, sage, rosemary, and maggikraut.

kierongreen

Indeed, XML for the sake of XML seems pointless. The scripting language approach looks a lot easier to read to me.

prissi

With the current tool calling structure in place, such a generation of scripts during map mode does seem quite straight ahead (but will still require some typing on the code side).

Maybe we need a certain requirements for tools. I.e. when adding/extending a toll, this should be avalable for scripting as well as returning a function name for it (the parameters are anyway sent as a string).

An_dz

Quote from: Dwachs on November 07, 2012, 08:17:58 AM
I do not see any advantage of XML over script. It is just another representation of data.

I dream rather of a different approach: Add a map-editor mode to simutrans, which records all the actions a player does (founding cities etc). If the player is satisfied with the result, then save these actions as script and the map as ppm-file.
Perfect. XML gets so big that no one will be stupid enough to mess with.

Fabio

Image+Script is good enough IMHO.
It would be nice if they could be bundled together (e.g. releases in .zip which you drop in your maps folder without extracting).
IIRC, the Open Document formats (.odt, .ods etc...) follow similar system, as they are nothing but a zip of several (xml) files.
This system could apply to scenarios as well.

sdog

#40
Quote from: Fabio on November 07, 2012, 12:57:10 PM
Image+Script is good enough IMHO.
It would be nice if they could be bundled together (e.g. releases in .zip which you drop in your maps folder without extracting).
IIRC, the Open Document formats (.odt, .ods etc...) follow similar system, as they are nothing but a zip of several (xml) files.
This system could apply to scenarios as well.

A  container is a good idea. If the need arises it is also easily extendable with further scripts or data, without changing the map file in the users perception.

edit:
We ought to put a tag file into it too, saving meta information about the map. This might be especially useful if we'd provide dowload pages etc.

edit:
Allowing a simuconf.tab in it, which could override pak-set settings might or might not be a good idea (perhaps with a check for pak-set and compatible version of it)

Since bz2 is already linked, it would be a natural choice, since it wouldn't be required to pack the large terrain data files for map sites anymore.


prissi

bz2 is not a container format. PNG is, it is actually a subset of HDF.

sdog

thanks prissi, been implicitly thinking tar.  tbz2

prissi

If the map is generated by simutrans, the script could save the random seed and the map number and coudl generate the same map without the need to supply even a heightmap. This would also greatly reduce the sizes of scenarios.

asaphxiix

Just bringing this thread up once more in hopes it be implemented.

And reminding of prissi's statement before:

Quote from: prissi on May 15, 2011, 07:14:34 PM
Simutrans can read tab files, and the maps can be save as (which are quite small, RLE compressed). Just somebody is needed to add a routine that tries to open a tab-file with same name as the map, and if found just call a parser for such files. Most of the routines are there, they just need to be parse and called.

yorkeiser

Hi all, I still re-up, hoping some willing developer will give this a look, sooner or later ☺

Leartin

I think all the usual willing developers already looked and commented on this 4 years ago.
But it's still valid, and something severely missing from Simutrans.

yorkeiser

Sorry I'd give an help but I have no time to re-configure all development environment... Did that some years ago, it really takes a lot of time

BlackMagic09

Hi there,
I'm a newbie but I like the idea as much as you guys and wil try to code a solution.
I think for a start we need 2 typs of positioning:
a) from some graphics file (I will stick to .ppm because that's what is allready implemented)
b) from some list (formated readible textfile)

So the creating process looks like this:
1.draw heightmap from .ppm
2. - n. draw objects from further .ppm files or place them directly from some list (it shouldn't matter wether it's a river or something else)

Right now I'm trying to find the locations where the mapcreator is creating the heightmap from the graphic file.
Thats how far I've got up to now:
welt.cc, l564-570 -> start MapCreator      komp==&start_game
welt.cc l565 load_heightfield(default_settings)
onwards everything in simworld.cc
-> l6359 load_heightfield(settings_t* const sets)
   -> l6366 init(default, z)
-> l1457 init(settings_t* const sets, sint8 const* const h_field)
   -> l1532 init_felder()
-> l899 init_felder()   -> l913 get_karte()->init()   just update relief?
   -> l1534 enlarge_map(default, z)   extending map?
   -> l1547 fabrikbauer_t::neue_karte()   placing factories
   -> l1570 fabrikbauer_t::verteile_tourist(...)   placing attractions

So where is the command for creating all points from the .ppm file?
Thanks to any help on this.

Greetings Alex

prissi

search for heightmap (Which will be soon have full PNG support too).

The placing of industries and cities could be done in a scenario (as discussed before).

Essentially you would call the same routines the factory building tool or the city building too does. (Look in simtools).