Opened 8 years ago

Closed 6 years ago

Last modified 6 years ago

#3591 closed enhancement (fixed)

Play nomad on all random maps

Reported by: elexis Owned by: elexis
Priority: Should Have Milestone: Alpha 23
Component: Maps Keywords:
Cc: Patch:

Description (last modified by elexis)

The map "Unknown nomad" only supports about 12 different map types. This has two bad consequences:

1) Nomad experience is limited / repetitive. 2) Other maps are less frequently played.

Both can be solved by making the nomad-mode a gamesetup option.

Implementation: If this option is enabled, a trigger script could just spawn the starting entities and delete all other player entities (buildings, units).

Deleting pre-built cities in scenario maps might yield unexpected maps. This could be fixed by adding a boolean mapsetting which would deny nomad gamemode for that map.

The actual "unknown nomad" map would have to be deleted, as it seems to be identical to the map "Unknown" with nomad gamemode.

Change History (17)

comment:1 by elexis, 7 years ago

Description: modified (diff)
Milestone: BacklogAlpha 23
Owner: set to elexis
Status: newassigned

At least for random maps, this is going to become a low-hanging fruit following the commit that removes the (about 60 copies) of the starting base loop.

comment:2 by elexis, 7 years ago

There are two choices to implement the spawn mechanism:

1) Spawn the starting units in the random map script code.
2) Spawn the starting units in a trigger script.

Here is why we have to use the random map script flavor:

1) Has the advantage of being able to fine tune the starting positions. For instance on Unknown Nomad, it is possible to get a variant where most players are on mainland and one or two players are spawned on islands with almost no resources: #3140. Same problem would arise on Aegean Sea. On danubius, extinct volcano and river archipelago and maps with violent animals (tigers) we might want to avoid gaia towers on islands and near the gaia CC. Howe Sound, Migration and Phoenician Levant, Pompeii also have small islands which might be considered unfair. On survival of the fittest, we might want to exclude the central area.

1) has the disadvantage that every map needs few lines of code stating the restrictions.

2) is done for Regicide and Relics. The starting position isn't a problem in Regicide, because a valid starting location is already known prior (near the other units). Relics can spawn in odd, barely reachable or dangerous places, but that is well balanced, contrary to a player being spawned in a disconnected or dangerous location contrary to the other players.

2) also has the barely relevant disadvantage that the unit is not visible until the first turn was executed (in regicide players sometimes wonder where their hero is while the game is waiting for other players to finish the loading screen).

comment:3 by leper, 7 years ago

What about option 1.5, where maps can place some hint entities that mark positions as "good" and then the trigger script picks from those if there are enough, or just ignores them (which reduces the chance that there are fewer markers than players thus putting a few players at a disadvantage).

Note that "good" might also mean near some specific hostile entity, if that specific map has that as one of the main design points.

This has parts of the disadvantages of both, but fixes a few of the issues with just one of them.

comment:4 by elexis, 7 years ago

TLDRL:

  • scenario maps inherently not supported
  • SkirmisherReplacer needs extension to remove the civic center and could replace a new triggerpoint with the starting units (before the simulation started) on both skirmish and random maps
  • a trigger script doesn't seem benefitial

TriggerHelper.GetLandSpawnPoints used by CaptureTheRelic.js assuming that every non-flying non-actor entity is reachable from every other of these entities always felt like workaround, despite never having ran into a problem on any map yet.

For random map scripts themselves wouldn't gain anything from using a trigger script afaics as passing a constraint is cheap enough, for instance hard requirement: avoidClasses(clWater, 4, clHill, 4, clForest, 2, clRock, 4, clMetal, 4, clGaiaSettlement, 4, clFood, 2), stayClasses(clLand, 10)) and a prefered requirement: avoidClasses(clFood, 8, clGaiaSettlement, 20).

Scenario maps generally don't offer any setting choice. So a scenario map is either always or never a nomad map, thus doesn't need any code.

For skirmish maps, the "default" / skirmish replacer templates will have to be removed. Also the initial starting resources ought to be removed somehow, because they will leave a spot that just looks like a city place without the civic center (visual aspect). Players would be incentivized to always build at these places as the resources are there). But then again the mines are always in the same place on skirmish maps anyhow.

A trigger script reusing GetLandSpawnPoints might work for many skirmish and random maps.

But to not place players on disconnected islands or near hostile entities, we will need some mechanism to add either constraints or preferable places, so a trigger script indeed won't be sufficient.

(Having to provide a finite set of spawn locations for each atlas map sounds like either few variation (repetitive starting locations) or lots of work and obstructing the view in atlas. But that is just in line with the properties of skirmish maps).

Given that SkirmishReplacer.js needs a nomad check already, perhaps we could just add skirmish/default_nomad_starting_units.xml with contents similar to a triggerpoint plus a <SkirmishReplacer> entry holding a nomad flag.

Then we can remove the nomad rmgen unit spawn code too and just spawn such a nomad trigger point from the rmgen script while still passing a constraing in every random map script for good measure.

comment:5 by elexis, 6 years ago

Nomad on skirmish maps that were not made for that mode is still ugly, because of the starting resources for players being placed everywhere, incentivizing the players to just drop the CC exactly there. So perhaps we need the SkirmishReplacer to delete starting resources in nomad mode, just like it would do for player owned templates.

For random maps it still seems like unneeded complexity to first spawn a trigger point that is only used to place entities of the player at game start (which supposedly is the job of the rmgen script).

Since the random map script still either has to place starting units or trigger points, since changing from one to another is simple and since all 65+ supported maps will need some kind of modification, I plan on going ahead with implementing this and Skirmish maps can be implemented separately in a diff that is 65+ files smaller.

comment:6 by elexis, 6 years ago

Milestone: Alpha 23Backlog
Owner: elexis removed
Status: assignednew

comment:7 by elexis, 6 years ago

While TriggerHelper.GetLandSpawnPoints() is universaly applicable to every map, it has the clear disadvantage that the map can't control where players can start.

For instance on some Unknown variants there are tiny islands that can have a tree or two and Danubius has garrisoned gaia civic centers that must be avoided.

The random map script and the skirmish map atlas editor is aware which areas are good and bad spawning locations.

So using TriggerHelper.GetLandSpawnPoints() is ruled out for random map scripts, as it is really easy to specify good locations in rmgen.

One could also use GetLandSpawnPoints if the mode is selected but no spawn trigger points found, thus not being required to adapt every map.

in reply to:  7 comment:8 by mimo, 6 years ago

Replying to elexis:

While TriggerHelper.GetLandSpawnPoints() is universaly applicable to every map, ...

Is it really? I don't like this function as it is not random. In maps like oasis, you will always pick points around the central oasis where all gaia entities are. That's also true for the relic game mode, where you know that you'd better look for relics in dense forests.

A bit off-topic here, but for relics, trying points from a grid, checking accessibility from the hierarchical pathfinder (and requiring a minimum distance vs all previously spawn relics) would be better.

comment:9 by elexis, 6 years ago

Universally applicable in the sense that we don't have to change the maps for it to apply. I fully agree that GetLandSpawnPoints is not the preferable solution for the given examples (spawning nomad starting units near gaia or tiny islands would be terrible) however.

Using the HPF in GetLandSpawnPoints would be a definite improvement and I'll write up a ticket.

What is your opinion about the two examples in CTR mode (not spawning a relic on tiny islands or near gaia CCs)? I considered it an interesting possibility if that happened so far, requiring the players to go through the side-quest of discovering, conquering and defending that remote part of the map or destroying gaia. One could spawn also the relics (and non-garrisonable regicide heroes on water maps) from rmgen and only spawn it in the triggerscript if it wasn't spawned yet to prevent these scenarios however. I guess there could be a map where it is essential to do that for Regicide mode. (For nomad there's also the aspect that units aren't spawned on turn-0 yet which I find a bit ugly.)

in reply to:  9 comment:10 by mimo, 6 years ago

Replying to elexis:

What is your opinion about the two examples in CTR mode (not spawning a relic on tiny islands or near gaia CCs)?

I've not really thought about it, but that looks ok. Spawning near gaia cc may certainly be interesting. Concerning tiny islands i would say it depends on how tiny it is :) On a naval map, there would be no problem whatever tiny it is, but on a land map, i would find annoying to have to build dock + ships just to explore a tiny small island while all the game is based on land fighting. A large island on the other side, in the latium map, would nonetheless be fine.

comment:11 by elexis, 6 years ago

In 20856:

Use vector algebra for the unconventional playerbase resources on Belgian Uplands, refs #4845.
Add an extra scope since that block will become conditional on nomad maps, refs #3591.

comment:12 by elexis, 6 years ago

Component: UI & SimulationMaps
Milestone: BacklogAlpha 23
Priority: Nice to HaveShould Have
Summary: Play nomad on all mapsPlay nomad on all random maps
Type: defectenhancement

While still an addition interesting to players, nomad on skirmish maps still appears to be weird due to the starting resources and city texture but no civic center to be found, inviting players to build in the original CC location.

Keeping this ticket for the a23 milestone.

comment:13 by elexis, 6 years ago

(Another map to consider is the frozen-lake variant of Gulf Of Bothnia, or the passable mountains on Latium. Players spawned in these reachable areas would have a measurable to significant disadvantage as they have to walk the extra mile until they can scout resources.)

comment:14 by Stan, 6 years ago

You wrote it was fixed in the commit but I believe the command wasn't interpreted

comment:15 by elexis, 6 years ago

Owner: set to elexis

Thanks, I didn't notice. Indeed there was this warning about a post-commit-hook having failed...

As mentioned, there are still some things that can be added:

  • Survival Of The Fittest needs something
  • Skirmish map support
  • Starting on a ship on naval maps
  • Use the skirmish map support (trigger script spawning) to remove some rmgen calls if there is no map-specific spawn condition

(But I want this ticket to be on the a23 milestone.)

comment:16 by elexis, 6 years ago

Resolution: fixed
Status: newclosed

In r20866:
Nomad mode on all random map scripts (except Survival of the Fittest), fixes #3591.

Fine-tune random map scripts if nomad mode is enabled by omitting gaia attackers and vast voids.
Fix nomad units on the Unknown sometimes being stuck on mountains or tiny islands, refs #3140.

Discussed with: bb

comment:17 by elexis, 6 years ago

In r21274:

Add Nomad checkbox for Atlas, refs #4824, #3591.

Differential Revision: ​https://code.wildfiregames.com/D1310

Note: See TracTickets for help on using tickets.