Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (1 invisible), 672 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
physx unregister / disable ent bugs ? #464966
03/21/17 12:29
03/21/17 12:29
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Howdy,

I use gs3d physx in my project and when I kill an enemy (registered as PH_CHAR / character -> pXent_settype(my, PH_CHAR, PH_CAPSULE);) I want to unregister or disable it so it becomes passable. However as soon as I either do pXent_enable(my, 0); or pXent_settype(my, 0, 0); , all other enemies becomes bugged and rotate randomly and move different directions than they normally would. Any idea how to solve this?

Re: physx unregister / disable ent bugs ? [Re: Reconnoiter] #464970
03/21/17 12:45
03/21/17 12:45
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
Sounds like a memory leak to me. Usually 3DGS handles the removal of physx ents himself. Have you used on_ent_remove anywhere?


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: physx unregister / disable ent bugs ? [Re: alibaba] #464975
03/21/17 14:11
03/21/17 14:11
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Ty for replying. I dont have any on_ent_remove's. Also it seems like I have it only for the characters, e.g. when I register e.g. a crate as a PH_CHAR and unregister after a wait it doesn't seem to cause any problems. So I think I am making a mistake in my character code somewhere but I dont know what.

Some outstanding code:
Code:
//Set Collision Event
for (you = ent_next (NULL); you; you = ent_next (you)) {  
	if (you) {
		if (you.TYPE == IS_ITEM || you.TYPE == IS_PROP_RIGID) pXent_setcollisionflag(my, you, NX_NOTIFY_ON_START_TOUCH);
	} 
}


But I unlink them through NX_IGNORE_PAIR before unregistering.

Also when I unregister I also set the following (dont know if this matters):
set(my, PASSABLE);
my.emask &= ~DYNAMIC;

Re: physx unregister / disable ent bugs ? [Re: Reconnoiter] #464977
03/21/17 19:47
03/21/17 19:47
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Hmm for some reason the doing following before registering as PH_CHAR does make it more stable (but still can bug out enemies after a while):
Code:
pXent_settype(my,0,0);
my.emask |= DYNAMIC;
wait(1);


Anyone know what is happening here?

Re: physx unregister / disable ent bugs ? [Re: Reconnoiter] #464983
03/22/17 09:57
03/22/17 09:57
Joined: Aug 2009
Posts: 1,438
Spain
painkiller Offline
Serious User
painkiller  Offline
Serious User

Joined: Aug 2009
Posts: 1,438
Spain
I've used pXent_settype(my,0,0); also in a test level with enemies and didn't have that issue, although I didn't reset the dynamic flag afterwards. maybe the problem is related to resetting that flag?


3D Gamestudio A8 Pro
AMD FX 8350 4.00 Ghz
16GB RAM
Gigabyte GeForce GTX 960 4GB
Re: physx unregister / disable ent bugs ? [Re: painkiller] #464986
03/22/17 13:47
03/22/17 13:47
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Ty for reply, I tried that but it doesn't seem to make a difference. Also maybe important to note: only the enemies bug out but never the player actor (even while they share alot of functions). I tried comment the AI only lines out but doesn't seem to make a difference to. Only the 'player' pointer is different ofcourse.

Also you run Shade-c evo right Painkiller? So that should not be it than.

Re: physx unregister / disable ent bugs ? [Re: Reconnoiter] #464993
03/23/17 11:40
03/23/17 11:40
Joined: Aug 2009
Posts: 1,438
Spain
painkiller Offline
Serious User
painkiller  Offline
Serious User

Joined: Aug 2009
Posts: 1,438
Spain
Originally Posted By: Reconnoiter
Ty for reply, I tried that but it doesn't seem to make a difference. Also maybe important to note: only the enemies bug out but never the player actor (even while they share alot of functions). I tried comment the AI only lines out but doesn't seem to make a difference to. Only the 'player' pointer is different ofcourse.

Also you run Shade-c evo right Painkiller? So that should not be it than.


yes, I'm running Shade-C too. Maybe you are using any global variable for the enemies that causes a conflict between them? or a memory leak issue?


3D Gamestudio A8 Pro
AMD FX 8350 4.00 Ghz
16GB RAM
Gigabyte GeForce GTX 960 4GB
Re: physx unregister / disable ent bugs ? [Re: painkiller] #465003
03/24/17 16:26
03/24/17 16:26
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
@Painkiller, in your tests, did you use pXent_move?
After exhaustive testing (with stripped down code, no player and only a couple of enemies and terrain) it seems there becomes something wrong with pXent_move only, the rest seems to work well. Also I think that pXent_move bugs out enemies/player only during the frame(s) the enemy get unregistered, hence why the player rarely bugs out cause pXent_move is not constantly triggered for the player but is for enemies.

Last edited by Reconnoiter; 03/24/17 16:30.
Re: physx unregister / disable ent bugs ? [Re: Reconnoiter] #465007
03/25/17 11:45
03/25/17 11:45
Joined: Aug 2009
Posts: 1,438
Spain
painkiller Offline
Serious User
painkiller  Offline
Serious User

Joined: Aug 2009
Posts: 1,438
Spain
Originally Posted By: Reconnoiter
@Painkiller, in your tests, did you use pXent_move?
After exhaustive testing (with stripped down code, no player and only a couple of enemies and terrain) it seems there becomes something wrong with pXent_move only, the rest seems to work well. Also I think that pXent_move bugs out enemies/player only during the frame(s) the enemy get unregistered, hence why the player rarely bugs out cause pXent_move is not constantly triggered for the player but is for enemies.


I use forces to move the characters, so yeah maybe it could be an issue with pXent_move


3D Gamestudio A8 Pro
AMD FX 8350 4.00 Ghz
16GB RAM
Gigabyte GeForce GTX 960 4GB
Re: physx unregister / disable ent bugs ? [Re: painkiller] #465010
03/25/17 16:52
03/25/17 16:52
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Ditching pXent_move and pXent_rotate seems to have solved the problem and is also much cooler imo being able to push away enemies etc. laugh
What function do you use to move entities around? pXent_addvelcentral? Movement is still a bit floaty even though I have set pXent_setdamping to 100%.

Last edited by Reconnoiter; 03/25/17 16:52.
Page 1 of 2 1 2

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