[C++] How do you implement a state chart or state machine?
Hi friends!
How do you implement a state chart or state machine in C++? I mean, which technique do you use? can you write a small example? How do you store transitions? Or any useful link.
I use a switch with a list of states, but I don't use transitions, so I guess I doing it bad.
Note: I would prefer in C++ without any library like Boost.
Is there any program opr IDE to draw state charts and then create its code in C++? Something like assitant.
Thanks a lot for your time, this is a very important part in every game.
How do you implement a state chart or state machine in C++? I mean, which technique do you use? can you write a small example? How do you store transitions? Or any useful link.
I use a switch with a list of states, but I don't use transitions, so I guess I doing it bad.
Note: I would prefer in C++ without any library like Boost.
Is there any program opr IDE to draw state charts and then create its code in C++? Something like assitant.
Thanks a lot for your time, this is a very important part in every game.
I don't think there's any one formula for a state machine.
If the state change is immediate, then there's no need for a transition.
You do obviously want to be careful to guard against getting stuck in a state loop, or stuck in a single state. However, the details of how that can happen and how to avoid it would be totally dependent on what you're doing.
If the state change is immediate, then there's no need for a transition.
You do obviously want to be careful to guard against getting stuck in a state loop, or stuck in a single state. However, the details of how that can happen and how to avoid it would be totally dependent on what you're doing.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| State Tables and Event Handling | geolycosa | 1 | 2,253 |
Aug 29, 2005 12:58 PM Last Post: ThemsAllTook |
|
| moving Mac OS X game to another OS X machine.... | WhatMeWorry | 15 | 5,042 |
Aug 19, 2005 09:19 AM Last Post: AnotherJake |
|
| Problem reading mouse button state | Bossa Nova | 3 | 2,805 |
Jul 23, 2003 12:09 PM Last Post: Iceman |
|
| State of OpenAL? | KenD | 16 | 6,151 |
Jul 11, 2003 05:35 PM Last Post: Iceman |
|

