The previous asynchronous approach did not work particularly well,
leading to large janks when switching to custom maps or opening the
mission browser.
This commit introduces two key changes:
* Rule loading for WorldActorInfo and PlayerActorInfo is made
synchronous, in preparation for the next commit which will
significantly optimize this path.
* The full ruleset loading, which is required for map validation,
is moved to the server-side and managed by a new ServerMapStatusCache.
The previous syntax check is expanded to include the ability to run
lint tests.
As far as I could tell, this was the last place that still
used 'seconds' instead of ticks, apart from
some sound notification intervals (which are better
converted to real [milli]seconds).
Also renamed ScaredyCat.PanicLength to PanicDuration for
consistency and easier finding.
There were 2 issues at work here, both when progress
would overshoot Distance (which is the usual case,
rather than the exception):
- the overshot progress was passed on by MoveFirstHalf, however
OnComplete would make the next MovePart start ticking the
same tick on which the old MovePart reached Distance,
but move by carryoverProgress +(!!!) terrain speed instead of moving
by just the left-over carryoverProgress.
- MoveSecondHalf would not pass any overshot progress to the
next MoveFirstHalf queued by parent Move, leading to
the next MoveFirstHalf performing a full-speed move the same tick
MoveSecondHalf finished its last move.
InnerActivity and UpdateCenterLocation made this
overly complex and hard to read & debug.
This also fixes a bug that would make an outdated
facing being passed during OnComplete (because
InnerActivity was cached before UpdateCenterLocation
could set the correct final facing).
Both writing to perf.log frequently as well as GetTimestamp
aren't free and hurt performance particularly on slower systems
(which can have notably higher output to perf.log, further
amplifying the problem).
Therefore we make simulation perf logging opt-in.
Additionally, logging of the current tick and tick type
(local/net) is removed from debug.log, and some
remnant debug logging for kills and pips is removed
to keep performance-sensitive logging limited to
perf.log.
*Remove internal GameSpeed defaults
Enforce setting values explicitly all the time
Require definition of a DefaultSpeed
*Remove Global.Timestep default
*Remove the hacky Timestep/OrderLatency setting via LobbyInfo
*Fix shellmaps ignoring mod-defined gamespeeds
*Make DateTimeGlobal use the MapOptions gamespeed
A mere int comparison is obviously cheaper than
a comparison between two multiplications,
so pulling this above the checks of other damage states
allows us to bail early for undamaged actors.
Profiling has shown that filtering them out early is cheaper
than applying those percentage modifiers anyway.
Additionally, profiling shows foreach loops to be cheaper
than LINQ here as well.
* ResourceType trait has been removed.
* Simulation-related data is now defined on the
ResourceLayer (which mods can subclass/replace).
* Support non-money resources by moving the resource
values to the PlayerResources trait.
* Allow mods to disable the neighbour density override
and instead always use the map-defined densities.
* Allow mods to define their own resource placement
logic (e.g. allow resources on slopes) by subclassing
(Editor)ResourceLayer.
* Improve ability to subclass/override ResourceRenderer
by exposing more virtual methods.