TradeWars Blog

TradeWars Blog


What is Botlink

Over the years, many TradeWars gameops have requested the ability to write custom add-ons for TradeWars v3.  Earlier versions of TradeWars, especially TWv2, enjoyed an active 3rd party add-on scene.  But when TW became a multiplayer game with the release of v3, it became impossible to implement stable add-ons by working directly with game data.  It would be like writing a program to hack an active SQL database.  You might be able to do it, but with three or four clients interacting with the data, the result would be messy.  Data corruption would be common.  Because of this, I have rarely given anyone access to the details of TradeWars data files.

Botlink is a tool that provides 3rd party developers access to TradeWars data through a controlled text-based command interface.  It has the same underlying transaction system that TradeWars uses to process player interactions, and in fact has access to all of the same code that TradeWars uses to process game activities.  By using runtime type information, I am able to expose the actual in-game objects directly to Botlink, so a field in, for example, a user record is automatically accessible through a Botlink user object.  These fields are bounded, making it impossible to assign invalid values.  Using a ship record as an example, if the ship class is set to 1, Merchant Cruiser, all fields on the ship record are given appropriate bounds.  If the ship only supports fighters from 0 to 1000, an assignment > 1000 is truncated to 1000.  Also, these fields are multiplayer safe, so setting a value on a user record will immediately update wherever the record is in use.  And in addition to fields, Botlink objects can also expose complex actions through functions.  Any function in the game can be easily exposed through Botlink, making it easy to expand as new functionality is requested.  These functions are multiplayer-safe transactions, locking all relevant records, then unlocking when completed.

Botlink is being developed in three major phases.  The first phase, which is well underway, is the core data interface phase.  The goal is to provide all relevant fields and complex functions through a set of objects.

Phase 2 is the event generation phase.  Once implemented, a Botlink controller will be able to express an interest in any event that is currently generated in the game, plus many more to be added.  Such events include “player enters sector”, “player deploys fighters”, “player lands on planet”, etc, but will eventually include any significant activity in the game.  Such events, if requested, will be output to Botlink where a controller can trigger on and respond to them.  In addition, I would like to support stored script blocks so that Botlink can process a block of script immediately on an event rather than waiting for the controller to tell it what to do.  This could be further extended by allowing events to return a boolean value to control what TradeWars does next.  Such events could control player access to ships, implement special code that overrides standard functionality, etc.

Phase 3 is the player interaction phase.  The goal here is to provide a way for Botlink to capture a player’s session and directly handle IO in place of standard TradeWars IO.  Using this system, a Botlink controller could implement a new area of the game.  For example, you could add a new shop on StarDock.  Once the player enters the area, Botlink provides all screen output and handles all input directly until it releases the player back to the game.  Provide custom menus and create custom areas for players to visit, and new ways for them to interact.  Botlink will introduce a special in-game command system to support custom commands from any area of the game.  These commands would be designated by a “.”, followed by the command text.  So, for example, you could introduce a “.land” command in a sector where you have a custom planet, and in response to this command, the player is handed over to Botlink where you would handle the player’s interactions with this planet.

That describes the basic functionality I have in mind for Botlink.  If you’re interested, you can see Botlink in action at the EIS beta site, telnet://twgs.classictw.com 2003 password “sandbox”, giving you admin access to game C, the sandbox game.  As I said, most of phase 1 is complete.  You can see the list of commands currently supported by sending a “>SHOW COMMANDS” command.  That’ll give you all the tools you need to start exploring the command interface.

I have been posting details about Botlink functionality on the TW forum, but I am going to begin to use this blog for that purpose.  I’ll also copy the previous posts on the subject into this blog so anyone interested can catch up on what’s been done so far.

4 Responses to What is Botlink

  1. Would this allow for individuals to create NPCs in their games?

  2. Hey, Josh. Good to see you.

    Yes, that’s a big part of what this is about. But it should allow more than just custom NPC behaviors. I can see some gameops or even players writing script packs to control aliens in games, giving them the ability to do the same kinds of advanced tactics that they use in games. Obviously, it will be necessary to balance the strength of such NPCs, because they could be made to be way too powerful without much effort. Imagine a good player with access to 50 to 100 alien ships running unlimited turns 24/7. The trick will be making these NPCs interesting and challenging, but not overwhelming. But considering the Gold aliens are often considered a push-over, it’ll be refreshing to have more of a challenge from the AI.

  3. Not quite first, Kaus, but thanks for trying ;)


  • dinamic_sidebar 4 none

©2017 classictw.com Entries (RSS) and Comments (RSS)  Raindrops Theme