Page MenuHomeWildfire Games

Danubius Random Map Script with TriggerScripts + DoRepeatedly Trigger function
ClosedPublic

Authored by elexis on Mar 10 2017, 5:13 AM.

Details

Summary

Following the annexation of their lands by foreign impostors, the Geto-Dacian Tribal Confederation has decided to summon their longstanding allies of Gaul.
Players must not only vie for power amongst themselves, but also to defend themselves against the waves of Gallic liberators.



Notice the nice defensive behavior, allowing the players to survive early on while having trouble to gain full map control:

A path leads from the gallic village to a meeting place near the shoreline where some kind of ritual (Samhain?) is celebrated:

One in three map generations at night:

State at the end of the game, when one side of the river was taken out. No more units are spawned at that place, but the remaining ones will patrol the map forever, taking care that noone else will take that land easily:

Gaia using formations would be much more enjoyable, but they don't attack as they should and abort the attack in order and patrol somewhere else. The same behavior is observed with attack-walk instead of patrol commands.

In formation, those units even don't care about getting attacked. Without formation, the units immediately start chasing them at a far distance.

Test Plan

Watch out for resource collisions, they hide everywhere. Make sure the map is playable on tiny mapsizes too.

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 811
Build 1277: Vulcan BuildJenkins
Build 1276: arc lint + arc unit

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
bb added inline comments.Apr 18 2017, 5:15 PM
binaries/data/mods/public/maps/random/danubius.js
229 ↗(On Diff #1237)

Some of these only used once, so can be inlined, but probably not for consistency

But they should all be named fooRadius

277 ↗(On Diff #1237)

Perhaps move some element(s) from this line to previous for equal line length

352 ↗(On Diff #1237)

inline placer and painter

845 ↗(On Diff #1237)

newline in end

binaries/data/mods/public/maps/random/danubius_triggers.js
204 ↗(On Diff #1237)

Perhaps place this in random.js. under GetRandomAmounts(array, count)

326 ↗(On Diff #1237)

AFAIK OnOwnershipChange function are always placed on the bottom of the file, just above the trigger definitions

575 ↗(On Diff #1237)

the first part works, but second is bugged (better not done now)

603 ↗(On Diff #1237)

after ungarisson, the ship should patrol again

631 ↗(On Diff #1237)

add newline in end

This revision now requires changes to proceed.Apr 18 2017, 5:15 PM
elexis marked 64 inline comments as done.Apr 18 2017, 10:21 PM
elexis added inline comments.
binaries/data/mods/public/maps/random/danube.js
141

No to inlining that, to keep it consistent

binaries/data/mods/public/maps/random/danube_triggers.js
204

Don't see the point in adding duplicate code if it saves 2 or 3 seconds when loading the map. We should rather fix the TriggerHelper to skip the footprint thing, which will be needed by many maps, see above.

binaries/data/mods/public/maps/random/danubius.js
158 ↗(On Diff #1237)

Oh, the commenting wasn't reverted apparently

229 ↗(On Diff #1237)

Yep, for consistency, easier editing, also JIT smart to auto inline.

lel at Radus

264 ↗(On Diff #1237)

k

277 ↗(On Diff #1237)

The idea is to have them grouped logically, so doing something for codestyle would make this signifcantly harder to understand

289 ↗(On Diff #1237)

thx

346 ↗(On Diff #1237)

aye

352 ↗(On Diff #1237)

Wanted to keep it easy to replace with that one github branch commit, but idc

363 ↗(On Diff #1237)

Variables not used once

375 ↗(On Diff #1237)

neither

399 ↗(On Diff #1237)

=> neither

423 ↗(On Diff #1237)

yep

610 ↗(On Diff #1237)

Your intention was the indentation

845 ↗(On Diff #1237)

Exists, otherwise phab would complain

binaries/data/mods/public/maps/random/danubius_triggers.js
18 ↗(On Diff #1237)

Originally did for heroes, but removed. If we do that, we should do it with all templates then. Then we still need to define all the classes, which might indeed be better for mods and future changes.

82 ↗(On Diff #1237)

A missing unused argument that would be nice to use, but needs gameplay testing, consideration and might even depend on a gamesetup option

124 ↗(On Diff #1237)

good catch

193 ↗(On Diff #1237)

IIRC polar sea too

204 ↗(On Diff #1237)

Since this should be used by survival too, could be done in a separate diff, especially since people don't like new maps changing existing library code

248 ↗(On Diff #1237)

Those templates do, meh, fine. Stupid mod support

254 ↗(On Diff #1237)

120 characters is my tolerance limit, this one has 121, so ok. In particular consistent with below
Yep, as said above above

321 ↗(On Diff #1237)

If they don't have a visual component, what are they doing on the map?
It would crash so modders can fix their template.
Don't see the point, but I'll just add it because I don't have time to go through another revision for no real reason. Adding the cmpIdentit check too for consistency.
put, put, put; split, split split; build built built.

326 ↗(On Diff #1237)

oyes. Since we're likely running into naming conflicts, DanubiusOwnershipChange?

334 ↗(On Diff #1237)

check, nice

347–348 ↗(On Diff #1237)

meh, might also want to add a check whether the component exists :P

380 ↗(On Diff #1237)

Nah, the siegeRatio is the most important part in the balancing consideration IMO

430 ↗(On Diff #1237)

technically yes, but would look odd with that comment and without a newline

432 ↗(On Diff #1237)

must be a relict, good catch.

No complaint about duplicate garrisonholder getter?

451 ↗(On Diff #1237)

Must be a performance concern. Should use a new function then, refs D185

459 ↗(On Diff #1237)

prior unload command that should really not be overwritten?

523 ↗(On Diff #1237)

Right! Someone could survive on an island or the water and rebuild later.

But better not cancelling the timer in the first place

543 ↗(On Diff #1237)

s/cleaner/actually functional

575 ↗(On Diff #1237)

Hm, removing that comment which I had intended to workaround once apparently.

603 ↗(On Diff #1237)

Adding a AttackAndPatrol call, but it will mean that we will queue duplicate AttackAndPatrol orders once the timeout kicks in again. Not a big issue since the ungarrison walkcommand thing will reset the order queue more frequently than queueing new orders, so we will never have more than twice those patrol+stance things queued.

Adding a check for the unitAI order queue sounds bad and ideally we should avoid making assumptions about the sim as far as possible to reduce maintenance cost as far as possible

607 ↗(On Diff #1237)

In accordance with every other trigger script file I put my hands on. To keep it notably different from the function scopes.

617 ↗(On Diff #1237)

:-S. added

626 ↗(On Diff #1237)

-.- who said we have to differ this each time wave instead of each match? but yes, those globals should not be functions then

631 ↗(On Diff #1237)

exists

elexis updated this revision to Diff 1344.Apr 18 2017, 11:09 PM
elexis edited edge metadata.
elexis marked 37 inline comments as done.

That what bb and jshint said.
Also made refilling an independent interval, so that respawning can be much slower than refilling and unloading.
Thereby nicer rebalancing of waves after gameplay test with Hannibal Barca, Grugnas, causative, Boudica, Uran238cz and FeldFeld.
Mostly 2x more time between ship respawns, at most 1.5x ships per player since only a small portion of the players is actually active on the sea, but more units per ship to compensate,
so that it's easier to do something on the water.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (305 tests).................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (305 tests).................................................................................................................................................................................................................................................................................................................OK!

http://jw:8080/job/phabricator/816/ for more details.

bb added inline comments.Apr 18 2017, 11:55 PM
binaries/data/mods/public/maps/random/danubius.js
400 ↗(On Diff #1344)

wrong rename, should be tDist, since it are trees.

binaries/data/mods/public/maps/random/danubius_triggers.js
105 ↗(On Diff #1344)

at the first wave (when t == 0) then there won't be any garrison, perhaps add a constant.

141 ↗(On Diff #1344)

shouldn't they also try to attack docks and trade and fishing ships?

340 ↗(On Diff #1344)

we don't garrison them here anymore

603 ↗(On Diff #1344)

could simply be OnOwnershipChange as is in sotf.

631 ↗(On Diff #1237)

my arc is yelling about it though...

elexis updated this revision to Diff 1347.Apr 19 2017, 12:17 AM
elexis marked 4 inline comments as done.

Rename to SpawnShips and angle, dist.

binaries/data/mods/public/maps/random/danubius_triggers.js
105 ↗(On Diff #1344)

0 at time 0 intended

141 ↗(On Diff #1344)

Entirely don't care about fishing ship (in particular it's about priorization, though the code complexity could be increased too to account for that, don't see the point though). I've seen ships staying at docks too, just not staying focused on it.
Until the map becomes less tough, better not make it harder, but we'll keep it in mind.

340 ↗(On Diff #1344)

O yes

603 ↗(On Diff #1344)

(In case I didn't post it already) Yes, but we might launch many other trigger scripts that all subscribe to ownership changes, so should really avoid naming conflicts here. At some point we need a custom prototype or something.

631 ↗(On Diff #1237)

but there is a newline at the end of the file?
Perhaps it's rather complaining about the missing newline at the end of the properties list?

vladislavbelov added inline comments.
binaries/data/mods/public/maps/random/danubius.js
817 ↗(On Diff #1347)

I suggest:

setWaterColor(0.317, 0.396, 0.294);
setWaterTint(0.439, 0.403, 0.262);
840 ↗(On Diff #1347)
setWaterColor(0.074, 0.101, 0.090);
setWaterTint(0.129, 0.160, 0.137);
846 ↗(On Diff #1347)
setWaterMurkiness(0.97);

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (305 tests).................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (305 tests).................................................................................................................................................................................................................................................................................................................OK!

http://jw:8080/job/phabricator/817/ for more details.

elexis updated this revision to Diff 1356.Apr 19 2017, 11:59 AM

Water settings by Vladislav. Thanks, looks much better!
Fill ships immediately after spawning them, since it is awkward to have unprotected ships right after those ships were so strong.
Rebalanced ship frequency and garrison again, might have nerfed too much.
Ran AI games for 2 realtime hours and it seems it works well enough with Petra actually.
I noticed females are entirely ignored by gaia sometimes, even if the units patrol there for 90 ingame minutes after having destroyed everything else.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (305 tests).................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (305 tests).................................................................................................................................................................................................................................................................................................................OK!

http://jw:8080/job/phabricator/821/ for more details.

bb accepted this revision.Apr 19 2017, 4:22 PM

debuglog needs to be set false, further map looks playable for now.

This revision is now accepted and ready to land.Apr 19 2017, 4:22 PM
This revision was automatically updated to reflect the committed changes.

Thanks

  • Hannibal Barca for the basic map generation,
  • bb and FeXoR for the reviews and the plentiful feedback in both this proposal and D219,
  • mimo for improving the house garrisoning in D220 in the light of this map,
  • niektb and Vladislav for suggesting environment settings,
  • Grugnas, FeldFeld, siole, causative, Boudica and Uran238cz for playtesting this map in multiple matches!