AutoElite
SDxWiki

Fellow spookydistancers: Please feel free to comment, encourage or discourage as you see fit...

DWM: Very cool. Sounds like you found a great playground for trying some ideas out. Hey, if it turns out to be OK to redistribute your work, we could set up a separate portion of the Web site for that.

Istvan: I'm definitely of the opinion we can pull a lot of inspiration from Elite. Would it be worth the time to try to adapt the codebase directly for two or more simultaneous players over a LAN? I'd suspect not, because that should involve too much rewriting at a very low level.

JDH: I was thinking about ways that we could try and make this happen - perhaps Peer-To-Peer rather than client server (although it would also be very "doable" to create a server) - remember that by todays standards it's a pretty simple game and a very simple engine (although a little obtuse and scattered with globals). It was fun working on it and I still think it's worth resurrecting it (for me anyway) as a test bed for ideas.

autoElite

This is my name for a project I'm playing with to add a sufistikated flight computer to Elite. The goal is to make the automation functions capable of playing the game entirely unattended from the first launch through to achieving "ELITE" status. These automation functions will not cheat - i.e. they should only work from the information as presented to the user and they should only be able to control the ship in the same way that a user can.

The Design

Created two hooks into the main game control loop. One hook is called each frame during flight (CheckFlightComputer_InFlight()) and the other is called when the player docks at a space station (CheckFlightComputer_Docked()).

The Flight Computer is made up of several sub-systems: ;/FlightPlan: Controls normal flight from planet to planet. The player can load the flight plan with a list of planets and then execute the flight plan. When the plan is executed the Flight Computer will launch, fly to the next planet, dock, buy fuel, fly to the next planet. This will continue until the final destination planet is reached. The flight plan uses a slightly modified version of the already existant docking computer. ;/ThreatPlan: Controls monitoring for threats and how to respond when a threat is encountered. The player can set a monitoring function and a response function. These functions will be specified via the scripting language. ;/FlightManeuvers: Controls detailed flight patterns. The player creates a stack of flight commands. Each flight command consists of two pieces of information: a flight function (roll left, climb, fire lasers etc.) and a duration (in number of frames). ;/TradePlan: Tentative - no work started yet. Specify a buy order and a sell order in terms of two functions. For example a buy order script could be very specific "if at lave buy food" or very general "buy anything that is 10% below average price". I'm also considering a "find market" function. This would interact with the /FlightPlan subsystem and would automate the task of finding a suitable market for the current cargo (or, perhaps for the currently available stock). For example the "find market" script could automate "buy from agricultural planets and sell to tech planets and then turn around and buy from tech and sell to agri". Or it could be more specific and look for the best potential market based on other criteria. However, because of the "no cheating" goal I can't grab actaul market data for other planets (but I'll introduce that as an update as outlined in Beyond autoElite (below)). The "find market" function is tentative because it might really belong to the scripting engine... ;/ScriptEngine: Tentative - no work started yet. The scripting engine will be able to control all aspects of the flight computer subsystems and will also be able to perform other functions (such as upgrading the ship and saving the game). ;/FUI: (pronounced "fooey") is the Flight computer User Interface. Allows the player to interact with all the above subsytems - oh yeah - it also lets them turn the FC on or off ...

Phase One

Add some basic automation functionality (the first 4 subsystems) and hard code some test scripts.

Status

8/7/01

This is proceeding quite well (although it's all just hacked together at the moment). I have rudimentary versions of the Flight Plan, Threat Plan and Flight Maneuvers subsytems in place.

I can launch from Lave, travel to Zaonce, buy fuel, and come back to Lave. Unfortunately the algorithm to detect that we've successfully completed the flight plan doesn't work - so when we get back to Lave it just launches and docks, launches and docks, over and over and over ... Quite funny really! ;-)

While following this flight plan I can successfully detect and respond to threats. So far I've tried the following threat detection funcs: TC_Hostile and TC_UltraParanoid. I had to change UltraParanoid to tell it that the space station is never a threat (otherwise very funky things happen as soon as you launch... ;-) The only threat response I've tried so far is TR_RunAway - after tweaking it a few times I can stay alive for a couple of minutes (my first attempt was so pathetic that my butt was fried in a bout 15 seconds!) - but I still can't make it to the safety of the space station though.

8/9/01

Fixed the bug that was preventing a flight plan from ever completing and added two new Threat Response functions - TR_Cheat & TR_RunThenCheat. TR_Cheat is for development purposes only (!) - I figured rather than holding up development while I got a successful "run away" algorithm working I'd just cheat - TR_Cheat makes all hostile threats within scanner range just mysteriously die ... TR_RunThenCheat first does the run away algo and then when energy is critically low it cheats. Of course, the first time I tested TR_RunThenCheat I successfully managed to evade my attacker for about 5 or 6 minutes - but I never got away from him (so I had to quit the game and try again - I think I'll add time into the decision making processes).

8/13/01

Added an implementation of BuyStock() and SellStock() and added them to the hard coded test script. I can now do a round trip between Lave and Zaonce (buy food at lave and sell it at zaonce and trade computers in the other direction) - woo hoo! "ELITE" status is just a few steps away ...

Phase One and a Half

Implement the FUI - at this point there will be enough functionality in place for it to be considered an enhancement to the game. At this point it would be possible (but not neccesarily wise!) to share my creation with an eager public.

Status

8/13/01

Started on the FUI - for now it's a modal dialog (freezes gameplay) - I'll convert it to modeless later. Very ugly - sort of reminiscent of the Beeb computer ...

Phase Two

Add in scripting support - hopefully using LUA

Phase Three

Continue to develop higher levels of scripting automation functionality until the goal is achieved (extra marks will be given for achieving the goal in the most elegant fashion!)

Beyond autoElite

Once (OK, if) autoElite is complete investigate extending the game in two different directions:

And Finally

All that'd be left after that is to get someone (called David?) to add some eye candy and I'll add an MP3 player to my ship and sit back and sell it for millions of dollars. Of course the only draw back is that it's whole basis is reverse engineered code without the copyright holders permission ... Mere details that I'm sure I can find a lawyer to help (perhaps I'll make my millions selling out of China?).

Who knew world domintation could be this easy?

Some Elite related links

Some programming links