Current edition:
Vol.3, No. 11, Nov. 2000
 

Active Worlds News


AW Product Updates
AWCOM's Family Tree
Bot-of-the-Month Club
Tech Support Tip Of the Month
Flagg's Worlds To Watch

Community News

Hot Spots to Visit!
 
Events:
AWEC Calendar
AWUniv Contest
Therapy World Opening
 
News:
AW Loses a Friend
AWCOMREG Community Articles
Tips & Tricks
Get To Know Your Neighbors

Resources

Building Links
Community Links
AWCOM Links

 

 

icon

 

icon

 

icon

 

 

Bot Of The Month Club

This month, citizen Who of ActiveWorlds takes us on an end-to-end ride of what it was like to script an RPG into bots. Who uses XelaGots for this, and has some incredibly complex scripts that allow the bots and players to interact. Here is Who's "Diary of a Bot Scripter":


Hamfon & The Hambots

Late 1999 after realising I was hopeless at 3D modelling I decided to try my hand at running bots within AW. I acquired the then versions of Preston and Xelagot and after a short test period settled with the Xelagot. The fun began...

Ok I perhaps was a little lucky in that I knew how scripting worked, but the myriad of options the Xelagot had soon saw me realising that this was going to be a long process.

Soon "Silver" was born, suitably placed in the world Ethereal sitting quietly up at the north end out of everybody's way I started working on scripting. It was fun, having a 24hr connection I left Silver running until one day when she wandered a bit close to gz. Ethereal is owned by Blythe Spirit - wow! did I get a hammering when Blythe arrived to be greeted by a bot! She hated them and I was chased across worlds by a crazy Scotish woman weilding a barrage of abuse! Ok, it wasn't that bad but the response I got was not very amiable :)

Blythe gave in eventually and let me keep the bot in Ethereal for me to work on "as long as it didn't get out of hand". Its funny when I look back, these days I get messages from Blythe and others when Silver is NOT in Ethereal!! "Where is Silver? What have you done with the bot? Bring her BACK!" Silver has grown in the last year albeit her development over the last 6 months is a little stagnant.

Anyway, after the obvious messing about with little scripts I eventually started on a project for Silver. Now DJ bots were all the rage, it seemed what everyone was using bots for, so that was the first big project. At that time, the DJ section of the Xelagot was not as comprehensive as it is now so my "DJ Silver" was based entirely on the use of external lists. I made lists of songs for adding to an object, a list of song name and artist and a list of the time length of the song plus of course a list to serve as a web page so people could see the list. This started as a small list but eventually became hundreds, I think now it is over 1200 songs.

Of course my DJ bot had to be different, and it was. I built a nightclub with animated walls, flashing lights etc. Now if you know Ethereal you will know thats not the world for a flashy nightclub. So I made the Nightclub a build project and had Silver build it on demand, then just to make it more interesting I used the Project move commands and some random generation to have her select a number of different locations to build the Nightclub and play the songs. It was quite humorous to see people voice activate the nightclub (yes the script allows anybody to start/end the nightclub and requests songs, drinks food etc) and proceed to where they saw it last, only to notice Silver wander off in the opposite direction to build the club elsewhere within Ethereal :)

Silver's Nightclub

Silver's Nightclub

Silver's Nightclub soon became very popular. Today it includes options to darken the world and start a couple of different light shows in the nightclub and of course it display a picture of the artist of each song requested - some are still missing, but then its not easy finding pics of artists that aren't copyrighted. I also had in place scripts for adjusting the world attributes plus performing a couple of little world "history" lessons and semi-humourous events. None of these were occurring as Silver was always running the nightclub. It was time for more bots!

Along came Dancer and Mira. Mira actually was basically just a bot that used XelaG's mirror script, Dancer was originally a dancer for the nightclub. She and Silver danced on the dancefloor as the music played. Anyway, Dancer took over the world attribute functions and a number of the underlying interbot processes, activating interaction between the bots and other small tasks. Silver was modified with a voice (although due to the size of wav's this didn't last long :) ) and had a few more simple script ideas added. She does things like give tours (a job split between her and Dancer), New Year's and birthday celebrations, information and coordination role for other projects.

Then I started on what I always wanted, some sort of rpg mechanism for worlds. An interactive environment so people could do other things rather than just look around the world. The tours, I guess, were the first step in this direction, it enabled visitors to get a idea of the story behind Ethereal and perhaps understand a little more. Now the first step in getting some sort of rpg enviroment is figuring out just how to script the bot. Locations, questions and answers, string lists and events. So I started small.

It was getting close to Xmas 1999, and with the help of Blythe Spirit and Ambient Spirit we decided to have a little competition. Very simple, a database of a dozen or so questions to which the contestants supplied the answers. This gave me an insight on how to construct a reasonable database using string lists. Hidden clues, questions, hints etc., most of which most people never found. Anyway, linked in with the tours etc the contest was of course won. I think we ended up giving away 5 cit's plus building rights and some other stuff just before xmas.

It was obvious to me that running 24hr bots you can do a lot of things so I started on my next venture - a game. This was also interactive with bots dictating the course of the competitors, the results and outcomes. I built an interface world area, rather large in size I submersed it at -250m alt so it wouldn't interfere with the main part of the world. Developing this game scenario really opened my eyes to the problems running bots.

The game encompassed 3 main bots that waited for people to enter various locations, there they would allow events or request quests depending on the current flags set in the character database. As each was completed another flag was marked. Then there were 3 more bots that played the part of random monsters called "Pet's", basically these were similar to a Paintball bot, if they touched you they "killed" (ejected you from the world) you. Overseeing all this and consolidating the databases for the players was again Silver. She was the central point that sent characters to their doom or success, updated the records and results. Dancer continued running the day to day functions of Ethereal.

This game lasted until about the end of February, for the first week I spent a lot of time fixing bugs in the scripts and also in the construction of the world. I found at this time that the single biggest issue concerning bots is network connection. Time delays, system processes etc take an enormous strain on a bot program that generally expects an answer to a query as soon as it places it. Every hiccup on the world servers, the AW server's etc (bots are continually checking players) and my own servers caused massive headaches in the entire game. Fortunately most of the time this was not noticable or apparent but when you see it from the bot's side of things - what a nightmare.

The game finished and we had a playoff for who "won". Considering everyone who had completed the quests had actually "won", the playoff was merely a humorous end tale to the whole game. Well, just think roman. We constructed a collesium and had a playoff time when we threw all the "winners" inside the circle, invited anyone who wanted to watch and threw 3 dragons in a cage (much like the christians vs the lions in roman days). AW granted an extension to the number of allowed people for the day and I scripted voice activated commands whereby both Silver and Dancer would activate opening and closing of cages and operation of the 3 dragon bots that acted again much like Paintball bots. Anyway it was hilarious with a dozen or so people running scared around the internal section while us spectators watched 3 dragons flying around them breathing flame "killing" the contestants.

