#3102 closed enhancement (fixed)
[PATCH] Map modification: Survival of the Fittest
Reported by: | NiAypa | Owned by: | NiAypa |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 22 |
Component: | Maps | Keywords: | patch |
Cc: | Patch: |
Description (last modified by )
Hello,
I have just modified the random map "Survival of the Fittest".
Here is a link to the forum post
What I changed:
Waves now have different unit types (and strength), more are added as waves are coming
- The first wave spawns at 5 minutes now instead of 10
Treasure seeker women now respawn when killedimplemented as invincible woman.
Disabled the corral
- Treasures now spawn more frequently & more randomly, also more treasures are spawned
- More info messages are now displayed
More detailed description for the new waves:
The waves can now contain of Infantry, Champions, Elephants, Healers, Siege Units, and Heroes. As more waves are coming, more unit types will be attacking, and their share changes. I guess this is quite unbalanced still, since I did not yet have the opportunity to test well, since this map is supposed to be played with 4 Players.
Im still working on it, but I think it can be tested now especially for balancing So I open this ticket to hope more people can test that way (Im quite confused but testing from SVN would be the point).
I highly appreciate any feedback :)
And I hope, of course, that it will be included in Alpha 19
Attachments (20)
Change History (72)
by , 10 years ago
Attachment: | SurvivalOfTheFittest_NiAypa.zip added |
---|
comment:1 by , 10 years ago
Description: | modified (diff) |
---|
comment:2 by , 10 years ago
Owner: | set to |
---|
comment:3 by , 10 years ago
I have attached an update with the following changes:
- Number of treasures changed
- Players who are defeated, and empty slots now cause less treasures to spawn (not yet working for the first two spawns)
- Balanced the waves (Feedback pls)
- Added a little more resources later in game
- Fixed a bug in the treasure spawn, that made treasures be unequally spawned
by , 10 years ago
Attachment: | SurvivalOfTheFittest_NiAypa_2.zip added |
---|
Survival of the Fittest modified map files. Unpack to 0ad/binaries/data/mods/public/maps/random
comment:4 by , 10 years ago
Some code comments:
- You should incorporate the changes from r16444. (I guess you were developing this against alpha 18, you should really develop it against SVN though (makes it easier to include, and less updating needs to be done in case something changes))
- Leave the warning about AI players at the start of the map description.
- Code style (also see the coding conventions)
- The indentation for arrays is a bit much, just use something like
var treasures = [ "gaia/special_treasure_food_barrel", "gaia/special_treasure_food_bin", "gaia/special_treasure_food_crate", "gaia/special_treasure_food_jars" ];
- In objects quote the value name
{ "foo": "bar" }
- One space between
if
and(
(also forfor
). - For
if
s andfor
s with just a single line of code in it omit the braces. - Adding methods to the prototype should have a
;
after the closing}
of the method (Also see r16444). switch
-case
indentation.
- The indentation for arrays is a bit much, just use something like
startEnemyWave()
andwaveAttackers
could likely be simplified by using an object to store the counts and a function to calculate those counts, then looping over those object keys and adding units that way.- In
MarkUnassignedPlayers
in the secondif
you could just assign a pre-made object. Instead of doingfoo = {}; foo.bar = baz; foo.bla = 2;
do something akin tofoo = { "bar": baz, "bla": 2 };
- I18n is completely broken. See Internationalization.
- Do not concatenate strings that should be translated. Use sprintf, or in this case just
markForTranslation()
the string with the format specifier, and then pass the parameter along. - Remove
TimeString
and use time/date formatting for this.
- Do not concatenate strings that should be translated. Use sprintf, or in this case just
- Naming of functions and variables can be improved (eg
TalkToPlayers
would be a lot nicer asNotifyPlayers
) - Use an consts instead of strings for the cases (and the parameters you call it with) in
TalkToPlayers
.
(Not an extensive review, but those should be fixed anyways.)
The ideas on how to improve it implemented in there are quite nice.
comment:5 by , 9 years ago
Component: | UI & Simulation → Maps |
---|---|
Keywords: | review added; Survival of the Fittest Trigger random removed |
comment:8 by , 9 years ago
Milestone: | Alpha 19 → Alpha 20 |
---|
If you want I can make an a18 patch from those three javascript files, so that it might be easier to review and update the map to svn.
comment:9 by , 9 years ago
Keywords: | patch added |
---|
comment:10 by , 9 years ago
Milestone: | Alpha 20 → Backlog |
---|
comment:12 by , 8 years ago
Keywords: | review added |
---|---|
Summary: | Map modification: Survival of the Fittest → [PATCH] Map modification: Survival of the Fittest |
comment:14 by , 8 years ago
Keywords: | map review removed |
---|
by , 8 years ago
Attachment: | t3102_survival.diff added |
---|
rebased still interesting parts of proposed changes
comment:15 by , 8 years ago
Description: | modified (diff) |
---|---|
Keywords: | review added |
Milestone: | Backlog → Alpha 21 |
patch includes:
- respawning woman,
- more random treasures (place and time),
- more info messages,
- trickle resource after some time
comment:16 by , 8 years ago
Keywords: | review removed |
---|
Thanks for working on this, but there are a number of points I disagree with, see comments http://irclogs.wildfiregames.com/2016-06-24-QuakeNet-%230ad-dev.log from 11:13-11:30.
by , 8 years ago
Attachment: | t3102_survival_2.diff added |
---|
comment:17 by , 8 years ago
Included comments
only a ceasfire or dplo states would be as much of a workaround as respawning. Making the woman invulnarable and undeletable seems a better option.
comment:18 by , 8 years ago
Keywords: | review added |
---|
follow-up: 20 comment:19 by , 8 years ago
(just formal quick stuff extra space l227 new empty line l71 you can let the comma at end of array what happens if we add starting females not in middle ?)
comment:20 by , 8 years ago
Replying to fatherbushido:
you can let the comma at end of array
I know, but hate it
what happens if we add starting females not in middle ?)
Implemented a little workaround: seeker woman need to have lower ID then other woman (what I guess can be assumed)
comment:22 by , 8 years ago
- Not sure whether the balancing is fine. Especially if one can't build fields nor corrals. That seems like a new change as I recall people having food income and selling that at the market. If we want to prohibit economy, markets should be prohibited as well (though not sure why we would want to prohibit food and trade economy). Neither sure that the provided resources + treasures are enough to build anything. Didn't playtest.
- If that comment is still accurate, the waves are not becoming strong enough:
A soldier for each 2-3 minutes of the game. Should be waves of 20 soldiers after an hour
It should be an exponential, not a linear increase.
IsUndeletable
/this.undeletable
change was broken, you have to compare against the string- Using a loop for the resources
- Invincible units should become unattackable, likely not easily doable.
let attackerEntity of attackerEntities
should use.map
- Some of the comments should rather be removed than correcting the case
// Place the treasures this.PlaceTreasures();
- Inlining that
ProcessCommand
object and removing that undefined value - Those defaults should be at the top of the file
seekersNumber
-> not sure if we need that- Should we just use trigger points
A-K
instead of deviating from those 3? Your code moves them up to23
tiles away while the trigger points are placed instayClasses(clLand, 5)
, so that might be out of range unless I'm mistaking the unit. - Renaming to
resourceMessage
and making that bool. Check if only one player remains. He will be the winner.
that should be unneeded as of r18441 or one of those endgamemanager/last-man-standing changes (#3970)
by , 8 years ago
Attachment: | t3102_survival_4.diff added |
---|
rebased and fixed a good number of the things mentioned
by , 8 years ago
Attachment: | t3102_survival_6.diff added |
---|
merge random number functions, make resource amount and other consts an interval too and don't create enemy's for non active players.
by , 8 years ago
Attachment: | t3102_survival_6.2.diff added |
---|
comment:23 by , 8 years ago
The number of occurances of shuffleArray(foo)[0]
is significant and more and more occurances are being added, as it's a usual task to pickRandomElement
. IMO there should be a function for that, right below shuffleArray
. Then it could also save some performance by using randInt
instead of randomizing the entire array.
by , 8 years ago
Attachment: | t3102_survival_9a.diff added |
---|
cleanup chatHelper (let it use pickRandomElement). All calls of randInt needs to be checked and updated to the new system, but this will be a separate patch.
comment:25 by , 8 years ago
Milestone: | Alpha 21 → Alpha 22 |
---|
follow-up: 33 comment:31 by , 8 years ago
Keywords: | review removed |
---|
Review: attachment:t3102_survival_7b.diff:
- I really didn't like seeing
Engine.DestroyEntity
. Errors shouldn't be corrected after they occured but become prevented in the first place. As seen in the commit above, the attacker wave code also did pointless loops.
- Not too happy about the
structures/brit_crannog
part. If you want to disable templates that can't be built in the first place, check #4229. Rotary mill would rather fit there.
foundSeeker
-> not sure how you got there, since the rms only places one woman
minutes = 60 * 1000
the second term seems easier to grasp than the variable name (as the latter requires a lookup)
- For this ticket I order a separate cleanup patch for the time intervals, one for the new messages and one for the treasure update (if we really need that. Hannibal Barca suggested to just play with bigger maps)
Random cleanup:
- Please create a separate ticket for the random cleanup.
pickRandom
and a separate patch doing the duplicate random function thing.
comment:32 by , 8 years ago
Description: | modified (diff) |
---|
comment:33 by , 8 years ago
Replying to elexis:
- I really didn't like seeing
Engine.DestroyEntity
. Errors shouldn't be corrected after they occured but become prevented in the first place. As seen in the commit above, the attacker wave code also did pointless loops.
Neither do I but IIRC there were some errors occuring when checking for "active" players, maybe they got fixed elsewhere in the mean time (as I can't reproduce them easily now).
foundSeeker
-> not sure how you got there, since the rms only places one woman
True indeed but when someone adds a non seeker woman it will become invincible too, so a nice unbreakable meatshield. This was added in order of bug prevention but I could agree on changing the comment in survivalofthefittest.js L201 by addressing this issue.
comment:34 by , 8 years ago
Sometimes the first wave doesn't spawn any attackers, so there is a Math.max(1, ...)
missing.
comment:35 by , 8 years ago
Disabling of storehouses: We should disable farmsteads as long as fields are disabled too. Should we also disable storehouses, so that players can't gather wood at the bottom (considering that civic centers and military colonies are disabled at the bottom too)? Is it possible to disable the training of the mauryan elephant worker as well?
Gameplay speed: We usually play this map in 2x speed, so we should increase the treasure- and enemyrate by that factor. For the currently spawned treasures on a giant map with 8 players and medium starting resources, players can survive for about 45min simulation time if they use the resources well. If the game is started with higher resources, players can survive for a much longer time and start self-trade, receiving infinite resources. However waves with 8 elephants and 30 champions are still hard to counter after 90-120 min of simulation time. Therefore we shouldn't use exponential of even square growth of units but stick to the linear increase, perhaps add a constant factor of 1.5 to the passed time.
comment:37 by , 8 years ago
Keywords: | simple added |
---|
Must-Have:
- With the a21 balancing, a game takes 2-3 hours before 50 enemies are spawned and those don't really work against 100 units either. So we need exponential waves for late game.
- There are long periods where nothing is to be done. So better spawn enemies much earlier (min 3?).
Should-Have:
- post delete command
OnOwnershipChange
to gaia, otherwise the attackers capture uselessly - Multiple spawn points for Gaia around the CC, so that players can't prepare too easily.
- one hero per wave after 15min, two heroes per wave after 30min
Nice-To-Have:
- Delete the gaia treasure woman after defeat (to distinguish it from treasure on the minimap)
- Don't spawn treasure if the previous treasure wasn't picked up yet
- Surprise waves
If time permits:
- Gaia units not seen in summary screen at all. Could be solved by manually tracking those gaia units on this map.
- Spawning gaia woman with waves, annoying the treasure picking, invincible woman
by , 8 years ago
Attachment: | survival-formula.ods added |
---|
libre office spreadsheet showing the new exponential formula
by , 8 years ago
Attachment: | survival_formula.pdf added |
---|
libre office spreadsheet showing the new exponential formula
comment:38 by , 8 years ago
Keywords: | rfc added; simple removed |
---|---|
Milestone: | Alpha 22 → Work In Progress |
RFC: https://github.com/elexis1/0ad/tree/survival
- Contains debug warn() messages so that the attached commands.txt can be replayed non-visually, showing which units spawn at which time without playing (to be removed when committing). Can rebase the branch into two clean commits later.
- Exponential waves from the PDF/ods above
- Moves constants to the top of the file
- Distinguishes between unit types (champs and siege) to allow adding citizen soldiers and shifting the ratio depending on the gametime
- Spawns gaia hero after 30min with increasing chance but certainly after 60min (but only if the previous gaia hero is not alive anymore)
comment:39 by , 8 years ago
A few problems I noticed when playing this map:
1 - the disabling of structures is only done at the first turn. It should be done before. The problem is clearly seen when playing with an AI, it will build a corral on the first turn, before the disabling be effective.
2 - gaul also have a rotarymill which should be disabled as the brit one.
1 and 2 are fixed in the attached survival.patch.
3 - there should be new victory conditions for this kind of map (stayAlive or any other better name) with two settings: either be the last one alive (i.e. with still its cc) or be alive after N minutes (with N settable). Having a new victory condition which matches the purpose of the map would allow to be able to adapt the AI strategy to this kind of map Having a time dependent condition would give the possibility to SP players to be able to enjoy that map even if the AI is not (yet) performant on it.
by , 8 years ago
Attachment: | survival.patch added |
---|
follow-ups: 42 47 comment:41 by , 8 years ago
re patch: Do we need the empty Trigger.js
function or would it suffice to add a comment? Should that become a part of eventNames
(which I don't really understand at first glance)?
re AI Survival Victory Condition:
I don't think we should wrap the information that we can't reach the enemy in a survival victory condition.
Either that victory condition will be a workaround that is valid only for one map, or we reuse it on other maps. If it will be reused on other maps, it shouldn't assume that we can't reach the enemy.
(As mentioned elsewhere, survival on all maps would be great i.e., the map comes with triggerpoints and in the gamesetup one would be able to specify whether only the same amount of enemies appear as on gallic fields, or whether they should be game deciding as on survival.)
Furthermore the enforcing of a victory condition would mean we can't play the regicide or wonder victory condition on this map anymore. It should even be possible to combine multiple victory conditions: #4014.
Also there could be other maps that are not survival where we can't reach the enemy, for example winning by gathering resources or fulfilling any scripted quest.
Perhaps it would be better to add support for AI flag in the map JSON, in this case stating that we can't reach the enemy (thus never attempting to plan anything with that regard)?
comment:42 by , 8 years ago
Replying to elexis:
re patch: Do we need the empty
Trigger.js
function or would it suffice to add a comment? Should that become a part ofeventNames
(which I don't really understand at first glance)?
The empty trigger is needed for the Trigger component to register to InitGame messages. It is possible that it would have worked at adding InitGame in eventNames, and defines a function to be called, but that would need more lines than what is done in the patch, I've not really understood why it was needed to do it this way for other events (although I've never used triggers, and i have certainly missed some subtleties), and I'm not even sure that this other method would work as I've not tested it.
re AI Survival Victory Condition:
Perhaps it would be better to add support for AI flag in the map JSON, in this case stating that we can't reach the enemy (thus never attempting to plan anything with that regard)?
Yes, you may be right, but the problem is not that we can't reach enemies, but rather that unforeseen waves of attackers will be sent. We could add a flag in the JSON file, or even better, the trigger script could send a message to the AI at initialization to warn it that such attack waves will be sent.
comment:43 by , 8 years ago
Concerning the way to deal with AI when trigger script, here is a simple proposal: the trigger script could fill an array of TriggerScritEvent stored in the Player component, which can then be accessed by the AI so that it is warned of what are the possible events it can expect and reacts accordingly. In the ai-survival.patch example, the TriggerScritEvent is the object {"type": "attackWaves", "value": "strong"} and is used by the AI to modify its proportion of support units.
by , 8 years ago
Attachment: | ai-survival.patch added |
---|
comment:44 by , 8 years ago
That looks much more meaningful. Shouldn't we just send the entity IDs there instead of some hardcoded string, so the bot might even decide to attack those entities directly and can estimate how strong that wave really is?
comment:45 by , 8 years ago
You've not understood the purpose of this: it is not to sent a message (or a list of IDs) at each wave, but only to send a message once (at init) saying that strong attackWaves will be sent so that the AI can modify its defense strategy exactly as a player would do (players know that attack waves will come and anticipate them).
comment:47 by , 8 years ago
comment:48 by , 8 years ago
Milestone: | Work In Progress → Alpha 22 |
---|
Exponential Waves, Gaia Heroes, Template Refactoring, Cleanup at https://code.wildfiregames.com/D145
Gaia waves attacking buildings and siege engines instead of uselessly attempting to capture: https://code.wildfiregames.com/P17
AI support by mimo in attachment:ai-survival.patch still requesting comments I guess.
About the AI patch:
I'm not sure whether that implementation is good the way it is. Usually events are added, processed once and then they cease to exist and they denote that something has happened at some time (in some defined chronological order). Our existing event system is the message system (like ownership changed).
There is no difference between a TriggerScript and existing simulation code and we might want to access those events from both places. Not sure whether the Player component is the right place to add this (as global events would be copied to each player). Why not use the AIInterface? The non-AI specific events are already treated well by our message system. Then the new event type could also become an actual event system (as in events being consumed) and It renamed to AI-event. Hypothetically waves could also stop at some point or be very far in the future. So the event could be sent each time a new wave is started and we could even pass the information of how strong that wave will be if we wanted to. (Just some thoughts)
comment:49 by , 8 years ago
Keywords: | rfc removed |
---|
comment:50 by , 8 years ago
While at it, description should be updated to mention how often treasures are spawned, that players are defeated upon losing their initial CC and should mention how often enemies are expected. Wouldn't hurt to display those hints at the beginning.
One thing that all matches seem to have in common in alpha 21 is that players are only defeated by elephants, as rams melt like butter and catapults are entirely inefficient. Hence, gaia units should add a guard order for siege engines instead of running like madmen into the defensive structures.
The spawnpoint should be marked somehow so that newcomers know where the enemies will come from. Not sure how to make it obvious though.
comment:51 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Calling this fixed by r19359 / D145:
Survival Of The Fittest Overhaul Exponential attacker increase to prevent boring endless games. Add a gaia hero per player at later stages of the game (if the previous one isn't alive anymore). Remove hardcoded template array and include gimmick templates (gaia), most notably the fireraiser which we never saw before and the siege tower. Remove treasure picker female after defeat to prevent confusion with treasure on the minimap. Add flag to the spawnpoints, so that new players know where the enemies actually come from, as proposed by bbleft and Hannibal Barca. Move all balancing constants to the top of the file. Actively chose attacker composition instead of having it relate to the number of templates that exist. Add debug output option, so that we can replay games and see which enemy wave composition attacked at which time. Add dry run, so that we can test the balancing effects from a non-visual replay instead of having to play some game. Remove many unused variables and some pointless tile classes from the mapgen. Whitespace and various code style cleanup, moving code to shorter, more readable functions. Reviewed By: bb Differential Revision: https://code.wildfiregames.com/D145
We should bundle those other ideas, especially mimo's AI support, guard order, garrisoning siege towers, better descriptions for newcomers and better treasure spawning and make a new ticket.
Survival of the Fittest modified map files. Unpack to 0ad/binaries/data/mods/public/maps/random