View topic - Map generator


All times are UTC + 1 hour


Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Map generator
PostPosted: 15 Jul 2011, 08:49 

Joined: 17 Jan 2009, 20:13
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? :-)
Top
 Offline Profile  
 
 Post subject: Re: Map generator
PostPosted: 15 Jul 2011, 09:59 
Journeywar Developer & Mapper
User avatar

Joined: 24 Jan 2006, 21:12
Location: Never go full Retro-ard! You just don't do it.
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.."
Top
 Offline Profile  
 
 Post subject: Re: Map generator
PostPosted: 15 Jul 2011, 10:32 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
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
Top
 Offline Profile  
 
 Post subject: Re: Map generator
PostPosted: 15 Jul 2011, 12:31 
Spring Developer

Joined: 31 May 2009, 23:08
hu? jk is also working on a map-format? https://github.com/jk3064/Map-Blueprint
Top
 Offline Profile  
 
 Post subject: Re: Map generator
PostPosted: 15 Jul 2011, 12:34 
Journeywar Developer & Mapper
User avatar

Joined: 24 Jan 2006, 21:12
Location: Never go full Retro-ard! You just don't do it.
Rohrschachtest map generator.. what do you see in this dsd:

a beautifull butterfly
Top
 Offline Profile  
 
 Post subject: Re: Map generator
PostPosted: 15 Jul 2011, 13:12 
Kernel Panic Co-Developer
User avatar

Joined: 16 Nov 2004, 13:08
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.
Top
 Offline Profile  
 
 Post subject: Re: Map generator
PostPosted: 15 Jul 2011, 15:32 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Madrman this sounds neat. Have some shots of the results?
Top
 Offline Profile  
 
 Post subject: Re: Map generator
PostPosted: 15 Jul 2011, 16:55 
Community Representative
User avatar

Joined: 08 Sep 2008, 21:59
Location: small cars
+1 to smoths request; i'd love to see the maps and see how you've handled metal and other stuff

neat idea IMO
Top
 Offline Profile  
 
 Post subject: Re: Map generator
PostPosted: 15 Jul 2011, 19:19 
Lobby Developer

Joined: 16 Mar 2007, 18:27
abma wrote:
hu? jk is also working on a map-format? https://github.com/jk3064/Map-Blueprint


doesn't look like he is ...
Top
 Offline Profile  
 
 Post subject: Re: Map generator
PostPosted: 16 Jul 2011, 04:49 
Zero-K Developer
User avatar

Joined: 10 Sep 2008, 02:11
Location: Bayesian space monkeys
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!
Top
 Offline Profile  
 
 Post subject: Re: Map generator
PostPosted: 16 Jul 2011, 08:07 

Joined: 17 Jan 2009, 20:13
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 :-)
Top
 Offline Profile  
 
 Post subject: Re: Map generator
PostPosted: 16 Jul 2011, 10:47 
Spring Developer
User avatar

Joined: 22 Sep 2007, 08:51
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! :-)
Top
 Offline Profile  
 
 Post subject: Re: Map generator
PostPosted: 16 Jul 2011, 14:29 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
a generator is not the same as the format(smf) or the config files which is what the map blueprint(the configs) is.
Top
 Offline Profile  
 
 Post subject: Re: Map generator
PostPosted: 17 Jul 2011, 10:42 
User avatar

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

looks like there is no need for .smd file anymore:
viewtopic.php?f=56&t=26028

Quote:
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...
Top
 Offline Profile  
 
 Post subject: Re: Map generator
PostPosted: 17 Jul 2011, 13:46 
Moderator

Joined: 12 Oct 2007, 08:24
I'd like to change the map texture. I already requested it a while ago to make terraforming look better.
Top
 Offline Profile  
 
 Post subject: Re: Map generator
PostPosted: 17 Jul 2011, 15:30 
Kernel Panic Co-Developer
User avatar

Joined: 16 Nov 2004, 13:08
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.
Top
 Offline Profile  
 
 Post subject: Re: Map generator
PostPosted: 17 Jul 2011, 16:04 
MC: Legacy & Spring 1944 Developer
User avatar

Joined: 29 Apr 2005, 00:14
Location: #moddev - join it!
Including being able to draw a void
Top
 Offline Profile  
 
 Post subject: Re: Map generator
PostPosted: 17 Jul 2011, 16:05 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
first lets just see the guy get the basics. I am sure he has lots of ideas of his own...
Top
 Offline Profile  
 
 Post subject: Re: Map generator
PostPosted: 17 Jul 2011, 18:37 
Journeywar Developer & Mapper
User avatar

Joined: 24 Jan 2006, 21:12
Location: Never go full Retro-ard! You just don't do it.
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.
Top
 Offline Profile  
 
 Post subject: Re: Map generator
PostPosted: 18 Jul 2011, 18:13 
Spring Developer

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.
Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

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

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Site layout created by Roflcopter et al.