Actually it was another mess from the bots point of view, so much information placed enormous strain on the servers, fortunately Dataman (Ethereal's world hoster) showed up on the day and did his best to give the world a priority connection. Still the amount of traffic generated by bots is awesome, maybe its just the Xelagots, but even in standby mode just sitting around doing nothing there is a lot of chatter on the links to the world server. Perhaps thats unavoidable, perhaps I should ask XelaG a little more about it :)

Anyway some changes were due if I were to continue on my idea to get the environment as an automated rpg style thing. The bots were given their own NT server (where they still reside today), they have a 512k link to the world servers, the world servers have a T1 link and a entire new world was purchased from AW. This world was called Eth2 (Ethereal2 is too many characters :( ) and it started late March early April 2000.

Eth2 was assumed as a second part of Ethereal, it was done as a separate world for specific reasons due to the nature of bots and AW.

  • The distance for "seeing", "speaking", "noticing" in the AW universe is 200m. To merely increase Ethereal's size would put people out of range of a lot of the action.
  • Having a large amount of bots in a specific area does cause massive lag and degradation of service to players. Ok, the world server and the bots may not care less about this or be too concerned, but anybody visiting on a modem link will soon tell you about the lag!
  • The use of the Xelagot inbuilt server/client features totally overcomes any world boundaries, for that fact even universe boundaries. Silver can speak/command anybody/anybot in Eth2 as easily as she can in Ethereal. The idea of a separate world is a good idea - one day I will actually make them more transparent with building interfaces, when I get time.
  • And of course, adding extra building sections is a lot easier when there's not most of world already built around you :)

April brought another very special thing to AW. AW V3! The ability to teleport people without the use of objects was a major advancement for my uses. Bot development slowed as Eth2 was built using V3 techniques, the entire Eth/Eth2 object database was completely overhauled to include V3 options like prelighting, collision and other things. But eventually, the scripting started with a flurry again.

I created a dungeon, a maze and a town. The maze is actually just to slow people down, no bot is used in the maze so it makes bots available to others playing the adventure. The first big thing you notice when writing adventure scripts for bots is the single player <-> multiplayer idea. It is very easy to write stringlists with quests and riddles, bring in a bot or 2 to act as a monster for the player to fight, keep a record of players and what they carry, etc. All this is relatively easy until something special happens - a 2nd person wants to play!! I learnt this from the previous game in Ethereal, everything worked fine when one person was playing, and I got it ok with 2 maybe 3 people playing. Suddenly 5 or 6 people are in there all trying to play and the place goes haywire. Bots are recalculating players more than they are interacting with them. Remember that the bots take note of every single action of every single person and every other bot in a world. Move one step and every bot instantly updates their known variables for your location, say one word and every single bot takes note of that chatline. If one bot answers not only does everyone in the world get notification of that but every bot takes a note of the chatline response. So, if you take a step and say a word, hundreds of lines of world server communication will occur with the bots. You can imagine what it gets like with a handful of players and 15 bots hanging around.....

Well this is what my first stage of my adventure became. I have a central bot called Traise who basically instigated things and intercommunicated with other bots, similar to what Silver and Dancer do in Ethereal. I had built a town so I populated the Tavern as the start point. Here a InnKeeper resided and he called (via Traise) other bots if they were needed and not around. Also in the tavern was a bot who was basically a thief trying to lure players into taking the wrong options (which they seemed to do a lot!) and also a Waitress who liked to give a little bit of lap dancing and table dancing for "a few coins" as well as serve drinks.

The tavern bots had answers to a lot of questions, most players never asked the questions. I soon realised that people in general expect to sit back and let the bot do everything while they watch. This idea is totally alien to me, perhaps I have played to many AD&D computer games in my life or something :) Anyway this stage 1, as I call it, eventually became a simpler and simpler game. The tavern bots called a fighter bot when requested with the right phrase. This fighter bot is the heart of my adventure scripting, from this script all others were to follow.

Basically the fighter bot script (I prefer to call it the fighter engine) tracks the player and locations. As the player commanded the bot around the dungeon it would activate events dependent on location and also random events. Btw, I am a big exponent of using random things in these adventures. At specific locations the fighter bot would call in other bots to act as monster - and then proceed to fight them - or it would initiate a search to locate treasure, or initiate a call to another bot handled event. Of course it would always update the players stats after every event, stats are an ongoing database of change, all bots actually access stats continually, modifying where necessary.

Through the dungeon the fighter bot eventually calls the Ghost bot that initiates another quest which initiates another quest and so on :) Stage 1 had a few bots, Silver started it in Ethereal, then Traise to drag them around worlds, a Commander, 3 in the tavern, a fighter, a ghost, 2 bots as monsters, 4 Gods.... Hmm wait a second, there's a second person who wants to play, but player 1 already has control of the fighter bot.....

Suddenly there's 2 fighter bots, hmm I need more monster bots.. Argh! 2 people are trying to access the Ghost bot at once! Uh oh, someone's trying to start the game in Ethereal yet the Commander is unavailble cause he's fleecing taxes off Player 1 .....

