Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Pages: 1 [2] 3  All

Author Topic: unload scene  (Read 15681 times)

0 Members and 1 Guest are viewing this topic.

hubertMichael

  • Regular poster
  • ***
  • Karma: 3
  • Offline Offline
  • Posts: 155
    • View Profile
    • Shadow Of Nebula - our point'n click adventure game
Re: unload scene
« Reply #15 on: May 30, 2013, 05:54:02 PM »

I don't want to dig that deep but I must. Thanks for this command. I'll try. If I will find something I'll write here.
Logged
Shadow Of Nebula fan page:

https://www.facebook.com/shadowofnebula

hubertMichael

  • Regular poster
  • ***
  • Karma: 3
  • Offline Offline
  • Posts: 155
    • View Profile
    • Shadow Of Nebula - our point'n click adventure game
Re: unload scene
« Reply #16 on: May 30, 2013, 06:37:33 PM »

I did this DEBUG_DumpClassRegistry() test. Like always I was walking through my test scenes A, B, C

First time in scene A I did DEBUG_DumpClassRegistry(), memory usage was very similar to my last time when I was writing above.
Then I did my walk cycle B C A B C A B C A B C A
And then when I was fifth time in scene A I did again DEBUG_DumpClassRegistry()

Using program WinMerge I found this differences:

003   CAdSentence          instances: 0    VS    003   CAdSentence          instances: 1
021   CAdPathPoint         instances: 6     VS    021   CAdPathPoint         instances: 0
038   CScValue             instances: 4823  VS    038   CScValue             instances: 4843
041   CScStack             instances: 264   VS    041   CScStack             instances: 268
042   CScScript            instances: 66      VS    042   CScScript            instances: 67
043   CBSprite             instances: 386     VS    043   CBSprite             instances: 387
066   CBSubFrame           instances: 4183  VS  066   CBSubFrame           instances: 4204
069   CBFrame              instances: 4166   VS   069   CBFrame              instances: 4187

Soo... Mnemonic what all that means because I'm not quite sure what this is telling me.
Logged
Shadow Of Nebula fan page:

https://www.facebook.com/shadowofnebula

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: unload scene
« Reply #17 on: May 30, 2013, 06:41:55 PM »

This seems pretty normal to me. One more script running, one more sprite, 20 more sprite frames in total.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

hubertMichael

  • Regular poster
  • ***
  • Karma: 3
  • Offline Offline
  • Posts: 155
    • View Profile
    • Shadow Of Nebula - our point'n click adventure game
Re: unload scene
« Reply #18 on: May 30, 2013, 07:56:34 PM »

Ok. If I'll find something I will write here.
Logged
Shadow Of Nebula fan page:

https://www.facebook.com/shadowofnebula

2.0

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 217
    • View Profile
Re: unload scene
« Reply #19 on: May 31, 2013, 12:24:19 AM »

1 more sprites (21 frames and subframes) and ~100-120 Mb more memory. It is ~5-6 Mb per sprite frame. That is approximately corresponds to size of sprite 1600*900 (5.6 Mb).
It can be some kind of animation? Maybe it is some of background animation? Or uncropped actor's animation?
« Last Edit: May 31, 2013, 12:28:32 AM by 2.0 »
Logged

hubertMichael

  • Regular poster
  • ***
  • Karma: 3
  • Offline Offline
  • Posts: 155
    • View Profile
    • Shadow Of Nebula - our point'n click adventure game
Re: unload scene
« Reply #20 on: May 31, 2013, 01:10:28 AM »

2.0: I was thinking about this. But dumptexture should tell me if there is something but it didn't.
« Last Edit: May 31, 2013, 01:14:33 AM by hubertMichael »
Logged
Shadow Of Nebula fan page:

https://www.facebook.com/shadowofnebula

2.0

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 217
    • View Profile
Re: unload scene
« Reply #21 on: May 31, 2013, 01:50:13 AM »

Is you tried to find this animation ("manually") and disable it? I think this is the only method to get a result in this case.
Logged

hubertMichael

  • Regular poster
  • ***
  • Karma: 3
  • Offline Offline
  • Posts: 155
    • View Profile
    • Shadow Of Nebula - our point'n click adventure game
Re: unload scene
« Reply #22 on: May 31, 2013, 02:22:06 AM »

