Android [released] Sailing app with fluid simulation

M

Mann_mit_Hut

Guest
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 ;)
 

Attachments

FROGANUS

Member
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?
 
M

Mann_mit_Hut

Guest
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 by a moderator:
M

Mann_mit_Hut

Guest
2 Sails implemented as well as a first particle (and surface) based visualization.
 

Attachments

M

Mann_mit_Hut

Guest
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?
 

Attachments

M

Mann_mit_Hut

Guest
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.
 

Attachments

sodap

Member
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?
 
M

Mann_mit_Hut

Guest
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.
 
D

Dr Sunnyside

Guest
Seems like an interesting idea, but it is a bit hard to visualise if it will be good or not.
 

sodap

Member
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.
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!
 
M

Mann_mit_Hut

Guest
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
 
E

Eutynemo

Guest
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
 
M

Mann_mit_Hut

Guest
Yes do you know anything about sailing physics? Because real-time simulation is very slow that's why mine is only one boat :D
 
E

Eutynemo

Guest
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...?
 
E

Eutynemo

Guest
I want to create a game in which players every turn can decide if go straight, tack, luff up, bear away, etc...
 
M

Mann_mit_Hut

Guest
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 =)
 
M

Mann_mit_Hut

Guest
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!
 
Top