Opened 2 years ago

Closed 2 years ago

#6417 closed defect (fixed)

Errors generating map

Reported by: Langbart Owned by:
Priority: If Time Permits Milestone: Alpha 26
Component: Atlas editor Keywords:
Cc: Patch:

Description

to reproduce

  • Open scenarios/unit_pushing_test.xml in Atlas.
  • Press Generate map
  • Errors and warnings appear
0 A.D. (0.0.26) Main log (warnings and errors only)
ERROR: JavaScript error: maps/random/rmgen-common/player.js line 66 g_CivData[getCivCode(...)] is undefined getStartingEntities@maps/random/rmgen-common/player.js:66:19 placeCivDefaultStartingEntities@maps/random/rmgen-common/player.js:111:44 placePlayerBase@maps/random/rmgen-common/player.js:159:33 placePlayerBases@maps/random/rmgen-common/player.js:147:18 @maps/random/aegean_sea.js:76:17

ERROR: CMapGeneratorWorker::Run: Failed to load RMS 'maps/random/aegean_sea.js'

WARNING: CSimulation2Impl::InitRNGSeedSimulation: No seed value specified - using 0

WARNING: CSimulation2Impl::InitRNGSeedAI: No seed value specified - using 0

ERROR: JavaScript error: simulation/helpers/Setup.js line 51 deepcopy requires one argument. LoadMapSettings@simulation/helpers/Setup.js:51:46

The problem can be reproduced for A25b [25860] but not for A24b [24937] because the scenario map unit_pushing_test was added with [25182].

Attachments (1)

generate_unit_pushing_test.jpg (497.2 KB ) - added by Langbart 2 years ago.

Download all attachments as: .zip

Change History (2)

by Langbart, 2 years ago

comment:1 by Stan, 2 years ago

Resolution: fixed
Status: newclosed

Don't have any errors anymore, probably fixed by:

In r26245:

UnitMotion pushing improvements

The main change is the introduction of a 'pushing pressure' counter on units. This counter increases when units get pushed around, and decreases over time. In essence, units under high pressure move slower & are harder to push around.

The major effect is that units can now get bogged down when very dense groups start colliding. This makes movement more realistic, makes unit movement more 'chokepointy', and generally improves the mathematical soundness of the system (lower values are easier to handle for our 200ms turns).

Other changes:

  • The logic to detect units crossing each other's path has been reworked. Units that run towards each other should not more obviously avoid each other.
  • New parameters: 'Spread' is a measure of how strong the pushing effect is based on distance. With the current settings, static-pushing is rather 'on/off', whereas moving-pushing is more gradual (and thus the max influence distance was increased when moving).
  • Default values have been tweaked for lower overlap.
  • Units only looked at other units within their grid region. This led to overlap near grid-borders. Units now look at neighboring grid elements, which largely removes this issue. While this may be slower, the performance of pushing was largely negligible before, so it is unlikely to become a main cause of lag (and overlap was generally disliked by players).
  • Units no longer orient in the direction of pushing, but instead keep facing their target. This can look slightly odd under very heavy pushing forces, but vastly improves behaviour of very slow units such as rams (since they spend much less time turning around). As a side-effect, clean up angle code following rP25953 .

Engine changes:

  • Add a debug rendering mode at compile-time to help understand what is happening.
  • Make it possible to constexpr initialise fractional fixed numbers by using FromFraction

The 'pressure' change was inspired by alre's suggestion at https://wildfiregames.com/forum/topic/56436-for-a-better-unit-movement/#comment-461987

Refs #6127

Differential Revision: https://code.wildfiregames.com/D4439

In r26275

Allow giving different weights to different templates when pushing.

This makes it possible to make units heavier, which both push more & get pushed less by other units. In particular, the diff does it for siege units & elephants.

This improves movement for these units in crowd situation, since they will now basically not move when other regular units push into them.

Supported By: asterix, marder

Refs #6127

Differential Revision: https://code.wildfiregames.com/D4452

Note: See TracTickets for help on using tickets.