Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New surface material footstep system crashes on collisions with ArrayMesh #65

Closed
Bezoika opened this issue Feb 13, 2024 · 8 comments · Fixed by #70
Closed

New surface material footstep system crashes on collisions with ArrayMesh #65

Bezoika opened this issue Feb 13, 2024 · 8 comments · Fixed by #70

Comments

@Bezoika
Copy link

Bezoika commented Feb 13, 2024

I use qodot for my level building which uses an ArrayMesh for every level build. The second I try to move it causes a crash with the new system. I noticed it works fine on the demo scene so I'm assuming based on the information that it is only looking for normal MeshInstances.
image

@ac-arcana
Copy link
Collaborator

ac-arcana commented Feb 13, 2024

I'll look at this ASAP. I love Qodot myself and intend to use it later. An array mesh is something I had not considered.

I'm at work so can't look at the code right now. For now if you just return null on that line it will probably prevent that crash so you can work on your Qodot maps. It will stop the system from working properly with the material dictionary though.

Also, regarding Qodot, what are your thoughts on how to support footstep materials through Trenchbroom?

@Bezoika
Copy link
Author

Bezoika commented Feb 13, 2024

All good, no rush, I took a look at the system a bit when i got the crash. Looks like a cool way of implementing it.

Also, regarding Qodot, what are your thoughts on how to support footstep materials through Trenchbroom?

This really shouldn't be too much of an issue, as if you add a .tres with the same name as the texture that trenchbroom uses, it will automatically replace the texture with the material when the map is built in godot. Add said material into the step system and it should work fine.

@ac-arcana
Copy link
Collaborator

ac-arcana commented Feb 14, 2024

You're definitely right this is due to an array mesh. I'm able to prevent the crash and tell when it is an array mesh with the following:

image

No idea how to get the right materials from an array mesh yet though.

I can get some information about the first surface, like for example the name of it. I'm not sure how I'm going to find the right surface out of all the surfaces in the ArrayMesh.

@ac-arcana
Copy link
Collaborator

I'm not sure that getting the right material is going to be possible. Currently, I'm just getting the first material I can find from a collider. This works fine for small models, but when the entire map is one static body this poses a problem.

Since I am relying on collision data, what I am getting back is the static body. From there I find the array mesh. The trouble is polling an array mesh to find out what surface would be at the collision location and its material. This is beyond my expertise and I'm not sure that its possible. I don't really know how to go about trying to solve it.

I can provide an update to fix the crash and just play a generic sound instead for now.

@Bezoika
Copy link
Author

Bezoika commented Feb 14, 2024

I see, that stinks because i really liked the simplicity of it. I don't know if this would be helpful or not, as its kind of older but he states that it takes into account models with multiple materials so I don't know if this would work or not, but the code is way over my head so I figured I might just link it to you and see what you think.
https://www.youtube.com/watch?v=WhMfocT9l-o

Whether it helps or not, thank you for making the bypass.

@ac-arcana
Copy link
Collaborator

I'll def take a look, and I will do some more digging into docs to find some kind of alternative at least. I'm determined to use Trenchbroom

@ac-arcana
Copy link
Collaborator

I got to look at the video now. It looks like it might work, I'll definitely dive deeper into the technique he used and try it out. It's gonna take a bit of time for me to really dive in though. It's a very busy week for me and next week I'll be away on a trip.

@Bezoika
Copy link
Author

Bezoika commented Feb 15, 2024

All good man, love to find out if it works but I'm in no rush, busy here too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants