Conquest! - Free Real-Time Strategy Game
  • Home
  • Start Playing
  • How to Play
  • About
    • Development Blog
    • History
    • Press Kit
    • Server Change Log
    • World Events
  • Login Help
  • Contact Us
  • Privacy Policy

Push vs Pull

8/14/2023

0 Comments

 
When Conquest! was first developed in 1993, it used a very simple model to exchange data between the server and players. A player would send a command and the server would reply with an appropriate response. If a player needed additional information, they would issue another command to retrieve it. This worked well for a text-based UI.

When the UI was developed in 2016, essentially the same model was used. However, it quickly became apparent that additional information was needed to update the UI. Therefore, after a player issued a command and the server sent the initial response, the client would send additional commands to the server to retrieve the rest of the information. For example, consider this sequence:
  1. Player sends Buy
  2. Server sends Response
  3. Client Sends Person
  4. Server sends Person
  5. Client Sends Review
  6. Server sends Review
  7. Client Sends Market
  8. Server Sends Market
This solved the issue of missing ancillary information but was inefficient and meant that any updates required a client deployment.

In January of 2021, I switch from a pull to a push model. With this model the server would decide what information to send after processing a command. The above example now looks like this:
  1. Player sends Buy
  2. Server sends Response
  3. Server sends Person
  4. Server sends Review
  5. Server Sends Market
This reduced the amount of network traffic and server-side processing and meant that any fixes could be done quickly without a client update. This has worked well for 2.5 years, but I have recently become concerned that data was being sent multiple times as the web of what to send and when became difficult to trace (each individual command was responsible for deciding what data to send back to the client).

I have updated the pull model to use a centralized function to examine the player structures after a command is executed to dynamically determine the data required to send to the client. In this way, I do not have to worry about a command missing something (or sending too much data). The correct data is sent automatically each time.
0 Comments



Leave a Reply.

    Author

    James has been working on Conquest! since 1993.

    Archives

    May 2025
    April 2025
    December 2024
    June 2024
    December 2023
    August 2023
    September 2022
    July 2022
    October 2021
    September 2021
    April 2021
    September 2020
    February 2017
    December 2016
    October 2016
    September 2016
    August 2016
    July 2016
    May 2016
    April 2016
    March 2016
    February 2016
    January 2016
    December 2015
    November 2015
    October 2015
    September 2015
    August 2015
    July 2015
    June 2015
    May 2015

    Categories

    All

    RSS Feed

Copyright 2025 GreenLion Gaming All Rights Reserved
  • Home
  • Start Playing
  • How to Play
  • About
    • Development Blog
    • History
    • Press Kit
    • Server Change Log
    • World Events
  • Login Help
  • Contact Us
  • Privacy Policy