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

 
 

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

patch #6857: New randomly generated map

Submitter:  Michiel van der Wulp <mvw>
Submitted:  Mon 29 Jun 2009 11:40:00 AM UTC
   
 
Open/Closed:  Closed Status:  Wont Do
Assigned to:  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>
Group Member
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>
Group Member
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>
Group Member
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>
Group 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>
Group Member
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>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Follow 13 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-11-16 mvw Open/ClosedOpen Closed
        Assigned tofeb mvw
    2010-07-11 feb Open/ClosedClosed Open
    2010-05-17 mvw Attached File- Added oasis.zip, #20557
    2010-01-27 feb StatusIn Progress Wont Do
        Open/ClosedOpen Closed
    2009-10-10 feb Assigned toNone feb
    2009-10-10 feb StatusNone In Progress
    2009-07-23 mvw Attached File- Added random.map.zip, #18458
        Attached File- Added patch-include-oslib-for-seeding-random-number-generator.patch, #18459
    2009-06-29 mvw Attached File- Added random.map.zip, #18343
    2009-06-29 mvw Attached File- Added random.map.zip, #18339
        Attached File- Added random.map.zip, #18340

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code