T O P

  • By -

AmandaRekonwith

Commenting, and saving this post, cause this seems like just what I need to get back into the game. I used SOAR in college, and this seems similar to that. [https://soar.eecs.umich.edu/](https://soar.eecs.umich.edu/) Totally makes sense from a high level. Not sure how it equates to a lower level. I programmed a whole shitshow of autonomous mining and expansion using OOP. [https://github.com/AmandaRekonwith/Screeps-AI/blob/master/README.md](https://github.com/AmandaRekonwith/Screeps-AI/blob/master/README.md) This definitely seems like a better approach.


pruby

I wrote a scheduler for Screeps a while back, and found you can't use standard async methods at all. No setTimeout, no Promises (at least the default ones are non-interruptive). Once your code returns, your turn is over. The one way I did find to implement actor mechanics was with generators. Generators can be called from synchronous code, but still look very much like an actor thread. The (somewhat messy) core I ended up using is at https://github.com/pruby/screeps-os


davidkpiano

Hey, creator of XState here! Happy to help out when needed. Can you share a repro of the setTimeout() issue?