Hi !
Featured games (87)
games approved by the League of Dukes
Games in Showcase (670)
Games in Android Showcase (194)
games submitted by our members
Games in WIP (727)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Entity update and render optimization in 2D map  (Read 1569 times)
0 Members and 1 Guest are viewing this topic.
Offline Alien94

Senior Newbie

« Posted 2013-01-09 13:17:00 »

i have a problem with my android game.
It is almost finished but now i have to optimize it to works well on most of devices.
The problem is that i have to update about 80 entities (monsters) each frame and render them. So one for cycle to update them and one to render them.
On devices like galaxy s3, galaxy nexus and others recent devices it works well but in the others, entities update and render process is slows down the game.

I'm using a 48x48 2D tile map and a fixed 60fps time step.
What do you suggest me? How can i efficiently update entities?
Offline alesky

Junior Devvie

Medals: 3
Exp: 15 years


« Reply #1 - Posted 2013-01-09 13:34:34 »

so generic question, impossible help you in this way

are you able to identify the slow part of your application?

divide et impera:
analyze your software
identify part that are slow
verify the possible solution (this can be question to be inserted in the forum)

Offline Alien94

Senior Newbie

« Reply #2 - Posted 2013-01-09 15:44:30 »

I already tried that.
The slow part of the game is cycle 80 entities two times for each frame.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online jonjava
« Reply #3 - Posted 2013-01-09 16:04:02 »

What sort of things are you doing for each entity every update?

Consider if there are events that could be grouped together.

Classic example: Only check for collision when there has been movement. No need to check for collision if the object is stationary.

In case of a bullet, let the bullet check for collisions when it moves and inform the object it collides with of the collision.

Without code we can't really help you analyze the situation.

Offline Best Username Ever

Junior Devvie

« Reply #4 - Posted 2013-01-10 01:18:34 »

I already tried that.
The slow part of the game is cycle 80 entities two times for each frame.

No you didn't. You don't even know whether it is the rendering or the logic update that is slow.

analyze your software
identify part that are slow

verify the possible solution

And if a 48 by 48 grid with 80 entities is too slow to run at 60 fps, then I doubt you can even call it optimization. Something is seriously wrong with your code if that is too much for it.
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

IanParcs (36 views)
2016-04-18 14:18:53

KaiHH (36 views)
2016-04-18 08:35:41

KaiHH (67 views)
2016-04-15 12:43:58

theagentd (69 views)
2016-04-14 02:16:17

theagentd (76 views)
2016-04-14 02:15:43

IanParcs (92 views)
2016-04-12 03:51:16

IanParcs (37 views)
2016-04-12 03:50:03

IanParcs (33 views)
2016-04-12 03:49:54

IanParcs (30 views)
2016-04-12 03:49:52

IanParcs (39 views)
2016-04-12 03:49:52
Website offering 3D Models specifically for games for free
by vusman
2016-04-29 12:56:17

List of Learning Resources
by SilverTiger
2016-02-05 09:39:47

List of Learning Resources
by SilverTiger
2016-02-05 09:38:38

List of Learning Resources
by SilverTiger
2016-02-05 09:35:50

Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!