-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Minimum Follow Distance for Follow Path Cameras in 3D #256
Comments
camera_better.mp4Was able to do an independent study/exploration outside of phantom camera to achieve the effect, but I would like any guidance (if appropriate/possible) on integrating some of the discoveries here with some of the benefits of phantom camera (volumes, framing, blending focus between multiple nodes) On the player, the raycasts provide this information:
and the test camera
Some code shown is from the following sources: https://godotforums.org/d/36094-3d-tank-controls-for-player-movement |
Have been giving this some thought, and think this should be fairly durable. The only question I guess is whether if the applied minimum distance should always be applied to the camera's local z-axis so that it pushes the camera away from its |
Practically speaking, it should be a matter of applying a positional value to the |
I haven't fully solved that one myself in regards to the quirky and sporadic movement, at least with the implementation I've been assisted with. A lot of does come down to the designer/editor being mindful of the placement. The source examples and era I'm drawing from do have a lot of infamy with cameras being a bit chaotic and unwieldly so it's not too bad I feel if that remains a caveat. One of the few potential resolutions I've been tempted to include but have yet to due to wanting to piggypack on Phantom Camera functionality is a bias/weighting system where there are rays also exiting from the sides of the character and the final camera position is based on trying to follow a few different positions or markers like the group functionality does in Phantom Camera currently. I think that, leveraged with a way to set a 180 degree bias plane would help keep the camera from making wild swings and make fairly natural / expected decisions, but I am unsure and it is necessary for the baseline integration. If you would like, significant improvements have been made on the code referenced above have been made if you think it would help in integrating the feature. I'll also try to implement things myself based on your description but am fairly new to programming so am unsure how clean it will come out. |
Wonder if a simple solution would be to have the camera offset itself from the path when the followed target gets too close, like so? Essentially, it's a bit of simple maths and trigonometry to push the camera away from the followed target if the distance between it and the |
Sorry for the delay on this! Yes, I agree and think/was hoping for the path to be a broad suggestion more often than being rigidly defined, at least by default. I think my delay came from wanting to grab better video of the current implementation I have, and where I wouldn't mind improvement. debug_video.mp4The camera right now is locked to the player's back essentially, which generally flows pretty good but when trying to turn where the debug figure is or in other scenarios, rather than fall back to where it has better coverage of the player, the front facing object and it's rear target position, it sacrifices everything for the front view. also, godot was being a little stubborn so here's a rough traceover of the path rather than the godot markers. With the red line being the path3d's charted route, gold being the current position and green being the ideal position. |
Think there's a way to do this, but the scenario of how a camera will remain a minimum distance away when the Also wonder if that would lead to a scenario where you could never have the camera on the other side of the player on the |
Hello! Sincere apologies for the delay, I appreciate the issue remaining open. I get your concerns I think, though I also agree this is down to implementation as many of the games referenced had moments where the camera could swing wildly if several factors stacked together. One thing in particular that drew me to phantom camera and might help here were the different types of follow mode. In my case what I was planning to do near transitions is set biases between a mixture of the player character mesh, the forward facing target and a node3D that was the intended angle. In other use cases (like the more static cameras of a Resident Evil game or Alisa) the forward facing target would be unused or not needed. Not sure if this helps at all, thank you again for looking into this |
Project Type
3D
Feature Description
example.mp4
Currently when using a path follow type it locks to the target and attempts to use the minimum possible distance between the target, it and the path. This generally works well but in my attempts to use phantom camera's set to path follow as the baseline of a realtime 3D survival-horror project the current implementation creates unflattering angles and feels very artless. I've attempted a few workarounds but am unsure if this is possible in the current framework as the core issue is that "lock-on" being absolute rather than a minimum distance it then tries to seek on the path.
Use Cases
Primarily focused around projects that require fixed camera angles along paths but also have some degree of player control or dynamic movement coded in the path. Example games would Silent Hill and Metal Gear Solid trilogies on PS1 and PS2, as well as Ico.
https://youtu.be/k7Kr15i7qeI?t=1980
This video showcases a section in Silent Hill 2. The camera system in the hallway is able to handle rotation alongside some sharp cuts (already supported) or static angles while also keeping a minimum distance from the protagonist/characterbody3D before needing to find a different angle.
Importance
High - there are critical things I can't do without this feature
Usage
Often - a significant amount of projects can find this useful
(Optional) Proposed Solution
While done in a completely separate engine (Unreal in this case) and shown via visual scripting, this forum discussion goes over how users of that engine were able to implement a similar camera system to what I am describing and may provide insights.
https://forums.unrealengine.com/t/how-to-camera-movement-silent-hill-hallway-style/1166190/2
The text was updated successfully, but these errors were encountered: