New Funky Trees Explained (Link)
Christ I'm excited. While I cannot access SP as of the status quo, here's the somewhat easier to digest breakdown of the new features.
FEATURES
Added air-to-air lead predictor for guns and cannons
Added Tracer Rounds to Cannon
Pretty self explanatory.
FUNKY TREES
This is absolutely juicy. Let me break it down for yall.
Funky Trees now supports multiple types: Numbers (floating point), Booleans (true/false) and Strings (text). Values will be implicitly converted between these types if possible, for backwards compatibility, so a value of true will convert to 1 if used as if it was a number, and a value of false will be -1.
New literals, "string", true, and false.
Okay, so the organization of data has basically changed from the ground up for funky trees. We now have three larger data types of strings, numbers, and booleans.
Strings are text ("hello"). Numbers are numbers (1 2 3), and booleans, in funky trees, is now been universalized to either the value true or false, numerically -1 and 1 respectively.
New operators:
Comparison: "=", ">", ">=", "<=", "<"
Boolean Operators: "&" (and), "|" (or)
Ternary (selection) Operator: a ? b : c (essentially if a then b else c)
Awesome! Basically logic statements are now actually in game, throw away my old guide on this because it's now much less useful. I won't elaborate too much here because it's simple, but I'll leave an example here. Let's say x = true
. That means, x - 1
becomes 0. This is basically what implicit conversion above means.
New parameters:
GForce (omnidirectional "force" acting on the pilot, in g)
VerticalG (vertical component of G)
SelectedWeapon (the name of the selected weapon, such as "Boom 50")
These are new parameters. These particular ones can be used to make G-counters and stuff like special weapon bays.
New functions:
ammo("Weapon") (where Weapon is the name of a weapon; for instance ammo("Cannon") returns the number of cannon rounds available as shown in the weapons drawer. ammo(SelectedWeapon) [note no quotes, as it's the variable not the string value] returns the ammo for the selected weapon)
Yep. Pretty self explanatory, but note the last one. Pretty important distinction. I'm on mobile right now, so I'll reiterate the differences between variables and strings etc. later when I can be on my computer.
Special functions: These are functions that have special functionality can store previous values, something not previously possible
rate(x): the rate of change of x.
sum(x): the integration of x over time.
smooth(x, rate): the output follows x, but only at a maximum speed of x units per second.
PID(target, current, p, i, d): A PID controller with the parameters p, i and d.
These are the real game changers this patch. First, one word... CALCULUS. THIS IS CALCULUS. Not to say that you must know calculus to use these, but the rate and sum functions are amazing tools for a variety of applications. Their function is largely self-explanatory to anyone whp might want to use these. PID controllers I'm not too entirely familiar with, but to my knowledge it means potential for even cooler FBW systems. Damn, I can already think of things like rate of climb indicators. I'll leave this for now.
Fixes!
Some potential parsing bugs were fixed with - signs.
This shouldn't break old expressions, if it does please report to me (@WNP78)
This means that all variables previously known as "toggle" type variables like LandingGear, fireGuns, etc have been all unified into the SP boolean format of -1 or 1. (True or False) This was an issue previously 'cause some variables were 0 or 1 and some were -1 or 1 and some were kinda both. Fixed and clear now!
activationGroup inputs now support entering FT expressions (which are taken as Boolean values)
Control surface and beacon light inputs now support entering FT expressions
These are also revolutionary. Previously funky trees was limited to parts with an inputController
class... Now things with activationGroup classes are compatible with Funky Trees. That means detachers can work with FT. Awesome. Control surfaces also now get long awaited FT compatibility.
Debug Command:
Open the dev console in level and type DebugExpression "expression" (for instance, DebugExpression "AltitudeAgl > 10").
Use ClearDebugExpressions to clear the list.
It's not going to be that important for most, but for me this is a fan favorite. Real time debugging, this allows for accurate testing of funky trees inputs in real time. It helps your sanity when you can see whst's going right and wrong.
TWEAKS
Added impactDamageScalar, explosionScalar, flashSpace, and flashScale XML properties to cannon
flashSpace sets the simulation space for cannon muzzle flash, either "Local" or "World"
So cannons now get realistic muzzle flash and customizable explosion forces and impact damage. Cannons now much more real!
Updated Fine Tuner with cancel MultiSelect when no parts are selected
Upgraded to Unity 2018.4.18f1, which will hopefully fix some performance issues on Android
Some quality of life improvements. Not much here.
BUGS
Fixed IAS algorithm
Fixed bug breaking guns alternate firing
Fixed reticle persistence issue on bomb predictor
Fixed layer mask for part select tool
Fixed attach point select with finger aid
Fixed designer platform not instantly showing
Fixed a bug that prevented Trim and VTOL sliders from displaying for combined input, such as "Trim + Vtol"
Cannon wind sfx no longer play while paused
Awesome, lots of bug fixes, and the new IAS algorithm will create much more realistic flight handling for planes.
My, I'm impressed. This patch is gonna be awesome. Stay tuned, I'll be updating the FT guide asap and also be making some extra posts to help the SP commoner.
@ThomasRoderick
.
Fairly certain they do.
@SnoWFLakE0s Another question: Do countermeasures actually support funky trees? I tried to put FT codes on its activation group but it didn't work.
@ThomasRoderick
.
Ah, none currently are available. You can simulate it using
smooth
however.@SnoWFLakE0s Like, I mean, a counter to the actual ammo, because if you simply press down the Countermeasures button the flares will be discharged every second or so...
@ThomasRoderick
.
LaunchCountermeasures
One quick question: which function(s) and variable(s) can be used for the ammo of countermeasures?
@sheepsblood ok
@Minecraftpoweer Oh, sorry, I thought you did somewhat. Well, keep in on the discussions. Because, you will learn eventually. I know I am.
@sheepsblood funky trees
@Minecraftpoweer You don't understand what I am attempting or "if,else,then" statements?
@sheepsblood I dont understand ft
@SnoWFLakE0s, @Minecraftpoweer
I am trying to use an "if, else, then" statement in a GYROSCOPE "Pitch Input". Basically I want the Pitch to only work when above a certain altitude. Seems simple enough. Probably, should go at this another way. The syntax I put below is what I have tried. All failed. I did run into one that I made that worked slightly. But, alas I deleted it and moved on with the syntax I have now then forgot the old one.
if( AltitudeAgl < 0.1) then( "Pitch" = 0) else( "Pitch" = 1, -1)
if AltitudeAgl < 0.1 then "Pitch" = 0 else "Pitch" = 1, -1
if AltitudeAgl < 0.1 then Pitch = 0 else Pitch = 1, -1
if AltitudeAgl < 0.1, then Pitch = 0, else Pitch = 1, -1
@SnoWFLakE0s That is amazing! I love it. Are they not posting it because they are creating a build to use it on?
@sheepsblood
.
An example from an acquaintance.
@SnoWFLakE0s
MY PID EXAMPLE
Basic as it gets. Just toyed around with it some and figured out it was as easy as it looked for engines. As for a wing... grrr. that just wasn't working as it was supposed to. Kept flipping upside down no matter what my TARGET degree was.
I tried all 3 combos. Even changed the P.I.D. to -1,0,1; 1,0,-1
none worked as I wanted.
PID ( 0, RollAngle, 0.1, 0, 0.1 )
PID ( 90, RollAngle, 0.1, 0, 0.1 )
PID ( 180, RollAngle, 0.1, 0, 0.1 )
PID ( 360, RollAngle, 0.1, 0, 0.1 )
@SnoWFLakE0s Thanks for the super quick response. I will keep working on it. See if I can make something basic work and then share.
@sheepsblood
.
Although I just very recently learned about PID controllers, but I think I have some idea over the syntax. So PID is used as
PID(current, target, p, i, d)
, socurrent
would be your currently measured parameter (e.g.Altitude
),target
, to my knowledge, is the target value of the parameter, andp, i, d
is what you expect (proportion, integral, derivative).Alright, here is the problem. Attempting to write any code into overload is proving difficult for me to understand. It seems to me that we are using a shaved down XML language.
Let's look at this from a C# standpoint.
This would be a PID controller in it's basic form.
How could I express that in Funky Trees? Any idea?
@SnoWFLakE0s yeah hellfirecoder said they had just forgotten to add it to magnets, which is what I tested it on.
@SnoWFLakE0s
Oh.
@ArcturusAerospace
.
It's "Altitude Above ground level." Go figure...
@SnoWFLakE0s
That can be done. Also, is the last character of AltitudeAgI "1" or "I?"
@ArcturusAerospace
.
The
AltitudeAgl
parameter is defined by the location of your cockpit, so if your cockpit is attached to the engine, yes.Idea/Input:
AltitudeAgI <= 5
If set as the input for a VTOL engine, could this theoretically (if the engine has enough power) keep whatever the engine is attached to at 5 meters above the ground?
@CoolPeach Great explanation of a PID and it's potential use.