Random map generator

Random map generator

Various things about Spring that do not fit in any of the other forums listed below, including forum rules.

Moderator: Moderators

User avatar
fraghawk
Posts: 75
Joined: 31 Jan 2009, 00:08

Random map generator

Post by fraghawk »

Is it possible to make a rm genator. like age of empire`s. :?:
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Random map generator

Post by smoth »

if you used forum search you will see that the idea was discussed and dev thought about doing it.
User avatar
fraghawk
Posts: 75
Joined: 31 Jan 2009, 00:08

Re: Random map generator

Post by fraghawk »

smoth wrote:if you used forum search you will see that the idea was discussed and dev thought about doing it.
thanks
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Random map generator

Post by smoth »

no problem, no way in hell you new guys would know all the crap that has been discussed over the years but don't let that stop you from making suggestions, maybe a dev will read your post and want to restart the effort.

In the future, if you want a feature added you should probably post in the feature request subforum.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Random map generator

Post by AF »

SJ actually made it and released a handful of random maps
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Random map generator

Post by CarRepairer »

(quantum originally suggested) even more interesting would be the ability to randomly generate a map right when the game starts and hide all terrain, features, metal spots, etc. from your starting view so that it's a new game every time and requires exploration.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Random map generator

Post by smoth »

AF wrote:SJ actually made it and released a handful of random maps
he was asking for in game generation.
User avatar
fraghawk
Posts: 75
Joined: 31 Jan 2009, 00:08

Re: Random map generator

Post by fraghawk »

CarRepairer wrote:(quantum originally suggested) even more interesting would be the ability to randomly generate a map right when the game starts and hide all terrain, features, metal spots, etc. from your starting view so that it's a new game every time and requires exploration.
sounds like Age of Empires.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Random map generator

Post by AF »

smoth wrote:
AF wrote:SJ actually made it and released a handful of random maps
he was asking for in game generation.
He never specified in or out of game. Either way if you wish to play semantics we can always hook SJs program into the lobby and not show the resulting map to the player till they're ingame.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Random map generator

Post by Tobi »

He did specify however that it had a running time of over 4 hours, IIRC, to generate one map. Also it did not generate a random map from scratch, you had to give it various inputs.

viewtopic.php?t=4885
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Random map generator

Post by AF »

Indeed, inputs can be generated randomly too but meh 4 hours
Caradhras
Posts: 381
Joined: 31 Jul 2006, 21:49

Re: Random map generator

Post by Caradhras »

If the maps were not that big, we could think about some sort of a map server.

The lobby client of the host downloads a random (or random generated) map from there and tells the other client in a hidden way, which file to download.

But i agree this is practically not achievable.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Random map generator

Post by smoth »

if we had sm3.. or splatting in general..
User avatar
Felix the Cat
Posts: 2383
Joined: 15 Jun 2005, 17:30

Re: Random map generator

Post by Felix the Cat »

A big problem is that the random map generator doesn't know how each game operates. It can read the mod file and so has access to max slope traversal, etc., but it has no idea what the balance implications of each slope level are.

For example, imagine a game with no air units. All units have a maxslope of 50, except that each side's unarmed builder unit has a maxslope of 100. How would the generator know that generating a cross-map ridge of 75 slope would be a bad idea?

Clearly this case could be solved with a sufficiently intelligent map generator, but it's a simple example case to illustrate the concept that since the engine doesn't know the properties of the games that will be played on it, a map generator is not feasible.

Game teams are free to mod the engine to include a map generator suitable to their game; the best way to support map generation without forcing game teams to mod the engine would probably be an API for game teams to program their own map generators, to be packaged with the game.
Saktoth
Zero-K Developer
Posts: 2665
Joined: 28 Nov 2006, 13:22

Re: Random map generator

Post by Saktoth »

Its pretty simply to make a 'randomish' map thats just randomly lumpy.

The major objection i got from CA lua devs is it would take ages to randomize the map (changing the height map etc).

But i dont feel this is correct, spawn 4 adv fusions randomly around the map and blow them up, there is perhaps a second or two of lag while the terrain deforms, at most, and will deform most small maps into a totally unrecognizable shape.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Random map generator

Post by jK »

Setting the heightmap takes 20sec alone on my 2.5+GHz, with a simple sincos random function it already takes 1min.
User avatar
fraghawk
Posts: 75
Joined: 31 Jan 2009, 00:08

Re: Random map generator

Post by fraghawk »

we could use simpler maps.
User avatar
quantum
Posts: 590
Joined: 19 Sep 2006, 22:48

Re: Random map generator

Post by quantum »

I could set the heightmap in a reasonable time. I did have trouble creating passable slopes, but it's just a matter of tuning the parameters.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: Random map generator

Post by trepan »

As I'd discussed with some springers (fairly sure quantum was
one of them), one of the better ways to do randoms maps
would be to setup a separate lua script with call-outs tailored
to that particular task. I'd actually started down this path at
one point (which was also combined with a new map format).

Code: Select all

local xsize = 2048
local ysize = 4096
local xmid = xsize * 0.5
local ymid = ysize * 0.5
local heightmap = Map.CreateArray(xsize, ysize)
local metalmap = Map.CreateArray(xsize, ysize)

heightmap:Set(0, 0, xsize, ysize, 0)
heightmap:Gaussian(xmid, ymid, 50, xsize * 0.25, size * 0.25)
heightmap:Noise(0, 0, xsize, ysize, 8)
heightmap:Smooth(0, 0, xsize, ysize, 16)
heightmap:Add(100, 100, 200, 400, 32)

metalmap:LoadImage('metalmap.jpg') -- b/w conversion

return {
  heightmap = heightmap,
  metalmap = metalmap,
}
If you throw in transformations and mask layers, you get a
powerful map editing API. Several other functions are probably also
desirable (copy area, sinusoidals, lorentzian, mirroring, etc...) You
could also specify tile sets and tile positions in the same file.
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: Random map generator

Post by TradeMark »

One problem with these run-time map generators is that what happens to the map? Will it be saved on your harddisk? After playing those games a lot, you might have loads of random maps in your maps folder, maybe thousands... And to watch replays, you need the map too.

I think the random map should be saved, but not in the same format as other maps, just the map generator "script" would be saved, or what ever it is made to...
jK wrote:Setting the heightmap takes 20sec alone on my 2.5+GHz, with a simple sincos random function it already takes 1min.
What the hell, you using PHP or what? heightmaps are like 1024x1024 size usually, or twice bigger... not so big to take 1 minute processing for simple sincos calculations on it o_O i cant believe that... i could make random noise blurred in 1 second (or less) to 2048x2048 image, and for bumps you really dont need sincos calculations, just blur and some random noise shit in it :D

I have though of making that random generator many times, but never really had time to waste in thinking about it :/ Its interesting programming concept... if you want to make it enough fast i mean... like not take more time than 10-20 seconds in generating one map etc...
Post Reply

Return to “General Discussion”