Database with Global description data

Game development with Board Game Arena Studio
Post Reply
User avatar
Mistergos
Posts: 79
Joined: 18 September 2011, 16:59

Database with Global description data

Post by Mistergos »

Hi there
I am quite new here. I have been through all the tutorials i could but cannot find an answer.

I am currently developping a car race game. My track have a lot of possible locations for cars (among other datas) that are precalculated.
So i need a table for all my games/races populated with the exact same data (referential).

If i understand it well, my database is recreated each time a game start.
Is it possible to have several referential database tables available for all my games not recreated at the start of each of them?
User avatar
A-dam
Posts: 107
Joined: 28 September 2013, 18:15

Re: Database with Global description data

Post by A-dam »

Hi

Im not sure I understand your question correctly, but if those data are exactly the same each time, why do you need to store them in the database? You could for example use file material.inc.php with definitions of possible locations for cars? Or you could use whatever format suits you the most..

To your database you can just store positions of cars eg game/player/car specific.

I dont see reason why to use database for static datas.

Adam
User avatar
Mistergos
Posts: 79
Joined: 18 September 2011, 16:59

Re: Database with Global description data

Post by Mistergos »

Hi thanks for your answer.

My game has 10 different tracks. (Track table)
Each track has around 130 possible car positions (X,Y, rotation, and game rules specific data) (Location Table)
Each location has 2 to 3 next locations with game rules data (Transition Table)
Each location has 2 to 3 Adjacent locations (Adjacent table)

Game is Rallyman GT. Track is made of hexagons. So each track needs to be described with a lot of data. These data have already been precalculated.
So i need a way to make these data available on server side for the rules part.

I could use a file if there is no other way. But that basically means load the database with same data at the beginning of each game. Or create my own homebrew data storing system which does not seem a good idea.
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: Database with Global description data

Post by Een »

Hi!
Indeed every game is separate for scalability.
So there is no common referential table that you can access from one game to another.
As suggested by A-dam, describing the tracks as php associative arrays in materials.inc.php can be appropriate (that's what we did for example for the different configurations of the Tobago island, which were also precalculated).
User avatar
Mistergos
Posts: 79
Joined: 18 September 2011, 16:59

Re: Database with Global description data

Post by Mistergos »

Here is an track example to make myself clearer.
Attachments
track.png
track.png (145.44 KiB) Viewed 1125 times
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: Database with Global description data

Post by Een »

(You could also have one file per track in the modules directory and include only the one you need)
User avatar
Mistergos
Posts: 79
Joined: 18 September 2011, 16:59

Re: Database with Global description data

Post by Mistergos »

OK si ill go with a specific sql file per track to create and fill 3 tables at the start of the game. Hopefully, it will not talke too long.

Thanks all for your support
Post Reply

Return to “Developers”