Looking to start a chatbot expansion

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

Moderators: winston, another_commander

unteer
Average
Average
Posts: 8
Joined: Mon Oct 19, 2009 5:53 am
Location: Mombasa, Kenya
Contact:

Looking to start a chatbot expansion

Post by unteer » Mon Oct 19, 2009 6:06 am

Hey kindly folks at Oolite bulletins, I am a relative newbie to the game, and these forums, but I have a lot of time on my hands and have an idea for an expansion. I am a programmer, so I am not afraid of that aspect of the whole endeavor, but I have some questions.

The general idea for the expansion is to have a chatbot AI based on an AIML parsing engine which can answer questions about the game such as recent prices of commodities based on last visit, and whatnot. Also thinking of throwing in some Natural Language Learning so that maybe it can even learn from the player as you go (I have A LOT of free time, and AI was my specialty in university).

However, I am getting mixed sources on where and how to approach this project. My concept of the game is that the chatbot engine would be coded in javascript, using a javascript-based AIML parser. And from this, the questions arise:

1) Which file would I modify for the HUD of the ship to include a chatbox which you would use to interact with the AI. hud.plst seems reasonable, but is the least documented on the elitewiki.

2) is it against any oolite/elite mantra to have the AI record prices based on last visit and whatnot to aid in commodities training?

3) is it ok to maintain external databases for the AI brain and memory or would that be against mantra as well. Is it ok to use a SQL based language, or should I stick to plsts?

4) are you able to code in Objective-C for the OXPs or is everything plst and javascript based? I dont know if OXPs can be compiled seperately of the game, or if major coding forces a recompile of everything.

And finally...

5) does something like this already exist for the game, and could i just use it instead of hacking my own?

I apologize ahead of time if these answers are out there. I have googled for some of the answers and will continue to do so, so I don't appreciate, "Go google it," as a response. I have googled, am googling, and will continue to google. but people are still better than google many times :)

Cheers!

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 5397
Joined: Wed Feb 28, 2007 7:54 am

Re: Looking to start a chatbot expansion

Post by another_commander » Mon Oct 19, 2009 6:20 am

Hi and welcome to the forums and the game. On with the answers:
unteer wrote: 1) Which file would I modify for the HUD of the ship to include a chatbox which you would use to interact with the AI. hud.plst seems reasonable, but is the least documented on the elitewiki.
hud.plist is what you would hack to produce a graphic like a box that would hold the chat text. However, the plist alone is not enough. You still need to add the logic behind it and for this you would probably need to create a ChatAI class that interacts with the HeadUpDisplay class.
2) is it against any oolite/elite mantra to have the AI record prices based on last visit and whatnot to aid in commodities training?
In my opinion, no. It would be in the same context as having a pen and paper and writing down prices from systems visited.
3) is it ok to maintain external databases for the AI brain and memory or would that be against mantra as well. Is it ok to use a SQL based language, or should I stick to plsts?
I would prefer to stick to plists for consistency with the rest of the game interface.
4) are you able to code in Objective-C for the OXPs or is everything plst and javascript based? I dont know if OXPs can be compiled seperately of the game, or if major coding forces a recompile of everything.
Objective-C is used only for the core of the game. OXPs are made with plists, model, sound and image files and JavaScript and they are not compiled, they just provide resources that the game reads and uses accordingly. They are cached, but this is not quite the same thing. Only the core exe code is compiled.
And finally...

5) does something like this already exist for the game, and could i just use it instead of hacking my own?
To the best of my knowledge, nothing like this has been attempted before.

unteer
Average
Average
Posts: 8
Joined: Mon Oct 19, 2009 5:53 am
Location: Mombasa, Kenya
Contact:

Post by unteer » Mon Oct 19, 2009 7:07 am

Thank you so much for your quick response. I am glad to see that the BB is patrolled by such helpful individuals as yourself :) I will therefore begin working on this project, and if and when I have made some major progress, possibly open up a code page somewhere and would glady appreciate contribution and experience :)

