Profile image

Pyphoon - Python to Funky Trees Demo Plane

62.3k Whills  one month ago

What is this?

This is a demo plane I created while developing the PYtoFT tool: a mini compiler that converts a Python script into Funky Trees variables. With this tool, it is possible to create complex flight control systems or other in-game logic in a much more structured and organized way. This makes control logic easier to read and debug, instead of relying on deeply nested, condensed Funky Trees expressions (which have tortured me for a long time).

What is PYtoFT, how to use it?

GitHub Page: Click

Project Home Page: Click

Python Script of this plane : Click

What PYtoFT does, is that it converts your Python script like this:

from lib.FT_functions import *
main_loop_name = '_process'
exclude = ['exported_var']

my_global_var = 1.0
exported_var = False

def _process() -> None:
    global my_global_var
    global exported_var
    simple_var = 2000.0
    if my_global_var:
        if IAS > exported_var:
            another_simple_var = foo(simple_var)
        else:
            another_simple_var = 0
    else:
        another_simple_var = -1

def foo(some_value) -> float:
    input_val = some_value
    if Altitude > 200:
        input_val += 2
    else:
        input_val -=2
    result = input_val + bar()
    return result

def bar() -> float:
    if IAS > 10:
        return 5
    else:
        return 0

Into XML code like this:

Setter variable= my_global_var function= 1.0 priority= 0

Setter variable= simple_var  function= 2000.0  priority= 0 

Setter variable= another_simple_var  function= (my_global_var ? ((IAS > exported_var) ? (((Altitude > 200) ? (simple_var + 2) : (simple_var - 2)) + ((IAS > 10) ? 5 : 0)) : 0) : -1)  priority= 0 

And then inject the code into your plane XML file.

Plane Features

  • All Funky Trees expressions in the variable setters are generated from a Python script. I did not write a single line of funky trees expression in-game :)
  • 89 parts!
  • Detailed cockpit and displays
  • Can land on a carrier
  • Works in SP2
  • Realistic flight characteristics
  • Auto-trim, AOA limiter and G limiter

Enjoy your flight!

And Merry Christmas!

Spotlights

General Characteristics

  • Successors 4 airplane(s)
  • Created On Windows
  • Wingspan 35.5ft (10.8m)
  • Length 52.2ft (15.9m)
  • Height 18.8ft (5.7m)
  • Empty Weight 27,301lbs (12,383kg)
  • Loaded Weight 35,207lbs (15,969kg)

Performance

  • Power/Weight Ratio 1.148
  • Wing Loading 65.6lbs/ft2 (320.1kg/m2)
  • Wing Area 537.0ft2 (49.9m2)
  • Drag Points 1486

Parts

  • Number of Parts 89
  • Control Surfaces 3
  • Performance Cost 707
  • Log in to leave a comment
  • Profile image

    So good

    17 days ago
  • Profile image
    2,056 PZLAgencies

    Ngl this needs to be a sp2 stock craft, its just amazing, the looks, everything

    19 days ago
  • Profile image

    Best plane I ever took flight in AND IT'S MOBILE FRIENDLY nice job man

    20 days ago
  • Profile image

    This is goat

    20 days ago
  • Profile image
    814 fltltSTIG

    Hey man, I know you probably get asked this a lot, but I figured I’d ask anyway. I’m working on an F-111C and want to feature a terrain-following radar, and you’re the first person I thought of since that’s really your thing. The goal is to make it as true to the real system as possible while keeping the part count reasonable. Totally understand if collabs or working on other people’s aircraft aren’t your thing (especially for a bronze player haha), and of course I will show you the finished product before you do anything. I know the answer is probably no, just thought I’d ask. Cheers

    20 days ago
  • Profile image
    450 firstplus

    PykyTrees!!

    +1 21 days ago
  • Profile image

    when and what is the next craft you are going to post

    25 days ago
  • Profile image
    62.3k Whills

    @winterro You mean converting the funky trees code into Python? That cannot be done. What we can do is converting the funky trees C-like syntax into python style, but for long funky trees expressions, the converted Python code would still be very unreadable and nested, which does not really help. It's like a compiler can convert a high-level language into assembly but it cannot convert the assembly back into the original script.

    26 days ago
  • Profile image
    107k winterro

    Can you also make it work in reverse? @Whills

    I am a master at funky trees as i have been experimenting with the SP input system for atleast 10 years.

    with Python, i might as well not exist

    26 days ago
  • Profile image

    How is this under 100 parts

    26 days ago
  • Profile image
    39.3k V

    @Whills FLOWRIDER0

    28 days ago
  • Profile image
    10.0k dabestsock

    @Whills how long did take you make the code

    29 days ago
  • Profile image

    when is the F-22 coming out?

    one month ago
  • Profile image
    62.3k Whills

    @V Sure, what's your discord user name?

    one month ago
  • Profile image
    1,598 Lavine

    Hats Off 😵
    Damnnn Amaaazing!!!

    one month ago
  • Profile image
    39.3k V

    Hey, is there a way I could contact you on discord?

    one month ago
  • Profile image

    чуваки мне уже 23 я помню как играл в это в школе (

    one month ago
  • Profile image

    @Someguywhomakesmods im sure i can help

    one month ago
  • Profile image

    Is it sp2??

    one month ago
  • Profile image

    really cool.

    one month ago
  • Profile image

    Hard to believe this beauty just on 89 parts

    +2 one month ago
  • Profile image

    @Whills do you know how to make flight characteristics because my plane has weird flight so I wondered if I can have help ? I will give you link after reply

    one month ago
  • Profile image

    I’m subscribed to your YouTube channel wills

    +2 one month ago
  • Profile image
    563 RGaming00

    We want a Python Modded tag to crafts now 😭🙏🏻

    one month ago
  • Profile image

    I guess I need to learn python now

    +4 one month ago
  • Log in to see more comments