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)
- 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.
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
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.
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.
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.
Joined: 22 Feb 2006, 01:02 Location: cheap kitchen
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
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.
would it be possible to allow Lua to change maptexture? Beside mapgenerators it would have multiple uses. Even if it only worked before the game starts for whatever reason (during loading) it would be kind of nice...
Joined: 01 Jun 2005, 10:36 Location: The Netherlands
MadrMan wrote:
i just hope speed won't become a problem when i do so.
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.
Users browsing this forum: No registered users and 0 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum