pila
pila

Reputation: 929

Best Practice: How to realize a browsergame "building system"?

i am developing a browser game and stuck on a "theory problem". I want to make the user to "level" specific buildings to gain better stats.

Example:

Now my question is, whats the best solution to handle it in the mysql database? What table setup's would you prefer and how to mange the "lvling" thing?

Would it be good to make a table called "buildings" and another one with "user_buildings" where a link to "buildings" is with actual level? Or are there better solutions?

Please help me with a good brainstorming :)

Upvotes: 0

Views: 182

Answers (2)

Dylan
Dylan

Reputation: 1

Im making a Browsergame and Just finished the building System for the Resources and I made something that Adds a Timestamp to A Database and process / upgrade the Building AFTER the user logges in, using Real-Time Handling..

I'm Using A simple logic script that calculates the time depending on Server Speed and Bulding LVL.

Upvotes: 0

user529543
user529543

Reputation:

in the buildings table I would keep the buildings "definition" like hours needed to upgrade from lvl 1 to2 is X, from 2 to 3 is Y...

in user_buildings I would keep the users curent building, like: Coal Mine, located apt partition of map z, built started at u, current level u...

Upvotes: 1

Related Questions