Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am studying entity indexed components and came up with a naive C++ implementation which just iterates over all entity "hash tables" and applies update/delete/insert functions in place. I'm having trouble maintaining a logical view of the game world (i.e. updates shouldn't be visible while iterating) and there is no attempt at maintaining spatial or temporal coherence of data.

I wonder whether there are libraries suitable to store components that are commonly found in games (position, movement, hp etc.) and allows ~500 queries per second on a netbook class computer over a database of ~10000 components total. Or is this even feasible? How much I can accomplish with this approach?

In essence I want to be able to do something like this with reasonable efficiency:

moving_update(DB) :- alive(DB,A),alive(DB,B),wontcollide(DB,A,B),
                     move(DB,A),move(DB,B).

wontcollide(DB,A,B) :- get_component(DB,position,A,PA),
                       get_component(DB,position,B,PB),...

move(DB,A) :- get_component...,update(DB,position,A,NewP).

DB=loadgame();
loop{ moving_update(DB); blow_stuff(DB); collect_loot(DB);...}
share|improve this question
Did you ever solve this? – ashes999 Dec 18 '12 at 2:51

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.