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

Replace RayCast node with a generic ShapeCast node that cover more options #2896

Closed
eon-s opened this issue Jun 20, 2021 · 7 comments
Closed

Comments

@eon-s
Copy link

eon-s commented Jun 20, 2021

Describe the project you are working on

Generic platformer-action game

Describe the problem or limitation you are having in your project

For some detections Area nodes can be overkill, RayCast nodes need a particular (sometimes not so simple) setup, there is when shape casting come handy but setting up shape casts is cumbersome (you need to get the body state, create the input dictionary, and then fire the cast) and visualizing them (in game and in editor) is complex (more in 3D).

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Replace the RayCast node with a generic ShapeCast node, it could behave the same but adding more (already existing) options.

This will improve the setup of shape casting features, reduce the usage of tool nodes and help on design and debug when using shape casting.

This feature have proven to be really useful on other engines, for example (search for shape traces):
https://docs.unrealengine.com/4.26/en-US/InteractiveExperiences/Tracing/Overview/

imagen

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Extend the RayCast functionality by extending it to use other shape casting options already available:
https://docs.godotengine.org/en/stable/classes/class_physicsdirectspacestate.html

imagen

If this enhancement will not be used often, can it be worked around with a few lines of script?

No, it requires making a tool script that can handle all the set up data and visualization which can be quite complex for average users.

Is there a reason why this should be core and not an add-on in the asset library?

For the same reason RayCast node is in core and not in the asset library, the existing PhysicsDirectSpaceState API is useful but too complex to use in an optimal way.

@yosoyfreeman
Copy link

Really important feature and well explained. This is a major improvement and will make prototyping a lot easier.

@Xrayez
Copy link
Contributor

Xrayez commented Jun 20, 2021

I have the 2D version already implemented in Goost. See also my proposal at #710.

@eon-s
Copy link
Author

eon-s commented Jun 20, 2021

I have the 2D version already implemented in Goost. See also my proposal at #710.

Oh, I was searching for references to RayCast and didn't found that proposal, I'll close this then.

@yosoyfreeman
Copy link

I have the 2D version already implemented in Goost. See also my proposal at #710.

Oh, I was searching for references to RayCast and didn't found that proposal, I'll close this then.

but that is only for 2D, this PR was for 3D, right?

@Xrayez
Copy link
Contributor

Xrayez commented Jun 20, 2021

These are just proposals which share the same topic. I personally have little expertise in 3D but it's probably better to have a discussion in a single place. Godot has an implicit development policy that any feature is implemented both in 2D and 3D (when relevant), but yeah 3D may have slightly different use cases compared to 2D when we talk about shape casting perhaps, I wouldn't mind if this one is kept opened personally.

@yosoyfreeman
Copy link

These are just proposals which share the same topic. I personally have little expertise in 3D but it's probably better to have a discussion in a single place. Godot has an implicit development policy that any feature is implemented both in 2D and 3D (when relevant), but yeah 3D may have slightly different use cases compared to 2D when we talk about shape casting perhaps, I wouldn't mind if this one is kept opened personally.

Thanks a lot for the Explanation. Is stilll hard to me to understand who all works with this things.

I think the 3D wokflow is particular, so if this keep closed maybe we should add some details on the other?

@Xrayez
Copy link
Contributor

Xrayez commented Jun 21, 2021

I added a link to this proposal at the top of #710 now.

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

No branches or pull requests

4 participants