The Ur-Quan Masters Discussion Forum

The Ur-Quan Masters Re-Release => General UQM Discussion => Topic started by: countchocula86 on February 08, 2007, 09:28:22 pm



Title: 'Spectator' Melee
Post by: countchocula86 on February 08, 2007, 09:28:22 pm
I think an interesting addition to the online melee feature of UQM would be a spectator mode; so when 2 people are squaring off, a few others could connect to whoever the host is and watch the battle.


Title: Re: 'Spectator' Melee
Post by: AngusThermopyle on February 09, 2007, 03:50:17 pm
I like this idea; though having little-to-no coding skills myself, I'm not sure how difficult this would be to implement.

I also wonder what effect (if any) this would have on latency?


Title: Re: 'Spectator' Melee
Post by: Novus on February 09, 2007, 07:05:41 pm
I like this idea; though have little-to-no coding skills myself, I'm not sure how difficult this would be to implement.
From the spectator's point of view, this is like having both players remote. From a player's point of view, it's just another socket to transmit the same information to. The connection setup and user interface part is probably going to be the most work, and that's reasonably straightforward.

I suspect this functionality will appear together with or shortly after some sort of "lobby" is implemented.

Quote
I also wonder what effect (if any) this would have on latency?
Latency is less a problem here as the spectators don't need to react to the game and the bandwidth use of a few spectators is negligible (if you want to support more than a dozen spectators or so, some sort of peer chaining solution could be a good idea instead of connecting directly to the players). The important part is to make sure that failure to transmit game state to a spectator never blocks the game (transmitting from a separate thread or with non-blocking I/O should do the trick).

As a bonus, if you have spectator mode, making a replay function is easy (save/load the data to/from a file instead of a network socket) and vice versa. However, adding rewind to the replay might be a bit tricky.