Skip to content

technical home

Vinorcola edited this page Dec 12, 2020 · 4 revisions

Technical wiki

Introduction

CityBuilderEngine is writen in C++. It uses some C++14 features and is built on top of the Qt framework (from version 5.13). The whole application is designed as a server/client architecture.

The server part contains the game engine. This game engine is the heart of the game: it runs a map through time to make elements evolve within. This game engine has no consideration about graphical view or layout. It only knows about map "logic", using it's own coordinate system to locate elements.

The client part, however, is where all the graphical representation take place. The client is divided in 2 pieces: the viewer and the user interface (or ui). The viewer is in charge to graphically render the logic representation of the map processed by the engine. This viewer in embedded into a ui in order to being displayed in an OS window. The ui also provider controls over the game process thanks to actions triggered by the user via menus, panels and the viewer itself. So the application is working in a triangle:

Engine -- Viewer
     \    /
      \  /
       ui

When the application is launched, only the ui is working. When the user starts a party (begining a new one, or loading a saved party), it will create an engine instance that will run in a different thread. A viewer is also instanciated and linked to the engine so it can read the map logical representation and render a graphical representation. Then, when the user trigger an action in the viewer, or into the menus and panels, the ui will send the message to the engine.

Summary

Clone this wiki locally