Skip to content

Profiles

JohanJansen edited this page Feb 10, 2015 · 2 revisions

Egoboo uses something called Profiles. When drawing many creatures or scenery objects such as trees on the screen, it would be inefficient to store a copy of the data associated with each object in the game (sounds, textures, 3D model, etc.).

Take for example the trees mentioned earlier. If we wanted to draw a forest we could do it like this: Inefficient Memory Use

But you see that there are a lot of resources re-used by each object instance. This is where Profiles come into the picture. Each GameObject in has a Profile, which contains all the data on what that GameObject should look, sound, feel and behave like. Profiles are loaded once at game start and can then be re-used to spawn many GameObjects. Now we have something that looks like this: Use of Profiles to spawn GameObjects

Now we can spawn a hundred trees with much less overhead and duplicate memory usage. The terminology Profile is used by different types of game resources:

  • ObjectProfile - A ObjectProfile contains all the sound effects, AI script, ParticleProfiles, EnchantProfile, 3D model and textures associated with any GameObject. It could represent anything from a Player, a Sword, a Monster or even a Tree.
  • EnchantProfile - Enchantments are sustained effects on a GameObject that affects it's characteristics (flying, poisoned, see invisible, etc.)
  • ParticleProfile - Particles are small 2D sprites that can collide and deal damage (fire, smoke, arrows)
  • ModuleProfile - Modules are game levels such as dungeons, towns or a forest
Clone this wiki locally