Open Xon opened 6 years ago
Most of these should be straightforward once the relevant concepts are in the engine.
// indicates if the 1st parameter(a unit ID) is local to this computer #define UNIT_IS_ON_THIS_COMP 68
Do you know what determines whether a unit is local to a computer? This is not a well-defined concept in RWE as multiplayer will employ a lock-step model where all players simulate all units.
For each side, Total Annihilation tracks if it was either; local human, local AI, or a remote player.
This is because Total Annihilation 's multiplayer is only appropriately lock-step multiplayer, As each instance knows knows if authoritative for a side. If it is, it send out periodic unit re-sync packets, and if not accepts them for a side.
The local AI/local human is a fairly obvious reason, to know if a local side has an AI driving it or not.
Even with lock-step multiplayer, you are going to need to handle the affects of latency between players. latency masking means the engine would need some sort of resync behaviour of some sort to 'rubberband' things back to the correct spot.
Honestly lock-step multiplayer has some significant complexities due to NAT everywhere which makes p2p model painful and general flakiness of consumer networks.
After a bit of thinking, I think UNIT_IS_ON_THIS_COMP
is just a bad fit for anything but exactly Total Annihilation's multiplayer model. I'm not sure how heavily used it is however
Started work on this in 422afd0f696cf50714311219756a71218cde6150 on branch 'getters', not tested an awful lot yet. At the very least, RWE can load the commander from ESC now (after renaming all the "E" suffixed dirs back to normal).
FYI, CobExecutionContext::pop()
should return 0 (or do error reporting) if the stack is empty rather than unexpectedly explode/break. As TA has no bounds checking which allows a script to pop off the bottom of the stack and then allows modifying of the TA's in-memory unit scripting structure.
I don't think any 3rd party units really on this bug.
I spent some time playing with the Zarganeth (one of Zodius' units with a fancy ground-tracking walk script) and got things working to the point where this is useful enough to be on master, so I've merged the getters code in.
I'm going to leave this issue hanging around for now as some of the getters/setters are still TODO. Either I will implement them or create other issues to track them before closing.
I have opened #56 to track fixing pop().
Standard Total Annihilation Getter/setter values:
From my old TADR extension getter;