I'll try to disable spirte by sprite to find it but that is very strange. Why would spirte from previous scene could be a problem? If I'm using changescene then all sprites should be unloaded. I did more, before I'm changing scene I'm unloading sprites manually by Scene.UnloadObject.... I don't even know if it's sprite... DEBUG_DumpClassRegistry indicates, like you noticed, that this is sprite but I don't know... I'll check it.
« Last Edit: May 31, 2013, 02:25:20 AM by hubertMichael »
Logged
Shadow Of Nebula fan page:

https://www.facebook.com/shadowofnebula

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: unload scene
« Reply #23 on: May 31, 2013, 07:00:34 AM »

Do you actually have ANY 1600*900 animations?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

hubertMichael

  • Regular poster
  • ***
  • Karma: 3
  • Offline Offline
  • Posts: 155
    • View Profile
    • Shadow Of Nebula - our point'n click adventure game
Re: unload scene
« Reply #24 on: May 31, 2013, 01:47:23 PM »

I got that big sprite. It's a complicated rendered atmosphere effect not possible to make with particle system. I've turned this off but why is that a problem? I'm even unloading this sprite from scene before changing scene. Maybe I don't understand how it works but if I'm unloading this then memory should be released and for sure memory usage shouldn't be growing. Thanks for your patience Mnemonic :)
« Last Edit: May 31, 2013, 01:50:59 PM by hubertMichael »
Logged
Shadow Of Nebula fan page:

https://www.facebook.com/shadowofnebula

2.0

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 217
    • View Profile
Re: unload scene
« Reply #25 on: May 31, 2013, 01:59:30 PM »

Simply interestingly - is this sprite have "Keep in memory" paramether choosen? And how you load and unload this sprite?
« Last Edit: May 31, 2013, 02:02:27 PM by 2.0 »
Logged

hubertMichael

  • Regular poster
  • ***
  • Karma: 3
  • Offline Offline
  • Posts: 155
    • View Profile
    • Shadow Of Nebula - our point'n click adventure game
Re: unload scene
« Reply #26 on: May 31, 2013, 02:02:19 PM »

no. That was the one of the first things to check.
Logged
Shadow Of Nebula fan page:

https://www.facebook.com/shadowofnebula

2.0

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 217
    • View Profile
Re: unload scene
« Reply #27 on: May 31, 2013, 02:10:50 PM »

Can it be so that you create entity and set sprite to it, and then delete entity? But the loaded sprite it remains in memory? I don't know, whether it is possible, but can quite be.
But if it so, try to create the .entity file and add path to sprite there, then load this file.
Logged

hubertMichael

  • Regular poster
  • ***
  • Karma: 3
  • Offline Offline
  • Posts: 155
    • View Profile
    • Shadow Of Nebula - our point'n click adventure game
Re: unload scene
« Reply #28 on: May 31, 2013, 04:05:38 PM »

Quote
Can it be so that you create entity and set sprite to it, and then delete entity? But the loaded sprite it remains in memory?.

The answear is no. I didn't do it in this way.

But I will try to do it like you said:
Quote
try to create the .entity file and add path to sprite there, then load this file.

and then I'll give my report here
Logged
Shadow Of Nebula fan page:

https://www.facebook.com/shadowofnebula

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: unload scene
« Reply #29 on: May 31, 2013, 08:41:55 PM »

I don't know what to add here, so I'll just recap the facts:

1) entities and actors loaded with Scene.LoadEntity() or Scene.LoadActor() will be destroyed automatically when the game changes to another scene
2) so will all entities defined in SceneEdit
3) entities and actors loaded with Game.LoadEntity() or Game.LoadActor() and windows will never be automatically destroyed and you are responsible for unloading them when you no longer need them. They are only destroyed when the game shuts down or when the player loads a saved game.
4) one image can be referenced by multiple sprites. the image is loaded only once and will be released from memory once no sprite references it anymore
5) the memory usage you see in windows task manager includes memory allocated by DirectX, and I have no idea what dirty trick it uses when managing textures
6) sprite frames 1600x900 pixels big are a total overkill and you should find a better solution. video memory is a scarce resource (not as much as it used to, but still) and should be treated as such
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
Pages: 1 [2] 3  All
 

Page created in 0.105 seconds with 23 queries.