Yes as this is very simple card game you can either use main thread for AI or else use a separate thread for it. Both will show the same performance as the logic of AI would not be so complex :)
how to write AI's into my app
-
03-12-2021 - |
Question
hey I'm writing an android app to play a simple card game (Dutch Blitz) I have a simple algorithm already made but I was wondering if I needed to run AI's as a new Thread or somehow integrate it into the main thread, or if anyone else has some good idea's I would love to hear them...
thanks for any ideas!
Solution
OTHER TIPS
I'd never use a main thread for AI evaluations, I don't know this game "dutch blitz" but you have to remember that on the weakest smartphone out there, if your algorithme just has a small chance to near itself to 5 (probably more like 4) seconds(blocking the ui thread), then your application will be closed.
So asynctask is where you should do such a thing.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow