Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Hiplinc · Aug 01, 2021 at 06:43 PM · movementnavmeshpathfindingbezier

How do I describe the path of a boat with a curve?

Hello math wizards of the forum. I have a question regarding a somewhat special bezier curve. I am trying to describe the path of a turning ship with a bezier curve like in the game Leviathan Warships. So far I tried a normal cubic bezier curve but as you'd expect it becomes very unnatural at tight angles. alt text I also tried the navemesh agent but it can move very unlike a boat. Anyone have an idea or a hint where to start to create a curve that describes the movement of a boat and takes its turning radius into consideration?

bezier-curve.png (27.4 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Pangamini · Aug 01, 2021 at 09:37 PM

How did you get an idea that a bezier curve describes a path of a physical object, with momentum and stuff? That can easily give you very unrealistic paths. I checked the video. From what I see, there's simply a circular path followed by a straight path. So try to define a turning radius of your boat, calculate the angular distance of how much you have to travel on that circle before you can move straight. alt text


image-2021-08-01-233547.png (5.8 kB)
Comment
Add comment · Show 7 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Hiplinc · Aug 02, 2021 at 05:32 AM 0
Share

The reason I thought a modified bezier curves might be the answer is because it already simulates something like acceleration. I like your approach but I think it might run into some trouble for targets that are very close to the boat at more than 90 degrees. In the video the turning radius "collapses" for very near points. I guess I would have to factor in the boat not accelerating to maximum if it aims for a near point. I wish there were a magic formula that takes all the factors like acceleration and turning radius into consideration but that might be too optimistic. Still thanks for the idea! ^^

avatar image Pangamini Hiplinc · Aug 02, 2021 at 09:33 AM 0
Share

Well, if the turning radius is a fixed constraint, then yes, you cannot reach a point that lies within the green circle without moving forward or backwards first. Imagine a car that's reversing to make it to a parking spot. If the turning radius is not a fixed constraint, then you could just evaluate it to be small enough so that the point you are trying to reach lies on it. Bezier curve will easily give you completely unrealistic acceleration and / or trajectory

avatar image Hiplinc Pangamini · Aug 02, 2021 at 09:58 AM 1
Share

That's probably the way to do it. Assume a fixed turning radius at maximum acceleration and speed if the target is a certain distance away and if it's inside the radius you evaluate a new turning radius with a lower speed. I think I can work with that. Thanks!

Show more comments
avatar image Bunny83 · Aug 02, 2021 at 01:25 PM 0
Share

I don't know the reference game, however when you look closely the path has a green segment which seems to represent the acceleration / velocity of the object. So the object most likely has a certain max acceleration and a certain turn speed. So the path it traces seems to depends on several factors of the movement mechanic. That means if the distance to the target is rather short, it does not accelerate up to it's max speed which in turn means that the turning radius will be smaller. So I'm pretty sure they just do a forward iteration / prediction of their movement mechanic. You can see that the radius changes and also the length of the green segment changes which most likely indicates an adaptive acceleration based on the distance.


So the real question is if for some reason you want to mimic this exact behaviour or do you just need "something" like that. You generally get the best results if you just use your actual movement mechanic to draw the prediction. So all you have to do is "fast forward" / integrate your movement logic into the future and sample the path on the way.


I once did something like that in a simple lunar lander clone completely written in C++. For the prediction I literally had transparent copies of the player object which were simply updated from the current state and drawn accordingly. Though this was just a debugging feature and not a game feature -.-


For example games like Peggle most likely used the same approach for their prediction and especially for the "zen shots" which adjusts your aim slightly to get the best result with that general direction. So the game simply played through all sorts of tiny variations and sees which one gives the best result.

avatar image Hiplinc Bunny83 · Aug 02, 2021 at 02:10 PM 0
Share

The green path only tells you where it will go through and where it will be after 10 seconds (that's where the green path becomes darker). Maybe I should've explained what the game does a bit better and put it into the video. I don't really need this exact behaviour but I'd like to just experiment a bit with boat movement. I think you and @Panga$$anonymous$$i are absolutely right that "fast forwarding" is probably the cleanest and best way of doing it. I think @Panga$$anonymous$$i 's answer sounded scary to me because he mentioned simulation but in hindsight that is exactly what I should do. The research paper has a very simple logic for the movement and I think it shouldn't be a problem to "cast that forward".

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

188 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How do I fix two NavMeshAgents fighting for the same position? 1 Answer

AI movement with other factors such as paths that increase walking speed 1 Answer

How to move object along Spline at constant speed? 0 Answers

iTween for Dynamically Moving Objects around a Sphere 0 Answers

NavMesh Baking Problems 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges