View unanswered posts | View active topics It is currently Thu Mar 28, 2024 7:31 am



Reply to topic  [ 14 posts ] 
 Botlink ready for testing 
Author Message
Site Admin
User avatar

Joined: Sun Dec 24, 2000 3:00 am
Posts: 3150
Location: USA
Unread post Botlink ready for testing
Over the vacation, I started working on a new feature I've been wanting to add. It's called Botlink, and it's a module that provides a text interface to TradeWars games. The basic idea is to provide a safe interface to game data so that people can develop extensions like they did back in the v2 days. The Botlink interface can be controlled by scripts, or by a program that opens a connection and interacts like a helper app would.

I've finished the initial phase of this design and I'd like to open it up for some testing and feedback from gameops who have an interest in server-side scripting. If you'd like to participate in the early beta of this new tool, let me know and I'll provide you with a game on the Beta server within the next few days.

Just to give you some idea of what Botlink can do right now, here's the output from the "SHOW COMMANDS" command:

SHOW OBJECTS
SHOW FIELDS [FOR Object]
SHOW RANGE FOR Object.Field
SHOW FUNCTIONS [FOR Object]
SHOW RECORDS [FOR Object]
SHOW FIND OPS
SHOW COLOR CODES

USE Object Index AS Alias
DROP Alias

EXEC Alias.Function
VIEW Alias
GET Alias.Field
SET Alias.Field = Value

EDIT Alias
COMMIT Alias
ROLLBACK Alias

LOCK Alias1, Alias2...
UNLOCK Alias1, Alias2...
UNLOCK ALL

As an example, the output for "SHOW FIELDS FOR USER" is:

Active : Boolean [READONLY]
Alignment : Number [-4500000, 4500000]
BankBalance : Number [0, 500000]
BBSName : String[41]
Corp : Number [READONLY]
Credits : Number [0, 1000000000]
Experience : Number [0, 4500000]
GameName : String[41]
ID : Number [READONLY]
OnPlanet : Number [READONLY]
OnPort : Number [READONLY]
Password : String[8]
Sector : Number [READONLY]
SectorAvoid : Array[sector : Number] of Boolean
SectorKnown : Array[sector : Number] of Boolean
Ship : Number [READONLY]
Turns : Number [0, 65535]

Boolean = {False, True}

And the command "USE USER 1 as ME", followed by "VIEW ME", looks like this:

Active = True
Alignment = 2
BankBalance = 0
BBSName = "John"
Corp = 0
Credits = 1000
Experience = 0
GameName = "John"
ID = 1
OnPlanet = 0
OnPort = 0
Password = "mypassword"
Sector = 142
Ship = 3
Turns = 1000

Finally, the command "SHOW FUNCTIONS FOR USER" would show this:

Deactivate(LeaveAssets: Boolean = False)
Kill(KillerType: KillerType = Admin; KillerIndex: Number = 0; LeaveShip: Boolean = False; Silent: Boolean = True)
Move(Sector: Number; Silent: Boolean = True)
LandOnPlanet(Planet: Number; Silent: Boolean = True)
LeavePlanet(Silent: Boolean = True)
LandOnPort(Port: Number; Silent: Boolean = True)
LeavePort(Silent: Boolean = True)
Transport(ToShip: Number)

Boolean = {False, True}

KillerType = {Admin, Player, GoldRace}

Every object has a set of fields and functions. The objects currently supported are:

GAME
USER
SHIP
SECT
PORT
PLAN
CORP
XNON
FEDS
TERRA
CLASS0
STARDOCK

with a number of standard aliases for interfacing with game objects.

Game : Game Interface
Terra : Terra Interface
Centauri : Centauri Interface
Rylos : Rylos Interface
Sol : Sol Interface
StarDock : StarDock Interface

There are also some search functions. The output of "SHOW FIND OPS" shows:

FIND SHIPS/PLANETS/FIGHTERS/ARMIDS/LIMPETS FOR PLAYER Index
FIND SHIPS/PLANETS/FIGHTERS/ARMIDS/LIMPETS FOR CORP Index
FIND SHIPS/PLANETS/FIGHTERS/ARMIDS FOR FERRENGI
FIND SHIPS/PLANETS/FIGHTERS/ARMIDS/LIMPETS FOR GOLDRACE Index
FIND ABANDONED/ROGUE/PIRATE SHIPS/PLANETS/FIGHTERS/ARMIDS/LIMPETS

FIND PLAYERS/FEDS/FERRENGI/ALIENTRADERS/GOLDALIENS IN SECTOR Index
FIND SHIPS/PLANETS IN SECTOR Index
FIND PLAYERS/GOLDALIENS ON PLANET Index
FIND PLAYERS/GOLDALIENS ON PORT Index
FIND PLAYERS WHERE NAME IS/LIKE "Name"

