I’m working on an agent-based model and focusing on the graphics so that it’s as visually interesting to watch as I can manage. The simulation is complex and compute hungry with agents making decisions using NNs and interacting, so I’m taking a multithreading approach and trying to keep the graphics and UI separate from the sim. The project has grown to a point I’m hitting the limits of my software architecture skills.
From what I’ve read about multithreading with Python the best approach seems to be to carve out some shared memory. The UI only has to read from this memory, and the sim would either just write to it and keep its own state, or keep its state in the shared memory (advice?). I don’t think synchronizing the memory access will be that complicated given this setup.
My question is if this is a decent or common architecture. What else should I consider as far as other approaches, or if I go with this idea? I haven’t found much on game design architecture, and what I do find is different enough from what I’m doing with an ABM it doesn’t apply much.
I obviously want to get this working so I can run my sims, but I also really like software architecture and I am having a lot of fun building on a project this size so I’ll spend as much time as I have to to get a solution I’m happy with. I’ll read any resources thrown at me.
D.Rod is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.