Skip to main content

My question if about resource management. Is it a good idea to store resources like Sounds in an array and then make a second array(lets call this SoundCollections) as a sort of reference table(name + index of sounds array).

The SoundCollection structure looks like this:

struct SoundCollection{
    unsigned char name[64];
    unsigned int offset;
    unsigned int count; 
};

GameObjects can aqcuire a SoundCollectionHandle and use the SoundCollection[SoundCollectionHandle].Offsetoffset in the SoundsSounds array. GameObjectsGameObjects then can call Audio.playsound(Sounds[SoundCollection[SoundCollectionHandle].offset + PlayerSounds::Jump])

Audio.playsound(Sounds[SoundCollection[SoundCollectionHandle].offset + PlayerSounds::Jump])

for playing a jump sound. The

The SoundCollection::count is used as offset for next SoundCollectionSoundCollection and bound checking. The The same thing iI want to use for Sprites and Textures.

Are there any other methods you usealyusually use in your games?

My question if about resource management. Is it a good idea to store resources like Sounds in an array and then make a second array(lets call this SoundCollections) as a sort of reference table(name + index of sounds array).

The SoundCollection structure looks like this:

struct SoundCollection{
    unsigned char name[64];
    unsigned int offset;
    unsigned int count; 
};

GameObjects can aqcuire a SoundCollectionHandle and use the SoundCollection[SoundCollectionHandle].Offset in the Sounds array. GameObjects then can call Audio.playsound(Sounds[SoundCollection[SoundCollectionHandle].offset + PlayerSounds::Jump]) for playing a jump sound. The SoundCollection::count is used as offset for next SoundCollection and bound checking. The same thing i want to use for Sprites and Textures.

Are there any other methods you usealy use in your games?

My question if about resource management. Is it a good idea to store resources like Sounds in an array and then make a second array(lets call this SoundCollections) as a sort of reference table(name + index of sounds array).

The SoundCollection structure looks like this:

struct SoundCollection{
    unsigned char name[64];
    unsigned int offset;
    unsigned int count; 
};

GameObjects can aqcuire a SoundCollectionHandle and use the SoundCollection[SoundCollectionHandle].offset in the Sounds array. GameObjects then can call

Audio.playsound(Sounds[SoundCollection[SoundCollectionHandle].offset + PlayerSounds::Jump])

for playing a jump sound.

The SoundCollection::count is used as offset for next SoundCollection and bound checking. The same thing I want to use for Sprites and Textures.

Are there any other methods you usually use in your games?

Source Link

assets access with index offsets

My question if about resource management. Is it a good idea to store resources like Sounds in an array and then make a second array(lets call this SoundCollections) as a sort of reference table(name + index of sounds array).

The SoundCollection structure looks like this:

struct SoundCollection{
    unsigned char name[64];
    unsigned int offset;
    unsigned int count; 
};

GameObjects can aqcuire a SoundCollectionHandle and use the SoundCollection[SoundCollectionHandle].Offset in the Sounds array. GameObjects then can call Audio.playsound(Sounds[SoundCollection[SoundCollectionHandle].offset + PlayerSounds::Jump]) for playing a jump sound. The SoundCollection::count is used as offset for next SoundCollection and bound checking. The same thing i want to use for Sprites and Textures.

Are there any other methods you usealy use in your games?