CJO Games Posted October 23, 2023 Posted October 23, 2023 Playing newly created terrain sees the player falling through the terrain - unlike the last terrain issue the player falls continuously as though the physics in the map are not working at all. Thea Mk2.zip Thea Mk1.zip 1 Quote
Josh Posted October 23, 2023 Posted October 23, 2023 It looks like this has to do with scaling of the terrain...stay tuned... 1 Quote Let's build cool stuff and have fun.
Josh Posted October 23, 2023 Posted October 23, 2023 Even unscaled terrain seems to not work too well against the player. I suspect this has to do with me adding half-floats into the terrain collider.... 1 Quote Let's build cool stuff and have fun.
Josh Posted October 23, 2023 Posted October 23, 2023 Maybe not. I switched to 32-bit floats and I still get the same strange behavior. Standby... Quote Let's build cool stuff and have fun.
Josh Posted October 24, 2023 Posted October 24, 2023 There's also a slight mismatch between the terrain collider and the visible geometry, maybe a one-meter horizontal offset... Quote Let's build cool stuff and have fun.
Josh Posted October 24, 2023 Posted October 24, 2023 Okay, I found there was a small error in the terrain texcoord calculation, which caused heightmap lookups to be half a pixel off. This caused a mismatch between the visual and physics geometry. I will continue working on this tomorrow, but I suspect everything will work out correctly now. Quote Let's build cool stuff and have fun.
Josh Posted October 24, 2023 Posted October 24, 2023 I have fixed the horizontal scaling. However, it looks like vertical scaling of terrain is not supported. Something should be done to resolve this or prevent the user from creating the situation, but I am not sure what yet... Quote Let's build cool stuff and have fun.
CJO Games Posted October 24, 2023 Author Posted October 24, 2023 That's great - thanks. The vertical scaling was mostly borne out of mu own laziness rather than it needing to happen that way :-) Quote
Solution Josh Posted October 24, 2023 Solution Posted October 24, 2023 I think I have a solution. In the terrain loading code, if the y component of the terrain scale is not one, then it gets set to one and every terrain point's height gets multiplied by that scale value. Quote Let's build cool stuff and have fun.
Recommended Posts
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.