How to make it possible to recover from hung game

Talk about general things concerning Forged Alliance Forever.

Moderators: FtXCommando, Ze Dogfather

How to make it possible to recover from hung game

Postby nine2 » 13 Mar 2015, 03:07

At the moment when someone disconnects or hangs or crashes or lags - the game is ruined and is lost forever - right? Here's a theory of how to fix that.

1. When the game is hung we hit a magic button thats dumps out the entire sim state to disk. To log file if nothing more elegant can be done. Basically all of the unit positions would be included as well as reclaim/wrecks. Then close FA.

2. Run a magic tool that analyzes that data dump and, using HazardX's map code, create a copy of the map (statistically it was probably setons) calls Setons_34441234. This new map would have the normal layout of setons plus all of the units created assigned to the right armies and put in the right place.

3. A player (doesnt matter who) hosts a new game using the new map. All of the original players join. Some lobby code changes here to display who was in what spot, faction, color, etc.

4. Hit run and the game is recreated. I'm not sure if we can preserve the orders. Maybe we can't so it starts paused and everyone can get everything going again.

You can even recover from a hard crash by watching the replay of the game, pausing at the right place (10 seconds before crash) and then doing step 1.

In fact, there is another use for this besides crash recovery. You could be watching a replay and decide "I want to start playing this game at this point here". Think of the use in training where you could undo that critical mistake and continue the game. Or replay famous battles. Or practice to micro that fight better.

Or if some bug happens (acu transport explode) you can rehost it at a certain point.

Or if there is some stupid tml team kill you can just rehost - resurrecting the dead player - kick out the idiot - and find someone to take his slot.

I'm pretty sure I can do steps 1 and 2 ...
Last edited by nine2 on 13 Mar 2015, 03:30, edited 1 time in total.
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: How to make it possible to recover from hung game

Postby nine2 » 13 Mar 2015, 03:19

5. need some lobby changes to keep these 'relaunch' maps tucked away some how. Don't want them all junking up your maps folder.
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: How to make it possible to recover from hung game

Postby Turkey » 13 Mar 2015, 08:54

Might be easier to begin playing a replay from a certain point. The data is already there, don't need to dump the sim state.
Turkey
Crusader
 
Posts: 26
Joined: 08 Feb 2015, 01:01
Has liked: 2 times
Been liked: 2 times
FAF User Name: Turkey

Re: How to make it possible to recover from hung game

Postby nine2 » 13 Mar 2015, 10:05

no the repay just contains commands... not simstate. so, no benefit
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: How to make it possible to recover from hung game

Postby RoLa » 13 Mar 2015, 11:53

some thoughts:

- you need to save the exact state of the map with all wrecks and without all trees and wrecks that were reclmaimed or destroyed and with all craters ...
- all buildings / all units / all states / all orders / all projectiles must be dumped to be restored later. It would be really ugly if someone launched a nuke which is then lost.
- Units in transports must be preserved.
- Missiles / Anti missiles in launchers must be saved
- state of shields
- current factory production and orders
- mass/energy in storage must be saved

- upgrades ACU /SACU
- veterancy
Last edited by RoLa on 13 Mar 2015, 13:02, edited 2 times in total.
User avatar
RoLa
Contributor
 
Posts: 313
Joined: 23 Apr 2013, 22:14
Has liked: 5 times
Been liked: 19 times
FAF User Name: RoLa

Re: How to make it possible to recover from hung game

Postby nine2 » 13 Mar 2015, 12:16

Those are not MUST haves. I think its enough to do as I said (units, buildings, wrecks) and then we can incrementally add things over time. Some things may not be possible.

Another one would be acu upgrades and veterency.
Partially build experimentals.
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: How to make it possible to recover from hung game

Postby Sheeo » 13 Mar 2015, 12:32

While I apreciate the sentiment and wanting to do all of this, I disagree with the premise. Games do sometimes recover gracefully from crashes and drops, so I would prefer it if we fix the issues rather than bolting an elaborate scheme on top.

Making moho load a savegame and launching a multiplayer session with it is still an unsolved problem, as well -- from my understanding.
Support FAF on patreon: https://www.patreon.com/faf?ty=h

Peek at our continued development on github: https://github.com/FAForever
Sheeo
Councillor - Administrative
 
Posts: 1038
Joined: 17 Dec 2013, 18:57
Has liked: 109 times
Been liked: 233 times
FAF User Name: Sheeo

Re: How to make it possible to recover from hung game

Postby nine2 » 13 Mar 2015, 12:53

Well yes of course better to fix the actual problems but I don't think you will ever get rid of 100% of crashes and desyncs and internet connection dropping and someone just having to go to work etc.

How many games were unfinished over the last 8 years? Jillions. It's worth some effort.

Any detail on the moho problems? Campaign does it. GW did it a tiny bit. I'm not proposing to 'load a save game'. I'm proposing to write my own map. Maybe save game is smarter I don't know.
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: How to make it possible to recover from hung game

Postby Col_Walter_Kurtz » 13 Mar 2015, 13:00

Sheeo wrote:Games do sometimes recover gracefully from crashes


What do you mean exactly? The game can't be relaunched and connect so crash is the end, right?
Col_Walter_Kurtz
Priest
 
Posts: 497
Joined: 28 Jul 2014, 10:42
Has liked: 42 times
Been liked: 45 times
FAF User Name: Apocalypse_Now

Re: How to make it possible to recover from hung game

Postby RoLa » 13 Mar 2015, 13:01

Sheeo wrote:Games do sometimes recover gracefully from crashes and drops, so I would prefer it if we fix the issues rather than bolting an elaborate scheme on top.
I agree with you, but some days ago i played with a friend aoe2 conqueres with user patch, after 2 hours the game just hung. We saved it, loaded it and continued to play, that was such a relief.

So it's would be a nice thing to have. You can continue games on huge maps which lasted hours. That would be so awesome. And as a scenario builder it would be so cool.

partytime wrote:Those are not MUST haves. I think its enough to do as I said (units, buildings, wrecks) and then we can incrementally add things over time. Some things may not be possible.

Another one would be acu upgrades and veterency.
Partially build experimentals.

You right that "we can incrementally add things over time." A complete todo list of things to dump is the starting point. So i add those things to my list.
User avatar
RoLa
Contributor
 
Posts: 313
Joined: 23 Apr 2013, 22:14
Has liked: 5 times
Been liked: 19 times
FAF User Name: RoLa

Next

Return to General Discussions

Who is online

Users browsing this forum: No registered users and 1 guest