Type Database
Store information which is common to Model types.
PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro — $3/month.
[size="5"]Intent
[size="5"]Problem
[size="5"]Solution
[size="5"]Structure
[size="5"]Examples
- Prototype state; e.g. max hit points, strength, range, cost, etc.
- Size, extents, initial orientations.
- Type categorization. (e.g. offense, defense, mobile, fixed, human, alien, etc.)
- Execution scripts. (See Usecode.)
- Artwork; e.g. meshes, texture-map, sprites. (These are frequently stored by reference to yet another database.)
- Sound effect handles or references.
- Appearance maps. (See Appearance Map.)
Alternately, type lookups may be delegated to an object. For example: modelBeingSorted->getSize(). The delegated method allows a sub-class to override in strange cases. For example:
int Spaceship::getSize()
{
int size = getType()->size;
if (shieldsUp) size *= 2;
return size;
}Type databases often contain tweaky constants which are adjusted for game play reasons near the end of a project. Also, these constants may be editable by the players or mission builders. Consequently, type data is often loaded dynamically from text files or similar human readable input.Art importation is often closely associated with the type importation. It is common to see a compile-time tool(s) which handles both.
A type database is usually read-only after game initialization, but may be read-write in editor mode.
Type Databases occasionally implement Factories (See Design Patterns) to generate specific Model or Controller objects on demand by either type number or type name. This is especially common in edit modes.[/bquote]
[size="5"]Related Patterns
Type Database may store global data for Appearance Map.
Type Database may act as a Factory for Model or Controller objects.[/bquote]
Related Tutorials
Balancing Game Development and Creative Direction in Indie Production
A practical look at how indie developers can balance creative direction with hands-on game development. This article co…
My Unreal Engine Development Process: From Core Idea to Playable Build
A practical overview of my Unreal Engine development process, covering how I move from a core game idea to a playable b…
Introducing LaneGraph: The Ultimate Road Network Solution for Unity
Discover the power of LaneGraph, a lightweight and flexible lane-based navigation system for Unity. LaneGraph makes it…
Retargeting Mixamo Characters with Root Motion In Unreal Engine 5.4.
I have always found Retargeting Mixamo Characters To have Root Motion is a serious lengthy Tast, Recently I stumbled up…
How To Make A SIMPLE Main Menu In Unity
In this tutorial for unity, i go over how to make a simple main menu for unity, it's an unlisted video because i do not…
Guide to Gameplay Balance
A perspective on competitive gameplay balance, from a background of "shooter" sandbox design.
Discussion
More from Zachary Booth Simpson
Comparing Shadow Mapping Techniques with Shadow Explorer
New Incentives and a Whole New Platform From The Intel AppUp developer program
The final installment in this series on Intel's AppUp program details additional incentives and opportunities for devel…
The Game Maker
This book excerpt contains the first chapter of the book that introduces beginning game developers to the Game Maker pr…
Discussion