Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revisionBoth sides next revision
slubworld_notes [2013-06-03 14:39] davegriffithsslubworld_notes [2013-06-12 13:52] davegriffiths
Line 31: Line 31:
  
  
 +This is a scripting language for the bots in Naked on Pluto designed to be written from the text game interface, and for programming large numbers of independant, cooperating bots. Allows access to all game data (although a lot of it is unimportant for this project) and some controlled modifications to the game environment to allow you to speak, create objects, pickup or drop items etc.
 +
 +http://slubworld.lurk.org/
 +
 +==Data structures==
 +
 +===pluto-node = room===
 +
 +  * name (string)
 +  * info (string)
 +  * entities (list of entities)
 +  * messages (list of messages) 
 +  * old-messages (list of messages)
 +  * vocab (list)
 +  * edges (list of connections to other rooms)
 +  
 +===message===
 +
 +  * meaning (string, "spam" "important" ...)
 +  * from (string)
 +  * to (string)
 +  * txt (string)
 +  
 +===entity = players and bots===
 +
 +  * id (number) 
 +  * name (string)
 +  * desc (string)
 +  * owner (number)
 +  * instructions (list)
 +  * contents (list)
 +  * face-furniture (entity)
 +  * hat (entity)
 +  * vocab (list)
 +  * money (number)
 +  * criminal-rating (number)
 +  * likes (list)
 +  * liked-by (list)
 +
 +==Some experiments to try==
 +
 +  * Interpretation of player messages in behaviour
 +  * Interactions between bots via messages (some kind of distributed state machine)
 +  * Bots programming/rewriting each other's code via messages
 +  
 +==How to use==
 +
 +Command line in naked on pluto game interface:
 +
 +Make a new bot: 
 +  make SlubBot
 +
 +Ping the new bot: 
 +  @SlubBot ping
 +  => SlubBot @BobBloggs I am stopped
 +
 +Program the bot:
 +  @SlubBot 10 say hello
 +  @SlubBot 20 goto 10
 +  @SlubBot run
 +  => SlubBot @BobBloggs hello 
 +  ...
 +  @SlubBot ping
 +  => SlubBot @BobBloggs I am running
 +
 +Look at the code:
 +  @Slubbot list
 +
 +Rewrite code:
 +  @SlubBot 20 goto 50
 +
 +  @SlubBot ping
 +  SlubBot @BobBloggs I have crashed with SYNTAX ERROR ON LINE 20: OUT OF RANGE
 +
 +Otherwise, to stop the bot:
 +  @SlubBot stop
 +
 +Doing something more useful, look at the world - speak the names of the entities (players or bots) in the current room (or node):
 +
 +  @SlubBot 10 for node.entities
 +  @SlubBot 20 say top.name
 +  @SlubBot 30 end
 +
 +top = top of the stack, I will change this for a form such as "for i in node.entities" and "i.name".
 +
 +Read what entities are carrying:
 +
 +  @SlubBot 10 for node.entities
 +  @SlubBot 20   say top.name is carrying:
 +  @SlubBot 30   for top.contents
 +  @SlubBot 40     say A top.name
 +  @SlubBot 50   end
 +  @SlubBot 60 end
 +
 +Conditionals (will say "BONG" if someone has picked up the TinyBell):
 +
 +  @SlubBot 10 for node.entities
 +  @SlubBot 20   for top.contents
 +  @SlubBot 30     if top.name == "TinyBell"
 +  @SlubBot 40       say BONG
 +  @SlubBot 45     end
 +  @SlubBot 50   end
 +  @SlubBot 60 end
 +  @SlubBot 70 goto 10
  
  • slubworld_notes.txt
  • Last modified: 2013-06-12 13:56
  • by davegriffiths