Take the 2-minute tour ×
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
add comment

closed as off-topic by Josh Petrie Dec 16 '13 at 21:33

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions that are about "which tech to use" are outside the scope of the site. For more information, see this meta post" – Josh Petrie
If this question can be reworded to fit the rules in the help center, please edit the question.