WarWorld - The Book of Rules
As of 10/01/2000
Recommended attributes
* World unit-of-measure: 1 meter.
* World size: 1024m x 1024m (realistic for demo version)
* Maximum number of players: 4 (red/green/blue/yellow) (realistic upper limit)
* Maximum number of total units: 50 (due to graphics/network performance. Not tested => not sure.)
* Grid cell size: 32m x 32m
Server
* Broadcast worldstate information 15 times per second. (that means an "INIT\0" 15 times a sec.)
* Broadcast unit movement information as needed (see In-Game Protocol Spec at POS/WPT)
Unit movement
* Exactly the way they do in Command & Conquer or Dune. Units move by driving, not by jumping, from one grid location to another.
* The server may impose a gridding of the world for collision detection/path finding/etc purposes, but the units move regardless of the grid. Only stationary objects lie always within the boundaries of a grid cell.
* Different types of units have a different maximum speed, acceleration and turn rate.
Example:
type = TANK
maxspd = 10.00000 // 10 m/s
acc = 2.00000 // 2 m/(s*s)
turnrate = 10.00000 // 10 deg/s
This means that a tank driving at full speed, moves 10m/s in the world, i.e. 10/15 meters per frame, to its current heading.
As we all know a tank may steer even when it's not moving, so a tank that is given a destination by a player may take a turn at the spot and start accelerating when the correct heading is reached. The destination is effectively a grid location if gridding is to be imposed by the server. Probably should.
Unit dimensions
* Units may span multiple grid cells. Such static units as factories and the like are, of course, bigger than a tank which is about the same size as a single grid cell. For hit detection a bounding rectangle or sphere may need to be defined for each of the different unit types to maintain a decent level of precision. For example, the builder, if it is to be considered a static object, could be 2 x 2 cells in size and thus enemy fire hit detection needs to be performed in all those cells.
Representation of gunshots and detection of hits
* Fake projectiles. In other words, the client draws a quickly moving projectile (moving handled independently of the server. fake. period. The server does only hit tests)
* The server just tests for a hit at the player-specified target point. In real life, this would be called arc trajectory..
(take into account that a target may not always lie exactly in the middle of a grid cell (moving))
Numeric data during comms
* Use only 16-bit integers to represent numeric values to the client. At this time, the client wont get any extra kicks from floating-point values as it is impossible to draw things between pixels and thus sending values with lots of decimals wastes bandwidth.
Presenting angles to the client
* An angle is represented as an integer value between 0 and 255. Winds counterclockwise from the x-axis. These values are not used in any translation calculations. The purpose is merely to give the engine information about how to draw units onto the screen.
Destroying units
* The UNIT_ID belonging to a destroyed unit may and must be reused when creating new units dynamically.
Client as of 11/01/2000
What's it made of?
* Written using Qt 2.x.
* 16-bit color depth. Works on all depths >= 8, but cpu time gets wasted with greater depths since memory copy operations take twice the time AND WarWorld doesn't look any better with 32-bits of color!! PLUS! The client eats up lots more memory with unrealistic graphics settings.
* A 400 by 400 pixel view to the world. (1 pixel = 1m)
* The world map is represented as a WORLDWIDTH x WORLDHEIGHT (=1024x1024 now) bitmap with the color depth of the current display mode.
* A widget displaying kill counts for all of the players.
* Button widgets for C&C-style unit building.
* Server IP address and port number can be given as parameters from the command line along with the player nick. example: ./wwclient -ip=127.0.0.1:1025 -nick=TriggaNigga2000[MOTHAFUCKAS]
* Mouse controls akin to C&C.
* 3-button mouse recommended. (buttons: left = select unit(s)/set destination/shoot at,
mid = hold down and scroll around the world map by
moving your mouse.)
right = unselect unit(s))
* A selected unit is marked with a selector image akin to C&C. Energy bar shown.
* Selection of multiple units, again, like in C&C, is in the works. The protocol takes this into account.
* Special effects: selected tanks' guns follow player's mouse cursor location as if aiming at that point. Exploding units leave a permanent crater on the ground. Treadmarks may be supported in the future.
* No sounds.
Unit type-specific attributes
TANK
Top speed: 20.0 m/s
Acceleration: 5.0 m/(s*s)
Turn rate: 45.0 deg/sec.
BUILDER (immobile?)
Top speed: 0.0 m/s
Acceleration: 0.0 m/(s*s)
Turn rate: 0.0 m/s