Decent way of getting lift coefficient and drag coefficient for game design

Discussion in 'Hydrodynamics and Aerodynamics' started by Bishiba, Jun 23, 2022.

  1. Bishiba
    Joined: Jun 2022
    Posts: 2
    Likes: 4, Points: 1
    Location: Sweden

    Bishiba New Member

    I'm a game-programmer-design student, and I both have a boat and love sailing. And as a kid I wanted to be a pirate, probably not in Somalia though, more likely in the 1700s Caribbean. And I've played every pirate game I can think of(surprising, I know, be hard to think of the ones I didn't think of).

    So now, I am currently delving into the first levels of sailing mechanics for the game. And after sitting for hours reading up on the physics of how to handle sails, and getting quite decent at understanding it, I came to a stop when I can't find a way to get the coefficients needed to get the final answers to whatever calculations I am performing.

    Naturally, the quality of the calculation doesn't need to be perfect, it's also not gonna be used for any research. My wish is to simulate each sail on the ship in a decently realistic way.

    As far as I understand it, you can somehow get the coefficients using the area and the aspect ration? But I've as of yet been unable to locate any formula for this.
    Here's an extra picture depicting the same, but it's how I've written it out in Visual Studio.
    These are the formulas at stake.
    While I am at it, I've assumed that the A is the area of the sail? This seems odd to me considering it's possibly also used in the coefficient calculation, so, if I am mistaken in what the A is I'd love to get a correction.

    Really hoping for some expert assistance on this as I really want to deliver a sailing experience that is realistic. Any tips, tricks, help or otherwise is greatly appreciated.

    Currently, I am focusing on this type of sail:

    Best regards!

    Attached Files:

    DogCavalry and Will Gilmore like this.
  2. Dolfiman
    Joined: Aug 2017
    Posts: 1,497
    Likes: 660, Points: 113
    Location: France

    Dolfiman Senior Member

    Welcome to the forum, your project is quite fun !
    Your formulas are effectively related to the sails forces, forward for the ship propulsion (F R) and lateral the force which heels the boat (F Lat). Va is the apparent windspeed and yes A is the sail area. They are part of the set of formulas usually involved in a Velocity Prediction Programme (VPP), you should have also the computation of the drag components and of the righting moment (+ some other details, I resume) and the VPP programme can iterate up to to have Drag = Fr and Righting moment = Heeling moment (the third condition : lateral force = lateral resistance being embedded in the formulas). I developed such tool, you can see in the annex of the document attached all the formulations that I have involved in mine.

    Of course, for a game, you should simplify all that, in particular to avoid as much as possible the iterations inherent to a VPP.

    May be you can have a look at the game Virtual Regatta (if you don't know it already) , play in one of the races they proposed, that can help you orient your own development. And last but not least, they also propose jobs for their future developments, can be an opportunity for you.
    Virtual Regatta - The e-sailing Company

    Attached Files:

    Will Gilmore likes this.
  3. jehardiman
    Joined: Aug 2004
    Posts: 3,686
    Likes: 1,072, Points: 113, Legacy Rep: 2040
    Location: Port Orchard, Washington, USA

    jehardiman Senior Member

    I agree with Dolfiman that factored polar look up tables baked into the code are the way to go rather than a re-calculation each time step. This saves FPO's and only has to be done once. This is the method used in PotBS and allows significant variation between rig types and sizes, allows tweeking for known historical performance, as well as having a significant benefit when using proportional damage models.
    Just do me two favors in the development which I haven't seen in any other sims/games.
    1) Make the larger ships faster than the smaller ships. A 1st to 3rd rate could easily run down a smaller vessel just on waterline length, especially in anything above a topsail breeze. While smaller ships with shorter waterlines are faster in stays, and depending on the rig were more weatherly; they were significantly slower overall.
    2) Make draft meaningful. Particular types of vessels operated in the Caribbean because of the depth, reefs, and channels. Having any vessel operate anywhere is unrealistic. Besides, it gives the small vessels somewhere to hide and can force players into small vessels and small vessel tactics.
    DogCavalry and Will Gilmore like this.
  4. AlanX
    Joined: Mar 2022
    Posts: 113
    Likes: 20, Points: 28
    Location: Perth, Western Australia

    AlanX Senior Member

    Hi @Bishiba,

    Here are a set of simplified (i.e. does not model stall) equations for a NACA 0012 aerofoil used to model a wing (excluding skin and interference drag):
    Coefficient of Lift (theory) Cl=2*pi/(180/pi)*A0
    Coefficient of Lift (NACA 0012) Cl*=0.11*A0-A0*A0/1600
    Coefficient of Drag (NACA 0012) Cd=0.010+Cl^2/80
    Wash Down Angle e=180*Cl/pi^2/AR
    Absolute Angle of Attack Aa=A0+e
    Induced Drag Cdi=Cl^2/pi/AR*K
    Non-elliptical distribution factor (1.2-1.4) K=1.25
    Aspect Ratio AR= (SA)/c^2 where SA is the "Sail Area" and "c" is the average cord.
    All I have done here is to fit equations for the Cl* and Cd curves from the aerofoil profile graphs.

    I am not aware of a good cloth sail aerofoil database.
    But you can get some indicative Cl* and Cd curves from:
    by looking at examples like:
    EPPLER 376 AIRFOIL - Eppler E376 ultralight airfoil​
    I would expect the drag will be higher for a cloth sail equivalent.

    As far as a textbook have a look at "Aero-Hydrodynamics of Sailing" by C.A. Marchaj.

    Anyway best of luck, AlanX
    Last edited: Jun 23, 2022
    Will Gilmore likes this.

  5. Bishiba
    Joined: Jun 2022
    Posts: 2
    Likes: 4, Points: 1
    Location: Sweden

    Bishiba New Member

    Thank you for the warm welcome!

    Thank you, this will be perfect I think. I don't yet know how much strain I can put on the Unity engine, that's why I was thinking to do continuous calculations. Albeit, a lot of stats would simply be saved on the sail object itself. I'll instead just create references that I'll add to the code and I believe that should do the trick.

    And yes, I've indeed played Virtual Regatta, quite long ago though so I don't really remember much about it.

    I will investigate this as well, but I think I will begin with a reference table for different sail types. But I am certainly gonna give this a try as well!

    I think that it will be good as well.
    1) Seems you haven't played probably the best pirate game then, Sea Dogs: To Each His Own. It went under another name some 10 years ago, namely Age of Pirates. It's a bit difficult to get in to, but it has the deepest, most realistic and most rewarding combat, trading and RPG elements of any pirate game. Sadly, the story is essentially horses**t and it just bogs down the game. The into-tutorial will take you 2 hours and the tutorial skip will take you 20 minutes(if you know what you're supposed to do. I had to get a guide to finish the skip-tutorial.). Sadly, again, when the game had its old name, it actually had a proper sandbox mode. But the new developer I guess wanted to make a better tutorial(?) and wound up doing the worst tutorial I've ever seen. I guess "The Pirate" also understand the waterline concept.(You've distracted me with this point, I must play Sea Dogs right now...)
    2) That... That is a great idea, I always want to use a sloop in pirate games(as can be assume from the ship I've modeled) but I always need to drop it for the bigger ships eventually. Would be great to have shallow areas where you're essentially tied down to using smaller ships. Because it's something I've thinking about, how to make smaller ships viable. And the only thing I could think of was that they'd be magically faster than large ships.

    And, well, if you got more ideas, do tell me as we seem to desire the same type of realistic depth for a game about ships. Most of these games seem to just ignore physics and make it easy, the worst games being the "W" for forward and "S" for breaking, and I don't mean raise/lower sails or drop anchor, I mean like a damn speedboat.

    To All:
    Thank you all for the support here, I'll certainly be posting more questions as they will unquestionably surface. It's all a lot to dive into and I feel that my understanding of the physics related to sailing are quite shallow and I have to admit that all of the data you've provided me with does scare me, but that's just part of the challenge. And I am sure that once I wade into it, it'll clear up pretty quick. I made a very realistic and optimized float system and wind system so hopefully I'll make the other stuff just as realistic!

    Best regards, and sorry for any and all puns!
    jehardiman and Will Gilmore like this.
Forum posts represent the experience, opinion, and view of individual users. Boat Design Net does not necessarily endorse nor share the view of each individual post.
When making potentially dangerous or financial decisions, always employ and consult appropriate professionals. Your circumstances or experience may be different.