Scripts / A different sort of thread from me - a bug I can't figure out!

Author
Message
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 29th Jul 2017 22:39
See I bet you lot sit there looking at my threads thinking 'it's all so easy for him|' well today I have to announce that I too spend ages chasing weird bugs, things which all logic dictates should work fine but for some reason which eludes me just won't play ball.

So here is an example which I have been chasing most of the day with absolutely no joy; you may have noticed a certain 'Mech' thread, well I am about to embark on a major redesign of the walking mechanics for 'Moose' as I wasn't happy with the way it worked, or more to the point 'appeared' to work as a lot of it was more smoke and mirrors than proper walking around.

Before doing so I set out to fix all the little niggly problems that I knew were there in the code, one of these was the propensity for the feet to suddenly sink into the terrain or entity that the mech was walking across.

See pics 1 & 2 , here we can see Moose standing on the terrain quite normally, one pic the terrain is sloped, the other flat. Notice the feet are angled with the slope and all is well.

Now compare with pic 3, here Moose is standing on an entity, big lump of concrete in this case, and as you can see the heel is on the entity but the toes are sunk into it.

Now the puzzle for me is that it is the same Lua function being called to detect the heel and toe contact points regardless of whether it is on terrain or an entity. Why it works fine for terrain but only works for the heel on an entity is bugging me (pun intended) no end, I've been scratching my head so much over this my cat tried to lend me his flea collar.

Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 30th Jul 2017 01:57
Hmm. This seems to be a question for Lee.

There is a FPE statement that will scale the collision boundaries of a meshed object.
collisionscaling = 100 This does work with static objects also.

Try setting this to collisionscaling = 101 and see if it effects the script detection. Dont forget to reload the map file.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

GraPhiX
Forum Support
19
Years of Service
User Offline
Joined: 15th Feb 2005
Playing:
Posted: 30th Jul 2017 11:50
not sure if it has anything to do with it but I have changed the feet now, they were not set up correctly, I have uploaded a completely new moose (individual components) in the Mech thread, I have changed the joints too they are longer giving you more scope for walking and crouching
Welcome to the real world!
Windows 10 Pro x64 - Core i7-2600K @3.40GHz - 32.0GB RAM - GeForce GTX 950 2GB - 4x500GB SSD Striped
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 30th Jul 2017 12:01
I have physics off and collisions off so I doubt it has anything to do with the FPE settings, think I have a possible solution, will try it out later.
Been there, done that, got all the T-Shirts!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 30th Jul 2017 12:27 Edited at: 30th Jul 2017 12:35
Well the fix worked, basically the way the under-foot detection works is that I calculate where the 'heel' and 'toe' lowest parts are and fire a ray straight down to detect any entity, I fixed the problem by instead firing the ray from a point 30 units above the lowest point and setting the 'ignore' object to be the foot itself. This seems to ensure that the top surface of the entity is detected properly.

It weill be interesting to see if this works as well when the foot is in motion.

edited to add the script so you can see why it badly needs a re-design!
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 30th Jul 2017 13:47
Welcome to the world of software testing (I do a lot of this):



Feet look better but for some reason now when going uphill they are floating above the terrain, darn still more debugging to do!
Been there, done that, got all the T-Shirts!
PM

Login to post a reply

Server time is: 2024-03-29 11:43:06
Your offset time is: 2024-03-29 11:43:06