This content has been marked as final. Show 6 replies
I would have "dimension" tables for skills, characters, games, and players. Skills, for example would resemble1 person found this helpful
Characters would resemble
Players would be the online constestants and Games would be used to identify a specific competition. Then you put it all together with some many to many relationships, all in one table. For the sake of a table name, let's call it GamePlayed. Fields would be
other fields you need.
I see where your coming from, and your answer would have been a good solution in perhaps a sports game.
I should have stated how my game would be played or what the game actually is...
Rather than single game events, this web-based game would be an ongoing game, lasting for as long as the player plays (coming back day after day). So for a player to start playing one day and choose his or her skill to learn, that player would then be able to come back the next day (or within hours) and see the skill learnt, depending on the set time for that skill. This skill would then remain within the characters "skills" forever (or until the player is removed or the game entirely reset). The skill would, for example, unlock the ability to do another thing within the game - or even apply more damage to future "battles" when using a certain weapon type within the game.
I hope my general game type is becoming clearer now ;)
So rather than the skills, players and characters all being bundled into game events... the skills would have to be ever-lasting, and assigned only to the player/character than has learnt them.
These skills and their effects would then be applied whenever an action can be affected by the skill.
Hmm... I hope I'm making sense.
Thanks a lot for your reply anyway :) and I'm sorry it wasn't of use to me.
"Thanks a lot for your reply anyway :) and I'm sorry it wasn't of use
Actually Dan was guiding you down the correct database normalization
path. What you have is a classic many-to-many join. You have many
character records and many skill records and you want to join them such
that a character can have 0-N skills (zero to infinity) and a skill can
be used by 0-N players.
This is done with three tables. A character table with the basic
details of a character and a skills table with the details of the skills
and a joining table that connects the two. At a minimum the join tables
simple consists of two fields, a foreign key field to the characters
table and a foreign key field to the skills table. Thus for each skill
a character has there will be one record connecting the two id's
together. This joining table can easily be expanded to have other data
about the character-skill join such as when it started, what level the
character has reached in the skill, whatever else your system needs.
An simple Example:
Character_Skill Join Table
Thus with basic SQL join syntax we can synthesize the data that Joe can
hunt and shoot arrows, Sam can cook and George can do it all.
Omg! I see now!
And as the crowd say when the magician reveals his trick... "and it was so obvious!" hehe :P
Well thanks for the help, both of you :)
I am very grateful.
I'd be interested in seeing your game down the line when you have it ready. I've never seen a game programmed in ColdFusion and SQL, sounds cool.1 person found this helpful