Performance Questions

Non-platform specific questions.

Performance Questions

Postby fauldran » Tue Jan 31, 2006 8:14 pm

In an attempt not to make a post about general performance issues...

I'm working on a maze game for the PPC. Fairly simple little thing, walk through hallways, avoid ghosts and traps.

Each level is segmented into many areas, each area contained in its own isolated activation region. The game is in an isometric perspective. The floor in each region is one actor consisting of many tiles and the walls in each region are an actor consisting of many tiles.

Heres the thing, I can create a fairly large area with no ghosts or traps in it. This area runs smoothly at about 24fps while the view is moving. (Keep in mind this is on the PPC 100mhz device.) I can add a single trap or a single ghost with no performance loss.

If I add more than one ghost or more than one trap then the frame rate drops to around 13fps while the view is moving. As soon as the view stops moving the frame rate returns to 28fps. This holds true whether the area is the size of six screens or one screen.

Also it does not seem to matter what scripts are active on the ghosts. They can be stationary with no scripts running and I still get the same performance decrease.

I have considered that this is all simply because the device I am testing on is only 100mhz. I don't have anything else to test on yet. The only basis for comparison I have are other games. The EverQuest game, Atomic Battle Dragons, A Bloody Mess, ... These all run fine. (At 20fps or higher where I could get an exact frame rate.)

I have also done the obvious to try and optimize :disabled collision and other events where possible, broken down the levels into reasonably small areas, ...

Anyway, I ramble on...

Here is a list of specific performance questions:
:?: Indexed Transparency vs Alpha Transparency
I assume that indexed is always going to be faster having pixels that are either 100% or 0% transparent. Is this correct?

:?: 50% Transparent Pixel
In an alpha mapped image is it faster to draw a pixel with 50% transparency vs 20% or some other value not 100%, 50%, or 0%?

:?: Overdraw
Is it true that the more actors you have overlapping the longer it takes to draw a given pixel in the overlapping area?

:?: Drawing Actors Outside the View
Are actors that are within the same activation region but outside the view still drawn?

:?: View Movement
Why does it affect the frame rate so dramatically when the view is moving?

:?: Animations
When an actor is created are all the animations for that actor loaded into memory or only the active animation? How does this work with a tile actor?

I just can't help feeling like I am missing something fundamentally simple here that I could do to make my game run better. Any tips, suggestions, or people interested in testing my game on other PPC devices will be greatly appreciated.

I want to say thanks to Makslane for all the support he's given me so far and to the rest of the community for some very helpful posts throughout this forum.

Thanks.
fauldran
 
Posts: 43
Joined: Tue Dec 20, 2005 10:52 am
Score: 0 Give a positive score

Postby Kodo » Tue Jan 31, 2006 8:43 pm

I dont mind testing your game out for you. My PPC is an ACER n30 (200mhz), I've had frame rate issues on my game which I've put down to the fairly slow cpu; so far I've been able to manage the problem by making sure nothing is able to 'recieve events even if out of vision' (which is the default when you create an actor) and keeping the overall file size down as the amount of used/free memory can also effect your fps.
User avatar
Kodo
 
Posts: 449
Joined: Thu Oct 20, 2005 8:20 pm
Location: UK
Score: 23 Give a positive score

Re: Performance Questions

Postby makslane » Tue Jan 31, 2006 9:04 pm

fauldran wrote:Here is a list of specific performance questions:
:?: Indexed Transparency vs Alpha Transparency
I assume that indexed is always going to be faster having pixels that are either 100% or 0% transparent. Is this correct?


The solid areas in your image (0% transparent) will be render faster than transparent areas. So, avoid change the transparency of the actor, keep it solid, and don't use images with alpha channels.

:?: 50% Transparent Pixel
In an alpha mapped image is it faster to draw a pixel with 50% transparency vs 20% or some other value not 100%, 50%, or 0%?


0% transparent will be render faster than transparent areas.
There is no differences if the transparency is 10%, 50, ...

:?: Overdraw
Is it true that the more actors you have overlapping the longer it takes to draw a given pixel in the overlapping area?


Yes. In the changed areas, the background actor will be draw first, followed by the actors with greater zdepth.

If you have the view moving, whole actors in screen will be rendered


:?: Drawing Actors Outside the View
Are actors that are within the same activation region but outside the view still drawn?


No, only the visible areas that need redraw.
If your view don't move, only the area cover by moving actors will be rendered.

:?: View Movement
Why does it affect the frame rate so dramatically when the view is moving?


Because whole screen need render again.

:?: Animations
When an actor is created are all the animations for that actor loaded into memory or only the active animation? How does this work with a tile actor?


Only the need frames will be loaded (even for tile actors).
You can play a long animation (with more than 1000 frames, for example) with no problem.


I just can't help feeling like I am missing something fundamentally simple here that I could do to make my game run better. Any tips, suggestions, or people interested in testing my game on other PPC devices will be greatly appreciated.


For slow machines Game Editor need a better collision detection algorithm.
Will be improved in the next versions.

I want to say thanks to Makslane for all the support he's given me so far and to the rest of the community for some very helpful posts throughout this forum.


Thank you too!
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby marathon332 » Tue Jan 31, 2006 10:53 pm

Regarding performance, what affect, if any, does putting code on the draw actor have on performance?

Is this a problem on pocket pc or smartphone?

Also, do Game Editor games cache anything on Pocket PC?

I'm having issues with erratic performance from time to time. This requires a soft reset, then the problems disappear.

I'm running this on Axim X50v 624mhz and it's only a 2MB game.

One more thing, it's my understanding that Game Editor games are Windows Mobile 5.0 for Pocket PC compatible. Is that correct?

--Steve