Ok, so there's an awful lot of scripting code to tell bots (and players) when things are just not available. In Eth2 this is Traise's job. If a player called the fighter the Innkeeper would request from Traise if the fighter was already in the world (it was possible the fighter could be out of the Innkeeper's range). Traise would search and if no fighter was found would call him, or else inform the Innkeep and thus the player that the fighter just wasn't available at that time. Of course this idea is expounded for all bots, not just the fighter, it could be the waitress or the thief, the ghost perhaps.

Stage 1 was fun, it encompassed around 10,000 lines of scripted material to control all those bots for the adventure, but it was still way to complex and resource intensive - I needed a better way.

Stage 2, where we are today. I had to make people pretend, it was my only way out. There is no way you can really have a good rpg/adventure style thing in AW if people don't get into actually playing it. So along came stage 2 with a simpler, different feel. By this time I was empowered with the use of 23 bots, and seeing nearly all of them running at any one time just to support one or 2 people in the world was a complete waste. Stage 2 would be simpler, more effective and yet only require a bit of imagination.

The first step was to reduce the number of bots. To do this I had to reduce the number of NPC's - the number of bots whose sole purpose was to add a little information to the players. Secondly, I had to reduce the script and bot calls. I had a myriad of scripts and calls and cross checking in stage 1. So much checking that is was causing errors. My answer? Make a better fighter engine!

Currently for stage 2 the script for the fighter engine is a little under 2300 lines. Thats nearly half the original stage 1 engine, but the most important thing is the way it is done. The fighter engine is actually a "shadow" engine :) What the bot is now is a shadow of the player playing the game. It is initiated by Traise when requested within the world by the player, it arrives and becomes attached to the player. The "shadow" mirrors everything the player does similar to using a join command with a bot. Also it randomly decides a series of locations from a database for random monster encounters. There are over 200 of these locations in Eth2 and the bot picks a random set of about 30 that it decides on using. When one of these locations is reached by the player up to 4 bots will appear acting as various monsters (also randomly determined by the shadow engine) and a battle will result. At the end of that battle the shadow engine will re-initialise its random database and reselect the locations where events will occur. Thus a player has a near impossible time of trying to figure out where to walk to to get a certain battle to fight.

The Shadow bot/engine also acts as a menu interface. Other than giving a list of possible commands and acting on those it is also the sole responsibility to talking with NPC's. In stage 2, NPC's are not bots, just objects. On approaching an "NPC" object the shadow will inform the player they can converse (or whatever) at this stage. The shadow acts as the interpreter, taking the queries of the player and giving the responses. Again, the responses are randomly organised from a database of possibilities. That means a player could walk up to the same "NPC" sitting at a table and ask the same question twice and get a different answer each time.

The Shadow interacts with all shopping (weapons, potions, etc) and also player training to advance levels. Again these conditions are based on locations player's visit. Fortunately most of the shops etc are not a random generation :) The quests within the adventure are initiated again by the Shadow. Again, it is randomly generated in some cases as to which NPC will give a player a quest and also the quest itself is randomly generated. So in order for a player to find a specific item - say a special sword, they must complete some tasks requested by NPC's. However a second player looking for the same special sword may have to visit a different set of NPC's and solve different tasks.

Shadow fighting monsters

Using the Shadow bot to fight monsters

What does this all mean? It means that with 5 bots plus 2 special bots (Traise and Ghost) one person can play the game without any interference. it also means that if a second player wants to play a second shadow and its 4 monster bots will appear (making the total in the world of 10 bots) and their game will not be affected at all by the first players game - or vice versa. Also the actual game both are playing will have different event locations, NPC's and tasks/quests. And still, a third person can come into the world and play and have their own Shadow as well! Currently I have it setup to support only 3 Shadow bots. I actually use only 8 bots for the monsters for the 3 Shadows as its a very rare situation that all 3 will hit a random encounter at the same time and that the random encounter will dictate (randomly) that there are 4 monsters as opposition in that battle.

The other good thing about my current development with this adventure script is the fact that it is totally portable. The entire event/quest/npc structure is based on locations, these locations are read from a data file. Simply move the bot to another world, make up a set of locations stored as a data file and the script will work. Obviously there's a bit more to it than this to make the game more enjoyable to play - like it is nice to actually have an avatar object standing where an NPC is supposed to be - but in regards to the script, well it will work.

Soon, I will start on Stage 3. Stage 1 has been converted to a stage 2 format - which has made it a little more boring to play, but my goal is getting closer. Stage 3 I hope will include a full adventure, one that will include all I have written so far plus what is to come.

The current bots in Ethereal and Eth2:

  • Silver - Gives tours, runs nightclub, interacts history and humour, gives information and help. Basic command: "Silver help"
  • Dancer - acts as a mirror, changes world attributes in Ethereal, interacts with Silver in a couple of diversions.
  • Traise - world attributes Eth2, initiates all calls to the games
  • Shadow(1,2&3) - Shadow engine bots in Eth2 for the game
  • M1 to M8 - Monster bots in Eth2 for the game
  • Ghost - NPC in Eth2 for the game, also acts as minstrel in tavern

Note: All bots intercommunicate via the Xelagot server/client, calls initiated to a bot in one world may bring a response from a different bot in another world.

Btw, you can get a few example scripts of mine from: here or from here.

 

 
 

Active Worlds   |   Newsletter Home   |   Newsletter Archive   |   Contact Us