Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plane Design Document #39957

Closed
kingcet opened this issue Apr 27, 2020 · 5 comments
Closed

Plane Design Document #39957

kingcet opened this issue Apr 27, 2020 · 5 comments
Labels
Organization General development organization issues stale Closed for lack of activity, but still valid. <Suggestion / Discussion> Talk it out before implementing Vehicles Vehicles, parts, mechanics & interactions

Comments

@kingcet
Copy link

kingcet commented Apr 27, 2020

now that we have helicopters i thought it wouldn't be a huge jump to make planes, i decided to make a design doc for it and a basic and changeable formula for it.

when or if possible i would like planes to be added to the game as an alternative to helicopters that, if built right would use less fuel or carry more stuff.

i understand that my idea and way of the planes functioning may not be chosen and a different way for them to work might be chosen, even if that happens i would just be glad that we got planes.

Mock up picture of planes and my design doc

cdda plane design doc.txt

design doc in text:A CDDA design document for how planes could work, i made this for any coders who have the time to make this stuff
Disclaimer: this was started at 5 in the morning, if i fuck up with anything here please give a bit of slack, now onto the stuff.

How a plane in cdda could generally function: flight would work similarly to helicopters in a few ways but for the most part would be very different,they would have a minium speed required for take off and would need wings for flight, adding wings to a plane would produce more lift at the cost of adding drag and weight, a formula of how lift is prudced could go something like this lift in pounds = velocity in fps squared * sqaure meters(instead of feet) /30, having more lift would let players be able to save more on fuel, this being one of the benefits of planes

the model i have for cessna might take off at 132fps while the piper aerostar i made might take off at 164.042fps

Sources:https://en.wikipedia.org/wiki/Piper_Aerostar , https://www.grc.nasa.gov/WWW/K-12/WindTunnel/Activities/lift_formula.html (chopped down) , https://en.wikipedia.org/wiki/Cessna_172.

let me know if my math is fucky @kingcat on the discord.
as for now, well thats all she wrote, i am gonna go take a break.

piper 1

piper 2

cdda cessna

cdda cessna 2

@natsirt721
Copy link
Contributor

I'm going to preface this with my personal take on aircraft:

Do you really need to travel that quickly or go that far? Given the current map generation algorithm, everything 'interesting' for a survivor to experience is going to be within a few tens of kilometres of where you spawn (obviously varying based on map gen settings and starting scenario) - a heli is a huge step up from a car or truck, but isn't much less advantageous than an airplane - in fact, in a disaster scenario a helicopter is significantly more useful that an airplane given the fact that it doesn't need a large prepared space for takeoff and landing. Additionally, the player should require special training (or heinously high driving skill) to operate an airplane - that might make a good NPC mission or starting class, and should not stand as a barrier to entry for aircraft - but the consideration should be made that most survivors cannot step into the cockpit and operate an airplane without prior training.

That out of the way, as an aerospace engineer by education I am entirely in favor of adding aircraft, however I think the vehicle mechanics require a little more work before implementation can begin. I got most of the way through an essay about aircraft design principals, but that's probably not what anyone wants to hear nor is it constructive, so I'll just cut to the chase:

Its going to be very very hard to implement a system that is balanced for both small and large aircraft, due to the number of terms with exponents the nuances of aerodynamic equations, the necessary granularity of vehicle construction, and the simplifying assumptions of the current vehicle dynamics system. Do you know how air drag is calculated for cars currently? Black magic (seriously, look at it). The vehicle dynamics refactor has been a long time coming IMO, but it is a pretty significant undertaking to even make aircraft a possibility, and a lot of the vehicle mechanics are balanced against it, meaning more modifications to disparate parts of the codebase to maintain some semblance of 'balance'. I'm sure that someone could invent a series of equations to make either small, or large aircraft work, but nobody can invent equations that make them all work, and be bolted directly onto the existing vehicle code.

That last part is the most important by the way, similarly in that a new scientific theory must explain previously observed phenomena in addition to new observations in order to be considered acceptable. More generally, it isn't that it is hard to simulate an aircraft, but it is hard to do that within the current context of the C:DDA codebase. I know it seems like helicopters are one step away from aircraft, but in reality, a helicopter is more like a car that can change Z-levels (read: hover) than a full-fledged aircraft, which explains why it was able to be shoe-horned into the existing vehicle system with relative ease.

If you want to put some more effort into an actionable design document, here are a few questions that need answering, preferably with attached pseudocode or detailed algorithms (e.g. it isn't sufficient to say "turrets should generate more drag because they're mounted on the outside", but something like "for turrets, drag is determined by the cube of velocity multiplied by 1/10 the mass of the turret to approximate cross-sectional area" is a good start).

  • How is total vehicle lift determined?
    • What parts are available to increase lift?
    • What role do other parts or types of parts play in increasing or decreasing lift (body lift)?
    • How does the wing and vehicle geometry affect drag
    • Is angle-of-attack relevant, or can it be simplified away? If not, how is that determined?
  • How is drag calculated?
    • What parts or types of parts affect drag, and by how much?
      • If a solution is provided for a type of part, how is drag calculated for each part therein from the part's type-specific attributes?
    • How does wing and vehicle geometry affect drag?
  • How is engine power translated into thrust?
    • Are there new parts for a propeller? Is the propeller assumed like for boats?
    • What considerations (if any) should be made for turbojet/turboshaft engines?
  • How do Z-level transitions work?
    • Most importantly, how fast must a given vehicle be moving before it can be compelled via controls to change Z-levels?
  • How is aerodynamic stability determined? Is that relevant?
    • [ author note: I want stability to matter but that might lead to a lot of dead survivors that thought they could make an airplane from scratch, or put too many gold bars in the back of their cargo plane ]
    • If it is relevant, include determining factors for all three axes (roll pitch yaw), as a function vehicle geometry.

If you need assistance with any of the lift/drag equations feel free to DM me.

@Night-Pryanik Night-Pryanik added <Suggestion / Discussion> Talk it out before implementing Organization General development organization issues Vehicles Vehicles, parts, mechanics & interactions labels May 1, 2020
@stale
Copy link

stale bot commented May 31, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not 'bump' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

@stale stale bot added the stale Closed for lack of activity, but still valid. label May 31, 2020
@mlangsdorf
Copy link
Contributor

A vehicle's air drag coefficient is determined by raycasting lines along the vehicle's axis of motion, and then adding or subtracting increments based on the vehicle's features. The same process is also used to determine the height of each column. Final air drag coefficient - which is really CoD * cross sectional area - is the sum of each column's CoD times the height and width of each column.

That's hardly black magic.

Airplanes can use the same logic. Maximum air velocity would be calculated as the speed when acceleration due to jet or propeller thrust is equal to deceleration due to air drag. At all speeds, lift is going to be governed by the simplified lift equation `L = 1/2 * air density * air speed * air speed * wing area * coefficient of lift, and coefficient of lift and wing area are probably going to be calculated in the same way as the air drag coefficient, but each wing structure will probably have it's coefficient of lift factor designed in JSON.

Partial answers for some of the other questions:

  • We can calculate AoA from arctangent( vertical movement per second / horizontal movement per second ), possibly with some adjustments for a fast-moving vehicle that is trying to stay at a level altitude.
  • Airplanes are definitely going to require explicit propellers. I should really go back and fix boats about that, but I don't intend to continue that error.
  • Vehicles aren't going to rise in z-level due to excessive lift while on cruise control - we can just assume that the pilot angles slightly toward the ground to stay at the same elevation and adjust the AoA appropriately. When not on cruise control, we can track vertical acceleration and velocity, integrate them into vertical distance, and transit z-levels after every 5 m or so of climb.
  • Vehicles with insufficient lift will also track vertical acceleration and velocity and transit z-levels after every 5 m or so of drop. Cruise control will not help here.
  • We already have algorithms to calculate the center of mass of a vehicle and check if it is within the bounding box of the wheels; we can repurpose the data for stability. I admit I am less familiar with aircraft stability equations because the issue didn't come up in my limited flight training, but inexperienced pilots who load too much junk in the trunk should expect to crash.

All that said, getting airplanes to work is a very low priority project for me, but I will provide advice and guidance for some other developer who wants to take a swing at it.

@stale stale bot removed the stale Closed for lack of activity, but still valid. label Jun 24, 2020
@stale
Copy link

stale bot commented Jul 24, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not 'bump' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

@stale stale bot added the stale Closed for lack of activity, but still valid. label Jul 24, 2020
@stale
Copy link

stale bot commented Aug 24, 2020

This issue has been automatically closed due to lack of activity. This does not mean that we do not value the issue. Feel free to request that it be re-opened if you are going to actively work on it

@stale stale bot closed this as completed Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Organization General development organization issues stale Closed for lack of activity, but still valid. <Suggestion / Discussion> Talk it out before implementing Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
Development

No branches or pull requests

4 participants