Unhardcode oil drums #4143
Comments
NoQ uploaded file |
Per changed blocking which not transferred by tractive |
Per changed blockedby which not transferred by tractive |
Per commented I really like the idea of moving drum placement into scripts. Perhaps add a check that drums are never placed inside any player's starting base? (And maybe oil drums should always spawn near an oil resource? Just an idea that popped out of my head.) Please add a comment to large numbers like 600000 saying what it means in reasonable units like minutes. They are hard to parse for humans otherwise :) No need to keep unnecessary code. Might be a good idea to add syncDiv() and syncMod(). |
NoQ changed _comment0 which not transferred by tractive |
NoQ commented
P.S. why do we respawn them at all? That's hardly realistic. The "near oils" idea looks curious though.
Can do, by increasing radius in |
NoQ commented Or rather geometric distribution.
Then for the real trouble: |
vexed commented The only reason we respawn them is, it was like that since day 1, with the change being that VTOL's can't pick them up like they did before (I think--I don't recall exactly) Not sure I follow the reason to move it to JS, I guess it could be just as easy to turn on / off this feature via a script command, then you can place whatever feature you want where ever you want. As you have noticed, we still have lots of issues with the pathing code and associated routines. |
NoQ commented A JS function for disabling (or enabling) drum spawning is enough of course, it just simply looks ugly, and it won't solve it when somebody would anyway want to make a custom respawn method. I am still to figure out what really needs to be done to |
NoQ commented Well, i guess i really shouldn't touch So i think i'd add a function to check terrain type. I add JS constants for only Attaching a working version with two patches:
|
NoQ uploaded file |
NoQ uploaded file second version, requires qtscript patch |
Per commented Looks good to me. |
NoQ changed status from |
NoQ changed resolution from `` to |
NoQ commented Pushed :) |
vexed commented in d289598813fbf1f865faebdd79de6492c1967262 (use closes/fixes #4143 in commit message...) Makes book keeping easier :) BTW, moving this to JS also opens the door to more abuse. |
Per commented I don't think this allows for abuse. If anyone changes the algorithm, then this will create a desync. |
NoQ commented Even without unhardcoding, a cheater could implement his own oil drum spawner in rules.js, along with the hardcoded oil drum spawner. |
vexed commented See forum thread for more about this. |
crab_ commented Replying to Warzone2100/old-trac-import#4143 (comment:12):
Please can you give me link to that forum thread. |
resolution_fixed
type_patch (an actual patch, not a request for one)
| by NoQCould 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)
andsyncMod(a,b)
that would simply do these operations on the C++ side?Issue migrated from trac:4143 at 2022-04-16 11:39:26 -0700
The text was updated successfully, but these errors were encountered: