Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (ozgur, TipmyPip, AndrewAMD), 1,209 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
free memory #407218
09/09/12 12:08
09/09/12 12:08
Joined: Jan 2010
Posts: 150
iran - tehran
F
flatron Offline OP
Member
flatron  Offline OP
Member
F

Joined: Jan 2010
Posts: 150
iran - tehran
Hi
i made a studio that player can select a car between 40 diffrent car.
each car size and it's parts have 16mb and palyer can select bodypaint for his car between 210 body paint(2048*2048 dds texture)

now i have problem.if player want to see some cars and some bodypaints,memory will be full.

i need some advices to free memory.

i find that it is enough to use ptr_remove for BMAP* to free memory but what about entities that have 2 skin with shaders?

i asked here:
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=407208&page=1

Re: free memory [Re: flatron] #407223
09/09/12 16:10
09/09/12 16:10
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
You don't want to use ptr_remove, but bmap_purge or rather ent_purge.
Btw. I doubt that you create (40*)210 different textures on your own, just use one or a few shaders with different material properties (f.i. realized via vecSkill41 and all the other shader variables).


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: free memory [Re: Superku] #407561
09/15/12 18:40
09/15/12 18:40
Joined: Jan 2010
Posts: 150
iran - tehran
F
flatron Offline OP
Member
flatron  Offline OP
Member
F

Joined: Jan 2010
Posts: 150
iran - tehran
I do this exactly.
but I think there is some problem in removing entities.

I think make one entity and change it's texture by shader is better than load a another entity because ent_remove dosn't remove entity completely and some data remain in memory.
I wrote a program and check it.

Re: free memory [Re: flatron] #407610
09/16/12 19:31
09/16/12 19:31
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Originally Posted By: flatron
because ent_remove dosn't remove entity completely and some data remain in memory. I wrote a program and check it.

Then prove it and post this program in the bug secetion. If ptr_remove wouldn't free all the memory this would clearly be a bug that needed fixing.

As you posted about this topic numerous times I still think you have got a bug, i.e. a memory leak on your side and as long as this is the case reducing the memory footprint of your programm won't help you.


Always learn from history, to be sure you make the same mistakes again...
Re: free memory [Re: Uhrwerk] #407623
09/17/12 07:33
09/17/12 07:33
Joined: Apr 2008
Posts: 245
GameScore Offline
Member
GameScore  Offline
Member

Joined: Apr 2008
Posts: 245
i use ent_purge to clear thr memory

Code:
ent_purge(my);ent_remove(my);




ent_purge(ENTITY*);
Releases texture memory, meshes and decals used by the entity. Useful for freeing the video memory when entities of a certain type won't be visible anymore. Video memory is automatically allocated again when the entity is seen the next time - so this function won't do any harm. However, any functions affecting the entity mesh or texture - such as bmap_to_alpha - must be performed again. Thus ent_purge followed by bmap_to_alpha can also be used to change the alpha factor of an entity texture. In a multiplayer system this instruction only affects the current PC.

Last edited by GameScore; 09/17/12 07:33.
Re: free memory [Re: GameScore] #407629
09/17/12 07:50
09/17/12 07:50
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
ent_remove removes ONLY the entity. It does of course not remove the model, sprite, or terrain file itself, as it might be used also by other entities. This file stays in the level cache and can only be removed with level_change or nexus_free commands.


Moderated by  old_bill, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1