Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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),

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

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

loop{ moving_update(DB); blow_stuff(DB); collect_loot(DB);...}
share|improve this question

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.

Did you ever solve this? – ashes999 Dec 18 '12 at 2:51