<story><title>Lessons learned while developing Age of Empires 1 Definitive Edition</title><url>http://richg42.blogspot.com/2018/02/some-lessons-learned-while-developing.html</url></story><parent_chain></parent_chain><comment><author>quadcore</author><text>&lt;i&gt;Develop strong out of sync (OOS) detection tools early, and learn how to use them.&lt;/i&gt;&lt;p&gt;The way lockstep work is that the clients gives themselves a rendez-vous in the future and agree to compute one turn of the game, given the players&amp;#x27; input of that turn, at that moment. It&amp;#x27;s very clever. The players input are sent to every clients and will be computed in the future in a deterministic way. So every client is computing the exact same game. Now if the clients doesnt compute the same game given the same players&amp;#x27; input, the game is OOS and that basically should never happen because the game is dead.&lt;p&gt;To detect an OOS, a client needs to compute a hash of some relevant game data (ultimately &amp;quot;everything&amp;quot; ends up being represented by the position of the units (plus a dead state)), every &lt;i&gt;turn&lt;/i&gt; and send them with its &amp;quot;end of turn&amp;quot; message to the server&amp;#x2F;clients. If clients disagree with the value of the hash, they are OOS.&lt;p&gt;The cool thing with lockstep is that you can record every turn inputs (which is fairly light) and then replay the whole game - because that&amp;#x27;s already how a game is played. So, when you have an OOS - or any bug, you can just replay the game until the OOS and try to fix it. Sometimes it doesnt work though and you may replay the game without detecting any OOS.&lt;p&gt;If you dont detect an OOS after a replay, you&amp;#x27;re basically in deep shit. I mean &lt;i&gt;needle in a haystack of c++&lt;/i&gt; kind of deep shit. Every client needs to dump &lt;i&gt;every data of every function that ever ran&lt;/i&gt; in a log file, and then you need to reproduce the OOS and then compare the log files and then guess what caused the data to differ.</text></comment>
<story><title>Lessons learned while developing Age of Empires 1 Definitive Edition</title><url>http://richg42.blogspot.com/2018/02/some-lessons-learned-while-developing.html</url></story><parent_chain></parent_chain><comment><author>xrisk</author><text>It&amp;#x27;s a pity they aren&amp;#x27;t releasing on Steam though. Most players aren&amp;#x27;t going to buy the game from the Win10 store.</text></comment>