Improve IgeEntityBox2d to get fullscreen scrolling 2d game

Post your help queries and engine programming questions here

Improve IgeEntityBox2d to get fullscreen scrolling 2d game

Postby Epsilon » Thu Feb 11, 2016 2:00 am

Hi Rob,

I made a decision to continue my 2D MMO game development with Isogenic. I've asked some question early and now I have a different thoughts.

My plan is to use simple sprites at the client side, while all movements will be done at the server side (all physics, collisions etc). This game is planning to be full-screen 2d game with whole screen filled by 2d 32x32 sprites and actual map intended to be relatively big (100 x 100 tiles for now). I want most of sprites to be static (like walls), others will be moveable (like boulders, stones etc) and some player-controlled sprites of course.
Any sprites can have animation. Thats why I used IgeEntityBox2d to display them.

However I found that map full of IgeEntityBox2d objects works MUCH SLOW than simple IgeTileMap2d. Even if I use 1-frame animation for all of them. I found that IgeEntityBox2d object rendered each tick, no matter if it was not changed or not visible.

What is my plan to improve speed:

1. Ensure that no physics algorthms applied to sprites at client side (I will control them from server, where all movement will be implemented). Only thing I need at client side is animation.

2. Modify IgeEntityBox2d to stop render sprites which is not actually visible (for example, out of browser window bounds).

3. Modify IgeEntityBox2d to stop render sprites which was not changed (coordinates/rotation/texture/animationframe was not changed) and no other sprite overlap it, so there no reason to redraw.

Currently I have 60-70ms to redraw 3000 sprites and it is very slow. I hope to have 30 Hz at least for 100 x 100 map, since it is relatively simple 2d graphics game. I've also tried to detect a reason why IgeEntityBox2d much slow than IgeTileMap2d elements, but no success yet. It would be very good if you can say where is a reason of slowness can be.

Could you please tell me if some functionality (1,2 or 3) is already implemented in Isogenic? How I can activate it?

Could you give me any recommendations or help to implement that (in case not yet implemented)?

Thanks a lot!
ZX Spectrum fan and game developer in the past. Wanna be game developer in present again.
User avatar
Posts: 13
Joined: Sat Sep 26, 2015 9:40 pm
Location: Russian Federation

Re: Improve IgeEntityBox2d to get fullscreen scrolling 2d ga

Postby rob » Thu Apr 21, 2016 7:34 am

Hey ya,

You should create the tiles that are static via the tile system and then create single large rectangle box2 entities to surround the static tiles that are contiguous. That way you can have many tiles but only 4 or 5 static box2d entites around them. For instance a "wall" might be made up of 6 tiles vertically but there is really only 1 wall so you only need one box2d entity to cover it.

The box2d entities should not need to exist on the client-side at all I think... they should be represented by IgeEntity instances since client-side there is no physics running. It's been a very long time since I played with (or coded anything for) the engine but there definitely shouldn't be 3000 box2d entities in memory... you need to combine them to reduce the number of entities as I described above.
CEO & Lead Developer
Irrelon Software Limited
User avatar
Site Admin
Posts: 316
Joined: Tue Oct 22, 2013 5:08 pm

Return to Help & Questions

Who is online

Users browsing this forum: No registered users and 1 guest