So, for example, if you enter "FIND PLAYERS ON PLAN 8", you might get a list of player IDs like "2 4 8".

That's basically it for now. This is just a start, but it's a good foundation. I'm ready for some feedback on how useful this interface will be, and how to improve it. Once this phase is complete, I will be adding an event interface that will allow a Botlink controller to receive and respond to any event in the game, then later add the ability for a Botlink controller to capture a player's IO so it can implement entirely new areas of the game. When it's all done, I think it will be very powerful. But even this first phase of development will open up many possibilities. I'm anxious to see what some of you can do with it.

_________________
John Pritchett
EIS
---
Help fund the TradeWars websites! If you open a hosting account with A2 Hosting, the service EIS uses for all of its sites, EIS will earn credits toward its hosting bill.


Thu Jan 12, 2012 9:57 pm
Profile WWW
Site Admin
User avatar

Joined: Sun Dec 24, 2000 3:00 am
Posts: 3150
Location: USA
Unread post Re: Botlink ready for testing
Ok, I've posted the new version on twgs.classictw.com with Botlink active. If you'd like to take a look at it and see what it can do, use the sandbox. Telnet twgs.classictw.com 2003 password "sandbox".

If you're a script writer and would be willing to test this out, I'll provide you with your own game. Here are some things you could do for testing.

1) Control a Gold alien. When creating a Gold alien through Botlink, you can set it to manual control. The Gold alien server will not control that alien with AI. Instead, you will have direct control over the alien through Botlink.

2) Implement a realtime Fed sweep of the MSLs. Using the Feds object, you can directly control any of the Feds. Eventually you will be able to expand the Feds with your own character, but for now you'll have to use one of the existing ones. The Fed can move along the MSLs, eliminating any Fighters that it finds.

3) Implement a realtime anti-grid script. Go through the active player list, grab a list of fighter deployments for each player and enforce a maximum fig deployment rule. Either have a Fed jump in and destroy figs, or just remove them from the sectors. I will be adding the ability to post mail or messages, and generate log entries, but that ability is not yet in.

4) Implement an evil ISS. Scan players to find a player in this ship. If the player does not meet the alignment or experience requirement, jump a Gold alien into the sector to attack the player and recover the ship. Again, this really needs some kind of messaging ability to inform the player of what is happening, but the basic system could be implemented to demonstrate how it would work.

5) Gather statistics about a game and use it to generate alternative rankings lists, or even to identify a winner and announce the end of a game. Eventually it will be possible to generate a list directly to a player's screen, but for now you would need to generate a file for display outside of the game, on a web page or whatever.

I think all of these things and many more will be possible with this system, but we just need to dig in and try some things out to see what needs to be changed or added to make it work. I already have a few new features on my todo list just from coming up with these uses.

_________________
John Pritchett
EIS
---
Help fund the TradeWars websites! If you open a hosting account with A2 Hosting, the service EIS uses for all of its sites, EIS will earn credits toward its hosting bill.


Fri Jan 13, 2012 1:42 am
Profile WWW
Gameop
User avatar

Joined: Tue Nov 19, 2002 3:00 am
Posts: 1050
Location: USA
Unread post Re: Botlink ready for testing
JP, ill prolly find out after you bang a game for me, but does the interface have ability to upload txtfile with batch commands? I cant speak for other scripters but im a see my code in a comfortable medium (twxide,etc) type of guy.

The 2002 access port is down.

_________________
Dark Dominion TWGS
Telnet://twgs.darkworlds.org:23
ICQ#31380757, -=English 101 pwns me=-
"This one claims to have been playing since 1993 and didn't know upgrading a port would raise his alignment."


Fri Jan 13, 2012 6:44 pm
Profile ICQ
Site Admin
User avatar

Joined: Sun Dec 24, 2000 3:00 am
Posts: 3150
Location: USA
Unread post Re: Botlink ready for testing
Should be 2003.

Initially you'll just need to send script as you want to execute it. I'm planning to provide a way to store script in Botlink to be used as event handlers, special actions, etc, so the script can be processed as quickly as possible. But I think there will still be plenty of times when you'll want to code responses to event triggers, gather data, make decisions, etc. But Botlink won't provide any kind of script processing itself. It's just a simple text command interface that will allow you to request data, issue commands and receive events. Any kind of logic will need to be implemented in your controller, whether it's a script engine or an application.

I hope that answered your question. I'm not 100% sure what you were asking.

_________________
John Pritchett
EIS
---
Help fund the TradeWars websites! If you open a hosting account with A2 Hosting, the service EIS uses for all of its sites, EIS will earn credits toward its hosting bill.


Sat Jan 14, 2012 3:35 am
Profile WWW
Gameop
User avatar

Joined: Tue Oct 10, 2006 2:00 am
Posts: 112
Location: In my bubble...
Unread post Re: Botlink ready for testing
Nice addition. Going to have to play with this. Almost reminds me of the BBS door writing the drop files.


Sat Jan 14, 2012 5:10 pm
Profile
Site Admin
User avatar

Joined: Sun Dec 24, 2000 3:00 am
Posts: 3150
Location: USA
Unread post Re: Botlink ready for testing
It's kind of like CIM on steroids ;)

_________________
John Pritchett
EIS
---
Help fund the TradeWars websites! If you open a hosting account with A2 Hosting, the service EIS uses for all of its sites, EIS will earn credits toward its hosting bill.


Sat Jan 14, 2012 6:09 pm
Profile WWW
Gameop
User avatar

Joined: Tue Nov 19, 2002 3:00 am
Posts: 1050
Location: USA
Unread post Re: Botlink ready for testing
Embarrassed about the 2002 thing but happens. Originally JP i was confused about the scope of Botlink. Then it occurred to me you intend it to be scripted outside of the interface. Going to put my initial observations into this thread for debug/conversation purposes.

1) The Botlink command line froze after prolonged abandonment
-I was posting in ClassicTW and left it at the command line for over 10 minutes when I went back I was unable to type a command. The server did not go down and I was successful at reconnecting.

2) A container of some kind would be nice.
-I'm unsure if its possible but a static event container/flag/parameter would be nice.

I.e. If A happens then notify me via B, or just set a Boolean value to false. I would prefer notification because then I'm not holding up resources back-end and am less likely to miss the event due to noise.

3) Stardock asset is not updating correctly in Botlink. I ported Kaus then ran view stardock. The LastPorted field did not update.
Code:
>view stardock

Active = True
ID = 4
InvEqu = 3000
InvOre = 3000
InvOrg = 3000
LastPorted = ""
PortClass = SSS
PortName = "Stargate Alpha I"
Power = 100
ProdEqu = 300
ProdOre = 300
ProdOrg = 300
Profit = 0
Sector = 1301
VarEqu = -35
VarOre = -80
VarOrg = -50
0 OK

4) I know its a alpha but I find the interface a little confusing. Some changes I would make:

-Place the Show Commands under a generic "Help" descriptor.
I.e. Help Commands, then build off Help for further development.

-Remove the "for" syntax, to me it feels unintuitive.
I.e. Show Records for Stardock vs. Show Records Startdock. Additionally its showing different redundant values. Not sure that this is intended?
Code:
>show records game

  Game : Game Interface
  Terra : Terra Interface
  Centauri : Centauri Interface
  Rylos : Rylos Interface
  Sol : Sol Interface
  StarDock : StarDock Interface

>show records for game

  Game : Game Interface

>show records for stardock

  StarDock : StarDock Interface

>show records stardock

  Game : Game Interface
  Terra : Terra Interface
  Centauri : Centauri Interface
  Rylos : Rylos Interface
  Sol : Sol Interface
  StarDock : StarDock Interface

5) Add a idiot check, trust me I need one.
I.e. if i type "show record stardock" currently it returns nothing, for frustration purposes I would like to see a invalid syntax warning.

/Edit color added for readability

_________________
Dark Dominion TWGS
Telnet://twgs.darkworlds.org:23
ICQ#31380757, -=English 101 pwns me=-
"This one claims to have been playing since 1993 and didn't know upgrading a port would raise his alignment."


Sun Jan 15, 2012 10:02 am
Profile ICQ
Site Admin
User avatar

Joined: Sun Dec 24, 2000 3:00 am
Posts: 3150
Location: USA
Unread post Re: Botlink ready for testing
Lots of things to address here.

For the redundant "show records" listings, when you enter "show records game", it really should throw an error because it's missing the "for" token. When you include that, it only shows the records associated with the specified object. So if you have "Port1", "Port2" and "Port6" aliases open for object "Port", that's what would show up. But if you just say "show records", every records that's open would show up. The "for" token is not required, but it allows you to limit the list. I could drop "for" as you suggest, but I prefer having some kind of designation for what you're doing here. You're listing records open for a particular object. A record would be a particular user, for example, and an object would be the file of all users.

I wasn't sure what you meant by "container". I currently don't have any events implemented, but I intend to provide support for all existing game events. What I anticipate is a very distinct syntax for event output so you can trigger off of them. But I am also hoping to provide a way for you to provide blocks of script to assign to events so you don't need to trigger on them at all, you just need to provide the logic for how to respond to them, and Botlink will already have it locally available for immediate processing, like stored procedures in SQL.

I'll look at StarDock updating, but I'm curious if you landed on StarDock or ported at its port. If you just landed on StarDock, it won't set the LastPorted. The underlying code for keeping these records updated is the same for all records, so it would be odd if it's broken just for StarDock. But I will take a look.

