Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Phantom Object number 100001 ????

Author
Message
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 19th Feb 2016 09:37 Edited at: 19th Feb 2016 09:38
Hello everybody.

So I was building a 3D world, with physics commands here and there.

The object number that is in uses are
10,000
13,000
15,000
20,000

I was trying to detect which object is colliding with my player object, which is number 10,000
So I called these commands



But the weird thing is, the command PRINT("object hit: " + STR(hit) ) keeps on registering a object with number 100,001
I'm 200% sure I've never made an object with that number, or have any function that can create object with that number.

Then, I tried to delete that object 100,001 by deleting the object before i detect the collision


But, somehow a new object was detected in its place, an object with the number of 100,002
When I tried to delete object 100,002, object 100,001 reappeared!

What is this object 100,001?

It's really troubling for me, because I was trying to detect what object is colliding with my character, but this object 100,001 is in the way, and I can't detect anything else reliably
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 19th Feb 2016 10:27
Autonumbered Objects start at 10,001.
Have you got any code that creates objects in this format:

i = CreateObjectPlane(1,1)

It sounds like there is more than just object 10,001 from the outset. When you delete it, it just makes 10,002 the next object to be hit.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 19th Feb 2016 10:39
I don't have auto-object-making routines like that
I specified the number for every object I made by hand

This phantom object starts from 100,001 though.
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 19th Feb 2016 15:43 Edited at: 19th Feb 2016 15:48
I can explain what is happening. It looks like you are creating a 3d physics character controller, correct me if I am wrong.
The 3d physics character controller automatically creates a capsule object based on the size of your character object.
This is then used to create the collision shape for the character controller. When you use the ObjectSphereCast()
command you are getting a hit on the character controller capsule object which is 100,001.

P.S. The 3D physics character controller capsule object is hidden and should not be returning a hit with the ObjectSphereCast()
command. Maybe it is a bug I do not think it should be getting a hit on a hidden object.
The coffee is lovely dark and deep,and I have code to write before I sleep.
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 19th Feb 2016 16:53
I see, so that's what the phantom object is for.
I did use character controller.

That capsule was hit even when I call ObjectSphereCast at the very end of the loop.
That probably means the object was not fully hidden

Maybe we can make it so that AppGameKit delete the capsule object every time after the controller finishes its physics interaction, and recreates it if it's needed again

Or its just the way it's hidden that need fixing
Or its the ObjectSphereCast collision detection that needs fixing.

I digress. I'll leave this to you guys, the pros
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 20th Feb 2016 06:05
GetObjectInScreen() also detected the phantom object 100,001

GetObjectExists() too

Seems like this phantom object problem is not just limited to collision detection.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 20th Feb 2016 08:13
The character controller uses object 100001, therefore it exists. It's not a phantom. If you use the Character Controller, expect there to be an object numbered 100001 and design your program to take that into account.
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 20th Feb 2016 12:52 Edited at: 20th Feb 2016 12:52
Yeah. The existence of those phantom object itself is not a problem.

It's the unintended interaction with the commands.
Those phantoms was picked up by various commands, even if they are not supposed to.
This would create confusions, and even major bugs.

For example, I use AppGameKit to scan my hard disk, and detected 500,000 files + folders in it.
I then proceed to create 2000 boxes to represent the first folders + files.
But because the phantom 100,001 was picked up by the system I set up, the file/folder management and interaction in game got haywired.
Not to mention I cant detect collision that its supposed to detect, if I placed the raycast in the way of the object, or set up the radius a little bit bigger
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 20th Feb 2016 14:36
This is looking more like a bug since an object that is not visible should not be included in the results of these core commands.
Let me clarify that the 3D physics character controller actually creates 2 capsule objects, one for the standing height and one for the crouched height.
The reason that the objects are not deleted and just hidden is because they can be unhidden for debug purposes.
The object numbers for these capsules are auto generated by AppGameKit so they do not override other objects.
It is an accepted practice to not hard code object numbers as this will cause many conflicts.
The coffee is lovely dark and deep,and I have code to write before I sleep.

Login to post a reply

Server time is: 2024-11-25 09:40:19
Your offset time is: 2024-11-25 09:40:19