Wiki

Clone wiki

Caesaria / Reverse engineering Caesar 3 (mathematical model of the city)

Created by dalerank Translated by Anastasia Smolskaya

Everything starts with the status value of the land which is taken into account in the game for calculation of the migration parameters and levels of houses. Each level as well as basic levels (interdependence of which is shown on the table below) can be additionally subdivided into parts.

R4.jpg

In the town people live in houses, the number of people and quality of housing is different for each level, each level has a number of parameters and after having acquired them all it can reach next level. As I have already told the basic parameter is the status value of the land, another basic parameter is provisioning, in a small town this may pass unnoticed but in cities the map location of residential blocks strongly depends on the proximity of barns and store houses. Bearing in mind the fact that the market has negative influence on the surrounding territory and the priority of the tradeswomen is closer to provisioning of the community with food, it is often the case when because of the food shortage you can feel the scarcity of other goods, mainly of the most valuable goods (for house development) – clayware and furniture. Every following level of housing requires more expensive services and resources. Thus, we get classic (social) hierarchy of needs.

R2.jpg

On a definite stage of development houses turn into mansions and significantly improve the rate of the town but degrade the number of workers in the town: patricians do not work which leads to a significant slow down of production and results in massive escape of townsmen, and if at some stage of the game you miss these “population swings” you may fail the mission. It is possible to invite new people but huts make wealthy townsmen leave their houses and the rate of prosperity goes down. 

Basic levels of the town can contain sublevels that are responsible for a certain parameter or provided service. Thus, healthcare, for instance, can be subdivided into general (doctors and bath houses) and specialized which is needed by patricians (hospitals) but it can also substitute the functions of the general, for example, hospitals provides services of GP and surges but the price is much higher than at doctor’s house. The same situation with entertainment with an exception that for entertainment buildings it is necessary to have so called apprentices: for the theatre these are actors, for coliseums – gladiators and lions. It is a seemingly insignificant detail but such gentle micro governance has a strong influence of town planning on conditions of restricted area of coverage of buildings. 

R3.jpg

Having made a decision about the components of “the city life” it is possible to create a mathematic model of the town. It should be noted that the original game uses the probabilistic model of the town which means that at certain time (game day, week, month and year) it (game) makes a snapshot of town parameters that is used (together with previous states of parameters) for calculating probability of an event. Simplified description of the model is shown below. Red shows negative influence of one object on another, green – positive. The plus of the probabilistic model is that it is unnecessary to take into account parameters of one object because average parameters are considered which significantly decreases the workload of calculations (let me remind you that the game was run on computers with RAM < 32Mb). Although the buildings have their own characteristics in the majority of cases they are used for calculating average parameters but not for calculating the situation for a certain building.

R1.jpg

In the game remake we initially provided for dynamic town model, similar can be seen in “Tropico” game, where each game object has a set of characteristics that is used to choose the object behavior at a certain time. In this case the set of connections is more complicated and depends on a certain object, for example, the house parameters depend on the number of people who live in this house and the number of people who work there, the presence of food and goods as well as the money for buying them at the market. The picture shows a simplified model for calculating the parameters of the house.

uY7EaG.png

The probability calculation is transferred from the town level to the object level which makes it necessary to introduce additional connections between the objects for their interaction, in the remake the mediator’s role is played by “service providers” (carriers, bath house servants, sacrificers, apprentices, etc.). Therefore, the behavior model of objects that interact through the mediator changes.

Dynamic.jpg

The usage of the dynamic model creates more complications for programming the logic of certain objects because it is necessary to take in account the influence and the type of the source. The plus of such a model is the flexibility of tuning the both of the sources of event and its agent. Any kind of dynamic modeling should evaluate time-dependent processes and answer the question: “What if?”. What if because of the large flow of migrants there will be famine in the town, in what way the epidemy, fire or earthquake will spread.

#Differences from the Original Game #

What about remake, CaesarIA is an independent game with an open source code, an attempt to revive the game with more than 15 years of history from Impressions Games.

No this is not Cesar, I use the ideas from this game, but the code is written anew: logic, maps, search of the way and other things that you are used to from the old Cesar have something in common with the old game, but they are different. Yes I use ripped resources for test assemblies, if legal issues worry you, you are free to choose the mode with original archives from the honestly purchased copy.

I talked to artists from gamedev.ru and my friends designers and we set the average price of 3D models (and textures correspondingly) of buildings and people: $6K (102 models of buildings + animation) for buildings, $4k for people and environment. This will allow to avoid claims from right holders and make it possible to create the game for desktop PCs as well as tablets with Android and iOS. At the moment I have done everything I planned until the autumn this year with the game world, but I am alone and I hope that help from other people will give the unique style to the game. Now the project is at the point when it has development difficulties without new textures, buildings, sounds and other materials.  

Updated