File: README

package info (click to toggle)
netpanzer 0.8.7+ds-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid, stretch
  • size: 34,336 kB
  • ctags: 6,849
  • sloc: cpp: 45,217; sh: 278; objc: 259; python: 102; perl: 30; xml: 30; makefile: 15
file content (504 lines) | stat: -rw-r--r-- 14,566 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
                                NetPanzer
                            an open source RTS

Contents:
1. Introduction
2. Building and Installation
3. Gameplay
4. Dedicated Server and Game Configuration
5. Bot Player
6. Contact

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1. Introduction
NetPanzer is an online multiplayer tactical warfare game designed for FAST
ACTION combat. Gameplay concentrates on the core - no resource management is
needed. The game is based on quick tactical action and unit management in
real-time. Battles progress quickly and constantly as destroyed players respawn
with a set of new units. Players can join or leave multiplayer games at any
time.

1.1 A bit of history
The original development of netpanzer was done from PyroSoft inc. In
1999 they stopped development and released the game 2002 in GPL and it was nearly
forgotten, until Ingo announced it at happypenguin.org. Soon after this
announcement a group of coders did the linux port in roughly 2 weeks, with
another 2 weeks polishing for the first release.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

2. Building and Installation



2.1 Prerequesites
The game depends on some tools and libraries to be present, before you can start
building it. Here's a list of them:

* normal gnu compiler and additional tools (g++ version 3.2 or later is
  required at the moment)

* SCons build tool
  http://www.scons.org/

* SDL 1.2.5 or later
  http://www.libsdl.org

* SDL_mixer 1.2.4 or later
  http://www.libsdl.org/projects/SDL_mixer/

* Git (to fetch the source from repository)
  https://git-scm.com/

Thanks to all the authors of these helpful libraries that made our development
easy and straightforward.

To fetch the code source: git clone git://git.code.sf.net/p/netpanzer/git netpanzer-git



2.2 Building without installing on non Windows

To build the game and run as normal user do the following:

# scons

When scons finish without errors the game is ready to play, type this:

# ./netpanzer

Remember that next time you want to play you have to go to the same folder where
you compiled and type './netpanzer'



2.3 Building on Windows

Building on Windows is a little bit more complicated, developers shouldn't have
any big problem.

MinGW should be installed in C:\mingw

Get the development libraries of SDL for mingw32, copy the include directory to
C:\mingw\include\SDL so you have the file "C:\mingw\include\SDL\SDL.h", and the
lib folder to C:\mingw\lib

Get SDL_mixer development libraries for VC8, copy the header file to
C:\mingw\include\SDL and the .lib file to c:\mingw\lib

Python and scons should be installed and working.

To compile netpanzer run scons on the folder where you have the netpanzer source
code:

C:\Some\Folder\With\Netpanzer> scons

After scons finish without errors you have to copy all the .DLL files from SDL
and from SDL_mixer to the netpanzer folder.

To run you can type 'netpanzer' or click on the netpanzer.exe file in explorer.



2.4 Building for distribution on non Windows operating systems

If you plan to distribute NetPanzer for installation (on Linux systems, for example)
there are some extra steps to be taken care.

NetPanzer needs to know where the data files will be stored when the game runs. To
set this data you have to add the parameter "datadir=/some/dir/" at compile time
and NetPanzer will look there for its data files. Example:

# scons datadir=/usr/local/games/netpanzer

Using the sample line, after NetPanzer is built, it will look in /usr/local/games/netpanzer
for it's data files.

For versioning, there is a file called "RELEASE_VERSION", the first line on that file will
be the version that NetPanzer will show. You can use that file to change the version of
the game shown. You should modify the file before compilation.

Actually there is no install script, you will have to prepare the script by yourself.
The installation is actually easy, and you only have to copy several files. The following
directories should be copied on the "datadir" destination:
- cache/
- fonts/
- maps/
- pics/
- powerups/
- scripts/
- sound/
- units/
- wads/

If you want to copy some documentation, the "docs" folder has it. There is also the COPYING
 and the README (this file).

Inside "support" folder there are many useful scripts and resources. 

"netpanzer.png" and "netpanzer.xpm" are some sample icons to be use with the game.

And of course, the file "netpanzer" is the main binary that should be on the PATH.



2.5 Music

