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

#1
A little lua script to control planes

it is not as sophisticated as Madwand's, and does a couple things differently:

- will aim the whole craft as if it were a turret, enabling cannon based aircraft to fly effectively even without mantlets

- will roll and pitch and maneuver both horizontally and vertically to reach it's firing solution

- will not fight the default AI if no enemies are around

- bugs!

2.0

- merged and simplified behaviour selection, now spends much more time on target
- configurable slow down when on the enemy six via minimumThrust
- added demonstrator in attachment

https://pastebin.com/EJLL8dRV

2.1

tunable edition!

- pitch up parameter for planes that don't fly centered
- integrative term with falloff to improve stability
- changed: aim all weapon by default, people was confused by that

https://pastebin.com/Uagqp37Q

2.2

- plane now try to go at a higher altitude before attacking
- fixed ai ignoring maneuver distance multiplier
- laser aiming support

https://pastebin.com/J3vszFpR


Attached Files
.blueprint   p47.blueprint (Size: 57.89 KB / Downloads: 50)
.blueprint   drone.blueprint (Size: 61.92 KB / Downloads: 40)
Reply

#2
can the player force control of the aircraft? That's the one thing I don't like about Madwand's script, but I understand why he did it.
Reply

#3
didn't think of that, will check if it is possible
Reply

#4
This AI seems to have a bad tendency when running, to try to go straight up and out of the atmosphere, at least on the craft I built, though it's fine in all other circumstances, and the standard AI doesn't even do this, Just this when it's 'running away'
Reply

#5
fixed running into space

sorry marine can't make lua play nice with players it seems there is no way to detect when you're trying to control the vessel
Sad
Reply

#6
wow, this thing has the amazing ability to survive against other lua based aircraft using missiles, even though that's not it's intended purpose(I'm using missiles with this code and it's pretty great in terms of survivability.)
Saraba Chikyuu Yo, Tabida-tsu fune wa~ Uchuu Senkan, Ya-ma-to!
(Translation: Farewell, Earth, the ship that is departing is the Space Battleship Yamato)
Reply

#7
How do you deal with gimbal locks?
Reply

#8
(2015-11-01, 05:48 PM)LoSboccacc Wrote: fixed running into space

sorry marine can't make lua play nice with players it seems there is no way to detect when you're trying to control the vessel
Sad

If you have a weapon on the plane you could use its PlayerCurrentlyControllingIt value as a proxy for vehicle PlayerCurrentlyControllingIt perhaps.

Edit: Updated to correct value name
Reply

#9
(2015-11-01, 06:40 PM)Arekku Wrote: How do you deal with gimbal locks?



I don't know what that means, but most probably I don't

v0.8 is here,
http://pastebin.com/u1vjL7fg
with a tuneable controller, for managing wobbling
Reply

#10
(2015-11-01, 06:53 PM)LoSboccacc Wrote:
(2015-11-01, 06:40 PM)Arekku Wrote: How do you deal with gimbal locks?

http://pastebin.com/u1vjL7fg,

Forum added a comma to your URL
Here is the version without: http://pastebin.com/u1vjL7fg

Since it only took a few minutes I made the change to use player controlling a selected weapon (default 0) as a proxy to allow player control. it is pretty crude but should be effective, only took ~5 lines to change


Attached Files
.txt   LoSboccacc_airal_ai_CHANGED_V0.8.1.lua.txt (Size: 10.61 KB / Downloads: 170)
Reply



Forum Jump:


Users browsing this thread:
2 Guest(s)