5 ms·
I had no idea StarCraft still saved the entire game state: what a gigantic waste! I wonder if the game engine was deterministic or not (if it wasn't there was
by TacticalCoder 4y ago
I had no idea StarCraft still saved the entire game state: what a gigantic waste! I wonder if the game engine was deterministic or not (if it wasn't there was no choice for save files: you had to save the full game state if you wanted to implement a replay or continue functionality).
Now Warcraft III, which came out only three years later, had a fully deterministic game engine and, for replay files, only saved players inputs. Hence the Warcraft III save file, even for entire games, were tiny. And there were several websites where you could download and replay save files from other people, including from famous matchups. Fun times: I'd exchange my best games with my brother, as email attachments IIRC. We'd then watch each other's games and make comments.
IIRC Microsoft's first Age of Empire, which came out in 1997, already used a deterministic game engine so there was already an AAA title who used that technique when StarCraft came out in 1998.
- RedNifre 4y agoIt's fully deterministic, multiplayer works by only sending user input around (at a reduced tick rate) and the unit movements get calculated locally from that.
- TacticalCoder 4y ago> It's fully deterministic, multiplayer works by only sending user input around (at a reduced tick rate) and the unit movements get calculated locally from that. That's interesting. I wonder why the other poster say the replay functionality would turn into nonsense at some point. Now if the game is deterministic and multiplayer works by only sending user inputs around, why the save / continue feature wasn't implemented that way? In any case I love to read about how these games worked!
- Macha 4y agoMultiplayer requires all users are on the same version. SC2 replays also require this. SC1 may not have. Determinism would only have applied if the version used for playback was the same as that used for recording.
- celdon25 4y agoThe replays can possibly malfunction if you speed the playback up faster than 1x. Not sure about the technical reasons, but the devs never fixed it. Many players still don’t know about the workaround to use 1x though.
- Linosaurus 4y ago> Now if the game is deterministic and multiplayer works by only sending user inputs around, why the save / continue feature wasn't implemented that way? Your only interpreter for the data is the entire game engine. By design it's going to use most of the power of the target hardware, so cannot run faster. Ie, 30 minute load time if you had played 30 min.
- Jare 4y agoRunning the simulation is not going to use most of the power of your machine, in any remotely sane design: - a huge part is going to go to rendering, which you don't need to do if you only care about the end state - in many games, the simulation runs at a much lower frame rate than the game, so perhaps you see the game animated at a silky smooth 60 fps but internally the sim runs at a fraction. 10 and 5 fps for the sim are common. - some sim architectures may allow you to run the sim at a variable frame rate and still generate deterministic results. So (ideally) you tell the sim to run a single step of 30 mins and you get the end result. In practice of course variable steps will be limited to much less, but Supercell mentioned reducing their server sim cpu costs by 80-90% with this kind of trick. All added up with reasonable guesses for a well optimized case: 30 mins of sim run at 1 sim tick per second of game time, where sim ticks take say 2ms, could take 3.6 seconds to sim, not 30 minutes.
- archagon 4y agoI recall a Starcraft multiplayer game diverging with a dorm buddy back in college. Thought I was winning; turned out we were playing entirely different games!
- jeffparsons 4y agoI remember StarCraft replays would often diverge from what actually happened part way through, and from the point of divergence would decay into increasing nonsense. So they were capturing events like user input, and when that wasn't done perfectly it failed spectacularly.
- koonsolo 4y agoDeterministic engines are very hard to pull off. I looked into it for my own engine, and decided not to. The problem is floating point calculations on different processors. Maybe in the 90's that wasn't such an issue, but good luck now. Plus, if you don't need a physics engine, maybe you can stay in integer space. That would explain small deviations at first, and getting bigger by time. For example a game like Braid also chose not to use a deterministic engine for that reason.
- JKCalhoun 4y ago> The problem is floating point calculations on different processors. Maybe in the 90's that wasn't such an issue Haha, I'd be surprised if they used floats at all in a 90's game. Fixed point were popular.
- Jare 4y agoAnd it's not gone. I can't seem to find the reference anymore, but I'd swear I recently saw a talk from a Supercell fellow describing they use fixed point today, for their online games. Edit: this is it https://www.youtube.com/watch?v=HrUF-LFTs-A https://www.youtube.com/watch?v=HrUF-LFTs-A The whole talk is very relevant to anyone interested in this topic.
- koonsolo 4y agoIn the 2000's I wrote games on MS PocketPC. It had emulated floating point, which was painfully slow for games. Most games could do with just integers. Once I made some physics based games, I implemented fixed point indeed, and it went more or less fine. A 3D engine in fixed point (which I never fully finished) gave me a lot of headaches. So glad all those devices have proper floating point and a gpu's.
- MrDOS 4y ago> I had no idea StarCraft still saved the entire game state: what a gigantic waste! > Fun times: I'd exchange my best games with my brother, as email attachments IIRC. We'd then watch each other's games and make comments. There is a major drawback to save files which rely on the deterministic nature of the game: what happens when the determinism changes? I don't mean due to bugs; I mean intentional modifications to the game's behaviour through patches. Either these changes will break old replays and saves, or the game needs to carry around multiple simulation versions. You bring up Age of Empires. This is a small problem in the current AoE2 competitive scene. Yes, AoE2 has a competitive scene – the game has been re-released twice in the past decade, and still enjoys the attention of competitive play, including sponsored tournaments (e.g., the Red Bull Wololo series). Microsoft are attempting to give the game the same treatment as other modern, competitive titles, which means frequent balance patches, and occasional injections of new content (DLC). Unfortunately, each one of these updates breaks old save games and replays, which, as you point out, rely on the deterministic nature of the engine. It means that any casting/commentating of games must happen within relatively short order of them being played, and that the only reliable distribution format for old games is... screen recordings. I'd much rather a less space-efficient save format (or at least having the option to convert deterministic replays into a fully self-sufficient archive format) than having to discard native recordings of great games by the wayside in favour of videos.
- rybosome 4y agoYep, I recall being bitten by that. StarCraft actually let you save replays which were just player inputs - which begs the question why save games couldn’t do this, but I digress - and I clearly remember attempting to watch a replay after a major game update and seeing it fall apart after a few minutes. The replay was of a 40 minute game. It ran fine for the first few minutes, then I’m not sure what went wrong but suddenly all the characters stopped moving (except the automated mining drones) and the game just stayed like that for the next 30+ minutes.
- stonith 4y ago> Which begs the question why save games couldn’t do this Replays weren't added until 1.08[1] so it may have changed sometime post launch, but I'd have thought because it means you have to run the sim to get to the eg. 30 minute mark where the save is, and even on modern machines running remastered that takes quite a while. A more constrained machine from the times wouldn't be able to do the x16 speed fast forward used today. [1] https://liquipedia.net/starcraft/Patch_1.08 https://liquipedia.net/starcraft/Patch_1.08
- havblue 4y agoI looked at the size of StarCraft game replay file sizes; less than half a megabyte. So maybe not that bad?
- deleted 4y ago[deleted]
- Jyaif 4y agoWith replay-based saving, if you want to load a game that has 30 minutes worth of progress, you have to replay 30 minutes worth of gameplay! what a gigantic waste! In other words, as usual it's all about tradeoffs.
- ItsMonkk 4y agoThis is exactly how rejoining an in-progress Heroes of the Storm(another Blizzard title that was built on top of the Starcraft II engine) match worked. You would 'fast-forward' through and it could often take 5+ minutes on a slower machine. The ideal system would be similar to what we have with video algorithms. Every so often we draw out the full data needed for the existing state, then from then on-wards is just diffs until the next key frame is reached.
- summerlight 4y agoProbably two reasons. You only have "two months away from the launch", so no time to re-architecture the existing working save mechanism. Why change it when you have an infinite amount of other works to be done? It's just a straightforward prioritization problem. Also, it's fairly tricky to make the deterministic replay works. SC definitely do that for network play, but the risk is arguably higher for saving. StarCraft there were lots of synchronization issues even at very last minutes of its beta due to unexpected non-determinism which is probably because the game engine was not designed with that in mind. IIRC, the game would simply shutdown the session in a such case. But if it's from the save file, you don't have a way to detect that so the save file is going to be in a corrupted state with no hope of recovering. In the case of WC3, the engine has been written with lessons learned in the hard way so it should be capable of handling this problem more elegantly.