Map generator
Moderator: Moderators
Map generator
Hi
I've been working on a map generator for a while now (2 years or so, with long breaks).
It can generate maps on-the-fly. So you simply have to give the appropriate seed + possibly other settings and spring would generate it on startup and everyone would be on the same map. No download times or anything just generation times (which shouldn't be long).
A small part of the ArchiveScanner/VFSHandler was changed to allow archives/files to be made from inside spring instead of having to write it out to disk first.
I got it to work on the latest master again after plenty of merging but i have a few questions because i'm not entirely sure how to best do a few things.
Currently it can generate the .smf file, not the .smd or .smt yet (it loads these from an existing map)
https://github.com/MadrMan/spring/tree/mapgen
- I need to be able to generate an .smd file from spring, or simply set all the required members in the MapInfo class. The former is probably the most reliable because spring already does quite a few safety checks on them and if the MapInfo class changes the generator wouldn't need to be changed. Is the .smd format still needed with the newer maps? or is it all replaced with the lua mapinfo stuff?
- Settings for the generator are currently passed into the script.txt as 'mapgenseed={seed}', i may or may not add more at some point. I also have to set mapname to the matching mapname or spring won't be able to find the generated map. Any suggestions on how to do this in a better way? or is this fine?
- The .smt format might be a bit annoying to get right. Generating the textures should be doable but would i need to compress them aswell? I haven't messed with this yet.
- The actual height generating is currently done from within a C++ class, but i'm slightly tempted to move it all into lua. This could severely decrease the speed, however.
Opinions?
I've been working on a map generator for a while now (2 years or so, with long breaks).
It can generate maps on-the-fly. So you simply have to give the appropriate seed + possibly other settings and spring would generate it on startup and everyone would be on the same map. No download times or anything just generation times (which shouldn't be long).
A small part of the ArchiveScanner/VFSHandler was changed to allow archives/files to be made from inside spring instead of having to write it out to disk first.
I got it to work on the latest master again after plenty of merging but i have a few questions because i'm not entirely sure how to best do a few things.
Currently it can generate the .smf file, not the .smd or .smt yet (it loads these from an existing map)
https://github.com/MadrMan/spring/tree/mapgen
- I need to be able to generate an .smd file from spring, or simply set all the required members in the MapInfo class. The former is probably the most reliable because spring already does quite a few safety checks on them and if the MapInfo class changes the generator wouldn't need to be changed. Is the .smd format still needed with the newer maps? or is it all replaced with the lua mapinfo stuff?
- Settings for the generator are currently passed into the script.txt as 'mapgenseed={seed}', i may or may not add more at some point. I also have to set mapname to the matching mapname or spring won't be able to find the generated map. Any suggestions on how to do this in a better way? or is this fine?
- The .smt format might be a bit annoying to get right. Generating the textures should be doable but would i need to compress them aswell? I haven't messed with this yet.
- The actual height generating is currently done from within a C++ class, but i'm slightly tempted to move it all into lua. This could severely decrease the speed, however.
Opinions?
Re: Map generator
mappers .. meat the discjockey 2000. It can play music and has three sort of standard comentary on the political situation.
"That maschine is fantastic..."
"Ssssh, dont praise the maschine.."
"That maschine is fantastic..."
"Ssssh, dont praise the maschine.."
Re: Map generator
hmmm I wonder what happened to SJs map generator
SJs was an external tool rather than part of spring. The main reason he didn't persist with his map generator project and why nobody has ellaborated since is because the process of generating a map in that format is costly. SM3 would have been a more appropriate format for this but it never took off.
I would speak with braindamage, he mentioned he would like to improve the map format, possibly remove some compile steps and other stuff I don't remember
SJs was an external tool rather than part of spring. The main reason he didn't persist with his map generator project and why nobody has ellaborated since is because the process of generating a map in that format is costly. SM3 would have been a more appropriate format for this but it never took off.
I would speak with braindamage, he mentioned he would like to improve the map format, possibly remove some compile steps and other stuff I don't remember
Re: Map generator
hu? jk is also working on a map-format? https://github.com/jk3064/Map-Blueprint
Re: Map generator
Rohrschachtest map generator.. what do you see in this dsd:
a beautifull butterfly
a beautifull butterfly
Re: Map generator
I don't like idea of the random map generator recipe to be in C++, first because it greatly raise the entry level for mappers (most of which aren't coders), but mostly because that means any new recipe would have to be built-in into Spring.exe
Technically we can already do random map generator in pure Lua. Even though we can't change the map texture / tile, I workarounded that by disabling ground rendering and drawing my own quads in Spring OpenGL Lua.
Technically we can already do random map generator in pure Lua. Even though we can't change the map texture / tile, I workarounded that by disabling ground rendering and drawing my own quads in Spring OpenGL Lua.
Re: Map generator
Madrman this sounds neat. Have some shots of the results?
Re: Map generator
+1 to smoths request; i'd love to see the maps and see how you've handled metal and other stuff
neat idea IMO
neat idea IMO
Re: Map generator
doesn't look like he is ...abma wrote:hu? jk is also working on a map-format? https://github.com/jk3064/Map-Blueprint
Re: Map generator
Nice work, Madrman! Thanks for contributing something exciting and unique to Spring!
You guys, don't forget to thank him for his work before starting with the questions/suggestions/complaints/requests!
You guys, don't forget to thank him for his work before starting with the questions/suggestions/complaints/requests!
Re: Map generator
I believe jK isn't working on the actual map format but rather on the format of other files which are part of maps aswell. BrainDamage said he is going to improve the SSMF format but he's been busy lately so it might take a while before that happens.
smoth/KaiserJ: I'll show some shots when i have the smt working aswell (currently it looks very flat)
zwzsg: mappers normally wouldn't touch the generator code. but yea, if the code was going to be changed it would become a bit of a mess. i think i might stick it all into lua. i just hope speed won't become a problem when i do so.
MidKnight: thanks
smoth/KaiserJ: I'll show some shots when i have the smt working aswell (currently it looks very flat)
zwzsg: mappers normally wouldn't touch the generator code. but yea, if the code was going to be changed it would become a bit of a mess. i think i might stick it all into lua. i just hope speed won't become a problem when i do so.
MidKnight: thanks
Re: Map generator
it sounds sane to me, to first try to get the basics done (have it able to create everything a map needs), and then focus on the details of the code that generates the map ("C++ or Lua?"). if you have to start testing (in multiplayer) with other people, it should also be easier if it is all contained within spring.exe, and one would not have to tweak and setup external stuff and make sure everyone uses the same content.
good luck from me too!
good luck from me too!
Re: Map generator
a generator is not the same as the format(smf) or the config files which is what the map blueprint(the configs) is.
Re: Map generator
looks like there is no need for .smd file anymore:MadrMan wrote:- I need to be able to generate an .smd file from spring, or simply set all the required members in the MapInfo class. The former is probably the most reliable because spring already does quite a few safety checks on them and if the MapInfo class changes the generator wouldn't need to be changed. Is the .smd format still needed with the newer maps? or is it all replaced with the lua mapinfo stuff
http://springrts.com/phpbb/viewtopic.php?f=56&t=26028
would it be possible to allow Lua to change maptexture? Beside mapgenerators it would have multiple uses.Technically we can already do random map generator in pure Lua. Even though we can't change the map texture / tile, I workarounded that by disabling ground rendering and drawing my own quads in Spring OpenGL Lua.
Even if it only worked before the game starts for whatever reason (during loading) it would be kind of nice...
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: Map generator
I'd like to change the map texture. I already requested it a while ago to make terraforming look better.
Re: Map generator
As a first step, it would be really nice if we could change which tile texture is associated with each square of terrain.
And as second step, something to redraw a tile texture, or add a new tile texture.
And as second step, something to redraw a tile texture, or add a new tile texture.
Re: Map generator
Including being able to draw a void
Re: Map generator
first lets just see the guy get the basics. I am sure he has lots of ideas of his own...
Re: Map generator
He posted here, he demanded the drama. Now that we all have put our hearts into it we can put fire into this once he ignores our advicious comands.
I suggest to put wheels on the Map generator. Everything is better with wheels.
I suggest to put wheels on the Map generator. Everything is better with wheels.
Re: Map generator
You could consider to offer to Lua large `building blocks', which can be used to compose a map generator, and which are implemented in C++. Think of e.g. a 2d perlin noise source as a building block, and allowing Lua to stack multiple perlin noises with different parameters to create a final map. Many other building blocks are probably possible.MadrMan wrote:i just hope speed won't become a problem when i do so.