3 ms·
Plenty of imperative domain spaces use state machines, gamedev and the like come to mind in particular.
by vvanders 9y ago
Plenty of imperative domain spaces use state machines, gamedev and the like come to mind in particular.
- pdelbarba 9y agoSimilarly with embedded development. We use them for just about everything from communications to scheduling. I think the subtext here is that state machines are just rarely used for web/mobile...
- DCoder 9y agoOne simplistic state machine in web/mobile is mouse/swipe motion handling – mousedown transitions into "in motion" state, mousemove tracks that state, mouseup transitions into "finished motion" state, runs event handlers, and transitions again into "idle" state.
- vvanders 9y agoYup, I'm in the middle of writing a packet radio protocol and it's mostly just nested state machines.
- jjjensen90 9y agoDefinitely true for gamedev in my experience. I don't think I've worked in a game code base of nontrivial size without seeing some implementation of state machines.
- PeterisP 9y agoThe "some implementation" probably is part of the problem - if there was a good generic implementation included in the standard library so that it could and would be used in language tutorials (especially in languages where rolling nice state machine code is tricky), then developers would use them much more.
- vvanders 9y agoThe problem with that is each system has slightly different requirements. Scripting state machines vs animation state machines are going to have very different constraints and end-goals. [edit] For example here is UE3's anim tree[1] editor vs Kismet[2]. [1] https://docs.unrealengine.com/udk/Three/AnimTreeEditorUserGuide.html https://docs.unrealengine.com/udk/Three/AnimTreeEditorUserGu... [2] https://docs.unrealengine.com/udk/Three/KismetUserGuide.html https://docs.unrealengine.com/udk/Three/KismetUserGuide.html