Another quick question then, is there a "hello world," style OXP out there that does not involve graphics or modeling (not my strong suits, nor my desire).

Cheers!

User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks » Mon Oct 19, 2009 8:19 am

'Hello World'? Not really, but farsun (see my sig) is fairly minimalstic, since all it does is move suns from position a to position b.

I'd personally have a look at each of the Articles pointed at from here before jumping in, though...

As per another thread on the boards somewhere, I suspect GalCoop would take a dim view of trade helping technologies, but that theory hasn't been tested yet!

Cheers, - & a_c already said - welcome to the friendliest boards this side of Riedquat!
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 5397
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander » Mon Oct 19, 2009 8:25 am

I've put together a quick and dirty Welcome To Oolite OXP as an example of what can be done. Downloadable from here:
http://terrastorage.ath.cx/Marmagka/6f4 ... te.oxp.zip
Unzip the contents of the file directly into the AddOns folder, maintaining the directory structure. This OXP displays a welcome screen the first time you start the game at Lave and also generates a "Launch sequence complete" message immediately after launch. Hope it gives an idea how it's all assembled and works out.

unteer
Average
Average
Posts: 8
Joined: Mon Oct 19, 2009 5:53 am
Location: Mombasa, Kenya
Contact:

Post by unteer » Mon Oct 19, 2009 8:49 am

As per another thread on the boards somewhere, I suspect GalCoop would take a dim view of trade helping technologies, but that theory hasn't been tested yet!
I was actually reading that thread and was about to mention my thoughts, and even just had an Elite-canon discussion with a friend of mine as well. What I was hearing was that system-wide and galaxy-wide trade-assistance programs are frowned upon for obvious reasons: it would make the game a whole lot less fun. Part of the game is taking a risk in commodities-trading and because the game cannot easily represent the risks of real-life commodities-trading, the universe creates artificial risks, such as price-masking through information obscurity.

What I am proposing is simply an electronic version of the paper and pencil method to price watching. Your ship AI will a) only remember prices from systems you have visited and b) only remember certain prices when you ask it to, on a per item basis (ie, "AI, please remember this system's food price"). I feel like this puts enough onus on the player to remember to tell the AI to remember the prices while allowing people like me to fly around in-game as well as in real life without needing to worry about bringing their physical log-book. I am trying to find a balance between learning how to write OXPs, give the Ship AI some functionality which will help me to select its working vocabulary for training its NLP engine, and adhere as much as possible to Elite/Oolite canon.

Anyone ever read McCaffrey's Nimisha's Ship? If so, think that for the AI minus the voices. If you haven't read the book, it's not the author's best, but it's certainly fun, and keeps me entertained when the electricity goes out and I am reading by lantern-light, lol.

Thoughts?
"Any sufficiently advanced technology is indistinguishable from magic." -Arthur C. Clarke's Third Law of Prediction

pmw57
---- E L I T E ----
---- E L I T E ----
Posts: 389
Joined: Sat Sep 26, 2009 2:14 pm
Location: Christchurch, New Zealand

Re: Looking to start a chatbot expansion

Post by pmw57 » Mon Oct 19, 2009 9:47 am

unteer wrote:2) is it against any oolite/elite mantra to have the AI record prices based on last visit and whatnot to aid in commodities training?
Oh bugger - that's what I'm quietly working on here. To store the commodities in a packed manner, and then to show the best price differences from what you know of the systems around you.
A trumble a day keeps the doctor away, and the tax man;
even the Grim Reaper keeps his distance.
-- Paul Wilkins

User avatar
Cmdr James
Commodore
Commodore
Posts: 1267
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Post by Cmdr James » Mon Oct 19, 2009 1:30 pm

Im not sure how useful that is, as prices will not be the same next time you visit.

unteer
Average
Average
Posts: 8
Joined: Mon Oct 19, 2009 5:53 am
Location: Mombasa, Kenya
Contact:

