Hi.
It probably depends on your project as i our project we need all sorts of physics.
I just took a quick look and i noticed @7:46 that you mentioned that transitioning to a other state 'cost a frame'.
This is not the case, you can loop thru 1000's of states in 1 frame.
But depending on your actions used you can have other results.
Yeah I generalized it, but I've always felt it runs slower when I move through too many states quickly, idk might have been placebo :S
Perhaps it's because I've only ""noticed"" latency when doing 'every frame' stuff within those states if required.
But I feel it's better to do more things within one state than to have it spread out without it needing to be spread out into different states.
If you can solve the problem within one state, why wouldn't you
If you can keep your state tidy, why not?
It follows that using events to jump from state to state would require more computation simply in dealing with these events, which cannot be free no matter what. So there would logically be a practical advantage in keeping more stuff inside a state.
Yes, my point exactly (but I didn't word myself well enough).
I did make a mistake by saying "it costs a frame", what I should have said is "it costs more computational power".
In fact, it costs quite a lot of computational power.
I've previously searched the web to quell a thirst for knowledge, that of "How expensive are operations on a CPU", and my answer was as follows:
It varies depending on instruction set and bit width and cpu architecture, but adding and subtracing is fairly cheap (pretty much the cheapest you can get), followed by multiplication.
Division is very expensive, and doing exponent and cos/sin operations is even more expensive.
Then we have branching. Branching is in orders of magnitude more expensive than division and the likes.
But branching can also be somewhat cheap, if the branch was predicted "right".
So I'd have a hard wager that switching between states with events can cost quite a lot if done too much.
I guess bottom line is; keep your states, and subsequently your code tidy.