GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 2011-05-13 00:04:19

Daniel
Member
Registered: 2011-05-04
Posts: 25

[Discussion] Pokemon Engine, or Handling Lots of Data

I've been having idea's for a Pokemon engine, thus decided to start a discussion about what the absolute simplest and most elegant way to store all that data would be. Feel free to also talk about general database management, ie, how do handle a large project when hard-coding all of it simply isn't possible.

The requirements are:
1) Could be converted to Online play easily.
2) Is space efficient (no data stored in more than 2 places when it doesn't need to be).
3) Is cpu efficient, requiring few file lookups and has few loops.

The conclusion I've come to is to treat it like a large SQL database with several tables. I believe this would be the most precise and efficient way to store all the information in the game. A lot of the databases reference another one, for example, Main references the Owned table, which references the Pokemon table. Any time you catch a new Pokemon it's Pokemon ID would be added to the Owned database along with it's level and moveset, and given a unique OwnID. The "current party" is simply 6 of these ID's referencing pokemon in your Owned database. (The rest would appear in your Computer, in-game, should you wish to switch them out.)

Main ( Name, Own0, Own1, Own2, Own3, Own4, Own5 )
Owned ( OwnID, Pokemon ID, Level, Hp, Move0, Move1, Move2, Move3, PP0, PP1, PP2, PP3, PPMax0, PPMax1, PPMax2, PPMax3 )
Pokemon ( Pokemon ID, Name, Sprite, Evolvesto, Type )
Trainer ( Name, Reward, Sprite, TrainerPokemon0, TrainerPokemon1, TrainerPokemon2, TrainerPokemon3, TrainerPokemon4, TrainerPokemon5 )
TrainerPokemon ( Pokemon ID, Level, Hp, Move0, Move1, Move2, Move3 )
WildPokemon ( WPID, Pokemon ID, Level, Hp, Move0, Move1, Move2, Move3 )
Moves ( MoveID, Type, Power, Accuracy, PP, Callback )
CanLearn ( Pokemon ID, MoveID, Level )
DoesLearn ( Pokemon ID, MoveID, Level )

The Moves table has a Callback entry in case the move has a non-simple effect, such as lowering the Attack or something.

I imagine these would be easy to "extend" with more information, for example, giving Moves an optional secondary type. I also believe that they could work with a Server very well, in terms of transferring your Party data to the other clients. All you'd be sending is Pokemon ID and Level of the one you have selected, and the client would be able to use that information to figure out everything else it needs about that one Pokemon.

Last edited by Daniel (2011-05-13 00:12:59)

Offline

Board footer

Powered by FluxBB