DroneSec/Getting Started

From Thousand Parsec Wiki

Jump to: navigation, search

Contents

Installing tpserver-py

These instructions were made using Ubuntu. For Windows try DroneSec/Getting_Started/Windows_Install

Using git to get the pull the latest repositories

Bring up the terminal on the directory you want to install tpserver-py. Use git to get the latest repositories.

git clone git://git.thousandparsec.net/git/tpserver-py.git

The output should look like the following,

tansell@tansell-mobile:~/FOSS/tp/server$ git clone git://git.thousandparsec.net/git/tpserver-py.git
Initialized empty Git repository in /home/tansell/FOSS/tp/server/tpserver-py/.git/
remote: Counting objects: 4630, done.
remote: Compressing objects: 100% (1756/1756), done.
remote: Total 4630 (delta 2743), reused 4630 (delta 2743)
Receiving objects: 100% (4630/4630), 963.11 KiB | 303 KiB/s, done.
Resolving deltas: 100% (2743/2743), done.
tansell@tansell-mobile:~/FOSS/tp/server$ 

Switching to the dronesec branch

cd tpserver-py
git branch dronesec origin/dronesec
git checkout dronesec

Check you have all the requirements

python requirements.py

The output should look something like,

tansell@tansell-mobile:~/FOSS/tp/server/tpserver-py$ python requirements.py 
It appears this is a fresh git checkout, trying to get dependencies
Submodule 'libtpproto-py' (git://git.thousandparsec.net/git/libtpproto-py) registered for path 'libtpproto-py'
Submodule 'schemepy' (git://git.thousandparsec.net/git/schemepy.git) registered for path 'schemepy'
Initialized empty Git repository in /home/tansell/FOSS/tp/server/tpserver-py-2/libtpproto-py/.git/
remote: Counting objects: 2137, done.
remote: Compressing objects: 100% (775/775), done.
remote: Total 2137 (delta 1346), reused 2131 (delta 1344)
Receiving objects: 100% (2137/2137), 344.26 KiB | 114 KiB/s, done.
Resolving deltas: 100% (1346/1346), done.
Submodule path 'libtpproto-py': checked out '4b05b93fdeea88d4b37a537a75c90b01c44430a5'
Initialized empty Git repository in /home/tansell/FOSS/tp/server/tpserver-py-2/schemepy/.git/
remote: Counting objects: 1898, done.
remote: Compressing objects: 100% (676/676), done.
remote: Total 1898 (delta 1193), reused 1898 (delta 1193)
Receiving objects: 100% (1898/1898), 509.23 KiB | 157 KiB/s, done.
Resolving deltas: 100% (1193/1193), done.
Submodule path 'schemepy': checked out 'f66a4b8f9ce459fbb7c89aa627f0dca931bcaa2c'
My information:
---------------------------------------------------------------
My version 0.2.0+0.2.1 (git 38493b680488483179a500009cb9b356c86211c3)
Running from  /home/tansell/FOSS/tp/server/tpserver-py

Checking requirements:
---------------------------------------------------------------

 * Looking for Thousand Parsec Protocol Library,
    Thousand Parsec Protocol Library Version (0, 2, 4)
       (installed at /home/tansell/FOSS/tp/server/tpserver-py-2/libtpproto-py)
       (git 4b05b93fdeea88d4b37a537a75c90b01c44430a5)

 * Looking for SQLAlchemy,
    SQLAlchemy installed version 0.3.10
SQLAlchemy version is too old

 * Looking for ElementTree implimentation,
    An Element Tree version is installed (xml.etree.ElementTree).

 * Looking for gettext,
    Found gettext.

 * Looking for SQLite,
      SQLite support installed, version 3.4.2 (DPI version 2.3.4)

 * Looking for MySQL support,
      MySQL support installed, version 1.2.2

 * Looking for SSL support,
No module named pyOpenSSL
      SSL support found, provided by <module 'OpenSSL' from '/var/lib/python-support/python2.5/OpenSSL/__init__.pyc'>

Configuring Schemepy:
---------------------------------------------------------------
 * Checking mzscheme
    recommended package mzscheme not installed
    installing mzscheme can make the scheme part runs faster
    use "apt-get install plt-scheme" to install
 * Checking guile
    recommended package guile not installed
    installing guile can make the scheme part runs faster
    use "apt-get install guile-1.8 guile-1.8-dev" to install
 * Configuring load path for schemepy
 Done.

Checking config file:
---------------------------------------------------------------
WARNING: No config.py found, setting one up for you.
 * Configuration seems okay

Possible problems found:
---------------------------------------------------------------

Starting tpserver-py

./tpserver-py

If tpserver-py does not work without sudo then do:

chown <username> tp.db

where <username> is your own Unix username.

Trying to join a game before running ./tpserver-py will fail.

Starting a Dronesec game

./tpserver-py-tool --addgame <name> dronesec <admin e-mail> <comment>

This will start a game on the server. <name> corresponds to the name given to the game. It must be used everytime a command is being sent through tpserver-py-tool

Example:

./tpserver-py-tool --addgame tp dronesec myemail@email.com "Dronesec Server"

Populating Dronesec

./tpserver-py-tool --populate <game> <number of Planets> <map type> <number of Players> <seed> <load file>

<game> is the game name. In this case we are using tp.

There are currently 2 map types: Random: All planets are arranged randomly and players will be spawned in any of these. This is set by default.All planets are designated home planets and players can join as long as there are unowned planets. Standard: The Map is randomly generated but allows for a more balanced map or attempts to at least. The number of players is set so that the map can remain balanced. Load: A Maptype is being planned which would allow for a pre-made map to be loaded. Each map xml file specifies which planets are home planets and as such the maximum number of players.

The seed can be left blank or written as None for a random seed.


Example Table

Number of Planets Number of Players Map Type Seed Load File
Default No Default Random 2 None (Random) None
Minimal Random 15
Minimal Standard 10 standard
Standard with Players 12 standard 5
Requirements for a Load Map load A seed aMap.xml
Load Example 2 load 20 None test.xml

Some examples:

./tpserver-py-tool --populate tp 15
./tpserver-py-tool --populate tp 10 standard 3
./tpserver-py-tool --populate tp 5 load 5 None test.xml

The first example would create a random game with 15 planets The second example would create a standard game with 10 planets and 3 players. The third example would load up the map called test.xml in the maps folder using a random seed. The two instances that '5' are used are irrelevant since the xml file should specify the number of planet and players

You should not be able to populate more than once.

Adding Players

./tpserver-py-tool --player tp <name> <password>

A standard or loaded game will only allow the specified maximum number of players. On random games there can be as many players as there are planets.

Ending a Turn

As of right now dronesec does not end a turn based on a timer or through tpclient-pywx's Request End of Turn feature. Instead the server must has a turn pass manually by typing this into the terminal.

./tpserver-py-tool --turn tp

Playing Dronesec

tpclient-pywx

The latest tpclient-pywx release can be found here.

start tpclient-pywx

tpclient-pywx

In this case. The server address is ourselves so we use localhost.

Image:Dronesec-ConnectingToServer.png

After typing in the username @ <gamename> and the password we click ok to connect.

Play

In this game its blah vs blag.

Image:Dronesec Start.png

Open the system tree and find your planet. We will now order it produce some drones. On the left there is an orders window. Click on the pull down menu at the bottom of it and choose ProduceDrones and click the New Button.

Image:Dronesec choosing order.png

Drone Production

Lets make some fighters. Production is handled automatically. We only have to pick what type of unit we wish to create and the planet will continue producing that unit using as many resources as it can until the order is changed. Our planet has 100 resources right now. This is enough to make 4 Fighters. Lets go ahead and name the fleet 'Blah Planet' and click save. Dronesec automatically appends the unit type and "Fleet" after a name to make it easier to tell which fleets contain what.

Note: Planets produce 100 Credit resources every turn which can be used for Drone Production.

Image:Dronesec ProduceDrones.png

Overlords

Now lets give our overlord some orders. By default they do not give out any commands. We can make the overlord place "magnets" of sorts which will attract or repel units to or from a location. There are two ways to do this. The default way of doing this is to choose the overlord and assign the order normally. This would involve writing the position of movement or clicking the P button and then the location.An easier and faster way of doing this when sending units towards an object(such as a planet) Is to click the overlord and then right click on the object you wish to "place the magnet" and select to "Attract" or "Repel" to the object. Stop is a command that will force all drones to remain stationary. The Overlord can also Move but this does not generally serve any purpose.

Image:Dronesec Overlord order.png

Overlord commands are:

  • Attract: This commands all drones to move towards this location.
  • Repel: This commands all drones to move away from this location.
  • Stop: This commands all units to come to a complete stop
  • Move: Moves the overlord.

Capturing a Planet

A planet is captured when enough units are present at that location. Once a certain "power" is present, the units will be removed and that planet will be captured and ready to be used for production.


Combat:

Combat occurs when at least two fleets of opposing sides enter the same position.


Known Bugs:

  • Repel will not repel drones away from a location if they are already at that location.
  • Production orders allow for multiple drones to be added to the list but only one of them will be allowed.
  • Research orders allow multiple researches to be done although they are not researched in the order place on the order list.
Personal tools