Page 1 of 3

Posted: Wed Jun 09, 2010 3:52 pm
by spxza
Hi All,

After a bit of absense from the game (and not much experience then), I've decided to attempt an introduction of a replay & recording system. I am a code monkey by day, so it's time I give away some of my talents for free. Please excuse any ignorance.

There are all sorts of reasons for or against the introduction of this kind of a system. I don't really care for those, cause I'm doing it in any case.

I'll be working with FAZR5. I forget what revision i checked out of the repo (not at my dev machine now), but it is whatever was available earlier today.

As far as I have thought it through, I'm setting the following milestones that need to be completed:

Record the incoming messages somewhere.
Messages are received from the client and acted upon by the server - and also generated by the server. There is oppurtunity in many places to dump this to a file locally. Initially, this dumping will probably be verbose and non-optimum (neither compressed nor optimized for quick I/O). Eventually, I'd hope to write this data in binary format and taking as few resources away from the game threads.
Set up a modified server for community testing.
I'll need the help of some of the community to play a number of different types of games on the server. I have a few places to host, but only in South Africa. Latency may be an issue. I'm not sure. Otherwise. I'd appreciate someone hosting my modified server for a few hours or days. I doubt anyone will see much data that comes out of this.
Analyze the records, deciding what is necessary and what is not
This is going to be a bit of a biggie, and somewhat related to #1. I have no idea how many messages will be logged. One would want the minimum that is required to account for every action a player may take in-game. Clearly, players who spend most of their time dogfighting will produce a signficant amount of data. Repeat 1-3 a few times, till I'm sure I know what I want. This completes the recording side of things.
Introduce an observer system (does this exist?)
There may be some opposition to this, but it is completely necessary to view a replay. IMHO, the commander view will be the best to watch a replay. Most other functionality will be disabled, and the commander view will be the only view that is accessible. The observer will be able to see the entire map or just what has been discovered by all the teams.
Enhance the observer system to replay games.
This will be launched seperately from the initial interface. The user will be taken directly to the commander view (well, observer view) and they can then sit back and watch the game. This may a
Add a options to the server/game settings, so the server admin/game creator can activate or deactivate recording and observing.
Publish (semi-) automagically the records somewhere publically accessible.
Extract parts of a replay to show an especially exciting dogfight, or close call.
Fast-forward/pause/etc buttons in the replay view.
Track a player as they fly around.

One could argue that the observer view could make games susceptible to cheating, but if it can be deactivated, then does this matter?

I'd appreciate comments and criticism, especially from some of alleg's main devs. I'll start posting some code or patches soonish.

