Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Performance and load management.!!!

carlosm
Registered User
Quote
2019-11-17 23:40:50

I'm developing a game with coppercube the first phase will be out!

and questions arise after the main menu the player clicks player and calls the first phase.

but let's say i have 50 levels .. does ccb load all phases when loading the game?

and they only appear as you change scenes. ?

I want to know how the loading of each scene works if the memory load is only done when we call a scene? or if the ccb engine loads all scenes in memory and displays each as it's called?


is there a command in api that says free memory when and how do you use it?

it would be interesting to free the phases from memory at the end.

I hope to receive help in this matter ...!


carlosm
Registered User
Quote
2019-11-17 23:57:30

ccbCleanMemory()

I would like an example of how to use it better saying!

The description says it's good right after the scene change but how do you use it?



I'm thinking of using it like this;

ccbCleanMemory ();
ccbSwitchToScene ('phase 2');

Clear memory and flame phase.


count2rfeit
Registered User
Quote
2019-11-18 17:01:06

when you switch from scene A to scene B, scene A will remain in memory so you can return to it later (if needed). If you have several scenes and they all remain in memory, it can become a problem for weaker systems... so if you do not need to go back to a scene, it is better to clear it from memory.
However --- you can not clear scene A if you are in scene B... once in scene B, you will have to restart scene A and then use the ccbCleanMemory (); - to remove it from memory...


count2rfeit
Registered User
Quote
2019-11-18 17:08:31

this might help you more

http://www.ambiera.com/forum.php...


carlosm
Registered User
Quote
2019-11-18 21:39:07

Thanks for answering.


carlosm
Registered User
Quote
2019-11-19 00:22:12

I have read and understand that you must restart a scene before you take it out of memory.

ms how do i do to restart a scene?
could you give an example?


guest_Robbo
Guest
Quote
2024-11-04 05:35:06

On looking into the source code from Niko in regards to 'ccbCleanMemory()' - what do you think I found ?........

absolutely nothing that's what - there is no code, it does nothing at all.....sad joke really even having an API that does nothing...


okeoke
Registered User
Quote
2024-11-04 09:46:28

It's a shame there is no access to previous code versions. Tbh, I have hard time understanding what exactly should clean memory do.

To me it seems like all assets except ones which you load using ccbLoadTexture and ccbPlaySound are loaded in memory on ccb file load. These only could be reloaded using scene reset action. And maybe I'm missing something, but if you manage to unload the assets from memory, there is no way to load individual assets back. Method that deserialize the assets just goes through the whole scenes list from ccb file and loads everything that is there.

So my guess, it's either supposed to run js GC, which doesn't really make sense, since it runs periodically anyway. Or the command was doing something in the old versions and is left there for the compatibility reasons.

edit:
If you reload the scene it actually reloads the assets but removes "physics world", i.e. world collider info. Basically, this is created on scene initialization as the scene becomes active first time.


j9907
Registered User
Quote
2024-11-07 01:19:13

I was morbidly curious and saw ccbCleanMemory was added in version 4.2, according to the changelog.

Version 5.5's CSpidermonkeyScriptEngineLib.cpp file is also a mere stub which returns 0, so it seems like it was either deprecated between 4.2 and 5.5 or it straight-up never did anything, and Niko simply added a definition for it to later add onto, and never did.


okeoke
Registered User
Quote
2024-11-07 06:20:27

There is also the post about v4.2 release here:https://www.ambiera.com/forum.ph...
There is now a new function named 'ccbCleanMemory' available, for removing unused game assets and thus increasing performance. In this way, you have more direct control over the memory usage of your app.

So it is supposed to be used to clear memory from unused assets, not to start garbage collector. I wonder what is "unused game assets". Well it probably, could be for example models for nodes which were removed from the scene. It would make sense since if you reload the scene they are loaded from the disk again.


just_in_case
Moderator
Quote
2024-11-07 16:10:10

As far as I remember from my memory. The command "ccbCleanMemory()' was for the flash (No more supported) and is for Android platform only. It was never implemented for other platforms.


morbott
Registered User
Quote
2024-11-13 16:37:13

Oh man... this is causing me concern.
I've been working on a project. It's about 10 small-ish scenes, BUT... the way I've been working is that I've made each scene it's own .ccb file. My thought was while everything is a work in progress it would be cleaner for me to keep my scene files separate, and then import them as separate scenes into one CopperCube file.
BUT...
I guess Copper Cube was never designed to handle this many scenes? Therefore... I guess I'm screwed.
Maybe what I'll do is try to actually put them together into 1 file and see what blows up? HA!


guest_Robbo
Guest
Quote
2024-11-14 21:15:55

I am am just now working on dynamically loading new scenes on request (as needed from separate ccb files) during runtime and having them accessible along with your main scene.

I'm hopefully this will work just fine - will keep you posted.
I would then have to make a way to delete no longer needed scenes also..


morbott
Registered User
Quote
2024-11-17 20:38:48

Sweet... got my fingers crossed.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Inte?national" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact