Page 1 of 1

_G.__uids are not updated correctly

Posted: Wed May 04, 2011 10:48 pm
by Graziel
in lua console after typing

Code: Select all

=_G.__uids
you get bunch of uids created in game but they are never deleted from there, after leaving zone each entity has given new uid and its added to _G.__uids I.E. :

- enter zone "green worm mass" has uid of 156
- type into console =_G.__uids[156] - we get data of "green worm mass"
- leave zone
- enter zone now green worm mass has uid of 1076
- type into console =_G.__uids[1076] - we get data of "green worm mass"
- type into console =_G.__uids[156] - we get data of SAME "green worm mass" !

you can go out and enter multiple times each time _G.__uids will grow and reference count will increase ( so next time "green worm mass" will be in 3 places, next in 4 etc, since its about ALL entities (particles, projectiles, items etc.) _G.__uids grow VERY fast)

Re: _G.__uids are not updated correctly

Posted: Thu May 05, 2011 4:09 pm
by darkgod
Hum, are you sure they are never removed? I did some test and the garbagecollector does delete them after a while

Re: _G.__uids are not updated correctly

Posted: Fri May 06, 2011 4:01 am
by Graziel
just did 25 min testing and yes they didnt got deleted, probably because i didnt 'kill' it and its still in multiple places there

you probably kill it and normal gc cleaned entries there, but as long as it 'lives' it will stay there in multiple places.

Re: _G.__uids are not updated correctly

Posted: Fri May 06, 2011 7:18 am
by darkgod
Hum, what do you do exactly ? uids from zones you left should disappear; is that what you are doing ?

Re: _G.__uids are not updated correctly

Posted: Fri May 06, 2011 9:45 am
by Vagabond
I'm not an expert of Lua, but garbage collecting languages often leave references in place if there is no shortage in memory (so that the performance hit of garbage collection won't effect the system, only when it is really important). Also, this is often platform dependent as well, so it might work differently on - say - windows and linux.