1. Hey! Guest! The 33rd GMC Jam will take place between May 23rd, 12:00 UTC (Friday noon) and May 27th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

Android [released] Sailing app with fluid simulation

Discussion in 'Work in Progress' started by Mann_mit_Hut, Jul 28, 2016.

  1. Mann_mit_Hut

    Mann_mit_Hut Member

    Joined:
    Jun 22, 2016
    Posts:
    79
    Hey guys!

    I'm working on a new project, which is an app that draws the flow around your sails on the boat.
    It does it with a fluid simulation, that takes the wind direction and the position and form of the sails as input.
    It calculates the flow around the two sails and draws it over the boat around the sails

    I made prototypes for both sides, the room the app will look like, where you set up the wind and sails, and the fluid simulation.
    The fluid simulation was (obviously) pretty hard to to, but it works for 1 sail now and can calculate a new set of streamlines very fast. Its realtime so i hope it will be fun to play around with it.

    Drawing the streamlines is not realtime, but it should be possible to move some particles though the velocityfield.

    So in the next time i will:
    - make 2 sails work
    - let the user set up wind and stuff
    - couple the fluid simulation with a actual sail on the boat


    Please let me know what you think ;)
     

    Attached Files:

    Lonewolff, Dr Sunnyside and FROGANUS like this.
  2. FROGANUS

    FROGANUS Member

    Joined:
    Jul 3, 2016
    Posts:
    218
    hrm what's the inspiration behind this? would you implement it in a sailing sim game? is it a tool for actual sailing for calculating boat velocity or something?
     
  3. Mann_mit_Hut

    Mann_mit_Hut Member

    Joined:
    Jun 22, 2016
    Posts:
    79
    Oh yea, i forgot that ;)

    It should give tipps on the actual situation on the boat, in a qualitive way.
    Calculating the boat velocity isn't possible, the realworld situation is way to complex. But the play between the sails is not that easy to understand, so it should give you hints what to try to get better in a certain situation and visualize it.
     
    Last edited: Jul 28, 2016
  4. Mann_mit_Hut

    Mann_mit_Hut Member

    Joined:
    Jun 22, 2016
    Posts:
    79
    2 Sails implemented as well as a first particle (and surface) based visualization.
     

    Attached Files:

  5. Mann_mit_Hut

    Mann_mit_Hut Member

    Joined:
    Jun 22, 2016
    Posts:
    79
    Hey guys,

    i implemented the two sails, the pylons and the ropes with a box2d simulation and coupled it with the fluid simulation.
    As a result, the sails get pushed up and move by the wind forces and the new shaped sail interacts with the fluid simulation again until it gets to a stable state, like in the image below.
    The two sliders can pull the sails near or let them go wider.

    I'm a little concearned about the scale... i think the ship is to small. Maybe it should all be zoomable? What do you think?
     

    Attached Files:

  6. Mann_mit_Hut

    Mann_mit_Hut Member

    Joined:
    Jun 22, 2016
    Posts:
    79
    Hey guys,

    update of the graphics and more usability with larger buttons, for mobile screens.
    I decided to go for a way larger ship, since the surrounding flow doesn't look interesting at all. The green and blue arrows indicate the forward force, everything moving in realtime is pretty awesome to play with!

    The framerate is around 40 on an G4 and s6. Once i compiled it with the YYC, i got 85 frames per second - which is quite awesome! I can decide to have more sail segments, which affects accuracy, or have it run on slower devices.

    Next goals are a small game mode and an optimizer, that optimizes the sailing trim for the given situation.
     

    Attached Files:

  7. sodap

    sodap Member

    Joined:
    Jun 21, 2016
    Posts:
    18
    Wow, just stumbled upon this as I was searching for a way to model wind currents for a litte trash game I'm making about sailing. It's not going to be a real simulation, but something more arcade. However I need a way to create wind currents similar to what you see in this weather forecast
    https://www.ventusky.com/?p=27.65;-82.16;6&l=clouds&t=20160913/22

    I want the game to be about positioning your boat and sail at the correct angle to reach a destination safely before you run out of time and I need the currents to make it fun. Any insight on how to achieve this?
     
  8. Mann_mit_Hut

    Mann_mit_Hut Member

    Joined:
    Jun 22, 2016
    Posts:
    79
    Hey sodap,

    yes, thats exactly the minigame i want to build around it. Currently i plan a 'level' to be a predefined windarrow movement and the player has to get the maximum speed out of it. So mine will be more a microscopic scale, i don't plan to really move the boat in a world, is that your plan?

    If you need some advice for your acarde simulation, just send me a pm.
     
  9. Dr Sunnyside

    Dr Sunnyside Member

    Joined:
    Jun 26, 2016
    Posts:
    24
    Seems like an interesting idea, but it is a bit hard to visualise if it will be good or not.
     
  10. sodap

    sodap Member

    Joined:
    Jun 21, 2016
    Posts:
    18
    Yes, I want to move the boat in a world. Currently I have that more or less down, but I have a global wind vector and I'd like to add different currents to make navigation more interesting. I've tried faking it with gravitational fields but that was crap so I need to come up with a way to model fluid dynamics to create satisfying currents. I might send you that pm!
     
    Mann_mit_Hut likes this.
  11. Bingdom

    Bingdom Googledom

    Joined:
    Jul 1, 2016
    Posts:
    1,675
    This looks cool, do you have any playable demos? I would like to give it a try and see how well this will run on my PC. :)
     
    Mann_mit_Hut likes this.
  12. Mann_mit_Hut

    Mann_mit_Hut Member

    Joined:
    Jun 22, 2016
    Posts:
    79
    Okay I will upload the current status tomorrow. It looks way better in motion :D

    @ sodap:
    What you need is a procedural fake turbulence fields to make the linear flow more interesting. To see what I mean take a look at the link below for example. Hope I gave you enough google keywords :D
    If you scale the turbulence large it will be easier to sail through, if you scale it small the wind changes often.

    http://wiki.popcornfx.com/index.php/CParticleSamplerProceduralTurbulence
     
  13. Mann_mit_Hut

    Mann_mit_Hut Member

    Joined:
    Jun 22, 2016
    Posts:
    79
    Here is a windows executable, it would be nice to know how it performs on your PC (according to the smoothed top right FPS counter). I get a round 120-140 FPS on my desktop.
    https://www.dropbox.com/s/90ljjnf1spfp7dx/Segeln.zip?dl=0
     
  14. Bingdom

    Bingdom Googledom

    Joined:
    Jul 1, 2016
    Posts:
    1,675
    I sit around 55FPS

    SPECS:
    CPU: 1.5GHz Dual Core
    Ram: 4GB
    GPU: Intergrated
     
  15. Eutynemo

    Eutynemo Member

    Joined:
    Feb 2, 2017
    Posts:
    3
    Hi, i'm trying to create a turn based sail game. I'm really new to game maker, and i 'don't understand how to set movement speed and angle related to wind direction. Do you have some helps? thank you
     
  16. Mann_mit_Hut

    Mann_mit_Hut Member

    Joined:
    Jun 22, 2016
    Posts:
    79
    Yes do you know anything about sailing physics? Because real-time simulation is very slow that's why mine is only one boat :D
     
  17. Mann_mit_Hut

    Mann_mit_Hut Member

    Joined:
    Jun 22, 2016
    Posts:
    79
    So maybe you need an abstract model to set the sails
     
  18. Eutynemo

    Eutynemo Member

    Joined:
    Feb 2, 2017
    Posts:
    3
    i know about sail phiysics because i'm a sail coach, but what i want to create is not a real time game but a turn- based tactical game. In game maker i can move the boat in an angle direction but i need to move the boat compared to the wind direction. So I made an object for the wind, but then...?
     
  19. Eutynemo

    Eutynemo Member

    Joined:
    Feb 2, 2017
    Posts:
    3
    I want to create a game in which players every turn can decide if go straight, tack, luff up, bear away, etc...
     
  20. Mann_mit_Hut

    Mann_mit_Hut Member

    Joined:
    Jun 22, 2016
    Posts:
    79
    Okay, so without making a full fluid simulation, you should build an approximation model for the Force that acts on your ship. You can build a function that takes the current wind and the sailing positions and gives you an approximation for the forward force.

    This function you can build from your experience, something like:
    Wind from 0° (front) = 0 Force
    Wind 0-180° = compute angle of sail compared to wind, good angle = full Force, bad angle = linear falloff to 0 Force
    Wind 0-30° = penalty to the resulting force, because these sailing angles are just bad ;)
    and so on....
    With the amount of Force you can move your ship in that turn.

    Good thing is: the player can learn and understand these approximated physics model, the can get better and understand their mistakes.
    Anyway, we can do further discussion in private, just send me a pm =)
     
  21. Mann_mit_Hut

    Mann_mit_Hut Member

    Joined:
    Jun 22, 2016
    Posts:
    79
    Hey guys,

    i released the simulation to the google app store in November and got >12.000 downloads upt to now, so the simulation found it's niche ;)

    I have implemented most relevant features but still do minor updates if people come up with good ideas or relevant feature whishes.
    You can find it here!

    Thank you all for your support!
     
    sitebender likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice