Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#4993 closed defect (fixed)

Remove rmgen2 circle patterns

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

Description

The Alpha 20 rmgen2 maps provided by _kali, most prominently Ambush place bluffs and mountains that avoid the player civic center in a perfect circle.

This looks quite ugly and it should be possible to use the ClumpPlacer or ChainPlacer to generate a more randomized land. Then it should be placed completely if it doesn't conflict with player territory - or otherwise not be placed at all.

Attachments (7)

bluff.jpg (777.6 KB ) - added by elexis 5 years ago.
blue = new player territory to ignore, red = ramp
screenshot1586.jpg (269.7 KB ) - added by elexis 5 years ago.
how it looked before
screenshot1590.jpg (320.1 KB ) - added by elexis 5 years ago.
ramps
screenshot1592.jpg (444.0 KB ) - added by elexis 5 years ago.
more competition for bluffs
screenshot1593.jpg (393.7 KB ) - added by elexis 5 years ago.
screenshot1595.png (2.0 MB ) - added by elexis 5 years ago.
problem solved
screenshot1599.jpg (401.0 KB ) - added by elexis 5 years ago.

Change History (11)

comment:1 by elexis, 5 years ago

Milestone: BacklogAlpha 23
Owner: set to elexis

Problem sounds easy, solution isn't.

The circle comes from the fact that a big circular area around the player is ignored by bluffs, so that the playerbase, starting resources and starting walls are all on the same ground.

So the first step is easy: change it from a circular avoidance to a ChainPlacer (many circles of different sizes and locations, creating a non-regular pattenr).

But the irregularity of that implies that we can only ensure a small playeraera so that sometimes a single giant bluff entirely surrounds a playerbase with impassable terrain, locking that player in.

Setting the fail-fraction of the bluff from 50% to 0% (i.e. a bluff can only be placed if all of its points avoid the player) would solve these issues. But it is not possible currently due to performance issues. It would be an infinite loop or consume half an hour or more...

So I decided to go for a workaround and place a ramp from the starting base to a nearby bluff. It solves the issue and in most cases changes the gameplay for good. Bluffs now have to ways to enter a mountain. This means it's less a defensive turtle game and there is more competition for these mountains.

But in few cases passages on the ground are blocked by the ramp. Another thing I don't like is that terrain entities (trees) have to be removed from the ramp. This is bad practice and usually first the terrain should be placed, then entities, rather than changing ones mind in the middle of the map generation. But rmgen2 is not designed for these things (addBluffs adds the terrain + entities in one go).

At the end of the day the circle patterns are so ugly and the circumstances forcing me to use the workaround. With more days of development to spend, more performance improvements and cleanup of rmgen2, the situation might change.

Another thing I have done in this patch is trying to improve the performance. Tileclasses constraints have a very bad complexity. So in this diff I reduced the time measurably but not sufficiently (still can consume a minute loading screen time) by marking the area bluffs should ignore after painting these areas (rather than recomputing these areas each time the constraint is tested). This adds a lot of code (20-30 lines), but I'll keep it now. It can be removed in case we develop a more general approach (Static constraints? multi caches for constraints? #5011)

by elexis, 5 years ago

Attachment: bluff.jpg added

blue = new player territory to ignore, red = ramp

by elexis, 5 years ago

Attachment: screenshot1586.jpg added

how it looked before

by elexis, 5 years ago

Attachment: screenshot1590.jpg added

ramps

by elexis, 5 years ago

Attachment: screenshot1592.jpg added

more competition for bluffs

by elexis, 5 years ago

Attachment: screenshot1593.jpg added

by elexis, 5 years ago

Attachment: screenshot1595.png added

problem solved

by elexis, 5 years ago

Attachment: screenshot1599.jpg added

comment:2 by elexis, 5 years ago

Origin: https://trac.wildfiregames.com/raw-attachment/ticket/4993/screenshot1586.jpg

Solution: https://trac.wildfiregames.com/raw-attachment/ticket/4993/screenshot1595.png

Blue = CC avoidance, Red = ramps:

https://trac.wildfiregames.com/raw-attachment/ticket/4993/screenshot1590.jpg

https://trac.wildfiregames.com/raw-attachment/ticket/4993/bluff.jpg

https://trac.wildfiregames.com/raw-attachment/ticket/4993/screenshot1592.jpg https://trac.wildfiregames.com/raw-attachment/ticket/4993/screenshot1593.jpg

Dissatisfaction: https://trac.wildfiregames.com/raw-attachment/ticket/4993/screenshot1599.jpg

comment:3 by elexis, 5 years ago

Resolution: fixed
Status: newclosed

In 21300:

Ambush bluffs rework.
Remove ugly large circle patterns around the playerbase on Ambush, fixes #4993.
To ensure passability, create ramps from the playerbase to the bluffs.

Change the circular player avoidance to a ChainPlacer generating more heterogenous pattern.
Use vectors in rmgen2 bluffs creation and simplify equations, refs #4992.
Don't turn inaccessible bluffs to plateaus but don't place them until it is certain they are passable.

Increase minimum distance from the playerbase to the mapcenter by picking different distance values per playerbase pattern in g_PlayerbaseTypes.
Attempt to improve bluffs performance by avoiding bluffIgnore by 0 instead of bluff by 12, refs #5011.
Implement AdjacentToAreaConstraint and deleteTerrainEntity.
Delete createBoundingBox and use getBoundingBox, refs #4947, #4805.
Delete fadeToGround and nextToFeature and use conventional createArea calls with the SmoothingPainter of rP21175, refs #5027.
Paint bluff cliffs slightly more accurately using the SlopeConstraint from rP21085, refs #5004.

comment:4 by elexis, 5 years ago

In 21404:

New mappreview images for Ambush and Stronghold, since the ugly circle patterns were removed in rP21300, refs #4993.
Fix missing word in a map description, reported by Sundiata.

Note: See TracTickets for help on using tickets.