4 ms·
> Just a "simple" card game like solitaire would suffice for a lot of the lessons. I've written an actual game, a 2D platformer. If there's a domain where it'
by TacticalCoder 3y ago
> Just a "simple" card game like solitaire would suffice for a lot of the lessons.
I've written an actual game, a 2D platformer.
If there's a domain where it's easy to demonstrate that the view is purely a function of the state it's precisely in gaming. In many games you can toggle (in dev or even for some during gameplay) between "the real view" and, say, wireframe view of the game (with lots of debug infos added too for example). Or you can toggle between a 3D view of your game or a top-down 2D one. Or you can toggle between different types of rendering (as in Diablo 2 where both a 2D and fake 3D view where available and the modern Diablo 2 ressurected, where you can you can show... The 25 year old view if you want to, at any time).
Many games are 100% deterministic and the entire game user(s) played can be recreated from only a record of the user(s) inputs (which is why some save files for long games can be tinier than tiny). And it'll replay the same on different screen configurations / different platforms.
The view in a game at time n is literally f(state n).
- taeric 3y agoCertainly! That was indeed my intention here. The big learning I'm intending is just how much state that people take for granted is necessary to track.
- ape_key 3y agorespectfully you haven’t written enough games > real game turn-based and real-time games have different kinds of complexity, so a platformer won’t expose you to all of it. turn-based games are roughly going to give you an easier time separating the game code, but the UI code is going to feel like a debilitating slog. > Many games are 100% deterministic Until you use floating points, networking, or different platforms. This is more likely to be true in turn-based games, and super unlikely in anything real-time and multiplayer. Most games like that periodically sync state instead of relying on applying actions on each client
- amelius 3y agoAre you saying that IEEE 754 floating point (which everybody is using) is not deterministic?
- politician 3y agoYou have to be careful with comparisons. In JavaScript, for instance, `(0.1 + 0.2) != (0.3)`.
- amelius 3y agoWell that doesn't make it non-deterministic in behavior.
- ape_key 3y ago(a+b)-a doesn’t always equal (a-a)+b It’s different behavior if the order of operations are non-deterministic. Plenty of room for such things in games. Most of the time the effects are too small to notice. They can chaos-theory out of control, though. So real time games nearly universally sync state instead of relying on deterministic synchronization via events/actions. For a good read, look up lockstep deterministic networking. There’s way too much nuance here to be so dismissive
- bowsamic 3y agoChaotic behaviour is deterministic
- ape_key 3y agoWeird how I write complete thoughts and supply references but this site full of tech geniuses mostly produces downvotes and single-sentence drivebys. Come back when you have things worth contributing.
- bowsamic 3y agoI’m a theoretical physicist, not a tech genius. Perhaps that’s the mode matching problem here. I don’t trust your 23 hour old account though :)
- agumonkey 3y agoI'm regularly wondering why games are not more talked about in software engineering. Even in the early 2000s games were: - more performant and responsive than most company applications - while displaying complex real time geometry - pretty well engineered - fun and engaging - didn't require reading 500 page manual to get by