14 Commits

Author SHA1 Message Date
Dan Albert
ba10298dbc Allow adjusting TOTs after sim start.
This makes the start time in WaitingForStart dynamic, which is more
expensive but probably still cheap enough.

It also checks that the new TOT will not result in a start time in the
past when the player changes the TOT.

https://github.com/dcs-liberation/dcs_liberation/issues/1680
2023-02-06 00:33:08 -08:00
Dan Albert
9cb641bddf Allow flights to self-initialize.
This makes it possible to add new packages to a running sim.

https://github.com/dcs-liberation/dcs_liberation/issues/1680
2023-01-04 12:58:36 -08:00
Dan Albert
4993353184 RTB canceled in-progress flights.
The UI won't stop you from aborting a flight that is already home, but
that should also result in it re-completing again on the next tick.

https://github.com/dcs-liberation/dcs_liberation/issues/1680
2022-03-08 01:04:19 -08:00
Dan Albert
f63a107c11 Account for time elapsed when leaving combat. 2022-03-07 23:23:52 -08:00
Dan Albert
005090fbcd Support display of dead flights. 2022-03-07 19:34:51 -08:00
Dan Albert
2585dcc130 Add (very!) rough simulation of frozen combat.
There are some TODOs here but th behavior is flagged off by default. The
biggest TODO here is that the time spent frozen is not simulated, so
flights that are engaged by SAMs will unfreeze, move slightly, then re-
freeze.

https://github.com/dcs-liberation/dcs_liberation/issues/1680
2022-02-26 13:01:46 -08:00
Dan Albert
09457d8aab Move frozen combat handling out of MapModel. 2022-02-19 13:51:18 -08:00
Dan Albert
656a98675e Rework sim status update to not need a thread.
Rather than polling at 60Hz (which may be faster than the tick rate,
wasting cycles; and also makes synchronization annoying), collect events
during the tick and emit them after (rate limited, pooling events until
it is time for another event to send).

This can be improved by paying attention to the aircraft update list,
which would allow us to avoid updating aircraft that don't have a status
change. To do that we need to be able to quickly lookup a FlightJs
matching a Flight through, and Flight isn't hashable.

We should also be removing dead events and de-duplicating. Currently
each flight has an update for every tick, but only the latest one
matters. Combat update events also don't matter if the same combat is
new in the update.

https://github.com/dcs-liberation/dcs_liberation/issues/1680
2021-12-23 17:46:24 -08:00
Dan Albert
fb10a8d28e Add frozen combat modelling.
This doesn't do anything yet, but sets up the data model handling for
frozen combat. The next step is to show combat in the map view, since
that will be helpful when debugging the step after that one: resolving
frozen combat.

This would benefit from caching the Shapely data for SAM threat zones.
Right now it's generating them once per tick and the stuttering is
visible at max speed.

https://github.com/dcs-liberation/dcs_liberation/issues/1680
2021-12-21 14:52:28 -08:00
Dan Albert
ce4628b64f Separate combat as a distinct flight state.
Will be used later to simulate combat.

https://github.com/dcs-liberation/dcs_liberation/issues/1680
2021-12-21 14:52:27 -08:00
Dan Albert
d31f0e22e3 Show the status of each flight in the UI.
https://github.com/dcs-liberation/dcs_liberation/issues/1704
2021-11-07 11:27:50 -08:00
Dan Albert
1a3b8d1dd6 Reduce fuel for fast-forwarded player flights.
This only has an effect for aircraft for which we have fuel consumption
data, but that's fine.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1681
2021-10-30 11:37:06 -07:00
Dan Albert
b2cbf4b6f4 Halt sim on A2A contact.
https://github.com/dcs-liberation/dcs_liberation/issues/1681
2021-10-30 10:18:49 -07:00
Dan Albert
5db1b94ac4 Add option to fast forward to first contact.
This is the first step in a larger project to add play/pause buttons to
the Liberation UI so the mission can be generated at any point.
docs/design/turnless.md describes the plan.

This adds an option to fast forward the turn to first contact before
generating the mission. None of that is reflected in the UI (for now),
but the miz will be generated with many flights in the air.

For now "first contact" means as soon as any flight reaches its IP. I'll
follow up to add threat checking so that air-to-air combat also triggers
this, as will entering a SAM's threat zone.

This also includes an option to halt fast-forward whenever a player
flight reaches a certain mission-prep phase. This can be used to avoid
fast forwarding past the player's startup time, taxi time, or takeoff
time. By default this option is disabled so player aircraft may start in
the air (possibly even at their IP if they're the first mission to reach
IP).

Fuel states do not currently account for distance traveled during fast
forward. That will come later.

https://github.com/dcs-liberation/dcs_liberation/issues/1681
2021-10-24 17:40:45 -07:00