Jump to content

Is their any way to extract the map data from a replay file in order to use it as a skirmish map?


Old Roman
 Share

Recommended Posts

I've been playing random 'unknown land' maps again and am reminded that sometimes the random  feature can create an interesting map that I wouldn't mind playing again.  It seems the original map data must be saved in the replay file and was wondering if there would be an easy way  of importing that data into Atlas to make it a permanent map.

One more general application of this feature  for example might facilitate generation of a static copy of a mainland map that could be used in competitions like the pop cap challenges to allow participants to install a copy and post their best time against the same AI and the same spread of resources.  Instead of having to upload a replay file-- a screenshot of the frozen game time at the 'you have won' prompt would suffice.

 

Link to comment
Share on other sites

10 hours ago, Old Roman said:

I've been playing random 'unknown land' maps again and am reminded that sometimes the random  feature can create an interesting map that I wouldn't mind playing again.  It seems the original map data must be saved in the replay file and was wondering if there would be an easy way  of importing that data into Atlas to make it a permanent map.

 

 

38 minutes ago, Freagarach said:

IIRC one can use the random seed (which is stored in the replay file) to generate a specific map.

I believe this is correct. Look in the replay file for the random seed number, and then you can use that number to generate the exact same map in Atlas (as long as you use the exact same settings).

  • Thanks 1
Link to comment
Share on other sites

Your responses have me on the right track.

I found the seed number in both the text file and json file and pasted that in the random seed field.  I loaded the 'unknown' option in the Atlas random map field and indeed it generated a map!

However the replay I chose to use the random number contained the landscape option of "lakes", which was a land map with lakes and a biome (chosen by me of artic).  However Atlas decided to generate a continent map with no lakes and a random biome.  

Is there currently a way to choose " landscapes" and "biome" within atlas before the generation step?

At this point I assume that if I had chosen a replay of mainland etc. from the random map choices  with the corresponding seed number atlas it would have performed correctly in its generation.

My curiosity is also aroused about the "seed AI" number that was also in the replay file but has no visible option in atlas

Link to comment
Share on other sites

  • 11 months later...
On 18/11/2021 at 8:38 AM, Old Roman said:

Is there currently a way to choose " landscapes" and "biome" within atlas before the generation step?

I'll try to answer even though I'm a bit late...

 

In you `$HOME/.local/share/0ad/mods/user/` folder (or corresponding Mac or Windows folder), create `maps/random/rmbiome`

 

Copy randombiome.js into it, and edit this function (near the top of the file):

 

function setSelectedBiome()
{
    // TODO: Replace ugly default for atlas by a dropdown
    setBiome(g_MapSettings.Biome || "generic/alpine");
}

You can change 'alpine' to any of the biomes listed in the generic folder.

Now when you generate a map from a random map in Atlas, it should use that biome.

Note that it only works if the random map includes the 'setSelectedBiome();' function (most random maps do).

Link to comment
Share on other sites

Thanks for  the info Andy.  I finally gave up back then.  

Some time later I decided that  I may have repeated my personal tendency in applying solutions in a way the person offering the solution never intended--like me expecting Atlas to generate the map from only the seed.

After reading some posts on starting the game from the command line it seemed to me that the real solution might be apply the random seed from the command line where the name of the random map  could be included in all the other things that needed to be included.  However from seeing  the complexity of how the command line to begin the game was generated, I decided it would be beyond my skills and inclinations to construct the command line needed to achieve my goal.

In retrospect I probably should have just 'begged' for a REPLAY  option in the game menu for a future release.  (Or a button that loads the map from a replay file and then switches the control to you to play the game.)  I can dream...:)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...