Hi,
using the delegates itself should not lead to problems i think, at least i did some tests with this and garbage collection, and i didnt need to do anything special to delete delegates or something. One instance where problems might occur is for example fwhere you use Key.addListener Mouse.addListener etc and you dont remove these listeners properly. If the memory usage when the game is running slower doesnt really differ from when its running faster, you might wanna delve into your program deeper with a tool like xray or something. Another option would be to disable parts of your engine ofcourse to try and narrow it down. tough one, i'll take a look at your engine when i have the time, thanks for the link!

greetz
Hans



At 11:39 AM 12/15/2005, you wrote:
Hello Hans,

I've been testing the game with the taskmanager open for
several hours.

I'm not using a textfield to debug anything at the moment.

The memory is going up, but not consistently. The game has many
backgrounds and tilesets (complete themes) but I use only one of each
theoughout my tests, to keep the parameters minimum.

Sometimes the memory adds up 2MB, for no apparent reason
when a level is finished and the game moves to the next level. And other
times (which is more often) the memory does not increase from level to level.
Also, during a level sometimes there are a few KBs added.

I'm thinking that maybe objects are not garbage-collected because of the Delegates.
I think this has been discussed before, but I can't recall a definate answer
if this is a problem and what is a possible solution.

The framework is not open source and it's not a commercial product
(at least not yet).
If you like, you can see a game I built with it at
http://www.total-eclipse.gr/academy-of-magic-word-spells/

Dimitrios Bendilas


----- Original Message ----- From: "Hans Wichman" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <flashcoders@chattyfig.figleaf.com>
Sent: Thursday, December 15, 2005 12:11 PM
Subject: Re: [FlashCoders] game slowing down - eventListener


Have you tried opening the taskmanager to see if your memory is hogging?

The game im working on slows down as well, but this is simply becoz im printin debug info to a textfield (will be replaced with xray ;)) and this takes longer to update as the contents get bigger. A game should not slow down, no matter the approach u take.

As a side note is it a commercial framework/opensource etc?

greetz
Hans


At 11:03 AM 12/15/2005, you wrote:
Hello everyone,

I have built a big, complex framework for creating 2D games in Flash.

I have developed 2 large projects based on it and I'm experiencing
a slow down as the game progresses. A while after you begin
playing, things start to slow down and in 20-30 minutes the game
is no more fun to play as it becomes much slower. They are both
tile-based puzzle games. I'm using Flash 8 and FP8.

The framework is written in AS2 and it uses a callback system
for communication between classes (e.g. tileManager.onEvent = Delegate.create(this, ....))

The use of Delegates is very common throughout the framework. I'm using the Delegate version that supports parameters too, so I often pass complete instances of complex objects
as parameters.

I have tried to use .destroy() on everything I can, so that objects get deleted from memory.

Do you think the framework could benefit from an eventListener-system approach instead of callbacks?
Will I be able to make the slow-down dissapear or decrease?

Any thoughts would be very welcome.

Thanks!
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to