
Show HN: Global sailing navigation simulator using real weather/ocean data - ls65536
https://8bitbyte.ca/sailnavsim/
======
gus_massa
[From someone that can barely distinguish the top and the bottom of a boat
...]

Nice captcha. I guess it's easy for the people that are the target of the
site, but uncommon enough to be difficult for robots. (Adding some decorations
may make it more difficult for robots, if they become a problem.)

Are robots really a problem or the problem are just morons that create too
many boats?

How many boats do you have currently? If I don't log in for a month, is my
boat sink/rescued?

When I read race, I expect at least two boats. Is there a record board when I
finish the race. [I have to go from Sydney to a random point in the middle of
the sea in the East, but there is too much wind and my boat is going north ...
I don't expect to finish soon.] Do you organize some kind of events where
people can race against other people?

It would be nice to see the target area in the map [I had to open Google
Maps.] and the trajectory. (And perhaps a log of the commands.)

How do you calculate the direction. From another post, I remember it is a mix
of the direction of the wind and the direction of the boat (and the direction
of the sail?). Is this a standard boat model? Is it a good idea to add more
models of boats?

~~~
ls65536
Thanks for the feedback and questions!

> Are robots really a problem or the problem are just morons that create too
> many boats?

I don't have much evidence of bots actually being a problem so far, but with
that being said I didn't want to start off by making it too tempting to begin
with. Without the captcha it would be trivial to write a bot that generates a
large number of garbage boats. Every boat adds to the server load, however
small the marginal amount may be.

> How many boats do you have currently? If I don't log in for a month, is my
> boat sink/rescued?

There are around 500 boats on the server at this time, but the number is still
growing as I type this (many new boats today certainly coming from HN users).
Currently, if you don't send a command to your boat (course change,
start/stop) within 14 days, it gets garbage collected to free up
resources...whether you consider that getting "sunk" or "rescued" is up to
you. :)

> When I read race, I expect at least two boats. Is there a record board when
> I finish the race.

When you race other boats, there is a table at the bottom of your boat details
page that shows information about all the boats. When a boat finishes its
race, this will be clearly shown in this table, along with the time it took to
finish.

To race other boats, you need to create a race with custom parameters (the
form is at the bottom of the start page) and choose a start time in the
future, with as little as 5 minutes or perhaps as long as several days, to
give others time to join.

> Do you organize some kind of events where people can race against other
> people?

So far I've raced just with a few friends myself (including some races lasting
weeks, between continents), but anyone is free to create a public or private
race and invite anyone else to join. Public races are published on the Races
page [1], where anyone else can copy the race ID and join before the race
begins.

> It would be nice to see the target area in the map

There's a "click here for maps" button on the boat details page, which will
take you to the maps page for your boat/race.

> How do you calculate the direction. From another post, I remember it is a
> mix of the direction of the wind and the direction of the boat (and the
> direction of the sail?).

The boat attempts to follow the true course commanded to it, subject to wind
direction and the boat wind response [2]. The ocean current vector is also
added to the result of that calculation, which gives the final course and
speed over ground.

> Is this a standard boat model? Is it a good idea to add more models of
> boats?

The boat modeled here is just a contrived boat model that seems reasonable
enough for perhaps some sort of 30-40 foot boat which may or may not exist in
the real world. I've created a polar plot [2] showing its wind response so
participants know what they're dealing with when racing. I would like to add
more boat models in the future (including models of real-world boats),
possibly even allowing for custom boat models to be uploaded by the user for
any given race.

[1]
[https://8bitbyte.ca/sailnavsim/races.php](https://8bitbyte.ca/sailnavsim/races.php)

[2]
[https://8bitbyte.ca/sailnavsim/img/wind_response.png](https://8bitbyte.ca/sailnavsim/img/wind_response.png)

~~~
gus_massa
Perhaps you can add at the top some links for people like me that don't
scroll.

Quick Start | Go to Your Boat | Join Race | Create Race

Now I see the box where I have to go. I missed it in the first time I went to
the site. It is in the second map! [My boat is going in the correct direction.
Perhaps not at the optimal speed.
[https://imgur.com/a/yE1Tfre](https://imgur.com/a/yE1Tfre) ]

Perhaps you can offer to save the boat key in a cookie, so it's easier to
return to the site.

~~~
dylan604
> Perhaps you can add at the top some links for people like me that don't
> scroll.

Why do you not scroll a webpage? Do you honestly only view a website based on
what fits in the initial viewport? How do you shop on sites like Amazon, or
browse Netflix, or any other single website on the entire internet?

------
gk1
Sailing tips from a novice:

\- To get past captcha: Find N on the compass. That’s 0 heading. Now go
clockwise and add 30 for every notch until you get to the needle. So 0 (N),
30, 60, 90 (E), 120, 150, 180 (S), ... 330.

\- Once sailing, find the wind angle. You _cannot_ sail within 45 degrees of
the wind. So if wind is coming from, say, 140 degrees, do _not_ set your
course between 95-185 or you will come to a stop. (Because physics.)

\- Sailboats are fastest when sailing 90 degrees to the wind. So if wind is
140, the fastest course would be 70 or 230. Just keep in mind that might not
be the direction you need to go.

\- More wind = faster sailing.

~~~
littlestymaar
> \- Once sailing, find the wind angle. You cannot sail within 45 degrees of
> the wind. So if wind is coming from, say, 140 degrees, do not set your
> course between 95-185 or you will come to a stop. (Because physics.)

> \- Sailboats are fastest when sailing 90 degrees to the wind. So if wind is
> 140, the fastest course would be 70 or 230. Just keep in mind that might not
> be the direction you need to go.

Sorry if this sounds rude, but this isn't how a sailboat works at all! I don't
know enough english vocabulary on that topic to provide a detailed explanation
but I'll try something anyway:

First, the angle between your boat and the real wind isn't what matters: it's
the angle between _relative wind_ and your boat that does, this angle depends
on the real wind and on your speed.

The limit angle is about relative wind, not real wind, and it's not a fixed
number: in depends on your vehicle (boat or other devices with sails like
windsurf or iceboat) and how much “grip” it has on the water (or ice).
Iceboats can have a really tiny angle for instance (few degrees).

> \- More wind = faster sailing

In theory only, because at some point when wind gets stronger, you'll need to
reduce your amount of sails to avoid breaking your ship. Also once again, it's
the speed of the relative wind that matters, not real one, and that's how you
can sail faster than real wind! (I don't know how practical this is with a
boat, but with iceboats it's easy).

Sailboat dynamic isn't that hard (it's mostly basic trigonometry) but it's
pretty counterintuitive. Main takeaway, sails works like wing.

Sorry for bad English.

~~~
gk1
You are nitpicking details that don’t matter in this game.

There is no “apparent wind” indication, only true wind. And the boat in the
game is modeled like a regular sailboat, which means a typical 90-degree no-go
zone.

~~~
xyproto
He sounds like he knows what he's talking about, in terms if real sailing. To
me, that's more interesting than the navigation simulator.

------
claar
Thanks for sharing! Neat idea, and kudo's on creating a concept I haven't seen
before! I like the technical nature of this with the weather integration and
other technical sailing details implemented.

If I may suggest an improvement, if you desire more than the smallest of
audiences, you may want to enlist help from someone with more user interface
or design experience. As is, even this extremely geeky and intellectually
curious HN audience is struggling just to get the simplest race started. I
finally got my boat started after quite a lot of clicking and fiddling --
these were the most confusing steps if it helps:

1\. Figuring out what exactly the site does. The help page really helped, but
it took me a while to realize it existed. I'd suggest adding more help content
to the home page.

2\. Passing the captcha took me a bit of Googling - this is unnecessary
friction if you want a broader audience.

3\. Once I started a race, it was very confusing that I had to just wait a
minute and continually refresh the page before I could even enter the heading
for my boat to use.

4\. It's weird that the maps aren't on the same page as where I enter my
boat's heading. It's also unwieldy to refresh all of these pages constantly -
a continually updated page would be a natural improvement.

5\. After entering a heading and pressing "Change course!", I expected my boat
to start moving. It took me several minutes to figure out that I also needed
to press "Start!". It's unintuitive to me that a boat wouldn't move when you
set its heading and the wind is blowing!

Thanks for a fun concept and good luck in your project. I hope this feedback
is useful and not a discouragement. With some interface tweaking, this could
be neat!

~~~
ls65536
Thank you for the feedback!

There's definitely a tradeoff to work with when it comes to keeping things
technical and finding a broader audience. I suppose there's also room for a
"simple" mode vs. "expert" mode interface or something along those lines to
try to cater to everyone, while keeping the underlying mechanics of the
simulation the same. Nevertheless, I acknowledge there's still room for
improvement here for all audiences. :)

As for the maps (and at the risk of sounding a bit paranoid here), I put them
on a separate page to keep the embedded map pages from possibly getting access
to the users' boat keys (since they're GET parameters and therefore part of
the URL). I fully realise that putting "secrets" in GET parameters is bad
practice, but in this case the bookmark-friendliness of having your own boat
page URL seemed to be worth the tradeoff of putting something semi-secret like
a randomly-generated boat ID/key in the URL itself. On the other hand, I
didn't find it worth the tradeoff of potentially leaking everyone's boat keys
to third party sites (however trustworthy they may be) through embedded
components by putting the maps on the same page.

~~~
jrumbut
I wish other sites would treat my email with the same respect that my boat key
is getting.

------
j4ah4n
This is great. I've been wanting to do something similar for simulating
attempts against the Microtransat Challenge[1] using realtime ocean
conditions, sailing physics, etc. In fact I was just writing down the
"feature" list yesterday, so very happily surprised to see this pop up on HN
today! :)

I was working with sailsd, boatd and similar packages from "sails-
simulator"[2] repo but wanted to simplify and make it simpler to jump in.

This looks like very similar work, could you comment as to how your simulation
compares if you're familiar with the "sails-simulator" packages?

[1] [https://www.microtransat.org/](https://www.microtransat.org/)

[2] [https://github.com/sails-simulator](https://github.com/sails-simulator)

Edit: formatting

~~~
ls65536
I haven't heard of the Microtransat Challenge before, but this looks
interesting, so thanks for sharing that!

As for sails-simulator (first time looking at this as well), there appears to
be, not surprisingly, quite a bit of similarity, but with one notable
difference that I can see so far...

One of the goals of my project was to simulate a large number of boats at the
same time with realistic large-scale navigation, geographical and weather
effects, so there is much less focus on the individual aerodynamic and
hydrodynamic sailboat physics (as these can also get computationally
expensive). The "boat physics" in my case consists of four lookups from a
"wind response" table (using angle from wind and wind speed as inputs) with
interpolation between the four points to get the final result (boat speed over
water). With some profiling and optimizations, I've found through load testing
that it can simulate (on a modern machine) several hundred thousand boats per
CPU thread with a simulation timeslice of one second. I'm certain this would
be far more difficult to achieve if I was trying to simulate more "real"
physics against the surfaces and masses of every boat. The tradeoff then is
that the boat controls are very crude (basically just selection of course over
water), and you don't have finer controls over sails/rudder, etc.

~~~
j4ah4n
I see. That all makes sense for the race scenario. I appreciate the thoughtful
response, thanks!

It's a really neat project. :)

------
saberience
This is a terrible captcha. I am a human and have sailed significantly and
failed the captcha a few times and it frustrated me enough to not want to be
on your site anymore.

~~~
mchan889
Agreed, the captia is excessive. Ended up giving up on the site after trying
to add in a second boat (not a sailor).

It's very difficult to have a positive experience when the first thing that
greets you is a source of frustration. It's also silly to put something like
this between the user and the meat of your site.

A significant number of people will just elect not to do this, and as a result
never see what you wanted to show them.

------
terenceng2010
The race map seem only keep the race start and current boat position. It would
be better if the whole historical locations of the boat are kept and drawn on
the map. Otherwise, nice!

~~~
ls65536
Hey, thanks!

The boat's historical track is shown after some time (within an hour of
starting), but it will only draw the lines between the positions at the top of
each hour (so intra-hour positions are lost, but this isn't that interesting
anyway for more long-distance races). But you're right, it's a bug that it
doesn't show you any track within the first hour. :)

Also, when you have more than one boat in a race, you'll see your historical
track and all the other boats' tracks shown on the same map. This makes it
interesting for long-distance races with multiple boats.

------
dewey
I'm already failing at the robot detection, so I guess that game is not for me
;)

~~~
capableweb
Same here, even when using
[https://www.nauticed.org/images/basicsailtrim/degreesoff.jpg](https://www.nauticed.org/images/basicsailtrim/degreesoff.jpg)
as a guide to pass it, I cannot get it to accept me as a human.

The captcha seems easy for a program to overcome though, so maybe it's meant
to stop humans and allow robots?

~~~
smartinspereira
you just need to know that there are 360 degree in a circle. now do:

\- count the segment dividers and divide 360 by that amount, let’s call this
X.

\- count at which divider the pointer is pointing, multiply that by X and be
good.

------
serkandurusoy
This is awesome!

Do you plan on adding different types of boats with varying sailing
characteristics?

Adding a multihull could be an amazing second option for those who want to
compare downwind/upwind characteristics as usually debated.

Oh and if you ever feel like adding in internationalization to this, I'd love
to help with a Turkish translation.

~~~
ls65536
Hey, thanks!

Yes, different boat profiles is on my list of things to add at some point.
There are some impressive global races [1][2] that happen every few years
using some interesting boats, so it would be neat to follow along virtually in
this way.

[1]
[https://en.wikipedia.org/wiki/The_Ocean_Race](https://en.wikipedia.org/wiki/The_Ocean_Race)

[2]
[https://en.wikipedia.org/wiki/Vend%C3%A9e_Globe](https://en.wikipedia.org/wiki/Vend%C3%A9e_Globe)

~~~
082349872349872
If you ever get tired of sea-going vessels, I read an account of the Graf
Zeppelin's 1929 circumnavigation which claimed that daily route planning was
very similar to sailing in that taking advantage of weather patterns gave them
significant deltas on top of the motors.

[https://www.navytimes.com/news/your-
navy/2019/08/19/globetro...](https://www.navytimes.com/news/your-
navy/2019/08/19/globetrotting-leviathan-graf-zeppelins-amazing-voyage/)

------
ls65536
I created a public race that begins shortly (apologies if it's already started
by the time you read this comment!), if anyone would like to join and try out
the "multiplayer" mode:
[https://8bitbyte.ca/sailnavsim/races.php](https://8bitbyte.ca/sailnavsim/races.php)

Just copy the race ID (809d3260e3e6b76da6282842cef7a342 for this one), and
join the race from the start page.

Also a note that anyone can create a public race with custom parameters, and
anyone else is also free to join that race by using the published race ID.

~~~
krisoft
The race is on :) I'm live streaming myself sailing against you guys.
[https://www.twitch.tv/ikrisoft](https://www.twitch.tv/ikrisoft)

------
poorman
Haha that captcha.

It would be interesting if you could input things like LOA, LWL, P, E, etc..

------
pmontra
I used to play a similar game some 10+ years ago. There were thousands of
players doing 2 / 3 weeks races. I can't remember the name or Google it. Maybe
the site doesn't exist anymore.

The site didn't show the wind, we had to find our sources. It did show the
boat (not much better than this one) and it's heading. We could choose a few
types of sails according to the wind. It detected when the boat hit land and
stopped it. Fun things happened to people sleeping at home when sailing
through areas with many islands :-)

To win one should wake up a few times at night or cheat and play with mates in
different time zones. Or take safer and longer routes and sleep well. Fun
game.

------
chrisweekly
This looks amazing!!! Thank you for creating and sharing this!

------
Homeschooler
As a sailing addict, I actually find this very nice :)

------
3zra
If this were packaged as an iOS App with only minor additions I’m sure it
would be very successful, like other ‚slow games‘ (Desert Golf)

------
bborud
Helm does not respond to input STOP Have tried colorful language and strong
drink STOP Crew annoyed STOP Abandoning ship STOP

------
theqult
Nice anti bot detection, im not able to try it because i dont know shit of
heading degrees

------
lostfocus
I just found this on MetaFilter and I'm already a big fan.

------
danielcraig23
Thanks for sharing! My family really enjoyed our race this evening!

------
ris
Al-right! I'm taking _this_ thing to Mexico!

