CSM
CSM copied to clipboard
Syncing creation and destruction of citizens
I Tried syncing the upgrading of buildings, but the process seems bound to the education level of the citizens.
Citizens are created with a random id, and we should be able to sync the creation of them like we are syncing buildings, roads ect. and since they don't constantly have to sync but only on creation, destruction (and building upgrade) it should not be a massive resource hog.
however since both server and clients are creating citizens, i think we have to remove the citizen creation on the client side, else they will be created in double rate, and possible we are gonna have a problem with the removal of citizens where they are removed faster than in the original game, but hopefully that wont be a problem.
I also noticed this problem and I wanted to fix it, but I found there is no api for changing the population
It should be posible to do using Harmoni
Emmm.. what is “Harmoni”?
Oh, it is Harmony
Ahh yes sorry mobile devise keyboard ;)
Hey there. Just wondering what the easiest course of action is to fix the money sync issue. Is syncing citizens going to be harder than a periodic sync on money? I'm guessing as well that there isn't a simple way to sync population... it wouldn't be possible to sync citizens without having generated buildings sync'd too, would it?
I've started a new branch to try and add citizen sync. I'm not very experience in this game so help is greatly appreciated.
My current attempt at implementing this will be to ignore changes to citizens performed by client's and broadcast only the ones the host has. Then on the client side add everything that comes from network. How am I doing this? no clue yet, looking into it :P
But please do provide feedback if u think this is the right approach or not.
I think the approach should work like that. The only problem I see is that the amount of packets could be too much for performance reasons. It would be nice if you could test how often these methods get called in a large city for example. Then we can decide if this is the way to go. An alternative would be to synchronize the RNG seeds, as most parts of the game are based on some kind of seeded randomness.
have been using this for couple games, this is so amazing project and made this game a lot more fun playing with friends.
and this is the only major issue that I observed. hope this can be fixed.