Ubiquitous Ambient Gaming - Sprint 2 : April 29 - May 17, 2010

From EQUIS Lab Wiki

Jump to: navigation, search
  • Extending the game
    • add the tigers
    • add the cages
  • Improving the user experience
    • find better sound samples (longer, less annoying)
    • add sound effects
  • Testing
    • new sound card (informal testing)
    • first mobile testing


Contents

The game

No modifications were done concerning the game.

There are currently 3 animals : cats, dogs and birds. The cats are worth 1, the dogs are worth 2 and the birds are worth 3. The user can catch the cats from the beginning, but he doesn’t have the tools to catch dogs or birds. A tool for dogs is worth 2, a tool for birds is worth 3.

When the user catches an animal, he has to bring it to a specified cage to get the money. If he wants to buy a tool he can only do so when he is at a cage.

Implementation

The game is implemented completely.

  • The ambient sound interface is working all the time.
  • There are 2 visual interfaces : the first one is the map, the second one gives information on the game’s state (how many animals are left, how much money the user has...) and is the interface used to buy tools.
  • A small speech interaction allows the user to know some figures without looking at the screen.

UML5global.png

Sound

Features
  • Animals (cats, dogs and birds) :
    • There are 3 or 4 different sounds for each type of animal so that they can be differentiated. The sounds are long enough and not repetitive so the user can hear them in a loop.
    • The animals emit a sound when they are caught by the user or eaten by a tiger.
    • When an animal is left at a cage, the user can hear coins falling.
  • Tigers:
    • The animal emits a different sound when he is walking, attacking or eating.
  • Cages:
    • The cages emit a knock sound continuously.
    • When the user presses the joystick button of the PC (or the ‘tab’ key of the keyboard), and if a cage is close enough, then the cage will emit a sound like a knock on metallic bars followed by the sound of the animals it can take.
  • Speech interface:
    • The user can know whenever he wants different numbers, by pressing the ‘C’ button of the ultra-PC.
    • The information given is : ‘You have X coins. You carry X animals: X cats, X dogs and X birds.’
Architecture

All the game entities that are related to sound inherit from a class called Entity. Then the entities are divided in 2 groups : emitters and listeners. UML5Entities.png

Entity

The entity class gives a location and a bearing, along with a form (user, animal, tiger or cage) and a texture. The entity also has a method allowing it to react to the different interactions with other entities. This method is virtual and does nothing, it has to be implemented for each entity regarding its behavior.

The class also possess its own Draw method to be called whenever needed.


Emitters

All the entities that produce a sound inherit form the EmitterEntity class.

This class (which inherits from Entity) provides everything needed to produce sound, but in a way that it is simpler to use (the interactions with the audio stuff of XNA are hidden). The class provides protected methods to create the emitter :

  • add/remove a sound to the list of sounds available for the emitter,
  • initialize the audio which takes care of all the initializations needed by XNA along with the retrieval of the sounds in the XACT library,
  • a method to apply whatever sound (that has already been added) to a listener,
  • a method to apply a bip sound to a listener (when the listener gets closer, the paste gets higher) not used in the game.


Listener

The only listener is the user. The UserEntity class possess the AudioListener used for the sound. As for the 3D sound, the listener is considered to be all the time at the position (0, 0, 0). The emitters are positioned according to their distance (in meters) to the listener for each axis.

Game behavior

Entities Behavior
  • User : before starting the game, one can choose the way to control the user : all GPS, all manual (with the arrows), or half manual (arrows to go forward or backward, but using the compass to precise the heading).
  • Animal : each animal has an AI that dictates its behavior. For the moment the AI is very simple : the animal looks if it can go straight for X more updates, if not it turns by 10 degrees and try again. If none way allows to go straight for X more updates, it takes the way that allows to go the furthest.
  • Tiger : each tiger has 2 AI. When it is walking, it has the same AI than the animals, but when it is hunting, it follows its prey.
  • Cage : each cage is fixed.
Communication between entities

All the interactions that can happen between entities are treated by the class EntitiesInteractionHandler. This class checks any possible interaction between the entities, and then sends a message to the entities concerned. To do so, it creates an EntityInteractionEvent that it sends to the entities thanks to the method InteractionEvent of each entity.

UML5Interactions.png

Visual interfaces

  • Map: the user is in the center, the animals that can be caught by the user are visible, the tigers and the cages are visible.
  • Switch button : a touch button is displayed at the bottom right corner of the screen to switch of interface.
  • Information interface: it is divided in 3 parts.
    • The global numbers concerning the game : how many entities of each kind are remaining in the game.
    • The numbers concerning the user : how much money does he have, what are the kind of animals he can catch, what animals is he carrying.
    • The tools he can buy, displayed as touch buttons that he can only interact with when it is allowed (ie he has enough money, he doesn’t already have the tool and he is at a cage).

UML5Buttons.png