Decision trees and state machines for game development