Not a member yet? Why not Sign up today
Create an account  

  • 3 Vote(s) - 4.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cinematic aircraft AI. 2.0: dogfights galore


And try to make the hint not saturate the output by lowering the constants.

Also I added an optional extra parameter to addhint which enables you to drop extra hints along the unit vectors.

t.AddHint(t,{a,b,c},{da,db,dc}) or t.AddHint(t,{a,b,c},d) for universal step

This is the equivalent of

or in the other form

Found an interesting cost function in A New PID Tuning Technique Using Ant Algorithm

Long story short, you have an error angle, and then you track how well the pid follows a curve that converges towards 0

For error E and a time constant T the curve to be followed is:
f(t,E,T) = E*(1-e^(-t/T))
can also be reinterpreted as, every tick, the error should be multiplied with a constant
redefine E(t) to be the error at time t, and K the bandwidth constant, then cost function c(t) = |E(t-1)-K*E(t)| + |E(t-1)-E(t)|

I believe is gonna have the same problem as above: it's gonna end up punishing good PID constant when the state logic changes the direction the aircraft should be

the problem is being at an error is most often than not a normal condition.

I see two solution: take out the error from the scoring, or assign scoring only when the target should be stable (TARGETING state and near aimpoint) this latter could be brought even further by having the pid only used when angle is small enough, and a dumb sign(error) when the angle is big enough

actually I think this second option is gonna solve loads of problems. just need to define when small enough is small enough and switch to pid control.
gets high on math

I'd go for alternative 2 for now, but I'll keep looking to see if someone else has already devised a solution

I'm just currious, HOw do you get the cannon to work without a mantle? When I tried I had to put a mantle on it to fire, and load amunition, it woulnd't do so without a mantle...

need to attach barrel to advanced firing piece directly, the problem is, after that the cannon will shot only if perfectly aligned with targets, so I am using the whole plane as if it was a two axis turret, rotating it in the direction needed to shoot and compensating for drop
gets high on math

updated to 0.99

can't describe how cool this is, so just watch this
gets high on math

niceee. I have been making planes with guns now because of this LUA code. I'm not sure if this would help you code better but here's a very crude wip if a HF/A-26 with a gun and your AI. It still is on the previous version and I can't work on it cause I'm at... work atm. I hope it would help you tweak faster aircraft using your LUA Big Grin

Attached Files
.blueprint   HFA26F_ExportLUA.blueprint (Size: 58.9 KB / Downloads: 59)

Will this do gun runs A-10 style? I can't get stock AI to do attack runs on my plane so maybe this can. My old attack plane does attack runs fine. but even with the same settings for some reason my A-10 style plane wont go in for strafing runs.

With this one of my spitfire almost took down two F4u corsairs if it werent for an unlucky collison this is so fricken awsome well done LoSboccacc who name i keep getting wrong!!!
[Image: Xx28lJc.gif]

"I'll just lean into the hill until I crest it and can catch my breath on the descent." ~ unknown stranger on a comments section.

Forum Jump:

Users browsing this thread:
2 Guest(s)