beyond-all-reason / beyond-all-reason/RecoilEngine
Name Conflicts in Multiplayer Replays
- Dominant language
- C++
- Stars
- 679
- Forks
- 290
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 40
Description
Name conflicts seem to be the single major blockage to multiplayer replays - i.e. if someone watches their own replay.
I've tried providing a custom username (e.g. `Username (demo)` in the start script for players from the demo, and the engine appears to accept this, and the demo loads. HOWEVER: units do not receive orders - though map drawing (via `drawinmap`) appears to work. I can't remember if chat/labels work.
This might be an ideal solution - if I can work out what's failing and fix it, but I haven't been able to. Does anyone know the relevant systems well enough to help me out?
For singleplayer, [the engine automatically adds " (spec)" to the player's username](https://github.com/beyond-all-reason/spring/blob/BAR105/rts/System/SpringApp.cpp#L570), thus avoiding conflicts. This system runs into issues in the case of 3 copies of a player in a demo. (I don't expect this to be a huge issue, but I also don't want to disable recording demos from demos - they may have some use.)
Something similar could be implemented for multiplayer. Generation of this modified username could happen either lobbyside, or in-engine. Do note - for some purposes (e.g. coaching) I'd have great desire to be able to play *and* watch the demo from the same room, so the current "isdemo" flag in the server protocol is a less-than-adequate solution.
Contributor guide
Research direction
Start with the username handling in rts/System/SpringApp.cpp around line 570, then trace the multiplayer demo path and the server protocol's isdemo flag. Reproduce a demo recorded from a demo with duplicate players and compare username handling with unit orders and map drawing. Done means multiplayer replays can be recorded and watched by the same player without name conflicts or lost orders.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev, networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100