The Game

From Wiki for iCub and Friends
Jump to: navigation, search

This is a simple project to get started on the school network and software. We'll have a very simple multi-user game running, and you'll write a client to connect and visualize the virtual maze you find yourself in.

The game is running on a server at 10.0.0.11

To connect with the game, it is easiest to use the global yarp server. To connect to this yarp server, stop any yarp server running on your machine. Type:

 yarp conf

Edit the IP address in the file reported to be 10.0.0.11

Now if you do

 yarp where

It should report 10.0.0.11

Now try the "minimal_client" example in YARP/example/game/minimal_client

Notes on the game protocol are here: Game Protocol


Notes for compiling game_client and game_server on Windows and MS Visual C++ 6.0

The following changes were necessary to compile game_client

In main.cpp

  for (int i=1; i<players.size(); i++) {

changed to

  for (i=1; i<players.size(); i++) {


In CmakeList.txt

  INCLUDE_DIRECTORIES($(CMAKE_SOURCE_DIR))

changed to

  INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})

Added

  #DEFINE(WIN32)


The following changes were necessary to compile game_server


In CmakeList.txt

  INCLUDE_DIRECTORIES($(CMAKE_SOURCE_DIR))

changed to

  INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})

What to do if your ports won't open

If you see a line like this--

yarp: port /sender failed to open: cannot listen on specified tcp address (tcp://127.0.0.1:10002)

then you may have another yarp process running. For example, you might have a game client running. To solve the problem, terminate the other yarp process (e.g., the game client), and then restart the yarp process you are trying to run.