Scripts / LUA Intersectall command

Author
Message
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 24th May 2020 06:39 Edited at: 24th May 2020 18:52
Has anyone else experienced issues using IntersectAll with dynamic entities where over time it stops detecting certain faces on the models? I noticed also a really weird behavior in that when im experiencing this issue, if i modify ANY value or field in the object property panel the issue will then transfer to another dynamic entity.

I basically have static walls and dynamic walls (immobile set) and you pull switches to open these doors. The issue still occurs even if the doors are removed completely of any script. So its an issue related to the raycasting. The raycaster works perfectly for the static walls.

The video below shows how everything works. Also show how it should work. I use ray casting so i can move the player around on a grid fashion. Works EXCELLENTLY.



For the most part it works fine, but out of nowhere the ray caster will start returning 0 on certain faces of the dynamic entities. Not present in the above video test, I'll do another.

EDIT: To better explain, the dynamic walls will sometimes work perfectly in some tests, then if i modify anything in their property panel or sometimes even just move them, the issue is transferred to a different entity. Also issue can sometimes come back to the original or include all or even none. It seems random.

The raycaster will return a value of 0 on some faces of the entities. (but again it will decide when it works and when it doesn't).
Store Assets - Store Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 24th May 2020 10:03
I don't see any issue in the video.. it's going to be hard to guess without any code or examples, you just said the same thing 3 times but not really given anything to go on... Can you show how you are working out the raycast and what you are doing to the dynamic objects that no longer return collision?

Game looks good, one of the most polished GG games I've seen
though I'm not personally a fan of the combat shown, does moving around actually benefit you? It feels like you were going for a more turn based D&D game then got some real time combat.

P.s your gold display is wrong, it updates with the last gold gained and not the total gold.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 24th May 2020 11:45
Pm me the script on discord and I can take a look see if you want.
Been there, done that, got all the T-Shirts!
PM
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 24th May 2020 18:45 Edited at: 24th May 2020 19:12
Quote: "I don't see any issue in the video.. "


Forgot to mention in the video everything is working fine. I should do another video showing the exact issue and even how to push it to occur.

Also my raycasts are more like lines rather than boxes. However I've tried also making a raycast cube check and the issue still is there even with a wider raycast check. It really seems to be related to faces. Something is going on randomly with my entities im thinking.

But if anyone wants to see how its operating right now:
http://tyronemw.com/peculiars/ThePeculiars.rar
(this build currently has the issue)

WASD to move Q+E to strafe. You can move through some dynamic walls/doors and strafe through them. This issue shifts around between the doors whenever I make an editor modification it seems. Its very odd and difficult to isolate.

Quote: "Game looks good, one of the most polished GG games I've seen"


Thanks! If I can get past these raycasting issues, I hope to start improving the assets and atmosphere.

Quote: "though I'm not personally a fan of the combat shown, does moving around actually benefit you? It feels like you were going for a more turn based D&D game then got some real time combat."


The combat is constantly evolving. I was originally going to go with a turn-based system. Though it seems that would just reduce the niche of interest with a grid-based dungeon crawler in 2020. Shorter attention spans I guess with gamers today. I've held a couple of polls in the dungeon crawler communities. Still debating though.

Moving around does have some affect, in that attacks can result in a miss. Enemies however, currently do not move. For obvious reasons related to raycasting at the moment i dont want to get into a bigger mess with enemies as well as walls.

Quote: "P.s your gold display is wrong, it updates with the last gold gained and not the total gold."


I might have fixed this in a more recent build, will have to double-check.

Here is a video of me playing through with the issue present in latest build and with me alternating the smallest information in the entity proper panel and then the issue goes away for no reason at all that I can think of. The issue will come back however if i even touch the other entities or the same one, in the editor.


If i get time later today where im in quiet environment I'll record with audio explaining the issue as i re-produce and show inside the scripts as well the possible offenders.
Store Assets - Store Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 25th May 2020 09:47
Quote: "The combat is constantly evolving. I was originally going to go with a turn-based system. Though it seems that would just reduce the niche of interest with a grid-based dungeon crawler in 2020. Shorter attention spans I guess with gamers today. I've held a couple of polls in the dungeon crawler communities. Still debating though."

Fair enough, I prefer turn based games personally, the Final Fantasy series was my favourite growing up but even the FF7 remake went with an action combat system so it does seem that is the flavour of the times.
Perhaps it would be better to lock the player in a room with the main enemies then so they can't simply keep backing away back down the corridor to make him miss every time?

Does the raycast only fail on strafe?
Not sure what you mean by a ray cast box... Ray casts are lines
You should ray cast from the player in the intended direction of travel.
You will want to use amen's quaternion code to work out the end of the ray.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 25th May 2020 18:08
Quote: "Perhaps it would be better to lock the player in a room with the main enemies then so they can't simply keep backing away back down the corridor to make him miss every time?"


Ironically I was just going to test this, with that last orc , where the doors close behind you. But of course. The player can just walk through the door due to this current bug I'm dealing with. Was going to make it where two doors close on you and you have to kill him in order to open the doors again.

Quote: "Does the raycast only fail on strafe?
Not sure what you mean by a ray cast box... Ray casts are lines
You should ray cast from the player in the intended direction of travel.
You will want to use amen's quaternion code to work out the end of the ray."


The raycasting fail randomly on either moving forward, strafing, moving backwards. And randomly only on certain directions it fails on (south, east, west, north). Which makes it exceedingly difficult to troubleshoot. Again though. The raycaster works perfectly for the static walls which are the same mesh/entity as the dynamic walls which randomly decide to work or not on.
Store Assets - Store Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 25th May 2020 18:23
does it only stop working after you open the door and close it again? perhaps it's simply not turning the collision back on? collision is required for ray casting to work
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 25th May 2020 19:10 Edited at: 25th May 2020 19:14
It stops working if I touch the entities at all in the editor. I could even remove the scripts entirely from the doors and the issue will still randomly come and go. I could place a new entity into the scene and it will sometimes occur for those entities as well if dynamic.

Everything was working for a few months then just started doing this. Not sure if related to GG Updates or just that I had expanded the level more either taking up more memory or causing more OBJECT ID's to being generated. I really am wondering if its related to OBJECTIDs as the issue directly seems to come when I change anything in the editor and not the scripts.

While working with Amen recently on this, he had mention that Object IDs can change if things are modified in the editor. So the static number i had put in the raycaster to ignore, I thought maybe that must have been the issue then, since that number could become any other entity. Changed that to using the global obj variable so it grabs the entity's object ID dynamically instead of a static number. But the issue still remains. Which is unfortunate.

All entities that have this issue have Physics On. Which is extra confusing. I've even added CollisionOn at the start of any of them using scripts and it still will randomly allow me to walk through them (at certain angles and not others).
Store Assets - Store Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 25th May 2020 19:55
Times ago I was working with raycast in my breakables building scripts, and I've some issues too about raycast working randomly.
IIRC entities should be zeroed (0,0,0) for rasycasting to work.
I remember raycast working only with dynamic entities, at least in those times. I haven't work with raycast enough but I think raycast need to know the entity id and static ones don't give much info.

Had you tried on a blank map? just the player plus few entities.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 25th May 2020 20:14
This one is really peculiar, I have added debug and the raycast works with exactly the same values when the camera is facing one way but fails with the exact same values when the camera is facing the opposite direction.
Pretty mind boggling one tbh.
I have noticed that the doors are a bit peculiar in that the origin appears to be offset from the visible door but that still doesn't explain why the ray cast works differently depending on where the camera is pointing.
Been there, done that, got all the T-Shirts!
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 26th May 2020 04:26
Yep, have experienced ray-casting anomalies many a time over the ages.
Always chocked it up to a faulty script, so kept bashing my head over where
it was wrong? Maybe it's just a bug after all?

BTW, it mostly works well most of the time-- except when it doesn't.
PM
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 26th May 2020 07:51 Edited at: 26th May 2020 07:53
The situation gets weirder. If I don't even touch any script what so ever nor touch any of the existing entities ... but simply place a new entity on the map, as dynamic with physics on and immobile... the issue will randomly go away from the original entity.

This has become one of the most impossible issues to isolate. I'm starting to really think this a Game Guru bug. Which I really hope isn't the case. As Id have absolutely no idea how to explain this one to Lee. Considering it would need to be reproducible and it's so random.
Store Assets - Store Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 26th May 2020 12:39 Edited at: 26th May 2020 12:42
If you notice here I have to look for the right angle for shooting.
I've forced to use other ways to get my building broken for release on the store, because I don't trust raycast in GG atm.



Edit: fixing video link
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 26th May 2020 15:18 Edited at: 26th May 2020 15:20
yep, confirmed, there's a bug going on in GG somewhere.



@3com you can use the projectile commands to make the houses explode more accurately

or make a script that tracks their HP (if you want non-projectile weapons to also destroy them)
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11

Attachments

Login to view attachments
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 26th May 2020 22:18
@smallg : can you add this bug to GitHub?

There should be enough for Lee or Preben to go on.
Been there, done that, got all the T-Shirts!
PM
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 28th May 2020 03:11 Edited at: 28th May 2020 04:25
Thank you both very much for looking into this. I couldn't describe the amount of debugging i was trying to do to try to isolate the issue. Worse than I thought it might have been something I was doing incorrectly. I was actually hoping I was doing something wrong - that would mean the issue could be fixed.

My game project is currently dead due to this issue. I would love it if it someone could support in getting the issue posted to Github. I don't have the ability to explain the situation well enough in the right terms. Considering this is an internal bug with one of the commands and not a general LUA issue.
Store Assets - Store Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 28th May 2020 17:57 Edited at: 28th May 2020 18:06
https://github.com/TheGameCreators/GameGuruRepo/issues/797

Issue raised in case anyone wants to add any further info to it.
Been there, done that, got all the T-Shirts!
PM
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 29th May 2020 04:23 Edited at: 29th May 2020 04:23
I also noticed someone was experiencing possibly a similar issue in 2019?

https://forum.game-guru.com/thread/220812

Could be related?
Store Assets - Store Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 29th May 2020 12:12
@ smallg
Quote: "or make a script that tracks their HP"

I finally ended up using that way on the day. I had opted to don't take a risk on the store items and don't trust raycast, better track the item health.
I was working too with the gunshot, but then all the closest buildings break as well, and that not the goal, so better track item hp.
Thanks anyway for the clue.
Anyway, I would work with raycast better than other ways, but working as expected with dynamic and static meshes.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 3rd Jun 2020 08:43
Made a post on github, though I am not sure how to instruct on how to re-produce the issue. Considering how complex the issue is and that sometimes the issue wont even be present and other times its there but only for certain angles of view.

What makes no sense to me is i could collide with the dynamic wall moving forward into it (in some cases) and then strafe through it. The code for doing this and the values on where to check for the collision is EXACTLY the same.. the only difference is the player/camera is angled differently.

Again the issue comes and goes. Sometimes everything works, sometimes not. Impossible for me to describe the issue on github sadly.
Store Assets - Store Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 3rd Jun 2020 11:37
that's a good point, in my example map it was consistent, the "walls" (i also tested with other stock objects) were always behaving the same regardless of how many times i played the map, i wouldn't expect it to work perfectly for you sometimes given how it worked (or rather, didn't) for me... the raycast was always missing part of the objects based on the direction of the camera
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 3rd Jun 2020 21:01
@smallg : can you add your findings to the GitHub issues, either the one I raised or T-Bone's one please.
Been there, done that, got all the T-Shirts!
PM
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 4th Jun 2020 06:06
Quote: "the raycast was always missing part of the objects based on the direction of the camera"


That's the best way to sum up this bug and reflects the issue im experiencing perfectly.
Store Assets - Store Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960

Login to post a reply

Server time is: 2024-03-28 19:49:30
Your offset time is: 2024-03-28 19:49:30