android - Andengine - a good rube loader? -
android - Andengine - a good rube loader? -
i took on 2 project found in here: andenginejb2djson andenginerubeloaderextension
as of know i'm developing rolling scene based game i'm loading entities xml file , create them in loading scene increment game width , , doing , in whole level have 500 entities (instead of 250+-) cause performance problems , game "lagging" \ "jumping" , move slow.
my question , if rube loaders back upwards performance issues , improvement or normal andengine loader , need manually load each entity in xml \ json
does develop rolling scene based game same amount +- of entities , tell me right way implement it?
thanks
as don't provide much detail specific implementation provide generic way of handling game of type.
first, need define "active" area game world - area of world needs simulated (i.e. entities in area move , interact world).
your world layout might this:
in illustration world grey block , extends beyond screen boundaries (which black frame). red frame indicates active area - notice extends beyond size of display, not cover entire world. size of area depend on specific implementation/needs.
the active area move along player , hence can represented distance player (in 2 directions).
the basic thought entities (in blue) simulated while within active area. entities right of active area should inactive until come in it, @ point simulation can start - reason, active area should extend amount right of display area entities have initial time run simulation before beingness displayed. 1 time entities leave active area (to left) can stop simulation - , removed if needed.
so in illustration image:
e1 has gone through active area , no longer needed (it can disabled/removed) e2 active , visible (currently displayed) e3 active not visible yet e4 , e5 not active yet , become active 1 time come in active area player gets closer themas how handle entities, depends on size of world, number of entities, etc.
one way create/load entities 1 time come in active area - in case should extend far plenty right of display have plenty time created/loaded before entering display area. best approach big worlds there may thousands of entities. in case may need kind of subdivision world can exclude big amounts of entities processing without checking each 1 - array of fixed sized "blocks", each containing entities within it, work fine in cases simple 2d side-scroller.
another approach load objects @ start , perform simulation updates (such physics, movement, collision detection) them 1 time come in active area. approach works great smaller worlds , provides easier implementation.
android performance andengine game-engine
Comments
Post a Comment