You're right, I need to support Help and probably also ? as ways to get the list of supported commands.

As for providing useful error output, I've tried to do that for a lot of the commands, but it's a work in progress. Eventually I would want any invalid input to generate hopefully a descriptive error, but at least a generic syntax error.

_________________
John Pritchett
EIS
---
Help fund the TradeWars websites! If you open a hosting account with A2 Hosting, the service EIS uses for all of its sites, EIS will earn credits toward its hosting bill.


Mon Jan 16, 2012 2:35 am
Profile WWW
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1131
Location: Augusta, GA
Unread post Re: Botlink ready for testing
I'm just getting a chance to play with Botlink, but I've attached a simple TWX script that grabs the Objects list, then displays the fields, functions, and records for each. This may be useful as a starting point for others.

A couple things...
Definately add ? and HELP commands.
Add QUIT to the commands list.
Please implement up-arrow, down-arrow navigation through previous commands.
I find no way to view sector warps.
If the user sends ENTER, please redisplay ">"... to help scripts see the prompt.

Exciting stuff, thanks JP.


Attachments:
ShowOFFR.ts [1.32 KiB]
Downloaded 855 times

_________________
Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.
Thu Jan 19, 2012 11:38 pm
Profile WWW
Site Admin
User avatar

Joined: Sun Dec 24, 2000 3:00 am
Posts: 3150
Location: USA
Unread post Re: Botlink ready for testing
Yeah, I've been wanting the command cycling myself. But we're slumming it in terms of interface at this early stage. Polish will come.

I haven't uploaded the latest update that includes course plotting, warp reports, etc, as well as a major extension to the Boss object for manipulating and expanding Feds, adding Pirates, or any other custom "boss" (a boss is a group of entities that are invincible but can interact with players and games). Oh, and the word translation system, though that's going to have a more general interface than just Botlink. I'll probably support it in TEDIT as well.

Thanks for the feedback. I will act on most if not all of the suggestions that have been made in here. Gotta get the new update out first, then I can get back to playing around with Botlink again.

_________________
John Pritchett
EIS
---
Help fund the TradeWars websites! If you open a hosting account with A2 Hosting, the service EIS uses for all of its sites, EIS will earn credits toward its hosting bill.


Fri Jan 20, 2012 1:17 pm
Profile WWW
Commander
User avatar

Joined: Mon Oct 29, 2001 3:00 am
Posts: 1096
Location: Tucson, AZ
Unread post Re: Botlink ready for testing
I was just thinkin' about some of the cool stuff you could do with this. You could set up raids on alien bosses in powerful ships, and edit the players' ships so they'd have to cooperate to beat the boss. You could have "tank" ships with high defensive odds, "healer" ships with a lot of fighters to drop/take but easily damaged if they take aggro... just like WoW. :lol:

_________________
Suddenly you're Busted!


Mon Jan 23, 2012 11:00 pm
Profile WWW
Site Admin
User avatar

Joined: Sun Dec 24, 2000 3:00 am
Posts: 3150
Location: USA
Unread post Re: Botlink ready for testing
My goal for the bosses is for them to be pretty much like Feds, invincible, but able to interact with players. If you want to have an AI that the player can attack, it's better to use Gold aliens for that. You can set an override on any Gold alien so that you control its actions instead of the Gold alien server. Really, anything you could do with a Boss, you could do with a Gold alien, but Gold aliens do a lot more. Boss AIs are just very quick and easy to set up and use, but for the kind of depth of interaction you're after, a Gold alien would be better.

_________________
John Pritchett
EIS
---
Help fund the TradeWars websites! If you open a hosting account with A2 Hosting, the service EIS uses for all of its sites, EIS will earn credits toward its hosting bill.


Tue Jan 24, 2012 12:37 am
Profile WWW
Commander
User avatar

Joined: Mon Oct 29, 2001 3:00 am
Posts: 1096
Location: Tucson, AZ
Unread post Re: Botlink ready for testing
That's what I meant by "boss"... a gold alien in a powerful ship. Is there some other kind of simple boss AI built into Botlink?

_________________
Suddenly you're Busted!


Tue Jan 24, 2012 11:02 am
Profile WWW
Site Admin
User avatar

Joined: Sun Dec 24, 2000 3:00 am
Posts: 3150
Location: USA
Unread post Re: Botlink ready for testing
Yes. I've added the ability to customize and control Feds, and have included them in a class of AIs called "bosses" which also includes Pirates, and 500 empty slots for your own custom bosses. So I thought you were referring to them.

_________________
John Pritchett
EIS
---
Help fund the TradeWars websites! If you open a hosting account with A2 Hosting, the service EIS uses for all of its sites, EIS will earn credits toward its hosting bill.


Tue Jan 24, 2012 12:25 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 14 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware.