Data Orientated Programming Adding and Deleting Object

Get answers to all your basic programming questions. No Ogre questions, please!
User avatar
AshMcConnell
Silver Sponsor
Silver Sponsor
Posts: 605
Joined: Fri Dec 14, 2007 11:44 am
Location: Northern Ireland
x 16

Data Orientated Programming Adding and Deleting Object

Post by AshMcConnell »

Hi Folks,

I have been reading up recently about DoD and I am trying to do a little experiment in a sub-system of my game (sound).

I think I've understood the main ideas of DoD, but I'm not sure about some of the best-practices for allocating / deallocating and referring to particular bits of data. For example I am hoping to move away from an object that represents all the sound data for a particular car to an object (or set of functions) that will manage all the car sound data. As network cars join the game, sound data is produced for each one and should be allocated (in a structure of arrays(or std::vectors) I believe). I'm not sure what the best way would be to index this data (in order to be able to update the sounds) and to delete this data without expensive ( ? ) moves or fragmentation.

Any guidance would be appreciated

Thanks guys,
All the best,
Ash