All in all, if I get it right, I feel this can be a very valuable addition to Alleg, that many would appreciate from cadets to squad leaders. The recordings and replays could be used for other things, such as data mining, discovering RoC violators, squad hiring, squad firing (yeh, the stupid things you do constantly will be seen), training (a cadet can't be promoted if they haven't been seen to nan properly), improved tactics (does a commander always do the same thing in a specific map? Are you a commander and do you? This'll stop you), improved dogfighting, etc.

P.S. To whom it concerns: AFAIK, SC has always had replays.

Posted: Wed Jun 09, 2010 4:59 pm
by Clay_Pigeon
This is a really neat project. There was an independent outfit that did something similar to Allegiance as a proof-of-concept for their business, but they went MIA. Still, I'm thinking it might be better to plug into some of our existing projects.

Posted: Wed Jun 09, 2010 6:06 pm
by spxza
Clay_Pigeon wrote:QUOTE (Clay_Pigeon @ Jun 9 2010, 08:59 AM) Still, I'm thinking it might be better to plug into some of our existing projects.
Sometimes it is better to plug in, sometimes it is better to get inspiration from and sometimes it is better to start from scratch. The decision which way to go is dependant on many factors.

I'll browse through the repos and forums for guidance. Any existing projects you'd suggest that I'd look into?

Posted: Wed Jun 09, 2010 7:03 pm
by lexaal
spxza wrote:QUOTE (spxza @ Jun 9 2010, 08:06 PM) Sometimes it is better to plug in, sometimes it is better to get inspiration from and sometimes it is better to start from scratch. The decision which way to go is dependant on many factors.

I'll browse through the repos and forums for guidance. Any existing projects you'd suggest that I'd look into?
It would be a good start to implement a web interface where we could look at (screenshots of) the last game settings+results screen. (e.g the last 10 games, the last 10 big games, search option)? There exist xml files who have game data. If you want i can send you one (or just save it after a game.)

Those webinterface will be the starting point for the real replay server.

i suck at coding so i can't help, but i can betatest good.

Posted: Wed Jun 09, 2010 8:13 pm
by fuzzylunkin1
Good luck.

Posted: Fri Jun 11, 2010 12:57 am
by finnbryant
this will help the esport aspect of alleg no end. looks at SC2 replays for inspiration if you havent already.

for spectator mode: lots complained at previous attempts to bring this in, mostly claiming cheating would be an issue, probably best to just ignore them, starcraft was hardly destroyed by the feature and certainly gained some fame from it.

oh, and
fuzzylunkin1 wrote:QUOTE (fuzzylunkin1 @ Jun 9 2010, 09:13 PM) Good luck.

Posted: Fri Jun 11, 2010 5:43 am
by Clay_Pigeon
I have a hard time remembering how the previous attempt was made. A game metrics startup did it as a proof of concept (because the game was active and the code was free). I believe they did it by modifying the server to record specific game events. The events were then dumped into a browseable webpage, ordered by time. Our project contact told us that he'd have something "really cool" for us soon, and I can only assume that it was some kind of a playback feature. He eventually disappeared and when we got into contact with the business, they said that he was "no longer with us".

If you look at it from the point of view of the server dumping events, generating a "recording" of a game should be too herculean of a task. Compromises would have to be made to manage the size of such a recording, but getting the recording itself would be a matter of piggybacking of what the server is already doing.

"Playback" would be another matter entirely, though. While the code exists for the client to "hypothetically" interpret such a recording, I doubt that the client was designed for a recorded playback from a "god perspective" in mind. It would almost be easier to rework the client code into a separate playback app, than to attempt to integrate it with the client.

Posted: Tue Jun 15, 2010 8:44 am
by spxza
Before I start coding I'll be doing a full design spec and publishing it somewhere so that someone can continue from where I left off if i get hit by a bus.
Clay_Pigeon wrote:QUOTE (Clay_Pigeon @ Jun 10 2010, 09:43 PM) If you look at it from the point of view of the server dumping events, generating a "recording" of a game should be too herculean of a task. Compromises would have to be made to manage the size of such a recording, but getting the recording itself would be a matter of piggybacking of what the server is already doing.
Yes, this'll be the easiest part, in that it is tying into the server at a few points, and adding a whole lot of new code (And bugs!). The challenge will be to get it into a nice machine-readable, compressed format, but even then there are some great tools and libs that one can use.
Clay_Pigeon wrote:QUOTE (Clay_Pigeon @ Jun 10 2010, 09:43 PM) "Playback" would be another matter entirely, though. While the code exists for the client to "hypothetically" interpret such a recording, I doubt that the client was designed for a recorded playback from a "god perspective" in mind. It would almost be easier to rework the client code into a separate playback app, than to attempt to integrate it with the client.
I've been thinking about this aspect. It's been a bit difficult due to all the soccer (was at the stadium watching the Netherlands thump Denmark yesterday) and alcohol associated with this.
The client does not have the server code necessary to perform playback by itself. There are two options: Code this in to the client, but we're duplicating code; or fork off the server and make a playback server. I'll be going with the latter. The server may be run locally or remotely or both.
I could be completely wrong here, I dunno. Call this part "to be worked upon".
scratchee wrote:QUOTE (scratchee @ Jun 10 2010, 04:57 PM)for spectator mode: lots complained at previous attempts to bring this in, mostly claiming cheating would be an issue, probably best to just ignore them, starcraft was hardly destroyed by the feature and certainly gained some fame from it.
This is the internets, people complain about everything. Move a button 2 pixels to the left, and people will complain.
Cheating in that way is almost impossible to catch. What is there to stop a spy from joining the enemy team?

Posted: Tue Jun 15, 2010 8:55 am
by Bard
What an excellent, excellent idea.

The server currently outputs ALL events (including ship positioning and what-have-you) as plain text. You'll be able to see what this looks like as soon as you set up a server.
spxza wrote:QUOTE (spxza @ Jun 15 2010, 03:44 AM) Before I start coding I'll be doing a full design spec and publishing it somewhere so that someone can continue from where I left off if i get hit by a bus.
\o/

(but please don't get hit by a bus)
spxza wrote:QUOTE (spxza @ Jun 15 2010, 03:44 AM) Cheating in that way is almost impossible to catch. What is there to stop a spy from joining the enemy team?
Actually the server logs can catch that to some degree because generally the people who do it use the game client to relay messages to each other.
In theory, they could use ventrilo or IM or what-have-you and it'd be much harder to catch but in general people don't bother because unless the whole team is in on it, someone's going to start questioning where one pilot keeps getting 100% accurate information/consistently eyes every con/miner/bombtrain.

Posted: Tue Jun 15, 2010 11:27 am
by Gandalf2
At least for squad games, I don't think you should be letting people watch it live, due to the intel it gives the other team. Perhaps with a 20 or 30 minute delay?

The rest of your stuff sounds great, though :)