Original Post
A couple of friends and I are considering writing small board-game apps for the iPhone (think "chess" or "backgammon"). I just started playing around with the iPhone SDK, I bought a couple of books and I think I understand basically how iPhone programs work.
Our programs will have one or more AI opponents, and we would like the program to be able to perform computations (alpha-beta or MCTS, most likely) while the program remains responsive to user input. The books I bought don't go deep enough into how things work, so I don't really know what my options are. I looked at Apple's online documentation, but I don't really like what it describes.
So ideally I would like to be able to call the event handler "by hand" from my AI code, so I can keep everything in a single thread, but I haven't found a way to do that. Is this even possible?
Alternatively, I could run the AI concurrently. Apple's documentation describes too many ways to do this (at least these: threads, operation objects, GCD, idle-time notifications, asynchronous functions).
Do you have experience with these options? Any recommendations or thoughts?
Our programs will have one or more AI opponents, and we would like the program to be able to perform computations (alpha-beta or MCTS, most likely) while the program remains responsive to user input. The books I bought don't go deep enough into how things work, so I don't really know what my options are. I looked at Apple's online documentation, but I don't really like what it describes.
So ideally I would like to be able to call the event handler "by hand" from my AI code, so I can keep everything in a single thread, but I haven't found a way to do that. Is this even possible?
Alternatively, I could run the AI concurrently. Apple's documentation describes too many ways to do this (at least these: threads, operation objects, GCD, idle-time notifications, asynchronous functions).
Do you have experience with these options? Any recommendations or thoughts?