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
Page 2 of 2 1 2
Re: enough ptr_remove? [Re: EvilSOB] #407208
09/09/12 09:52
09/09/12 09:52
Joined: Jan 2010
Posts: 150
iran - tehran
F
flatron Offline OP
Member
flatron  Offline OP
Member
F

Joined: Jan 2010
Posts: 150
iran - tehran
it crash "script crash in lifetime "with this data:
counter=210
nex=25
mem=818
free=1202

Re: enough ptr_remove? [Re: flatron] #407209
09/09/12 10:00
09/09/12 10:00
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 made a studio that player can select a car between 40 diffrent car.
each car size and it's part 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.
and please some one show me a code for sys_malloc and sys_free for using with ENTITYs.

Re: enough ptr_remove? [Re: flatron] #407211
09/09/12 10:20
09/09/12 10:20
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
MasterQ32:: Yup, you are right. I just over-simplified my poor understandings...

flatron:: Try my code again, but remove the ent_clone in 'lifetime', and
see how much of a difference it makes. The ent_clone part is an EXTREME stress-tester.

THEN, if it is still crashing, try increasing your nexus with the '-nx'
command-line option in SED/Options/Preferences.
Check the manual for detailled help.
This may not help at all, it might be your VIDEO-memory is overflowing.
If this is so, Ive never hit this issue, so I cant help at all.


I cant help much more than this, because even with my most detailled models,
1000 of em are only hitting a nexus of 6. I aint much of a modeller...

As for how to use sys_malloc with entities??? I dont even think is CAN be done.
But FOR YOUR SAKE hopefully someone will just tell me Im an ignorant dumb-ass! laugh


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: enough ptr_remove? [Re: EvilSOB] #407213
09/09/12 10:56
09/09/12 10:56
Joined: Jan 2010
Posts: 150
iran - tehran
F
flatron Offline OP
Member
flatron  Offline OP
Member
F

Joined: Jan 2010
Posts: 150
iran - tehran
one suggesstion use "process hacker"(it has a system information part)
without change in nexus: counter=560
with -nx=500 : counter=560

it crash in both time



if there is no way to free memory ,it is very bad.
i spend 1000$ and buy an engine and now at the end of a 12000$ project a problem occurred an there is no way to solve it?

and a question : i can't use sys_malloc for entities?

Last edited by flatron; 09/09/12 11:16.
Re: enough ptr_remove? [Re: flatron] #407216
09/09/12 11:32
09/09/12 11:32
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
God no. There will be a way around it, its just "I" dont know the answer.
Im sure someone else will, given time for them to find and read your problem.

I 'discover' how to do stuff ONLY when I hit that problem myself.
And I have never dealt with multiple large textures like you are doing.
So Ive never NEEDED to solve this problem, thats why I dont know how.


But back to the issue on hand..

Did you take the ent_clone out as I suggested? It more than doubles memory usage.
And when it is crashing, it IS showing 210 models isnt it?
And were they all with the SAME skin? Or different ones?
How big(roughly) is the MDL file IF it contains the DDS skins?
OR How big(roughly) is each DDS file, and how many are used per model?


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: enough ptr_remove? [Re: EvilSOB] #407217
09/09/12 12:01
09/09/12 12:01
Joined: Jan 2010
Posts: 150
iran - tehran
F
flatron Offline OP
Member
flatron  Offline OP
Member
F

Joined: Jan 2010
Posts: 150
iran - tehran
yes ,i hope find an answer to it.
thank you.

above result is for time that i comment ent_clone.
when it crash(in case of comment ent_clone) it show 560 with same skin.
model size is 3.78mb
and dds file are about 2 mb

Re: enough ptr_remove? [Re: flatron] #407219
09/09/12 13:58
09/09/12 13:58
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Well, to be honest, I cant see any REAL problem.
How often are you going to be racing agains 560 other cars at once?

The memory consumption really only applies to what is ON-SCREEN at the same time.
Everything else can be managed swapping models and textures in and out as
we need them on screen.


So... lets roll back a bit and take a FRESH look at what you are trying to do NOW.
Lets go back to the studio, you have 40 car types ATM I believe. Not a problem.

Is there any way you can fill me in better about the 'base' car models...
Can you send me one? Or even a screenshot would do.
Im trying to figure how much of its 'built in' texturing is 'necessary'.

Does the MDL contain ANY of the bodypaint texturing?

Could you post a (JPG) screenshot of its various textures?

The reason Im trying to better understand the models skin layouts is to figure out
which textures get swapped/replaced when you put bodypaint on them.


The basic concept I have for the 'mechanics' of the studio is this.
We have 40 car types, so at studio start-up we create an array with one of each.
After each ent_create and shader-apply we set each car invisible and then do an
ent_purge to minimise memory usage.

We then display the first car on-screen. When we 'scroll' to another car then
we need to do an ent_purge on this one after setting it invisible.

While a car is visible, you can scroll through the bodypaint skins.
Ptr_remove the existing one and bmap_create the next one as we scroll through.

Thats the BASIC mechanics of it. Can you see any STRUCTURAL problems here?
Problems that may interfere with your Studio design?


Also... do you have 210 bodypaint skins PER CAR?
Or is the 210 spread across all 40 car types?


PS you can start a PM with me if you want to keep things private/confidential.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: enough ptr_remove? [Re: EvilSOB] #407562
09/15/12 18:49
09/15/12 18:49
Joined: Jan 2010
Posts: 150
iran - tehran
F
flatron Offline OP
Member
flatron  Offline OP
Member
F

Joined: Jan 2010
Posts: 150
iran - tehran
thank you EvilSOB.

i have no problem in loading and showing models and skins.
the problem is occured after i do it for more than for example 40 times.

but I am working on it.

Re: enough ptr_remove? [Re: flatron] #407579
09/16/12 05:15
09/16/12 05:15
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
OK. Then it sounds like as you are loading models and/or skins that
have been visible at some point are 'piling up' in memory somewhere
and eating all your available space.

In that case, I would suggest using ent_purge and bmap_purge to flush them out.
As each model becomes "not visible any more' because your studio is viewing
a different car, then perform an ent_purge on the model that WAS visible.
This will flush the model from memory.
This MIGHT also flush its skins but Im not sure... It SHOULD at least flush the
skins embedded in the MDL file, at least I would EXPECT it to.

Then for any 'bodypaint' skins you have loaded to view on the model,
as soon as any one of these skins is no-longer visible, do a bmap_purge on it.

Following these steps sould keep your memory usage down.
The drawback of doing it this way is that EVERY time you change models or
bodypaint skins, the engine will need to reload that skin/model from disk.
If they are big, or a slow machine, this may cause a 'lag' as the file loads.

Also... doing a ent_purge or bmap_purge EVERY time a model or skin is changed
is probably rather overkill.
If you can figure out some form of counter system, you could probably get away
with only doing your purges when you have scrolled through 10 or so models/skins.
But this would take a bit of trial and error to find a healthy balance.


Best of luck all the same dude.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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