Strange behaviour

Posted By: preacherX

Strange behaviour - 12/10/17 18:28

Does someone know what can trigger this:
https://www.youtube.com/watch?v=bDLbxAAUnF4&feature=youtu.be

Look at the statistic panel, the memory of entities is increasing without an end. Normally this value is about 200, but sometimes, after using level_load(); this strange thing happens and the fps are going down.

It only happens after using level_load(); - could this be a bug?

Normally all entities should be removed after level_load or not?

Does someone else encounter such a problem?
Posted By: 3run

Re: Strange behaviour - 12/10/17 18:38

Hey

Never faced anything like that, but my guess is that you just messed/missed something up after loading new level. I once had an issue similar to yours, but not the same. Amount of functions (loops) was increasing each time I called 'level_load'. Reason was the loop that handled all props (elevators, plaftorms etc) on the level. I forgot to break it before calling 'level_load' (I was calling that loop over and over again as soon as level was loaded).

Greets.
Posted By: preacherX

Re: Strange behaviour - 12/10/17 19:30

Do you know when this value should increase? I thought that the entities memory would only grow if a new entity is loaded with ent_create... Or not? So even if a function in a loop is creating new entities, this should not happen, or am I wrong? ... I just also found out that this value won't return to zero after a new level_load -normally it will go to zero if you perform a level_load.
Posted By: 3run

Re: Strange behaviour - 12/10/17 19:43

That value is num_entities, you can see that from 'default.c' -> 'def_debug_pan' panel.

Originally Posted By: preacherX
I thought that the entities memory would only grow if a new entity is loaded with ent_create... Or not?
num_entities - will grow if entities are created (doesn't matter how).
You have to check your code for 'ent_create' first (that's what I would do). I think some logic get's messed up after level_load.

Originally Posted By: preacherX
I just also found out that this value won't return to zero after a new level_load -normally it will go to zero if you perform a level_load.
This is weird. Do you use view entities? They aren't purged at level change, but I'm not sure if they will affect 'num_entities'.

Edit: just made a test, view entities don't affect 'num_entities'...

Greets!
Posted By: preacherX

Re: Strange behaviour - 12/10/17 19:51

I don't meant the number of entities but its memory:

https://1drv.ms/i/s!AnPFFAcZiQdslchqJim9fp6iZGyjNA

The number of entities is normal in that case.

Posted By: 3run

Re: Strange behaviour - 12/10/17 19:59

Ohh, sorry, then that value comes from 'd3d_texskins'.
So my question about using view entities is still valid (they also don't get purged on level_load).
Posted By: preacherX

Re: Strange behaviour - 12/10/17 20:03

I'm also using some view entities but I remove them before using level_load.
Posted By: alibaba

Re: Strange behaviour - 12/10/17 21:58

Do you use any shader that bmap_creates anything?
Posted By: preacherX

Re: Strange behaviour - 12/13/17 07:04

Not in that moment... It seems that the problem lies somewhere else. Maybe a broken pointer or an invalid array. At the moment it runs fine again but I didn't changed something... I hate those bugs which are only appearing sometimes! wink
Posted By: preacherX

Re: Strange behaviour - 12/13/17 07:09

Thanks for the hints, guys! laugh
Posted By: Kartoffel

Re: Strange behaviour - 12/13/17 09:38

Another thing: I encountered some problems with the engine which were solved after restarting my PC. Once it was an input bug (one of the keyboard inputs were constantly sent) and another time it was something at the directx setup process (engine couldn't start because it was unable to initialize dx9). I belive might have something to do with windows updates requiring a restart to be fully applied.

Anyway, I don't think something like this is the problem in your case but you might want to keep it in mind.
Posted By: preacherX

Re: Strange behaviour - 12/13/17 11:47

Thanks for the info! With the keys there is also a problem if you hit a key and you still push it and then changing the window with ALT+TAB, then this key is still marked as pushed even if you don't push it anymore.
Posted By: Kartoffel

Re: Strange behaviour - 12/13/17 20:16

Originally Posted By: preacherX
Thanks for the info! With the keys there is also a problem if you hit a key and you still push it and then changing the window with ALT+TAB, then this key is still marked as pushed even if you don't push it anymore.
Yes, this one is a bit annoying. Though, the one I referred to still persisted even after I restarted the engine or pressed the button in question. But so far this has only happened a single time so I suspect it was something related to windows.
© 2024 lite-C Forums