patchBos Wars - Patches: patch #6857, New randomly generated map

 
 

You are not allowed to post comments on this tracker with your current authentification level.

patch #6857: New randomly generated map

Submitted by:  Michiel van der Wulp <mvw>
Submitted on:  Mon 29 Jun 2009 11:40:00 AM UTC  
 
Open/Closed: ClosedStatus: Wont Do
Assigned to: Michiel van der Wulp <mvw>

Sat 16 Nov 2013 10:41:33 AM UTC, comment #5:

I committed the 10 oasis maps.
They are NOT automated - just 10 maps in a folder.

Michiel van der Wulp <mvw>
Project MemberIn charge of this item.
Mon 17 May 2010 11:54:35 AM UTC, comment #4:

I have been thinking this over:

What if I create a folder of maps, all quite similar, but the items are located elsewhere in every map. So, it is very hard to remember where things are.

In attachment a zip with 10 different maps in a subfolder of the maps folder.

I renamed the level to "oasis" - since it consists of groups of rocks, trees and magma in a boringly flat and empty terrain.

Can we re-open this issue?

(file #20557)

Michiel van der Wulp <mvw>
Project MemberIn charge of this item.
Mon 26 Oct 2009 02:50:25 PM UTC, comment #3:

Yes, it breaks replay, too.
Understood.
Let's forget this.

Michiel van der Wulp <mvw>
Project MemberIn charge of this item.
Sat 10 Oct 2009 09:05:02 PM UTC, comment #2:

Extra downsides besides those you mentionned:

  • it breaks debug analysis
  • it breaks multiplayer games
  • there is already a random function available

The SyncRand provided by the engine generates random numbers that work over replays and the network.

Fran├žois Beerten <feb>
Project Administrator
Thu 23 Jul 2009 06:39:05 AM UTC, comment #1:

Actually, since the random numer seed is not set, this generates the same map over and over again (at least when restarting the application).

The solution is to set the seed of the random generator to a number based on the actual time. But to make this possible, the following patch is needed:

Index: engine/stratagus/script.cpp
===================================================================
--- engine/stratagus/script.cpp (revision 9599)
+++ engine/stratagus/script.cpp (working copy)
@@ -742,7 +742,7 @@
// {LUA_LOADLIBNAME, luaopen_package},
{LUA_TABLIBNAME, luaopen_table},
// {LUA_IOLIBNAME, luaopen_io},
-// {LUA_OSLIBNAME, luaopen_os},
+ {LUA_OSLIBNAME, luaopen_os},
{LUA_STRLIBNAME, luaopen_string},
{LUA_MATHLIBNAME, luaopen_math},
{LUA_DBLIBNAME, luaopen_debug},

Then the map can include this line:

print ("Seeding random number generator with time = " .. os.time())
math.randomseed(os.time())

The downside of a randomly generated map is that it is not replayable (leads to a crash), nor editable (looses the random effect).

In attachment the latest map, and the patch needed to script.cpp to make it work.

(file #18458, file #18459)

Michiel van der Wulp <mvw>
Project MemberIn charge of this item.
Mon 29 Jun 2009 11:40:00 AM UTC, original submission:

Hi *,
When playing BosWars, I found it becoming a bit too easy when I know where everything is on the map.

Hence, I created a map where everything is randomly placed. I will attach.

This map is for the latest svn version.

Please let me know what you think!
Have fun.

Michiel van der Wulp <mvw>
Project MemberIn charge of this item.

 

Attached Files
file #20557:  oasis.zip added by mvw (44kB - application/zip)
file #18458:  random.map.zip added by mvw (2kB - application/zip)
file #18343:  random.map.zip added by mvw (2kB - application/zip - This is a vastly improved version)
file #18339:  random.map.zip added by mvw (2kB - application/zip)
file #18340:  random.map.zip added by mvw (2kB - application/zip)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by feb (Posted a comment)
  • -unavailable- added by mvw (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 13 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 16 Nov 2013 10:41:33 AM UTCmvwOpen/ClosedOpen=>Closed
      Assigned tofeb=>mvw
    Sun 11 Jul 2010 12:58:48 PM UTCfebOpen/ClosedClosed=>Open
    Mon 17 May 2010 11:54:35 AM UTCmvwAttached File-=>Added oasis.zip, #20557
    Wed 27 Jan 2010 07:37:27 PM UTCfebStatusIn Progress=>Wont Do
      Open/ClosedOpen=>Closed
    Sat 10 Oct 2009 09:05:02 PM UTCfebAssigned toNone=>feb
    Sat 10 Oct 2009 09:05:01 PM UTCfebStatusNone=>In Progress
    Thu 23 Jul 2009 06:39:05 AM UTCmvwAttached File-=>Added random.map.zip, #18458
      Attached File-=>Added patch-include-oslib-for-seeding-random-number-generator.patch, #18459
    Mon 29 Jun 2009 12:56:11 PM UTCmvwAttached File-=>Added random.map.zip, #18343
    Mon 29 Jun 2009 11:40:00 AM UTCmvwAttached File-=>Added random.map.zip, #18339
      Attached File-=>Added random.map.zip, #18340

    Back to the top


    Powered by Savane 3.1-cleanup