Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - spinnerbox

Pages: 1 ... 5 6 7 8 9
Ask a Question / Re: Optimizing my game
« on: November 14, 2013, 06:14:38 am »
Some links on how stencyl works under the hood?

It is silly because I am making a memory game and the game works something which I am not aware of. It is bassicaly point and click game on static objects :)

Ask a Question / Re: Optimizing my game
« on: November 14, 2013, 05:54:41 am »
Even on my initial stage where I have only "on create" event and set points var to 0 the game takes 10-20 % processor time.

What things could possibly go wrong? :)

Ask a Question / Re: Optimizing memory allocated by my game
« on: November 13, 2013, 01:59:09 am »
Yup, thanks. I reworked my code and now it is better (It goes up until 100MB :D ). I suppose each time new actor is created stencyl or rather flash keeps track of it in memory. I also changed to "create recycled actor" block instead of "create actor". But again even with my improvements the memory allocated still rizes in time.

The problem I had was, each of the actor had lot of duplicate animations so I separated them into smaller bits.

But again if there are some tricks for improving let me know.

Ask a Question / Re: Optimizing memory allocated by my game
« on: November 12, 2013, 04:58:25 am »
Is there a GC working behind the scenes? :) It seems that memory allocated from previous level doesn't get cleaned.

If I call "empty list" block on a list are the elements cleaned from memory?

It should clean them.

Ask a Question / Re: Optimizing memory allocated by my game
« on: November 12, 2013, 04:39:56 am »
probably its a stupid question. I will try to improve the design.

I suppose the actor will die when the health reaches zero. So you can use event "when updating" and check with "if" block if the health is zero or below. If that happens switch animation to death and add block "do after n seconds" to kill the actor after number of seconds/ milliseconds i.e wait for the death animation to finish and then kill the actor.

Health is a number attribute, you can add it to your behavior on the right panel.

Ask a Question / Optimizing memory allocated by my game
« on: November 12, 2013, 01:52:19 am »
I have 36 levels and I have 36 actors, one for each level. Each actor has at least 6 animations with 9 frames. I did some tests and I published to swf file.

I run the swf file separately and when I start it it allocates around 55 MB RAM which is I suppose ok.

In time, during the play the RAM allocated increases constantly and when I reach 36-th level it is about 200 MB which is alot. It may crash somebodys browser :)

Is there a way to improve this aspekt of the game?

Note: I can improve the actors somehow but I have to change the whole game mechanics which would take me time.

Ask a Question / Optimizing my game
« on: November 12, 2013, 01:46:48 am »
I have only HUD display on my game when playing and it is drawn "on draw" event. It draws only text like current level, score and picks but it takes at least 10 % of processor time all the time :)

Is that ok? I cheked other scenes and behaviors, all of them have "on created" event which goes only once.

Ask a Question / Re: Set up default frame duration
« on: November 11, 2013, 04:40:37 am »
Nice! It works, thank you :)

You can also use "switch animation" block in Actor->Draw section to switch to death animation and then use "kill" block also in Actor->properties section to remove the actor from stage.

There is also time based block "do after n seconds" in Flow -> Time section.

Ask a Question / Set up default frame duration
« on: November 11, 2013, 04:32:09 am »
Is there a way to set up default frame duration in each animation.

I have 36 actors with roughly 6 animations and each animation has 9 frames. By far I had to rework the actors 2 times and each time I have to set for each frame in each animation from 100ms to 50 ms which is lot of redundant work.

Is there a way to ease this up?

If no than ok I can handle it.

Note: I am using stencyl 2.2.0

I managed to fix this by adding code that will set all zeroes to the same list when initializing the game. It works this way i.e all non played levels are zeroes now instead of [object Object]

But still this is a workaround. What is actually happening?

If somebody knows please let me know.

Hello. I have 36 levels in my game and I keep track of score achieved for each level. I have a game attribute aka list which when firstly played it has all zeroes. I recently added code for saving game data locally so that I can continue later from the level I stopped. It works well except this list of scores when the game is loaded contains values of type [object Object] instead of zeroes.
Only the score for levels I have played remains number in the list.

What do I do in this case? How can I check if something is [object Object] and replace it with zero.

Ask a Question / Re: Creating actor by its name
« on: October 29, 2013, 06:22:49 am »
Wow nice! It works :)

Ask a Question / Re: Creating actor by its name
« on: October 29, 2013, 05:18:14 am »
I haven't worked with custom blocks and code in stencyl, though I know to code AS3 very

What would be actually staying in this getActorTypeByName() function?

Anyway this is a real progress if I implement this it will save me a lot of extra redundant work.

Pages: 1 ... 5 6 7 8 9