Netpanzer doesn't come with own musicfiles yet. However you can place your
favourite .mp3, .ogg or .mod files into the sound/music directory and netpanzer
will play these in random order while you play.



2.6 Starting the game

You can start the game in several ways:

If you compiled yourself NetPanzer (and didn't install), first "cd" to the folder where
you compiled it and type:
# ./netpanzer

If NetPanzer was installed and is in the PATH, type
# netpanzer

It is possible that in your distribution NetPanzer was installed and has a menu item,
if that is the case, just click on the item.

On Windows, you can click on the "netpanzer.exe" file.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



3. Gameplay

An extensive list of commands is available in the Help section of NetPanzer binary,
together with some useful tips and guides.

The same list is available while in game too - just press F1 key.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



4. Dedicated Server and Configuration Files



Checking (setting) up your Network


To run a netpanzer gameserver visible to everybody on the internet you must be able to forward port 3030 to your local PC address.

Generally this can be done in your modem/router control panel (look for the 'NAT' or 'Port Forwarding' section etc). You can google for your router brand manual and follow one of the many tutorials about port forwarding (http://en.wikipedia.org/wiki/Port_forwarding - You might already have done such a thing when configuring Emule or other file sharing tools!). You can obtain more information about your network using command 'ipconfig' in cmd. (start -> run -> type 'cmd' -> type 'ipconfig' ) 'IPv4 address' is your network device address (your machine local address) - 'Default gateway' is likely to be your modem/router address and typing that address in a browser might send you to its control panel.

Also check that Windows Firewall - and/or other antivirus software which may act as firewall - are not interfering.

TIP:  Howto check if your network is ready: start your netpanzer client normally, then choose 'Host' from the top menu (be sure that 'public' checkbox is checked), then 'play'. This is a 'non-dedicated' netpanzer server - e.g. with you inside :). Then open your browser and go to http://www.netpanzer.info/Server-Browser/, wait 30-40 seconds and see if your gameserver appear in the list. If so, your network is ready and you can immediately run a 'dedicated server' without further changes. Otherwise you might need to make some more operations...



Running a dedicated Gameserver


First of all, I strongly suggest you to download the latest Windows snapshot available (run the .exe and install):

The reason I suggest u to use this version is the new menu in Start -> Programs -> Netpanzer which allows you to choose easily among many options - notably u can 'start a dedicated server'.

A new 'terminal' or 'dos' window will appear. That is your netpanzer dedicated server running!
You can type several commands inside this window, like 'status' etc.

After succesfully creating your dedicated server, if you want to connect to it (play) with a separate client, remember to use the LOCAL server IP address (or 'localhost:3030' if it's the same PC).


Restart on crash

Here is a script that restarts the server automatically in case of a crash. This can be achieved with the following script (called start-netpanzer-dedicated.sh).

#!/bin/bash

# insert the directory of the server binary here
DIR=.

cd $DIR
running=yes
while [ $running = "yes" ]; do
    ./netpanzer -d $@
    if [ $? -ge 128 ]; then
        echo "`date`: Restarting server after crash"
        # wait a bit to not blow cpu and logfiles on constant crashs
        sleep 30
    else
        #normal exit
        running=no
    fi
done
        

Screen

Typically you don't always want to monitor your server in a terminal window. Also in case your monitoring terminal terminates the server is normally stopped too. To solve these problems there's a handy little tool called Screen that allows you to run your applications in a virtual terminal to which you can attach/detach at any time.

So typically you write another script with your startup parameters like this (also take a look at the Security Warning at the end of this document for the commented variants).

#!/bin/bash

# insert the directory of the start-netpanzer-dedicated.sh here 
DIR=.

cd $DIR

# starts the server in a screen. Please consider using 1 of the 2 variants below
# for increased security
screen -A -m -d -S netpanzer ./start-netpanzer-dedicated.sh $@

# This version switches to a more secure user account
# screen -A -m -d -S netpanzer su - netpserver -c "./start-netpanzer-dedicated.sh $@"

# This version starts the server in a chroot environment and with a different
# user for even more security
# screen -A -m -d -S netpanzer chroot /home/netpserver su - netpserver -c "./start-netpanzer-dedicated.sh $@"
        


You can attach to this virtual netpanzer terminal by typing screen -r netpanzer. You can detach again by pressing CTRL+A and then CTRL+D. See the Screen documentation for details. 

The code of the server hasn't undergone an in-depth review for security holes yet, so you should expect the possibility that attackers can find buffer overflows to obtain control over the netpanzer executable and the user account the server is running. (Experience shows that this also happens with other servers that claim to be secure...)

Therefore it is recommended to run the server in a special user account with limited rights. On linux/bsd you should also consider using a chroot environment for increased security. Consult external documentation about details. The screen startup script shown above also demonstrates in a comment how to do this with the su and chroot commands. 



Configuring the Gameserver


Let's talk now about the configuration.

In your home directory you will find a folder named .netpanzer .
Inside it, another folder named 'config', and inside that a file named server.cfg .
You might need to run once the dedicated server to generate this file.

This file (you might open it with wordpad) will contain all the entries to configure your dedicated server.

Note: not ALL the entries in server.cfg are related to the server, only those tagged as 'server.' and 'game.' - so let's see in detail the ones which are really important.



        server.port = 3030

	you can select an alternative port number - remember then to make the correct port forward - no reason to change it if u run a single server

	

	server.bindaddress = ""

	leave it blank

	

	server.motd = "Welcome to NetPanzer Server"

	This is the message that appears to players when they connect to gameserver

	

	server.logging = false

	you can save more detailed logs by setting 'true'

	

	server.public = true

	leave it 'true' if u want players to connect from the internet

	

	server.masterservers = "masterserver.netpanzer.org, masterserver2.netpanzer.org, masterserver.netpanzer.info"

	don't change these addresses unless you've been told to do so in our forum

	

	server.name = "NetPanzer Server"

	your gameserver name which will be displayed in server browser etc

	

	game.enable_bases = true

	by setting this to 'false' you disable all bases in the map

	

	game.base_capture_mode = 1

	the kind of base capture, no capture, helipad capture, full base capture

	

	game.base_limit = 0

	max bases per player

	

	game.autokicktime = 20

	kicks inactive player after given minutes

	

	game.allowmultiip = true

	by setting this to 'false' you prevent people with same IP address to connect

	

	game.unit_profiles = "Manta, Panther1, Titan, Stinger, Bobcat, Bear, Archer, Wolf, Drake, Spanzer"

	In this string separated by commas you can decide the available units in a game (the ones u see when u click on top of an outpost u own)

	

	game.unit_spawnlist = "1, 1, 1, 1, 1, 1, 1, 1, 1, 1"

	another comma separated string which must reflect the previous. Here you decide the starting number of units (on respawn)

	

	game.adminpass = ""

	you can set a password to allow admin commands via chat in a game (see the help section in your netpanzer client for a full list of commands)

	

	game.gamepass = ""

	you can set a password players must know to connect to your gameserver.

	

	game.changeflagtime = 15

	timeout for flag change in minutes

	

	game.gametype = 0

	0=objective, 1=frag limit, 2=timelimit

	

	game.maxplayers = 8

	max number of players

	

	game.maxunits = 320

	max number of units (tanks) in the game - which also determines the max number of units per player: maxunits/maxplayers

	

	game.timelimit = 30

	time limit in minutes

	

	game.fraglimit = 300

	frag limit (kills)

	

	game.powerups = true

	enables (or disable) powerups

	

	game.occupationpercentage = 75

	decides outposts percentage to end an objective game

	

	game.allowallies = true

	enables (or disable) ally



        game.anticheat = 3 

        sets the anticheat level (too fast clicking - or rather packet sending) - default is 3 (values allowed are 1 [strict] to 5 [very permissive])
	


        game.lowscorelimit = -25

        players get kicked if their score is less than this value - allowed range is -15 to -100




	game.cloudcoverage = 0

	clouds density

	

	game.respawntype = 0

	0=round robin, 1=random

	

	game.windspeed = 30

	clouds speed

	

	game.map = "Two clans"

	starting map

	

	game.mapcycle = "Two clans"

	map cycle (comma separated list)



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


5. Bot Players

In a new terminal window (Posix) or in the command prompt (Windows) type:

netpanzer -b [gameserver host:port]


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

6. Contact

Bugs should be reported to the netPanzer forum:
    https://sourceforge.net/projects/netpanzer/