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 1183
Build 1871: Vulcan BuildJenkins
Build 1870: 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
230

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

But they should all be named fooRadius

278

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

353

inline placer and painter

846

newline in end

binaries/data/mods/public/maps/random/danubius_triggers.js
205

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

327

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

576

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

604

after ungarisson, the ship should patrol again

632

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
140 ↗(On Diff #865)

No to inlining that, to keep it consistent

binaries/data/mods/public/maps/random/danube_triggers.js
203 ↗(On Diff #865)

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
159

Oh, the commenting wasn't reverted apparently

230

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

lel at Radus

265

k

278

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

290

thx

347

aye

353

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

364

Variables not used once

376

neither

400

=> neither

424

yep

611

Your intention was the indentation

846

Exists, otherwise phab would complain

binaries/data/mods/public/maps/random/danubius_triggers.js
19

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.

83

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

125

good catch

194

IIRC polar sea too

205

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

249

Those templates do, meh, fine. Stupid mod support

255

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

322

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.

327

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

335

check, nice

348–349

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

381

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

431

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

433

must be a relict, good catch.

No complaint about duplicate garrisonholder getter?

452

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

460

prior unload command that should really not be overwritten?

524

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

But better not cancelling the timer in the first place

544

s/cleaner/actually functional

576

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

604

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

608

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

618

:-S. added

627

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

632

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

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

binaries/data/mods/public/maps/random/danubius_triggers.js
105

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

141

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

340

we don't garrison them here anymore

603

could simply be OnOwnershipChange as is in sotf.

632

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

0 at time 0 intended

141

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

O yes

603

(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.

632

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
818

I suggest:

setWaterColor(0.317, 0.396, 0.294);
setWaterTint(0.439, 0.403, 0.262);
841
setWaterColor(0.074, 0.101, 0.090);
setWaterTint(0.129, 0.160, 0.137);
847
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!