Tutorial body

Note: This tutorial can be applied to both PogamutUT2004 and PogamutUDK examples.

In this tutorial you will learn about Pogamut modules. The purpose of Pogamut modules is to provide some basic functionality that can be used by users programming their bots. What functionality are we talking about? Well, there are two types of Pogamut modules - sensor modules and command modules. Sensor modules are a wrappings of the bot WorldView. They have public methods defined on them that can respond questions such as "Do I see some player?", "What is my location?", "Was I hit recently", etc. Command modules wrap Pogamut commands - simply by calling preprepared methods, our bot will move, jump, shoot, etc. Now we will first present Pogamut sensor modules and then Pogamut command modules.

Pogamut sensor modules

Here we will describe pogamut sensor modules - what they provide and how we can initialize them.

  • Game - this module provides basic information about the game the bot is currently in. Information such as time limit, maximum number of health, goal frag score, etc. will be provided here. This module is needed for AgentInfo module below.

  • AgentInfo - very usefull module providing basic information about the bot itself. Here we can get how much health the bot has, what is his location, what is his team and more. This module is needed for Players and Senses modules.

  • Players - want to know more about the bot surroundings? This module has done all the dirty work for you! Provide methods that return all currently visible friends, enemies or all players.

  • Senses - this module register provides a wrapping for a lot of Pogamut 3 events. Want to know last time your bot was damaged? Want to know if you bot recently heared a sound? Ask this module and you have the answers - no need to write a ton of listeners yourself.

  • Items - a similar to players module, but now we are handling items. This module is also capable of optimistic guessing if some item is currently spawned in the environment.

  • AdvancedItems - extended items module.

Pogamut modules are automatically instanciated in UT2004BotModuleController. They can be used in any Pogamut example or in PogamutJavaBot project.

Here is an example of using modules in logic() method. Example below is a simple follow bot.


    @Override
    public void logic() throws PogamutException {
    
        // a simple follow bot logic

        if (players.canSeePlayers()) {
            Player followPlayer = players.getNearestVisiblePlayer();
            if (followPlayer != null)
                getAct().act(new Move().setFirstLocation(followPlayer.getLocation()));
        }
    }
        

Pogamut command modules

Command modules provides wrappings of Pogamut3 commands. All Pogamut3 command modules are wrapped by CompleteBotCommandsWrapper. Below we will provide you with a list of all Pogamut command modules with a brief description.

  • Locomotion - locomotion commands can be found here (moving, turning, jumping, strafing etc.).

  • SimpleShooting - simple shooting commands.

  • AdvancedShooting - advanced shooting commands such as alt firing or firing grenades.

  • Action - Provides commands for throwing weapon, issuing combos, item interactions and other commands that didn't fit in other categories.

  • Communication - allows bot to send text messages.

  • ConfigureCommands - commands for bot configuration.

  • SimpleRayCasting - commands for Pogamut ray tracing.

The command modules are automatically instanciated in UT2004BotModuleController class. You may access them in all examples or PogamutJavaBot projects by typing body.. Here is an example of jumping bot done through Pogamut modules:


    @Override
    public void logic() throws PogamutException {
        //we can simply use our command module to create a crazy jumping bot
        body.getLocomotion().jump();
    }