Check Out Alien Jump.
My first Game Editor game at:
http://xrl.us/js8k
(shortened URL)
User avatar
marathon332
 
Posts: 57
Joined: Tue Sep 06, 2005 4:00 am
Score: 2 Give a positive score

Postby fauldran » Wed Feb 01, 2006 6:12 am

Thanks. That clears up much for me. Not to pile questions on more questions, but ...

:?: Image Color Count
I read somewhere that all graphics are converted to a GE format for optimum performance. Specifically for pocket pc images are converted to 16bit. Does it make any performance difference depending on how many colors are in the image?

:?: Z Depth of a Tile Actor
In an isometric game managing the z depth can sometimes be tricky. When it comes to tiles I assume each tile shares the same z depth(being that it is one actor). What determines that depth? Center of the tiles actor, first tile, ...?

:?: Collision Optimization
Is it true that disabling collision events for actors that have no collision events improves performance? Even though actor A has no collision event, is it better to disable event collision for actor A when the actor is created?

Is it better to break up large actors that detect collisions? For example walls. Each area contains a walls actor that is very large and irregularly shaped. Not square. Would it be better to break the walls into several actors or leave it as one actor?

Does shape affect collision performance? Is detecting collision with a square faster than a circle?

:D Receive events even if out of vision
Thanks Dr Reed for pointing this out to me. I noticed performance improvements immediately when I started trying this.

I'm sure I have more questions but this is all my late night brain can put together coherently.

Thanks Again
fauldran
 
Posts: 43
Joined: Tue Dec 20, 2005 10:52 am
Score: 0 Give a positive score

Postby Game A Gogo » Thu Feb 02, 2006 12:58 am

fauldran wrote:Does shape affect collision performance? Is detecting collision with a square faster than a circle?


i tink i can enswer this one...
no, it dos not affect the colision, but, there may be some epxection:
1. depens on what type the colision is(action, or physical respond)
2.depens on where and from which way it touchs it.

but these epxection are rarelly visible, so, it dos not really matter which shape you choose.

if I would be you, i would choose the shape that needs to be use.
ex:using a triangle insted of a quadrupal shape(a shape that has 4 sides, can be in any position.

fauldran wrote:Is it better to break up large actors that detect collisions? For example walls. Each area contains a walls actor that is very large and irregularly shaped. Not square. Would it be better to break the walls into several actors or leave it as one actor?


no, because if you do that, there will be too much actor to render whit all the events that comes whit it.

ex:
insted of an actor sized 1000x1000, i break it up in 10 actor, it will do 10 actor sized 100x100, then lets say that the 1000x1000 actor has 24 events, well, the events will be duplicated by 10, that will come up whit 240 event, thats a lot of event to render at the same time.
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby makslane » Thu Feb 02, 2006 4:30 am

fauldran wrote: :?: Image Color Count
I read somewhere that all graphics are converted to a GE format for optimum performance. Specifically for pocket pc images are converted to 16bit. Does it make any performance difference depending on how many colors are in the image?


No, there is no performance differences

:?: Z Depth of a Tile Actor
In an isometric game managing the z depth can sometimes be tricky. When it comes to tiles I assume each tile shares the same z depth(being that it is one actor). What determines that depth? Center of the tiles actor, first tile, ...?


Zdepth is defined in the Actor Control

:?: Collision Optimization
Is it true that disabling collision events for actors that have no collision events improves performance? Even though actor A has no collision event, is it better to disable event collision for actor A when the actor is created?


If you have an actor B with event collisions with Any Actor, it's better disable the collision events for actors that no need it.
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby makslane » Thu Feb 02, 2006 4:38 am

marathon332 wrote:Regarding performance, what affect, if any, does putting code on the draw actor have on performance?


It's more fast use actions without script.
If you need just set the position for some actor,
it's better use the Move To action.


Also, do Game Editor games cache anything on Pocket PC?


No, and the memory management monitors the memory load to deal with low memory conditions.

I'm having issues with erratic performance from time to time. This requires a soft reset, then the problems disappear.


May be the system doing some work

One more thing, it's my understanding that Game Editor games are Windows Mobile 5.0 for Pocket PC compatible. Is that correct?


Tha games are compatible with Pocket PC 2002, Windows Mobile 2003, 2005 systems (for Pocket PC and Smartphones)
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Novice » Fri Feb 03, 2006 5:39 pm

Is it faster to use x and y infinite actors or just create as much tiles as you need?
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby makslane » Fri Feb 03, 2006 6:20 pm

Infinite actors
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby ericdg » Sat Sep 02, 2006 12:45 pm

I know you already touched on this but I want to make it clear.

If I want actor A to follow actor B, should I use the move to function under a draw actor, or use
Code: Select all
angle = direction(x, y, yourhero .x, yourhero .y);
directional_velocity = 10;
under script editor in a draw actor event.

I imagine using the move to will be faster, how much of a difference would it make if you had lots of actors performing this action?


Is it always faster to use the actions in game editor instead of doing the same actions with a script?
ericdg
 
Posts: 53
Joined: Tue Nov 29, 2005 1:18 pm
Score: 1 Give a positive score

Postby makslane » Sat Sep 02, 2006 1:04 pm

If you want to change the actor velocity (xvelocity, yvelocity or directional_velocity), you can put this change in a event other than 'Draw Actor'. Put the velocity changes in a 'Draw Actor' event only if they always change.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby ericdg » Sun Sep 03, 2006 7:57 am

Ok, I didn't think of that.

But, which one would be faster for slow devices, using script or move to.


Would it always be faster using game editor actions or would script ever be faster?
ericdg
 
Posts: 53
Joined: Tue Nov 29, 2005 1:18 pm
Score: 1 Give a positive score

Postby makslane » Sun Sep 03, 2006 3:43 pm

The actions are faster than script execution
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest