#4143: Unhardcode oil drums
-------------------------------------------------+-------------------------
        Reporter:  NoQ                           |      Owner:
            Type:  patch (an actual patch, not   |     Status:  new
  a request for one)                             |  Milestone:  unspecified
        Priority:  normal                        |    Version:  master but
       Component:  Engine: Scripting / AI        |  not 3.1
Operating System:  All/Non-Specific              |
-------------------------------------------------+-------------------------
\
\
 Could anybody ... review that?

 I recently got really fed up with hardcoded oil drum placement when i
 tried to make another tower defence map and wanted fine control over how
 much power the human player has after each wave (>_<)

 So i made this patch to move oil drums code to rules.js.

 I didn't bother understanding the confusing original drum placement
 algorithm, so it is made slightly differently. Number of initially placed
 oil drums is now proportional to map area, one drum per 64x64 tiles, with
 at least one to be placed regardless (originally it was proportional to
 number of players). Oil drums are now respawned in 10 minutes after they
 are picked up. Oil drums are always placed in locations reachable from at
 least one starting position, otherwise uniformly spread around the map.

 One of the recent (and quite flooded up) forum discussion on this topic is
 here: http://forums.wz2100.net/viewtopic.php?f=30&t=10410

 It seems that we no longer need `moveInitialize()`. Remove it or keep for
 future use?

 And the thing that troubles me the most is sync-unsafe javascript
 division. It is known that there is no such thing as integer in
 javascript. So when i divide map area by 4096, i might get a platform-
 specific double. I worked around by using right shift instead of division,
 but maybe it's worth it to add special javascript functions for division -
 something like `syncDiv(a,b)` and `syncMod(a,b)` that would simply do
 these operations on the C++ side?
\
\
\

--
Ticket URL: <http://developer.wz2100.net/ticket/4143>
Warzone 2100 Trac <http://developer.wz2100.net/>
The Warzone 2100 Project
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Warzone2100-project mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/warzone2100-project

Reply via email to