Post by unteer » Mon Oct 19, 2009 1:41 pm

I think much of this AI work is moot anyway, as there is no way to intercept key presses using spidermonkey apparently (according to another thread I've started). If this is the case, there will be no way for the user to interact with the bot. This is most sad!

Possibly a companion program then, depending on what sorts of variable-values I can access externally of the game.

Does anyone else have any thoughts on this matter?

Cheers!
"Any sufficiently advanced technology is indistinguishable from magic." -Arthur C. Clarke's Third Law of Prediction

User avatar
PhantorGorth
---- E L I T E ----
---- E L I T E ----
Posts: 603
Joined: Wed May 20, 2009 6:48 pm
Location: Somewhere off the top left of Galaxy 1 map

Post by PhantorGorth » Wed Oct 21, 2009 12:19 pm

Does anyone else have any thoughts on this matter?
Yes, I have been looking into ship to ship communications a little while ago. I have already looked into to adding an interface and how to do a relatively simple response mechanism whilst you are in flight.

To do this you will have to alter the core code.

I have already got a copy of the code that adds a semi-transparent window that overlays the HUD for selecting your response which can be toggled on or off on the F9 key. But I put this on the back burner as it was too ambitous to be my first modification.

I was going to to do the response method by having te player select options using the equivalent of cursor keys (thought not the real cursor keys as you will still need those for flying the ship). The response method was to be grammer based with each option selected to be able to add further options if required so building up your sentence. The left-right keys would select which part of in the of the sentence to alter and the up-down keys would cycle through the options for that part. Typing would only be needed for special options such as numeric fields for money for example.

This would be an injection system so OXPs can have ships transmit a message to you and add to your comms system the grammers or basic options for a response. When you respond a message is sent to the ships AI using the normal mechanism. AIs then can call a JS script to check your response and decide if to change state or send another message and grammers to you.

As well as responding to messages you can send messages to ships, police, stations etc.

The choice of a grammer based system was to make it easier for the language to changed.

I can provide examples if you want but it will have to be later. (I'm at work)

User avatar
Svengali
---- E L I T E ----
---- E L I T E ----
Posts: 2365
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali » Wed Oct 21, 2009 12:35 pm

Great idea PG! I'd like to see some examples .-)

overmage
Deadly
Deadly
Posts: 128
Joined: Mon Mar 23, 2009 6:55 pm

Post by overmage » Wed Oct 21, 2009 4:01 pm

I think it's a great idea. We can have a SmarterTharglet ;)

User avatar
PhantorGorth
---- E L I T E ----
---- E L I T E ----
Posts: 603
Joined: Wed May 20, 2009 6:48 pm
Location: Somewhere off the top left of Galaxy 1 map

Post by PhantorGorth » Wed Oct 21, 2009 8:02 pm

Svengali wrote:Great idea PG! I'd like to see some examples .-)
Here is an image of the comms interface overlap:
Image

It is a simple test so there is no interactivity in it at the moment. Just toggles on and off with the F9 key and is removed if you dock.

Examples of now I expect the communications interface to work:
Image

The first example is a basic response. The second is sentence construction with the on screen message that goes into the normal log is shown underneath. The third is another sentence construction.

These may have huge issues that have yet to be worked out but I hope these examples at least gives everyone a feeling to what I am suggesting.

User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3092
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

...

Post by Lestradae » Wed Oct 21, 2009 9:29 pm

Very cool idea :D

User avatar
pagroove
---- E L I T E ----
---- E L I T E ----
Posts: 3033
Joined: Wed Feb 21, 2007 11:52 pm
Location: On a famous planet

Post by pagroove » Wed Oct 21, 2009 10:18 pm

PG: my dream comes true when you get this implemenred. I like the idea of the com channels :)
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
Image
http://aegidian.org/bb/viewtopic.php?f=4&t=13709

Post Reply