Jump to content

Collision firing when body beyond the bounds of object reporting collision


 Share

Recommended Posts

I'm on 4.6 seen on both intel and AMD systems with both AMD and intel integrated graphics.

Basically I am seeing collision events firing when my character object has passed BEYOND an object which I want to detect collisions on. I see a few collisions fire on entry as expected and then MANY many more on exit which go on for a good few seconds.  But then even worse if I let my character rest BUT then move the character object again then there are loads of collision events on the brush (or mesh) I have the collisiontrigger.lua script on even when the object is not anywhere near the object.  Could be my setup is just wrong but struggling to make sense of why this behaviour makes sense. 

To reproduce (see attached files or reproduce according to below):

  1. Create an new project with the marble game project.
  2. Change the character to be COLLISION TYPE of CHARACTER (is this my error? - even if it is is the seen behaviour not going to be super confusing?)
  3. Change the first brush (shown below) to be collision type trigger and switch the script to be collisiontrigger.lua and change it's shape so it's a nice big block across the map.
  4. Change the collisiontrigger.lua script so that it does System:Print("*** COLLISION***") as the first line of the method so we can see when collision are happening.
  5. Run the level

image.thumb.png.5b7a92621f153e302b3648ea85247bf2.png

 

Running the game.... move through the trigger brush...allow the object to stop...move again and brush collisions will fire even when you are clearly not in the area of the brush and there will be many more than you saw on entry.

 

image.thumb.png.4e2194cbef1ec0b17ca03cc7f430be45.png

 

here is a video showing what it looks like.

 

 

start.map CollisionTrigger.lua

Link to comment
Share on other sites

Does it do this when the ball is set to Collision::Prop? How about the character controller set to Collision::Character?

I have successfully created my floor buttons using the collision function and experienced no issues. I do an aabb test of my off touch detection, however.

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

Well I think the collision doesn't fire unless you set it to character. I know you can reconfigure collision types and aabb test is probably a good idea but it really seems like it should be possible via the editor and standard scripts for a novice  to setup a basic collision zone without having knowledge of aabb tests.  Also, is there really a good explanation for the observed behavior?

 

 

 

 

Link to comment
Share on other sites

 

23 minutes ago, reepblue said:

I have successfully created my floor buttons using the collision function and experienced no issues. I do an aabb test of my off touch detection, however.

In your ball game what was your setup for controller (prop?).   What's the best way you have of seeing if a user is still in an area or left (e.g. a healing zone, or damage zone).  AABB test as you are saying?

Having a good example of a zone where you can detect entry exist seems like an essential script in the standard set but I don't think there is one (only a collision which I don't think detects exit).  I used to use what was called the entry/exit script, which I was using in this project too but I think it was suffering the same fate where it would keep firing when I wasn't in it. Which I don't remember it doing in the past, though I suppose I usually use a full character controller.

 

 

Link to comment
Share on other sites

Check over on the collision docs

I see this entry https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_SetCollisionType

Says .....The documentation of the Collision class provides a detailed explanation of the default collision types and their interactions.

Is there a hyperlink to said detailed explanation...nope...

check back in help docs to try to find it. Come across this as possibly the doc it means....

https://www.leadwerks.com/learn?page=API-Reference_Object_Collision

Which has this content....

This class just contains static members used for collision constants.

Constants

  • number None
  • number Collide
  • number Prop
  • number Scene
  • number Character
  • number Trigger
  • number Debris
  • number Projectile
  • number LineOfSight

Well not really what I was hoping to find for detailed documentation. Probably the wrong file but I could have not yet found the right documentation. Shouldn't it be easy to find good documentation/scripts/samples on how to do an enter/remain/exit zone in a game? 

 

  • Upvote 1
Link to comment
Share on other sites

14 hours ago, reepblue said:

Does it do this when the ball is set to Collision::Prop? How about the character controller set to Collision::Character?

I have successfully created my floor buttons using the collision function and experienced no issues. I do an aabb test of my off touch detection, however.

Checked again and the marble game is by default setup to use character. It would be HORRENDOUSLY unfortunate for new users if they then find when they set up a trigger brush that they can get some truly baffling behaviour as a result. The marble tutorial does specifically mention setting up items as triggers (which the coins are but probably lead to no obvious problem).   Would be great if Josh could explain how the behaviour that seems to be seen in this issue makes good sense.  I don't get it yet. 

I found your post on the volume trigger. I think this will get me round this.  

 

I didn't realise you had published the script for this, thought I strongly suspect I read it way back 2 years ago when you published it.  No offence meant to you but I actually find it a DEEPLY DEPRESSING considering the number of hours people might waste trying to locate something like this.  I found Einlanders first (which probably also works) and didn't event realise that yours was on the same post. I think it did not show on the page as it was only showing later posts or something. Maybe I just didn't  scroll up, but feels to me like it only showed Einlanders post and following responses.  

I went back to see if I could locate the post and work it out and I can't even see it yet and I have to get back to work.   Thanks for supplying the script :).  Good look to those that have lots of time to try to find these things. Really wish it wasn't like this. :(

 

Link to comment
Share on other sites

I'll give the marble game a look sometime. I think it has something to do with the collision mode being "Character" and it not being a character controller.

I think my script uses a custom aabb test. The engine has a way to test if an entity is in its aabb. I use that function now.

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

Does this occur in the door FPS example? There is a hidden trigger field there that opens the second door.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

5 hours ago, Josh said:

Does this occur in the door FPS example? There is a hidden trigger field there that opens the second door.

For now I'd appreciate it if we can we focus on the provided test case I took the time to put together. I'm not using FPS so choosing a different example with a much more complicated map and different controller seems a strange request.  I purposefully chose marble game as it is close to what I am doing and the problem can be shown there very easily (at least for me).

Link to comment
Share on other sites

5 hours ago, Josh said:

Does this occur in the door FPS example? There is a hidden trigger field there that opens the second door.

All I do is fps stuff and I have seen no issues. Again, I never was looking for a problem.

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

I can confirm this. Note that it only starts happening after you have hit the object once. I went behind the block without touching it and the error did not occur until the first time I touched the block.

screenshot0.thumb.jpg.ee237c5e217558678be1038db8f0bbca.jpg

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Thanks god I'm not being crazy then.

I came across this when I was planning to do a Ludum Dare Jam game.  This cost me a lot of time and I've had to abandon my submission (which I may have held of on anyway - it was more and informal thing). Well if it is real and it gets fixed then great in the end.

This behaviour was REALLY screwing up trying to do checkpoints and respawns as it would just keep respawning me after I'd triggered the checkpoint collision brush.  I suppose I could also have had some bad code but it seemed to be this mainly I think.

 

Link to comment
Share on other sites

Please don't forget that I believe there is also missing collision documentation  as mentioned above.  I really think that some information needs to  be outside of needing a forum search.  Order by date might help too.

 

Link to comment
Share on other sites

This does not seem to happen with character controllers. I probably missed this when making my button as I only use the collision function to add an entity to a list if it's not already part of the list.

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...