gameboy Posted November 16, 2017 Report Share Posted November 16, 2017 @elexis Today, I sent replay a strange bug:, when I started a new single game, the game for more than a minute, I built the house in the game, and then I saved the game, quit the game. More than an hour later, I reloaded the game and continued the game until the end of the game, playing a total of 30 minutes and 59 seconds. When I replayed the game, and when I chose to replay the 30:59 replay file, I found that the house had not been built before, and the workers went directly to build other buildings. Why? Quote Link to comment Share on other sites More sharing options...
elexis Posted November 16, 2017 Report Share Posted November 16, 2017 Replays can only be loaded for games that start at minute 0. Quote Link to comment Share on other sites More sharing options...
gameboy Posted November 16, 2017 Author Report Share Posted November 16, 2017 @elexis I upload them, so please look at them. Can you make some changes, and can you connect with the last time? 0.0.23.zip Quote Link to comment Share on other sites More sharing options...
elexis Posted November 16, 2017 Report Share Posted November 16, 2017 Ah, that was the reason why we should serialize the turnnumber in savegames as well. Yes, one can concatenate these two replays, but not before computing every turn number. Can implement that eventually depending on how old I get. 1 1 Quote Link to comment Share on other sites More sharing options...
gameboy Posted November 16, 2017 Author Report Share Posted November 16, 2017 @elexis I have no way to connect them together, and whether the serialization has been implemented, do you have any other options? My friend, can you help me? Quote Link to comment Share on other sites More sharing options...
elexis Posted November 17, 2017 Report Share Posted November 17, 2017 You see those two commands.txt files right? The first one ends at turn 312, the second one should start at turn 312 where it now says turn 0. One could write a script to add 312 to every turn number in the second file. Then one can copy&paste the files together. Hm. Actually I have an old patch somewhere that plays replays from a savepoint. Digging. Found. Alpha 21. You are lucky, the patch still applies. You have to compile the game with the patch, unzip the savegame, then start pyrogenesis with -replay-visual="/path/to/second_replay/commands.txt" -load="/path/to/simulation.dat" and it should work in theory. I guess we could commit this part as a debugging feature if we don't priortize implementing it for the average user. Index: source/ps/Game.cpp =================================================================== --- source/ps/Game.cpp (revision 18875) +++ source/ps/Game.cpp (working copy) @@ -37,10 +37,11 @@ #include "ps/LoaderThunks.h" #include "ps/Profile.h" #include "ps/Replay.h" #include "ps/Shapes.h" #include "ps/World.h" +#include "ps/GameSetup/CmdLineArgs.h" #include "ps/GameSetup/GameSetup.h" #include "renderer/Renderer.h" #include "renderer/TimeManager.h" #include "renderer/WaterManager.h" #include "scriptinterface/ScriptInterface.h" @@ -52,10 +53,12 @@ #include "tools/atlas/GameInterface/GameLoop.h" extern bool g_GameRestarted; extern GameLoopState* g_AtlasGameLoop; +extern CmdLineArgs g_args; + /** * Globally accessible pointer to the CGame object. **/ CGame *g_Game=NULL; @@ -189,11 +192,21 @@ bool CGame::StartVisualReplay(const std: JSContext* cx = scriptInterface.GetContext(); JSAutoRequest rq(cx); JS::RootedValue attribs(cx); scriptInterface.ParseJSON(line, &attribs); - StartGame(&attribs, ""); + + CStr savegame = ""; + if (g_args.Has("load")) + { + std::ifstream file (g_args.Get("load").c_str(), std::ifstream::in); + std::stringstream buffer; + buffer << file.rdbuf(); + savegame = buffer.str(); + } + + StartGame(&attribs, savegame); return true; } /** 1 Quote Link to comment Share on other sites More sharing options...
gameboy Posted November 17, 2017 Author Report Share Posted November 17, 2017 @elexis I can solve this problem with this patch, good, my friend, can you upload a patch file directly? Oh, about you mentioned the command format I really not use it, if you can give me a test patch directly to solve this problem, I will help you to test it, thank you, my old friend. Quote Link to comment Share on other sites More sharing options...
elexis Posted November 17, 2017 Report Share Posted November 17, 2017 I didn't actually test the patch since a year ago, so I don't knowif it will be successful, but it should work because the relevant code didn't change. Apply the patch and compile the game. Rename your savegame to something.zip and you can use any zip program to unzip it. The zip folder contains a simulation.dat file. The replay contains a commands.txt file. You need both. If you are on Windows, you need to execute the following command: pyrogenesis.exe -load="C:\folder\simulation.dat" -visual-replay="C:\folder\commands.txt" load_simstate+visual_replay.diff 1 Quote Link to comment Share on other sites More sharing options...
gameboy Posted November 18, 2017 Author Report Share Posted November 18, 2017 (edited) @elexis If I only use the patches you give, instead of using commands: can pyrogenesis.exe -load=, "C:\\folder\\simulation.dat", "-visual-replay=", "C:\\folder\\commands.txt" connect two replays together? To achieve the same effect as using commands? Ah, A bad news : I tested this patch, and two replay files were not connected. The first replay was 2 minutes, and the second one had six minutes. When I loaded second repeats, the first replay of the house wasn't built. Edited November 18, 2017 by gameboy Quote Link to comment Share on other sites More sharing options...
elexis Posted November 18, 2017 Report Share Posted November 18, 2017 Use the original commands.txt with the savegame where it started. No modification of the file needed. The replay you uploaded is 30minutes long. Are you sure you have compiled the game with the patch? Quote Link to comment Share on other sites More sharing options...
gameboy Posted November 18, 2017 Author Report Share Posted November 18, 2017 (edited) @elexisYes, I'm sure I used your patch, I tested it, I did the same test, but the two replay files didn't connect. D:\trunk\binaries\system>pyrogenesis.exe -load=C:\Users\lg2015\Documents\My Games\0ad\replays\0.0.23\2017-11-16_0003\metadata.json -visual-replay=C:\Users\lg2015\Documents\My Games\0ad\replays\0.0.23\2017-11-16_0003\commands.txt Edited November 18, 2017 by gameboy Quote Link to comment Share on other sites More sharing options...
elexis Posted November 18, 2017 Report Share Posted November 18, 2017 They are not supposed to connect. The replay should start from the savegame point. So the house should have been built already when the replay starts and the remaining 30 min should be replayable. I can test the patch later again to see if it works for me. Quote Link to comment Share on other sites More sharing options...
gameboy Posted November 18, 2017 Author Report Share Posted November 18, 2017 @elexis This is a 30 minute replay file, but it can't be connected to the previous 1 minutes replay file. I built the house in the last 1 minutes replay, but in the subsequent 30 minutes replay, we didn't see the completed housing. Quote Link to comment Share on other sites More sharing options...
elexis Posted November 18, 2017 Report Share Posted November 18, 2017 Which means that the simulation.dat wasn't loaded Quote Link to comment Share on other sites More sharing options...
gameboy Posted November 18, 2017 Author Report Share Posted November 18, 2017 But the replay should start from the savegame point. Unfortunately, it didn't work. The house should not have been built already when the replay starts and the remaining 30 min should be replayable. Quote Link to comment Share on other sites More sharing options...
elexis Posted November 18, 2017 Report Share Posted November 18, 2017 -load=C:\Users\lg2015\Documents\My Games\0ad\replays\0.0.23\2017-11-16_0003\metadata.json NOT metadata.json but simulation.dat! The simulation.dat is inside the savegame of that replay. The savegame has the fileending .0adsave, must be renamed to .zip and unzipped as I mentioned above. Quote Link to comment Share on other sites More sharing options...
gameboy Posted November 18, 2017 Author Report Share Posted November 18, 2017 (edited) I didn't find the file simulation.dat. I don't know where it is There's no file here: C:\Users\lg2015\Documents\My Games\0ad\replays\0.0.23 Please tell me. thank you my friend. Do I use the win10 64bit operating system to prevent the generation of this file: simulation.dat???? Edited November 18, 2017 by gameboy Quote Link to comment Share on other sites More sharing options...
gameboy Posted November 18, 2017 Author Report Share Posted November 18, 2017 (edited) I only found them: metadata.json commands.txt. Why didn't i have that simulation.dat, did win10 block the production of this file, what should I do? Please help me, my old friend. I can't finish the test now. Edited November 18, 2017 by gameboy Quote Link to comment Share on other sites More sharing options...
elexis Posted November 18, 2017 Report Share Posted November 18, 2017 The second replay was started from a savegame, right? Then find the savegame file http://trac.wildfiregames.com/wiki/GameDataPaths Then rename savegame.0addata to savegame.zip Then unzip 1 Quote Link to comment Share on other sites More sharing options...
gameboy Posted November 18, 2017 Author Report Share Posted November 18, 2017 (edited) @elexis yes. Why would you do that? Then rename savegame.0addata to savegame.zip Then unzip For example: 1. Oadsave renamed to 1.0adsave. Zip? Edited November 18, 2017 by gameboy Quote Link to comment Share on other sites More sharing options...
elexis Posted November 18, 2017 Report Share Posted November 18, 2017 Just add a .zip so you can unzip the file, yes 1 Quote Link to comment Share on other sites More sharing options...
gameboy Posted November 18, 2017 Author Report Share Posted November 18, 2017 @elexis Why I not have the simulation. dat file, my friend, the operating system you used was win10? BTW: why did you ask me to do this? Quote Link to comment Share on other sites More sharing options...
elexis Posted November 18, 2017 Report Share Posted November 18, 2017 It doesn't matter which OS. Can you upload the savegame? It is needed because it contains that house you built before loading the savegame, and all the rest. 1 Quote Link to comment Share on other sites More sharing options...
gameboy Posted November 18, 2017 Author Report Share Posted November 18, 2017 @elexis I'll upload the game archive later, but I'm wondering why I don't have this file, simulation.dat, and I didn't find it in the replay folder. Quote Link to comment Share on other sites More sharing options...
elexis Posted November 18, 2017 Report Share Posted November 18, 2017 The replay folder contains replays, the savegame folder contains the savegames. simulation.dat is one of the two files in the savegame. Indeed it would be reasonable to put them in the same folder sometime or at least use matching directory names. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.