Frederick_1 Posted July 23, 2022 Report Share Posted July 23, 2022 Hallo, usually when I load a replay one of my games in Singleplayer against A.I.-Bot my entities does not move in the Replay, while Bot Entities do work. Only when the game is really fresh, when it was not saved and not interrupted from the begining the Replay does work. I can not see any influence of the Regenerate Cache button. Game versionis 0.25, but it was the same in 0.25. My system ist ubuntu 20. Is this normal behavoiur? Or is there something wrong with my installation? F. PS: Interestingly it seem in multiplayer mode it seems human players Entities do work, while A.I-Bot entities are freezed. Quote Link to comment Share on other sites More sharing options...
Stan` Posted July 23, 2022 Report Share Posted July 23, 2022 38 minutes ago, Frederick_1 said: Is this normal behavoiur? Or is there something wrong with my installation? Saves break replays Quote Link to comment Share on other sites More sharing options...
Frederick_1 Posted July 24, 2022 Author Report Share Posted July 24, 2022 This explains what I experience. So do people not save their games, when they present an replay here? I often split a game in lot of small sections just using 0AD als stopgap. Quote Link to comment Share on other sites More sharing options...
Stan` Posted July 24, 2022 Report Share Posted July 24, 2022 4 minutes ago, Frederick_1 said: This explains what I experience. So do people not save their games, when they present an replay here? I often split a game in lot of small sections just using 0AD als stopgap. Indeed they do not split their replays. Quote Link to comment Share on other sites More sharing options...
Freagarach Posted July 27, 2022 Report Share Posted July 27, 2022 With some manual work one can combine the replays of different sections into one functioning replay. Each section has its own replay file (https://trac.wildfiregames.com/wiki/GameDataPaths). Maybe there already is some script to combine replays, else I can write one. Quote Link to comment Share on other sites More sharing options...
Frederick_1 Posted July 30, 2022 Author Report Share Posted July 30, 2022 For trying out I made a small match with only one save in the middle. It is true, the replay of the first section works on its own, but not the whole game. so I tried: f@Nanox:~/.local/share/0ad/replays/0.0.25/2022-merge$ cat ../2022-07-30_0015/metadata.json ../2022-07-30_0017/metadata.json > metadata.json f@Nanox:~/.local/share/0ad/replays/0.0.25/2022-merge$ cat ../2022-07-30_0015/commands.txt ../2022-07-30_0017/commands.txt > commands.txt When I try to start the replay 0AD crashes. Seems the merge of metadata.json does not work correcty. See error output. Quote Link to comment Share on other sites More sharing options...
Stan` Posted July 30, 2022 Report Share Posted July 30, 2022 You cannot merge json using cat. It's not a plain text file. Quote Link to comment Share on other sites More sharing options...
Gurken Khan Posted July 30, 2022 Report Share Posted July 30, 2022 On 27/07/2022 at 7:21 AM, Freagarach said: Maybe there already is some script to combine replays, else I can write one. I've been told it's possible to merge them manually ("hm hm lines..."), but no one was willing or able to answer my follow-up questions. I didn't see a script, so please see if you can come up with something. Naive me would expect something more automatic/user friendly... But what do I know. Quote Link to comment Share on other sites More sharing options...
Frederick_1 Posted July 30, 2022 Author Report Share Posted July 30, 2022 23 minutes ago, Stan` said: You cannot merge json using cat. It's not a plain text file. I do not see such a limitation in cat command, or a cat alternative for binary files. Wikipedia states: cat can be used to pipe a file to a program that expects plain text or binary data on its input stream. cat does not destroy non-text bytes when concatenating and outputting. As such, its two main use cases are text files and certain format-compatible types of binary files. https://en.wikipedia.org/wiki/Cat_(Unix)#Use_cases Quote Link to comment Share on other sites More sharing options...
Frederick_1 Posted July 30, 2022 Author Report Share Posted July 30, 2022 Now I opened the metadata.json files in an text editor. It is text but everything in one line. And it seems data is enclosed in a header and a summary of the saved game. Guess this blocks, in wrong order, in the middle of the file causes trouble. Quote Link to comment Share on other sites More sharing options...
Stan` Posted July 30, 2022 Report Share Posted July 30, 2022 The limitation is not with cat it's with the format. Metadata.json must contain one object not two. Objects are delimited using {} Quote Link to comment Share on other sites More sharing options...
Frederick_1 Posted July 31, 2022 Author Report Share Posted July 31, 2022 yes, there is an confusing use of {} in metadata.json. So seems there would be a lot of trick necessary to merge these two files. Quote Link to comment Share on other sites More sharing options...
Stan` Posted July 31, 2022 Report Share Posted July 31, 2022 6 hours ago, Frederick_1 said: yes, there is an confusing use of {} in metadata.json. So seems there would be a lot of trick necessary to merge these two files. No too hard but you have to learn about json first Quote Link to comment Share on other sites More sharing options...
Freagarach Posted August 2, 2022 Report Share Posted August 2, 2022 (edited) I thought/think you could just ignore the JSON? Just get the start settings from the first replay and up the turn number of any subsequent replay with the total number of turns so far. If I would have half an hour spare time, I would certainly make it (in Python) for you. If I had a day spare time, I would have made a patch. [EDIT]: I didn't read properly, the metadata is a lot trickier indeed. But the above works for the commands.txt. Edited August 2, 2022 by Freagarach Take time to read or be quiet. Quote Link to comment Share on other sites More sharing options...
Darkcity Posted August 2, 2022 Report Share Posted August 2, 2022 (edited) While discussion is on replys. Are we working on multiplyer replays fixes? Problems: No replay is saved if you join the game in-between. Even if you join the game and drop in between, and then rejoin, you reply will only exist till your first drop point. Solution 1: Have a unique Id for each game hosted. Start saving replys whenever you join any game any time. Merge replays based on unique id. >Example use case: If user join a game at the starting and left at min 7, he rejoins the game at min 10, and continued forward untill game closed at min 18. >Expected result: After dropping at min 7 if he checks his replay, he will see till min 7 reply. After rejoining at min 10 and dropping off at min 18, if he checks his reply he will see, reply of first 7 min + 10-18 min reply appened to his first 7 min reply. The reply file will be same for him but updated with new content. Solution 2: Any player/observer joining the game will have reply synced up with host. So, no matter when you join your reply will be same as host. >Example use case: If user join a game at the min 5 and left at min 7, he rejoins the game at min 10, and continued forward untill game closed at min 18. >Expected result: If you join at min 5 and drop at min 7, you will have reply of first 7 min, copied from host. If you again rejoin at min 10, and drop at 18, you will have your updated reply (based on unique game/host id) till min 18. This way consistancy remains but data consumption might increases. Maybe we can keep it up to host to enable to disable replays. If not already picked, then I think we should introduce this feature. Edited August 2, 2022 by Darkcity Quote Link to comment Share on other sites More sharing options...
Darkcity Posted August 2, 2022 Report Share Posted August 2, 2022 5 hours ago, Darkcity said: While discussion is on replys. Are we working on multiplyer replays fixes? Problems: No replay is saved if you join the game in-between. Even if you join the game and drop in between, and then rejoin, you reply will only exist till your first drop point. Solution 1: Have a unique Id for each game hosted. Start saving replys whenever you join any game any time. Merge replays based on unique id. >Example use case: If user join a game at the starting and left at min 7, he rejoins the game at min 10, and continued forward untill game closed at min 18. >Expected result: After dropping at min 7 if he checks his replay, he will see till min 7 reply. After rejoining at min 10 and dropping off at min 18, if he checks his reply he will see, reply of first 7 min + 10-18 min reply appened to his first 7 min reply. The reply file will be same for him but updated with new content. Solution 2: Any player/observer joining the game will have reply synced up with host. So, no matter when you join your reply will be same as host. >Example use case: If user join a game at the min 5 and left at min 7, he rejoins the game at min 10, and continued forward untill game closed at min 18. >Expected result: If you join at min 5 and drop at min 7, you will have reply of first 7 min, copied from host. If you again rejoin at min 10, and drop at 18, you will have your updated reply (based on unique game/host id) till min 18. This way consistancy remains but data consumption might increases. Maybe we can keep it up to host to enable to disable replays. If not already picked, then I think we should introduce this feature. @Stan` Do we have ticket for this already or it was never discussed before? Quote Link to comment Share on other sites More sharing options...
Stan` Posted August 2, 2022 Report Share Posted August 2, 2022 I don't think we do. The reason we do not send full replays is because of network bandwith which has always been kept to a minimum. (obviously not for ddos but heh) Quote Link to comment Share on other sites More sharing options...
smiley Posted August 2, 2022 Report Share Posted August 2, 2022 We just send the serialized game state. It would be less bandwidth to send the commands instead, but it would require too much record keeping from both host and client to keep track of what to send and request. And I don't think we even store commands in memory. It's just logged out IIRC. 2 hours ago, Darkcity said: Merge replays based on unique id. Where does the missing commands in between minutes 7 and 10 come from? Or is it a time travel type deal where we just skip the 3 minutes? This requires storing the serialized saved game state which should be loaded in between replays and likely not implementable without starting from scratch. Solution 2 would work and should not consume that much extract bandwidth, (the commands would have been transmitted anyway had they not disconnected). But it seems to be a bit clunky at first glance. I am not thinking of any alternative though. Quote Link to comment Share on other sites More sharing options...
Darkcity Posted August 2, 2022 Report Share Posted August 2, 2022 2 hours ago, smiley said: Or is it a time travel type deal where we just skip the 3 minutes? This. You will have reply of what you observed under solution 1. This will atleast solve the reply problem for players that are playing and may not for observers. We can further improve solution 2 by doing following. Let me know the feasibility and viability of the solution. Priotize sync-up with observer of the game instead of syncing up with host. Check if any observer (not host) has replay, means he is there since beginning. If yes, then we sync-up with that observer. If no, check if host has enabled the sync up to observer If enabled, then sync with host If not enabled, then you will be sync-up to nothing. Sync with player with high bandwidth. Check the players in the game and their bandwidth. Sync-up with the player that if you sync with will not lag Find that player and sync with him If your sync might introduce lag then don't sync. Solution 3- Replay sharing at the end of the game. At the end of the game, any observer or player can request for full reply by clicking on request reply. This will sync-up the host reply with player/observer reply. By doing this we neither interuting the game, nor casuing any other kind of issue (hopefully), since its post game action. Solution 4- reply sharing in lobby You can share any reply to any player logged in lobby. This can be introduced as part of command line or commands on chat window or any CTA in lobby itself. Exact solutioning we can discuss if this is a good solution. I have few other solutions in mind but I think these are more than enough.. Quote Link to comment Share on other sites More sharing options...
Frederick_1 Posted August 5, 2022 Author Report Share Posted August 5, 2022 On 02/08/2022 at 7:21 AM, Freagarach said: I thought/think you could just ignore the JSON? Just get the start settings from the first replay and up the turn number of any subsequent replay with the total number of turns so far. I tried this once again, before writing an answer. It just crashed. Quote Link to comment Share on other sites More sharing options...
Stan` Posted August 5, 2022 Report Share Posted August 5, 2022 40 minutes ago, Frederick_1 said: I tried this once again, before writing an answer. It just crashed. I think he means not having the file at all. Only the commands.txt Quote Link to comment Share on other sites More sharing options...
Frederick_1 Posted August 5, 2022 Author Report Share Posted August 5, 2022 I copy-pasted the metadata.json form the first sectionof the game into the replay folder of the second part with the merged commands.txt. It just crahed, when loading the replay. Altough, now after this, I realize 0AD crashes anytimy I want to start it again. But I swear I was playing a game just until I tried this. Maybe the universe decided it is not good for me to play 0AD any more. Assertion failed: "!m_Worker" Location: UserReport.cpp:516 (~CUserReporter) Call stack: (0x5575cd3dfe55) /usr/games/pyrogenesis(+0x5f4e55) [0x5575cd3dfe55] (0x5575cd37fc19) /usr/games/pyrogenesis(+0x594c19) [0x5575cd37fc19] (0x5575cd381291) /usr/games/pyrogenesis(+0x596291) [0x5575cd381291] (0x5575cd381b1b) /usr/games/pyrogenesis(+0x596b1b) [0x5575cd381b1b] (0x5575cd10c097) /usr/games/pyrogenesis(+0x321097) [0x5575cd10c097] (0x7f4b839918a7) /lib/x86_64-linux-gnu/libc.so.6(+0x468a7) [0x7f4b839918a7] (0x7f4b83991a60) /lib/x86_64-linux-gnu/libc.so.6(on_exit+0) [0x7f4b83991a60] (0x7f4b841a417b) /lib/x86_64-linux-gnu/libX11.so.6(+0x4117b) [0x7f4b841a417b] (0x7f4b841a428b) /lib/x86_64-linux-gnu/libX11.so.6(_XError+0xfb) [0x7f4b841a428b] (0x7f4b841a0ff7) /lib/x86_64-linux-gnu/libX11.so.6(+0x3dff7) [0x7f4b841a0ff7] (0x7f4b841a1095) /lib/x86_64-linux-gnu/libX11.so.6(+0x3e095) [0x7f4b841a1095] (0x7f4b841a201d) /lib/x86_64-linux-gnu/libX11.so.6(_XReply+0x23d) [0x7f4b841a201d] (0x7f4b8419d7f1) /lib/x86_64-linux-gnu/libX11.so.6(XSync+0x51) [0x7f4b8419d7f1] (0x7f4b325470ed) /lib/x86_64-linux-gnu/libGLX_nvidia.so.0(+0x880ed) [0x7f4b325470ed] (0x7f4b32534915) /lib/x86_64-linux-gnu/libGLX_nvidia.so.0(glXCreateContext+0x45) [0x7f4b32534915] (0x7f4b83861c97) /lib/x86_64-linux-gnu/libGLX.so.0(glXCreateContext+0x37) [0x7f4b83861c97] errno = 9 (?) OS error = ? Quote Link to comment Share on other sites More sharing options...
hyperion Posted August 5, 2022 Report Share Posted August 5, 2022 Just delete the metadata.json, it's not needed at all. Don't even try manually fixing it. Quote Link to comment Share on other sites More sharing options...
Gurken Khan Posted August 5, 2022 Report Share Posted August 5, 2022 37 minutes ago, Frederick_1 said: Altough, now after this, I realize 0AD crashes anytimy I want to start it again. But I swear I was playing a game just until I tried this. Did you delete your frankenfile? I've tried to merge replay-files and had to delete my frankenfile then... Quote Link to comment Share on other sites More sharing options...
Frederick_1 Posted August 5, 2022 Author Report Share Posted August 5, 2022 Strange, after an reboot everything works on my system again, but not the merge with the commands.txt 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.