1 registered members (TipmyPip),
18,388
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
ent_cloneskin issues with 7.66 (same as ent_clone issue)
#248517
01/27/09 11:53
01/27/09 11:53
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
OP
Expert
|
OP
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
I found the problem with ent_clone() on the bugs page, but it doesnt mention ent_cloneskin().
Im getting exactly the same symptoms with 7.66 using ent_cloneskin(). The same workaround as that listed for ent_clone() ALSO works-around the ent_cloneskin issue.
Just bringing this to your attention in case it is NOT a linked issue.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: ent_cloneskin issues with 7.66 (same as ent_clone issue)
[Re: EvilSOB]
#248647
01/28/09 09:22
01/28/09 09:22
|
Joined: Jul 2000
Posts: 28,024 Frankfurt
jcl

Chief Engineer
|

Chief Engineer
Joined: Jul 2000
Posts: 28,024
Frankfurt
|
|
|
|
Re: ent_cloneskin issues with 7.66 (same as ent_clone issue)
[Re: jcl]
#249328
02/01/09 19:23
02/01/09 19:23
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
OP
Expert
|
OP
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Cool, thanks.
Also, this may also be related, or I can start a new thread if you want. When using ent_clone, how do you release the memory it consumes? I can get neither ent_remove, ptr_remove, nor ent_purge to give me the memory back. AND, if I run ent_clone on an entity MORE than once, it seems to be re-cloning because it consumes another chunk of memory each time.
(By memory I mean nexus size. And in my test model it uses about 550k each time I use ent_clone from a 1meg MDL, containing 100 verts, just in case that information is of use to you)
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: ent_cloneskin issues with 7.66 (same as ent_clone issue)
[Re: jcl]
#249388
02/02/09 09:40
02/02/09 09:40
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
OP
Expert
|
OP
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
You mis-understand my questions. I will try phrasing them differently.
QUESTION>1 Once I have sucessfully cloned an entity, used it for my nefarious purposes, and no-longer need it (as in a destroyed artifact), i would expect using ent_remove, ptr_remove, or ent_purge would release all of the resources the entity was consuming. But it doesnt... All the nexus it was using is still in use.
I know this because in my project (which is too large and scattered to post), I do basically this... Step 1> ent_create(same model every time) Step 2> clone_ent Step 3> modify its mesh Step 4> leave it visible a while Step 5> ent_purge & ent_remove This process occurs with up to 50 entities at any one time, and the problem is my memory consumption (ie nexus) and as shown in WindowsTaskManager/Processes just keeps growing by 500k per entity created. BUT if I kill ONLY Step2 (ent_clone), all ents look the same now, but my memory consumption STOPS growing. So in my mind that tells me the cloned entity is not being released from memory by ent_purge or ent_remove. See what my problem is, and why I think its ent_clone? PS If Im not using the correct way to purge the memory of the ent_clone, I apologise and please explain.
QUESTION>2 My second question was why does ent_clone consume space when used on the same entity more than one time. Only the most recent clone will be valid (and accessable), so isnt any of the intermediate clones of this entity a waste of resources? It would be a programming flaw to allow this to happen in one's code, but shouldnt the engine try to protect against certain types of programmer mistakes?
Example ENTITY* test = ent_create("MyModel.mdl",...); //creates "MyModel.mdl" at address #1 ent_clone(test); //creates a clone "MyModel.mdl" at address #2 ent_clone(test); //creates a another clone "MyModel.mdl" at address #3 ent_clone(test); //creates a another clone "MyModel.mdl" at address #4 ENTITY* test2 = ent_create("MyModel.mdl",...); //I assume this points to the "MyModel.mdl" at address #1 (please correct if wrong assumption)
Isnt the existance of the clones at addresses #2 and #3 a waste of space? And if I then say ent_purge(test); and ent_remove(test); then which model at which address (if any) get free'ed?
Wouldnt it be "better" if the enging took away this chance of dumb programmer errors by working like this instead?
Example ENTITY* test = ent_create("MyModel.mdl",...); //creates "MyModel.mdl" at address #1 ent_clone(test); //creates a clone "MyModel.mdl" at address #2 ent_clone(test); //does nothing as 'test' is already a clone, and is thereby unique ent_clone(test); //still does nothing as 'test' is already a clone, and is thereby unique ENTITY* test2 = ent_create("MyModel.mdl",...); //I assume this points to the "MyModel.mdl" at address #1 (please correct if wrong assumption)
Thanks for your time. And again, I'll make this the first post of a new thread either here in Bugs, or in Ask-Developers forum if you want.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: ent_cloneskin issues with 7.66 (same as ent_clone issue)
[Re: jcl]
#249400
02/02/09 11:44
02/02/09 11:44
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
OP
Expert
|
OP
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
As for the second question - OK, I can live with that. It was just a "it would be nice if" type question.
And for the first question, I cant see any way to implement level_free in my situation. So there is no definately other way to free a selected entity's nexus usage other than level free? Because my entities are elements of a self-creating, flowing landscape, created in an empty level. So I cant use level_free to remove old entity-space because I now have new, living entities that have been created since my last proposed level_mark.
Any ideas or suggestions? (yes this is stretching the topic a lot)
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: ent_cloneskin issues with 7.66 (same as ent_clone issue)
[Re: jcl]
#249410
02/02/09 12:17
02/02/09 12:17
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
OP
Expert
|
OP
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
I think Im going to have to, but to do that I'll need to make an array of entities, which will have a fixed number of elements at design time.
Whereas the code I've developed so far (with much blood, sweat and many tears) is theoretically limitless, using a custom linked list of structures that store the entity of that location as well as much other data. (I'd only just started testing the memory consumption when this clone issue became instantly apparent)
So it was self-adjusting in size, dependant on available CPU horsepower at run-time, and now it is going to have to be decided at compile-time instead.
I think I'll look into creating meshes in realtime using directX first though, I want my project to be very PC-Hardware tolerant.
This is not an actual request, but how feasable would it be, in your opinion, to request an ent_purge like new function (or appended to ent_purge) that will release the model-data memory(that ent_clone creates). Thereby alleviating my problem as well as having a useful memory management tool being added to the engine....
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
|