Skip to content
Florian Wesch edited this page Apr 5, 2012 · 1 revision

First steps tutorial

The first Join and Hello (World)

To play the game, you must first connect to a game server. We'll use the server running on infon.dividuum.de in this tutorial. To connect to a game server you can use any telnet client. We'll use putty here. Download putty, execute it and set the Host Name to infon.dividuum.de, Protocol to Telnet and Port to 1234. Then hit Open:

The game server will greet you. Press enter to get into the main screen:

Press <enter> 

              Hello ip4:xx.xx.xx.xx:60397!
              Welcome to Infon Battle Arena 217

                    .--..-.
                   /   / \ \'-.  _
                  /   /  _( o)_ ; \
                  O  O  /      ' -.\
                        \___;_/-__ ;)
                          __/   \ //-.
                         ; /     //   \
                         ' (INFON  )   )
                          \(       )   )
                           '      /   /
                            '.__.- -'
                          _ \\   // _
                         (_'_/   \_'_)

enter '?' for help
> _

The first thing to do is type ? to get help:

> ?
-------------------------------------------------
Infon Battle Arena 215
visit http://infon.dividuum.de/ for documentation
-------------------------------------------------
j - oin game
s - how scores
q - uit                    use '??' for more help
-------------------------------------------------
> _

We can then check, if there are other players on the server. Type s:

> s
Scores | Creatures | Time |     Mem | CPU | #Cl | No | Name
-------+-----------+------+---------+-----+-----+----+-------------
    90 |        11 |    7m|   95624 |   0%|   0 |  0 | test
-------+-----------+------+---------+-----+-----+----+-------------
> _

Hey. There is one player named test! Lets join the game by typing j. Since you want to create a new player, press at the first prompt. Enter some simple password. It will allow you to reconnect to your player later, if you reconnect to this server.

> j
------------------------------
  0 - test
------------------------------
enter <playernum> or press enter for new player: 
password for new player: secret
joined. player 1 has now 1 client(s)
> Creature 33 spawned
Creature 34 spawned

> _

We are in the game now. 2 creatures were created. They are idling at the moment. When you now disconnect from the server, you can rejoin your just created player within 2 minutes using your password.

Lets enter ? again to see the available commands again:

> ?
-------------------------------------------------
Infon Battle Arena 215
visit http://infon.dividuum.de/ for documentation
-------------------------------------------------
n - ame
c - olor
p - art game
l - ua shell
b - atch. enter bunch of lua code
r - estart all your creatures
i - nformation on your creatures
k - ill me
s - how scores
q - uit                    use '??' for more help
-------------------------------------------------
> _

Once in the game, we have some more commands. First you should set your player name by typing n:

> n
Player Name: beginner
> _

Type s to see your new player on the score table:

> s
Scores | Creatures | Time |     Mem | CPU | #Cl | No | Name
-------+-----------+------+---------+-----+-----+----+-------------
     0 |         2 |    1m|   71788 |   0%|   0 |  0 | example
*    0 |         2 |    1m|   60293 |   0%|   1 |  1 | beginner
-------+-----------+------+---------+-----+-----+----+-------------
> _

We will now use the graphical client to watch the game (and our 2 creatures!). So download the client now und unpack it. Next create a shortcut to infon.exe and open the shortcuts properties and append infon.dividuum.de to the commandline. This will tell the infon client which server it should connect to:

Finally doubleclick the shortcut. The graphical client will connect to the server and display the game:

We see the arena including ours and other creatures. At the bottom are two rows showing information on connected players (hey, there is our player beginner!) and a scrolling text displaying various messages.

Lets make our creatures display the text Hello. First have a look at oo-default.lua. This is the source code your own code should be based on. Therefore download the code now and open it in a text editor of your choice (Use one with syntax highlighting!). At the very bottom of the sourcecode there is a function called Creature:main. This is the functions that each of your creatures will execute. Lets add the Hello message:

function Creature:main()
    self:screen_message("Hello")
end

Next we need to activate this code for your player. Switch back to putty and execute:

> b
enter your lua code for paste 249. '.' ends input.
function Creature:main()
    self:screen_message("Hello")
end
.
> 

Note the single dot on the last row! This action will overwrite the previously defined function main with your new version. Switch back to the graphical client to see the result:

Both of our creatures display the message Hello.

This short tutorial explained how you:

  • join/rejoin a game
  • connect using the graphical client
  • upload your code

Now its time to code some more simple bots.