Oolite AIs

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
RyanHoots
---- E L I T E ----
---- E L I T E ----
Posts: 958
Joined: Fri May 20, 2011 8:10 pm
Location: Nowhere
Contact:

Oolite AIs

Post by RyanHoots »

I am going to work on AIs for Oolite, maybe an escort fighter, or a clown that blows up after a bit. Any tips or ideas? Thanks.
Image
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Oolite AIs

Post by Smivs »

Yeah, read the Wiki page, then realise it really doesn't give you any idea how they actually work. :o
The good news is, as always, there will be plenty of help here if you need it.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
RyanHoots
---- E L I T E ----
---- E L I T E ----
Posts: 958
Joined: Fri May 20, 2011 8:10 pm
Location: Nowhere
Contact:

Re: Oolite AIs

Post by RyanHoots »

Smivs wrote:

The good news is, as always, there will be plenty of help here if you need it.
Yep. I just completed a simple AI. If it works it will be very funny. If attacked, it blows up like a Q-Bomb.
Image
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Oolite AIs

Post by Smivs »

RyanHoots wrote:
..... it will be very funny. If attacked, it blows up like a Q-Bomb.
I can think of something else that does that. :lol:
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
RyanHoots
---- E L I T E ----
---- E L I T E ----
Posts: 958
Joined: Fri May 20, 2011 8:10 pm
Location: Nowhere
Contact:

Re: Oolite AIs

Post by RyanHoots »

Cool! I think I see some big explosions in my future...
Image
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Oolite AIs

Post by Smivs »

:D :D :D
Commander Smivs, the friendliest Gourd this side of Riedquat.
m4r35n357
---- E L I T E ----
---- E L I T E ----
Posts: 296
Joined: Wed Jan 19, 2011 4:00 pm

Re: Oolite AIs

Post by m4r35n357 »

Try looking at these to give you some ideas . . .

http://wiki.alioth.net/index.php/AI

That should get you started. Also, try looking at any OXPs that do things that you enjoy with the AI.
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Oolite AIs

Post by Capt. Murphy »

In addition to the Wiki take a look at the AI's included in the core game to get a bit of a grip on how they are put together. It's a pretty complex area.

If testing a new creation's AI I suggest giving it an attached script with this code snippet.

Code: Select all

this.shipSpawned = function()
{this.ship.reportAIMessages = true;}
This will help you tweak/bugfix your AI from the log file.

I'll be releasing version 1.1 of my escort contracts OXP in a day or two which includes a custom AI and ship script built from scratch. It's only taken me about a month to get it right.... :roll: . If you are interested take a look.
Last edited by Capt. Murphy on Wed Jun 15, 2011 11:36 am, edited 1 time in total.
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
RyanHoots
---- E L I T E ----
---- E L I T E ----
Posts: 958
Joined: Fri May 20, 2011 8:10 pm
Location: Nowhere
Contact:

Re: Oolite AIs

Post by RyanHoots »

I hope to write AIs for some ships I've made. I then need to find out why I can't install Wings... but getting a LInux app to work is my specialty. 8)
Image
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Oolite AIs

Post by Eric Walch »

Capt. Murphy wrote:
If testing a new creation's AI I suggest giving it an attached script with this code snippet.

this.shipSpawned = function()
{this.ship.reportAIMessages = true;}

This will help you tweak/bugfix your AI from the log file.
Yes, if you really want to understand, you must start logging them. That helps in understanding how they work. They probably work different than you first think. And instead of setting the messages on with a script you can also switch it on during the addition command:

Code: Select all

system.addShips('pirate', 1, player.ship.position, 10000)[0].reportAIMessages = true
But if testing a special script, it is the easiest to use the method by "Capt. Murphy". It even works for ships spawned at the other end of the system.

One other way is targeting the ship and use:

Code: Select all

player.ship.target.reportAIMessages = true
But in doing so you will miss the initial AI commands.

Anyhow, you do need the console to do this all.
User avatar
RyanHoots
---- E L I T E ----
---- E L I T E ----
Posts: 958
Joined: Fri May 20, 2011 8:10 pm
Location: Nowhere
Contact:

Re: Oolite AIs

Post by RyanHoots »

I am now going to take a look at some AIs, and write a few while I'm at it.
Image
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Oolite AIs

Post by JensAyton »

There’s also the generate-ai-graphviz hidden setting, which makes graphs of the possible state transitions in each AI that’s loaded. Have I mentioned that I like graphs? ;-)
m4r35n357
---- E L I T E ----
---- E L I T E ----
Posts: 296
Joined: Wed Jan 19, 2011 4:00 pm

Re: Oolite AIs

Post by m4r35n357 »

Wow, some cool stuff in there, esp. flush cache!
m4r35n357
---- E L I T E ----
---- E L I T E ----
Posts: 296
Joined: Wed Jan 19, 2011 4:00 pm

Re: Oolite AIs

Post by m4r35n357 »

Ahruman wrote:
There’s also the generate-ai-graphviz hidden setting, which makes graphs of the possible state transitions in each AI that’s loaded. Have I mentioned that I like graphs? ;-)
Anyone know where these files are created, I have yet to locate one - it's either missing, or absent . . . ?
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Oolite AIs

Post by JensAyton »

m4r35n357 wrote:
Anyone know where these files are created, I have yet to locate one - it's either missing, or absent . . . ?
They should be generated in the same place as the log. Also, they’re only generated when an AI is first loaded, so start Oolite with shift held down to clear the cache.
Post Reply