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

  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The AI/code library

Because I felt we needed a sticky index for all the code in this forum!
If your code isn't included here, it's because I missed it, or it doesn't do enough.

The order is completely arbitrary and not an indicator for the quality of the AI nor how much I like the author.

AC-130/Pylon Turn AI
Advanced aerial, water start, and dogfighting AI
Cinamatic aircraft AI - LoSboccacc
Aims the entire plane towards the target so cannons can fire without mantle.

Code for graviton ram-powered flight (Version 1.1) - BaronVonSatchel
Float your airships in the air with Graviton shells!

Basic naval AI

Advanced aerial, water start, and dogfighting AI
Simplistic Sub/Missile Control Code
Submarine AI! Full Hydrofoil support! Terrain Detection Re-rewrite is here!
Hydrojet Submarine AI - CalenLoki
Proportional LUA thrust control for pitch and roll - Miyuki

New Missile Predictive Guidance Script - EpicRootHairCell
javelin style close in guidance for missiles - LoSboccacc
Simple Missile Directional Attack Scripts - Falcon256
Missile TPG guidance - Blothorn
Unguided Torpedo Code - Moonruner
Remember the old unguided torpedoes from WW2? Just like it says in the title, fires dumb torpedes from a spinblock that goes straight ahead.

Advanced aerial, water start, and dogfighting AI
CP75's hovercraft controller lua, with minor changes by goduranus
Desert Surreal - Hovercraft - Antypodish
Stable thrustercraft drone code (WIP) - Moonruner
PID- Hover AI - Styrkar

Helicopter AI(Standalone Or Addon) - 7thfleet
Quadcopter/Helicarrier AI v1.9
Hover gunship/repaircraft AI - Draba

Ground vehicles:
Land/Tank AI

Active stabilization:
Active ship stabilization
Submarine automatic propulsion balancing! Hydrofoil support added!
Delta Stabilization - MJOne
Looks like a roundabout PID-controller, maybe, we don't know either but it seems to work.

DoctorPC's Terrain Detection Script
Takes several uniform samples in 8 directions to determine the peak
Simple "Seabed Depth" warner and indicator
Prints out a warning to HUD when seabed is too shallow.
PID controller (/w windup prevention) - Arekku
Your standard PID controller that can be instantiated to how many instances you need and then feed the result to your actuators.
Simplex optimizer - Arekku
A generic function to optimize parameters
DeflectorNet: A Lua Networking Library - Vebyast
Automagic Sheilding - TBTerra
Activates shields facing enemies

Maybe you could also include basic Lua tutorial at the beginning?

I believe sticking that thread would be better. This is intended to be the thread you go to if you want some pre-written code, someone looking to learn lua would likely not look here.

Learning by reverse engineering is the way to go Tongue But you're probably right

While I originally thought this would contain all AI/code, I'm starting to suspect this needs some sort of lower bound in order to prevent it getting flooded with 50 billion copies of the same submarine code that seems to be the latest fashion now.

I wanted this to be fair, but it's not going to work Sad I'll do my best though.

When judging entries I had in mind to look at a few points to filter out entries

How easy is it to mix this script with another script. Having lots of global variables will be a disadvantage and not localizing variables properly may be enough to exclude the entry.

The script must do something that you can't do with PID-regulator. Self-tuning PID-regulator is acceptable though. Examples of desired behaviors would be evasive maneuvers, navigate to get behind the enemy vessel, surface when no enemies are around to recharge batteries etc (for when we get engine overhaul), and of course the self-tuning PID.

Looking for something here to indicate that the ship is an intelligent agent rather than a dumb regulator.

Ease of use and configuration
How fast can I get this script working? How many configuration options must I fill in, and what quality are they? There must be default values for everything and they must be reasonable.

Lots of low level (regulator level) configurations that must be done counts as bad, whereas lots of high level configuration (AI level) counts as good.

Examples of bad configurations: How much and how fast do I turn hydrofoils, which hydrofoils do I use?
Good configurations: Do I attack from behind or head on? How damaged must I be to withdraw for repairs? Do I stick together with my group or go alone? How close should I aim to be?

How stable is the craft? Dampened oscillations are acceptable, large constant oscillations are not. This applies even if these intentional regulatory defects are part of your "evasion maneuvers". If you can't flail around wildly in a controlled manner your AI is out.

How well does it handle losing a few actuators? How many actuators can it lose before spinning out of control?

Can it handle going backwards? Upside down?

Can it navigate the world without getting stuck on the occasional mountain and what not?

Is the code written in a way that makes it easy to follow what it does, properly indented and commented?

Is the AI code (planning) separate from the regulation code (execution)?

Execution time
Entries should be reasonably fast, if it does something the slow way when there is an obvious faster way to do it and get the same results, it may not make the list depending on how slow it is.

I have to disagree with "all submarine code the same" - each has something unique. Some have really expanded terrain avoidance, some NavalAI integration, full yaw/pitch/roll hydrofoil support, manual control option, ect.
I'd keep quite a lot of them (maybe best 10? so all ATM) with short description of their unique functions.

But even if you go your way and shave off some code, I think I'd stay.
Compatibility - check. Most variables local
Complexity - check. Diving to avoid enemy fire, self-tuning controls
Ease of use and configuration - check. 4 high-level regulators and 1 low-level
Stability - check. Can go half destroyed. Reverse and upside down soon
Pathfinding - it already avoids terrain not so badly, but islands are still a problem - it manage to always find that single little island on the battlefield. Still working on it, and the goal is to make it navigate in LH east fiords.
Style - check. Clean division between decision making and execution. All commented
Execution time - check. Clocked to run at 4Hz. Optimization for multi-player set really high standards
Unique features - check. Full yaw/pitch/roll hydrofoil control, dual hydrojet support, emergency diving. More soon, as I started with execution, to pave the way for decision making.

Fine I'll concede on all submarine code not being the same.

I don't want to point fingers at anyone claiming their code sucks, but those criteria actually works to exclude some code. I want to establish some sort of floor to make sure the entries here are of decent quality.

I'd like to be notified if my code is found to not to meet one of the requirements, if that's feasible.
[Referring to drumstick engines] "majyst:The Rapier? WTF, cant Teamspeak people just build a dam ship without trying to cheat the system"
I've made some forum themes.

Could my terrain detection algorithm pass?

What it does is it gives you a worst case estimate of the terrain around you. Usable for both aircraft and submarines. It 'casts a net' on the ground(configurable in size, density, dead zone and density dropoff), picks the highest point, and returns your distance to it on the y-axis.

hi can you remove probabilistic missile guidance from the list? code has been merged into javaelin guidance system and pretty much discontinued

Forum Jump:

Users browsing this thread:
1 Guest(s)