FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


So I am making this game.....





polly-gone
Okay, so I am making this game and it is a sort of medieval based browser game. It has tons of customizations, but I can't figure out how to sort them all out.

See, here is my dilemma:

In the game, there is a machine shop that can make different kinds of siege weapons.

One of the weapons is a battering ram.

The battering ram has a ton of customizations. 4 different kinds of wheel, 2 different kinds of braking system, 5 different Ram heads, 4 different things to make it stronger 5 different kinds of support structures.

My problem is that, in the machine shop, someone could select to build 10 battering rams with basic wheels, a hand brake, a steel ram head, a spike in the head, and a square structure.

Then they could make 20 more rams that have steel wheels, grappling hook brakes, a blunt steel head, an archer deck, and a triangular support.

These two different types of battering rams will have different attack and defense strengths and different purposes.

My problem is storing the information of who has how many of what ram. I didn't even list all the combinations. There are hundreds of total combinations.

What would be the best way to store the data saying Player A has 500 of the first kind I listed, 20 of the second kind, and 500 of some other combination, while Player B has something totally different.

I was thinking that maybe each individual weapon could have it's own database with every possible combination in it, and every combination is numbered and in the user's file it would show what numbers the player has. Would this work? Anyone have any ideas for simpler way?

Thank you so much,

-Nick Smile Smile Smile
DjMilez
It'd seem more efficient in my eyes to have a table for every weapon instead of a database =/
rvec
just have this in a database:

first all objects as they can be bought (no upgrades)
object id --- attack --- defense --- ....

then all possible upgrades
upgrade id --- attack -- defense -- description --...

then combine those where possible (only a ram can get a new ramhead)
upgrade id --- object id

and in the end have a database with all stuff the users bought
item id --- object id --- user id

then you could add the upgrades in the last table as an extra column where all upgrade-ids are in one field (like this '2,7,13,19,5'), or you could add an extra table with item id and upgrade id. I think the second option would be better, but the first might be easier.
polly-gone
Thats what I mean. Since I use DirectAdmin and phpMyAdmin, for some reason, I call tables databases since I never have to actually manually deal with the database itself. So every weapon having it's own table with all possible combinations seems like a good idea?

-Nick Smile Smile Smile
polly-gone
rvec wrote:
just have this in a database:

first all objects as they can be bought (no upgrades)
object id --- attack --- defense --- ....

then all possible upgrades
upgrade id --- attack -- defense -- description --...

then combine those where possible (only a ram can get a new ramhead)
upgrade id --- object id

and in the end have a database with all stuff the users bought
item id --- object id --- user id

then you could add the upgrades in the last table as an extra column where all upgrade-ids are in one field (like this '2,7,13,19,5'), or you could add an extra table with item id and upgrade id. I think the second option would be better, but the first might be easier.


Would this be efficient since it is possible, once someone has researched all the upgrade, to make one or 10000 rams of every possible combination if they wanted to?

-Nick Smile Smile Smile
Related topics
Want to start making games?
Game making - anyone interested?
Game Making
Screen Shots from some games I made
Looking for advice on making a good video game based website
moola.com
Cool Game Making Software !!!
I'm Making a web based game and need your help!
Making new virtual sim game. Nee'ds load's of things-Inside
The Game creation topic! - Share experience - Find resources
Garry's Mod
Utopia - A Game I'm Making
Gamedevelopment
Does someone design games?
Making game table terrain
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.