3 ms·
The best way to estimate load is by looking at Quasar's internal execution queues. Yes, but then how do I break things down in specific terms? With the game lo
by stcredzero 13y ago
The best way to estimate load is by looking at Quasar's internal execution queues.
Yes, but then how do I break things down in specific terms? With the game loop, it's easy for me to just take milliseconds timestamps before and after each subroutine. For example, I can just time how long it takes for me to run (prepopulate-monsters).
Also, every actor in this game has a loop of 30ms, i.e. it immediately responds to messages it receives, but if there are none, it updates every 30ms. If you miss that deadline, namely your current run is over 30ms from the previous one, you know the server is overloaded.
So then, I have to aggregate the loop running-times for every entity, or take a census of entities overrunning?
Of course, the main advantage of working like that is that you get really good parallelism.
I've always understood this part. However, consistent game ticks are useful for various aspects of simulation and game AI.
but you're not making the most out of your hardware as all cores basically become idle after each step
A laudable goal, but what if one is prioritizing "never lag" over efficiency? My game is to have some of the same "a-life simulation with a game attached" quality that Dwarf Fortress has. To ensure that such calculation never interferes with player responsiveness, I was planning to put such background processing on an entirely different instance, then import the resulting evolved monster species into player instances. How would this be architected differently using actors?
- pron 13y ago> With the game loop, it's easy for me to just take milliseconds timestamps before and after each subroutine. For example, I can just time how long it takes for me to run (prepopulate-monsters). Well, you can do the same here, for each actor's loop. With a single loop you're letting your hardware go to waste and limit your scalability. > So then, I have to aggregate the loop running-times for every entity, or take a census of entities overrunning? You can do both. Whatever makes sense for you. > However, consistent game ticks are useful for various aspects of simulation and game AI. Well it's a tradeoff. I think that given the current state of hardware, you need to use all your cores. > A laudable goal, but what if one is prioritizing "never lag" over efficiency? I don't think the two are mutually exclusive. How will you achieve "never lag" if your single thread can't perform all the computation in time? > My game is to have some of the same "a-life simulation with a game attached" quality that Dwarf Fortress has. Sounds like a perfect fit for the actor approach. > To ensure that such calculation never interferes with player responsiveness, I was planning to put such background processing on an entirely different instance, then import the resulting evolved monster species into player instances. How would this be architected differently using actors? Well, you could always still use a single-threaded loop and offload computation to actors. But a better way would be to split each entity to two actors. One for sending feedback to the player, and one for slow computation. If you want to ensure little interference, you can run the different kinds of actors in different Quasar schedulers, each using a different thread-pool, and control the number of threads in each of the pools. Quasar also supports distributed actors, so you can place the slow, computation-heavy ones on different machines, just as you have planned.
- stcredzero 13y agoI don't think the two are mutually exclusive. How will you achieve "never lag" if your single thread can't perform all the computation in time? My plan is to determine the max number of players supportable in each instance, which I call an "interaction pool" and basically ensure no instance exceeds this number. All players will be in the same world, but can only really interact within the same instance. I think this will be okay since the shared world is huge and not every player will be interacting. (And I will write my way out of the sticky details. When players have to change instances, they will experience a "phase storm") Let's say I want to move my Clojure code on top of spacebase, how would I go about it?