Skip to content

Syncing creation and destruction of citizens #69

Open

Description

@Treholt3103

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.

Activity

  1. Dywane commented on Jan 6, 2019

    @Dywane

    I also noticed this problem and I wanted to fix it, but I found there is no api for changing the population

  2. Treholt3103 commented on Jan 6, 2019

    @Treholt3103
    CollaboratorAuthor

    It should be posible to do using Harmoni

  3. Dywane commented on Jan 6, 2019

    @Dywane

    Emmm.. what is “Harmoni”?

  4. Dywane commented on Jan 6, 2019

    @Dywane

    Oh, it is Harmony

  5. Treholt3103 commented on Jan 6, 2019

    @Treholt3103
    CollaboratorAuthor

    Ahh yes sorry mobile devise keyboard ;)

  6. added
    hacktoberfestGood for contributing during Hacktoberfest (https://hacktoberfest.digitalocean.com/)
    on Sep 29, 2019
  7. removed
    hacktoberfestGood for contributing during Hacktoberfest (https://hacktoberfest.digitalocean.com/)
    on Nov 10, 2019
  8. tangles-0 commented on Jun 11, 2021

    @tangles-0

    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?

  9. joaogl commented on Jul 2, 2021

    @joaogl
    Contributor

    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.

  10. kaenganxt commented on Jul 2, 2021

    @kaenganxt
    Member

    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.

  11. ibigbug commented on Apr 21, 2022

    @ibigbug

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions