Opened 9 years ago

Last modified 7 years ago

#3102 closed enhancement

[PATCH] Map modification: Survival of the Fittest — at Version 32

Reported by: NiAypa Owned by: NiAypa
Priority: Should Have Milestone: Alpha 22
Component: Maps Keywords: patch
Cc: Patch:

Description (last modified by bb)

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 killed implemented 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

Change History (47)

by NiAypa, 9 years ago

Survival of the Fittest modified map files. Unpack to 0ad/binaries/data/mods/public/maps/random

comment:1 by NiAypa, 9 years ago

Description: modified (diff)

comment:2 by NiAypa, 9 years ago

Owner: set to NiAypa

comment:3 by NiAypa, 9 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 NiAypa, 9 years ago

Survival of the Fittest modified map files. Unpack to 0ad/binaries/data/mods/public/maps/random

comment:4 by leper, 9 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 for for).
    • For ifs and fors 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.
  • startEnemyWave() and waveAttackers 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 second if you could just assign a pre-made object. Instead of doing foo = {}; foo.bar = baz; foo.bla = 2; do something akin to foo = { "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.
  • Naming of functions and variables can be improved (eg TalkToPlayers would be a lot nicer as NotifyPlayers)
  • 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 Itms, 9 years ago

Component: UI & SimulationMaps
Keywords: review added; Survival of the Fittest Trigger random removed

comment:6 by leper, 9 years ago

Keywords: review removed

See comment above.

comment:7 by leper, 9 years ago

Any updates?

comment:8 by elexis, 9 years ago

Milestone: Alpha 19Alpha 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 elexis, 8 years ago

Keywords: patch added

comment:10 by Itms, 8 years ago

Milestone: Alpha 20Backlog

comment:11 by elexis, 8 years ago

Refs r18209 and #2817

by bb, 8 years ago

Attachment: t3102_survival_letsvar.diff added

cleanup

comment:12 by bb, 8 years ago

Keywords: review added
Summary: Map modification: Survival of the Fittest[PATCH] Map modification: Survival of the Fittest

comment:13 by elexis, 8 years ago

In 18430:

Survival of the fittest cleanup. Based on patch by bb, refs #3102.

Show notificaiton to all players and observers.
Whitespace fixes.
let instead of var.

comment:14 by elexis, 8 years ago

Keywords: map review removed

by bb, 8 years ago

Attachment: t3102_survival.diff added

rebased still interesting parts of proposed changes

comment:15 by bb, 8 years ago

Description: modified (diff)
Keywords: review added
Milestone: BacklogAlpha 21

patch includes:

  • respawning woman,
  • more random treasures (place and time),
  • more info messages,
  • trickle resource after some time

comment:16 by elexis, 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 bb, 8 years ago

Attachment: t3102_survival_2.diff added

comment:17 by bb, 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 bb, 8 years ago

Keywords: review added

comment:19 by fatherbushido, 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 ?)

Last edited 8 years ago by fatherbushido (previous) (diff)

in reply to:  19 comment:20 by bb, 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)

by bb, 8 years ago

Attachment: t3102_survival_3.diff added

more cleanup

comment:21 by elexis, 8 years ago

In 18487:

Delete command improvements and bugfixes.

Allow deleting of miraged foundations.
Add component method to set units undeletable. Based on patch by bb, refs #3102.
If the control-all-units cheat is active, delete sheep, mostly captured buildings and undeletable units.
Merge duplicate delete checks in the GUI. Thereby take into account the control-all-units cheat and undeletability in all places.
Disable the delete button if the entity can't be deleted.
Add a tooltip for undeletability.
Don't colorize whitespace.
Remove unneeded comments.

comment:22 by elexis, 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 to 23 tiles away while the trigger points are placed in stayClasses(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 elexis, 8 years ago

Attachment: t3102_survival_4.diff added

rebased and fixed a good number of the things mentioned

by bb, 8 years ago

Attachment: t3102_survival_5.diff added

Cleanup based on work by elexis

by bb, 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 bb, 8 years ago

Attachment: t3102_survival_6.2.diff added

by bb, 8 years ago

Attachment: t3102_survival_7a.diff added

random changes only

by bb, 8 years ago

Attachment: t3102_survival_7b.diff added

survival part

comment:23 by elexis, 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 bb, 8 years ago

Attachment: t3102_survival_8a.diff added

use pickRandomElement

by bb, 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.

by bb, 8 years ago

Attachment: t3102_survival_9.2a.diff added

pickRandomElement --> pickRandom

comment:24 by elexis, 8 years ago

In 18772:

Petra AI: Use ally instead of team chat, since it should eventually be able to use diplomacy. Based on patch by bb, refs #4143, #3102, #4069.

comment:25 by elexis, 8 years ago

Milestone: Alpha 21Alpha 22

comment:26 by elexis, 7 years ago

In 18906:

Remove a hunk with commented out code and a hunk of broken duplicate code from survival of the fittest, refs #3102.

The removed code is redundant with the AlliedVictoryCheck of the EndGameManager which is called for all victory conditions.
The code is broken because it suggests last man standing mode while actually not implementing it.
As of #4143, players can chose between allied victory or last man standing mode. They should be able to chose on this map too.

comment:27 by elexis, 7 years ago

In 18907:

Don't throw errors attempting to spawn templates that don't exist on survival of the fittest. Patch by bb, refs #3102.

comment:28 by elexis, 7 years ago

In 18913:

Don't spawn units for defeated players and players who won on survival of the fittest. Refs #3102.

The previous code errored as the trigger point became gaia, consequently trying to access the undefined playerCivicCenter of gaia.
Remove two useless loops by sending the command for all entities instead of one command for each entity.
Rename attackerEntities to attackerTemplates and attackerCount to attackersPerTemplate.

comment:29 by elexis, 7 years ago

In 18914:

Don't use black for gaia on survival of the fittest, refs #3102.

Some GUI elements use white until the first diplomacy change.
The choice black is confusing, problematic as there is a dark gray player color and
problematic as black words in the chat have no contrast to the black background.
Changing playercolors in running games is a questionable feature, thus don't attempt to inform the GUI via a GUIInterface notification now.

comment:30 by elexis, 7 years ago

In 18915:

Invincible women on survival of the fittest to prevent women fights and cheap tower kills. Based on patch by bb, refs #3102.

comment:31 by elexis, 7 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 bb, 7 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.