Plague Readme: 2009/01/01
Benedict Carter
http://plague-like.blogspot.com/
http://sites.google.com/site/plaguelike/Home

Plague is a real-time top down “rogue-like” arena shooter pitting humans against the zombie horde, inspired by the games XCOM, Syndicate and Gauntlet. 

Currently under development, Plague already features procedural level generation, finite element modeling for physical effects, a 2D physics engine, AI and line of sight vision for every “sentient” game entity, multiple weapons and a whole lot more, all running in real-time.

In the future Plague will have new features like modifiable “RPG” stats for sims, RTS base building and base defense missions, a day/night cycle, resource management, inventory for sims and the Zombie Plague will continue to mutate as the game progresses. See the To Do lists below for more detail.

 Table of Contents
GAMEPLAY:	1
CURRENT FEATURES:	2
CONTROLS:	3
DEPENDANCIES:	3
TO DO:	4
CREDITS:	6
COPYRIGHT:	6
Updates:	6

GAMEPLAY:
Scenario
You are a human fighting for survival in a zombie plague outbreak.

Currently (in this version of Plague) you find yourself in the countryside - unfortunately infested by zombies; fortunately cluttered with guns and ammo.

Hives
Zombies are made by “Zombie hives” (the purple blobs) constantly, so you must destroy Zombie hives as soon as possible. Zombie hives can be destroyed with enough firepower – or enough fire. Zombies will try to attack and kill human survivors, and turn them into zombies.

Melee attacks
Zombies have melee attacks – they can attack you if you are close enough and in front of them. Similarly humans will melee Zombies if they get too close, and try to push them back so they have more room to shoot them.

Guns
All guns have a barrel length and as such require some room to successfully fire on Zombies. If you are fighting in close quarters, switch to a smaller, less powerful weapon.

Pickups
You can get weapon ammo and grenades from ammo crates and health 
from medkits. You can pick up weapons from the ground, but only one of each type. Weapons will automatically reload when empty and equipped, but you can also manually reload them when convenient.

Zombies will eat corpses to gain health. They can also rest and gain health automatically.

Movement
Movement is directional – you can run forwards and walk back. You and everything else has inertia, so unless you stop your motion you will glide to a halt. This is also true for Zombies, so use that to your advantage. You can sprint as well, but will slow down as you run out of stamina. You automatically regain stamina all the time.

Other survivors
There are other humans, and they will also try to survive - they will pick up ammo and health as necessary and will run from and try to kill zombies. They wont attack you or other humans in the same faction deliberately. They will share ammo and guns, if you or other humans have none. 

Destruction of map objects and neat stuff like that
Note that everything in Plague can be destroyed (apart from crates and weapons because that wasn't much fun). Objects will set on fire if they get hot enough and emit heat. Heat is transferred around and can therefore set other objects alight. Explosions are transferred through the air and are confined by walls. As such they are much more deadly in confined spaces.

Edge of screen indicators
Indicators show you the relative position of a sim from the screen center. The length is proportional to distance, and the direction indicates if the sim is off-screen or on-screen. 

They are useful for pointing out to you if you can see zombies or not (in case you were looking elsewhere), finding friends, or finding remaining zombies when there are no Zombie Hives left.

Victory conditions
When all the humans or zombies are dead, the game is over and you can start a new randomly generated map.

Quitting
Pressing Esc will take you to the main menu (and quit your scenario). Pressing Esc again will quit Plague.

CURRENT FEATURES:
Zoom in and out at anytime to see the level – no mini map required
Non-predictable procedural level generation
Vision based on line of sight
AI for all sentient sims
Memory based on what was last seen
2D physics engine powers object interactions and motion
Finite element modeling of explosions, fire, etc
Fire modeling that allows objects to catch on fire and be destroyed
Lots of firearms, concussion and incendiary grenades, Molotov cocktails
Sim direction and distance indicators.

CONTROLS:
With mouse (Desktop)
WSAD to move
Mouse move to aim
Mouse wheel to change weapons
Middle mouse to toggle screen scrolling
Left mouse to shoot
Right mouse to throw grenade
1-7 pick weapons
8-0 pick grenades
Left Shift to SPRINT
QE to zoom
No mouse (Laptop)
WSAD to move
i,p to change direction
o,l to change weapons
L_CTRL to shoot
L_ALT to throw grenade
1-7 pick weapons
8-0 pick grenades
L_SHIFT to SPRINT

MAP BUILDING FOR FUN (NUM PAD KEYS for now, sorry laptop users):
DEL deletes whatever is under pointer
1 makes blocks
2 makes shrubs
3 makes ammo and health
4 makers player
5 makes soldiers
6 makes guns
7,8,9 makes zombies (fast, normal, massive)

Other
t controls the shadowing method - one is slow and precise, 
the other is fast and mostly good enough (some artifacts 
will exist in "unusual" situations).

y adds extra game info, like AI state information, collision, heat maps
checking, blocking information, etc. Stuff that is useful 
to me to program the game, but may also be interesting to you.

DEPENDANCIES:
Python
Pygame
Psyco (Optional for decent speed increase)

TO DO:
Engine:
1.	Store old game_states and switch between them
2.	Add path finding AI
3.	Let player issue orders to AI sims (that AI sims can choose to allow or not) – AI, UI, code, data structures, etc.
4.	Make a completely tiled based background and expand procedural generation algorithms to build battlescapes (and not slow down game more)
5.	Change map building keys to add, subtract, change left, change right – generic data structure uses datamanager
6.	Update sims in ordered fashion – will stop “floatiness” with guns etc
7.	Add RPG stat system and data structure and AI
8.	General inventory (items, weapons) data structure
9.	Add bases (below)
10.	Use sleep instead of clock.tick to free up CPU
11.	Change class attributes to a dictionary keys
12.	Change inventory to a list of instantiated objects

Bases:
1.	Add barricades. Zombies to attack them to get to humans
2.	Add doors player/humans can open/close/lock/unlock
3.	Add "base zones" for humans and zombies, and add associated AI states to go to base zones
4.	Add base building algorithm
5.	Add city generation algorithm
6.	Add base building AI for sims (gather resources, deposit resources)

Battle scenario gameplay:
1.	Add day/night cycle
2.	Add food and food logic for humans
3.	Add flamethrower
4.	Add land mines
5.	Add claymores
6.	Add rocket launcher
7.	Add trees/wooden walls
8.	Add animals to game
9.	Add zombie types associated with animals
10.	Add "black ooze CA" enemy
11.	Have survivors as team mates that you can issue orders to 
12.	Meat as bait for zombies
13.	Drop gun button and associated AI
14.	Freeze grenade
15.	Let melee attacks destroy bushes and other items
16.	Add melee weapons
17.	Add shields (and blocking logic)
18.	Add dodge key (to dodge melee attacks)
19.	Add fast_blockable melee, slow_unblockable melee
20.	Teleport ability to teleport to memorised squares
21.	Add torque and rotation to physics
22.	add friction force for bullets hitting blocks

Strategy:
1.	Strategic game play in addition to tactical maps - resource management, research, scenarios, colony/base creation, colony interaction
2.	Scenario based missions (base defense, infestation reduction, search and rescue, resource gathering, etc)
3.	Trade with AI players
4.	Make Zombie horde mutate to be more dangerous

Art:
1.	Lots more sound (hit scream, die, kick, etc)
2.	Burnt trees
3.	Burnt corpses
4.	Bullet ricochet sound
5.	Make player health more visible - red comes in from edge of screen?
6.	Redo survivors to hold guns better
7.	Add vehicle art
8.	Add more reloading sounds
9.	make reloading sounds representative of the relevant timing (maybe reload start sound, reloaded sound?)

Fixes:

1.	make survivors avoid heat in battle
2.	Thermal vision for sims as well – make sims heat cells?
3.	Make sims change weapons down to lower ones if enemies too close
4.	May make it so can hold two weapons and can drop weapons to pick up a new one
5.	Recalibrate damage model (in progress)
6.	Add different ammo types for grenades
7.	make laser put heat into cells instead of temp
8.	change all of check_player_controls to use events

Optimisations:

1.	Speed up finite element analysis (numpy and multi-threading?)
2.	Turn Polar into Cartesian as much as possible

Lower priority (and HARDER) To Do:
1.	Speed up game
2.	Make Line of Sight bigger while maintaining game speed
3.	Add more sims while maintaining simulation speed
4.	Add multi player - coop and versus
5.	Make heat and flow CA interact - universal model?
6.	Make 3D graphics (not this version!)
7.	Use OPENGL to see if we get a speed increase

CREDITS:

Benedict Carter – Author (code, design, art, sounds, etc)

Guido van Rossum - Python
Pete Shinners - Pygame

Andy Harris - Game Programming - The L Line – great introduction to game programming
Sean Riley - Game Programming with Python – for the advanced stuff
Brad Beveridge – useful discussions, general advice and hosting for development
Taryn Nicolle – Tester
Tom Forsyth – Cellular automata modeling and useful discussions
Sean Lange – sprite art and the shotgun
All the helpful people at pygame on IRC
soundsnap.com – some good free sounds

COPYRIGHT:
Copyright, Benedict Carter, 2008.

Plague may be reproduced in full for the purposes of playing it. Written permission must be obtained from the copyright holder for any other use.
Updates:
●	3.14
○	changed survivor sim ai so that they change to the best gun they have (ammo permitting)
○	nerfed sniper rifle a little
○	nerfed the zombies a little – it was too hard
○	added more of Sean Lange's artwork, and his implementation of a shotgun.
○	Implemented inventory for sims
○	rebalanced grenades and guns a little
○	changed the ways guns and ammo interact
○	made laser make its own (non-universal) ammo
●	3.13
○	Stopped using JSON and started using pickle as file saver/loader. Pickle, being part of core Python, just worked.
○	Altered draw_image code and image class to internalize elevations of images – so I can pull images as part of an inheritance diagram
○	Changed physics constants so that they are referred to in a attrs dictionary instead of as attributes of the sim
○	Fixed shockwave physics so that energy and momentum aren’t carried along the edge of the map. Energy and momentum are now carried off the map. 
○	Fixed sim shadowcasting so that the tile you are in does not block sight. Allows LOS as originally intended (there hass been a kludge in there for ages).
●	3.12
○	optimised connected sets algorithm to calculate and update optimal cells only – builds maps faster
○	made CA_tech demo more fun by letting player burn stuff and delete rocks, etc. 
○	“easter egg”: press “o” on the main screen for the test map. You can deposit stuff using numpad keys. Fun for making your own map and populating with soldiers, zombies, ammo, etc.
○	Renamed Connected_sets to Partitions
○	made zombie_normal slightly slower
○	made zombie_massive turn slightly slower
○	made bullet currently_penetrating only for blocking sims
○	fixed logical error in bullet_collision. Bullets now interact with more than the first sim (eg: sniper rifle bullets kills MULTIPLE zombies in one shot).
●	3.11
○	tweaked bullet properties to try to reduce computational load and weird looking reflections off  blocks.
○	Realised I wasnt using melee_arc to determine whether or not something could be meleed. Now fixed. Zombies and survivors can now only melee things in front of them.
○	Realised is was calculating melee distances incorrectly. Fixed. Now zombies and humans will consistently correctly melee. This has the effect of making zombies more deadly.
○	Game is too easy – increased zombie_normal and zombie_fast health.
○	Zombies now react to being shot – they will run towards direction of incoming fire.
○	Ensured zombie_hive, human and zombie numbers are reset between maps.
●	3.10
○	additional sprite art from Sean Lange
○	made zombie_hive counter decrease when zombie_hives destroyed
○	fixed creation of remains – this crashed python when uninfected humans were killed
○	added a timer to ai to make sims pick another destination after a few  seconds (stops them getting stuck indefinitely)
○	added comments to sim “add sight tiles” code
○	(last version, whoops!) made it so that health and ammo “tick up” as you stand over them, no longer instant refills
○	increased animal burn_max so that zombies and survivors burn for a little longer
●	3.09
○	Code rewrite to make code more readable, use inheritance more, and do things in smarter ways
○	Some nice new sprite art / sprite improvements from Sean on www.blogger.com
○	Rest of sprite art upgraded to match Sean Langes work.
○	Changing drawing order so UI drawn last
○	Reduced bounciness of some bullets (where the gun has a high fire rate) to decrease computational load
○	calculated bullet draw paths without physics_locations – new list: draw_locations made
○	fixed add_sim so that “effects” are always drawn
●	3.08
○	stopped reloading if sim has no ammo
○	improved sim panicking when on fire
○	improved sim searching when exploring
○	removed “sim not moved check” as should be irrelevant
○	improved square project to interact with circles
○	increased bullet elasticity so they can be bounced of blocks better (more fun)
●	3.07
○	grenade sprint throw “bug” removed
○	make incendiary the default grenade
○	fixed control bug where player would stop receiving input because input was not “fresh”
○	changed bullet physics so that embedded bullets actually embed all the time
○	reduced laser_pule_temp from 5 to 50 (necessary because embed bug fixed)
○	added 2000 burn damage to laser pulses 
○	made zombies and survivors panic and flee when on fire
○	fixed text – I dropped some brackets when rewriting it...
○	reduced num_zombies to 60 again for speed
○	reduced zombie sight radius to 8 for speed
○	reduced soldier sight radius to 14 for speed
●	3.06
○	Eval is evil – it has a “memory leak” and its not as fast as a lambda function
○	removed eval from entire code base (whew!)
○	set battle game scale to 1 so players knew that there was a game to play (it was too zoomed out)
○	made zombie_massive more red to distinguish from zombie_fast and made it larger
○	increased sight radii to tempt players to zoom out
○	changed control scheme (mouse wheel weapons and QE zoom) – see instruction help page for more information
○	changed zombie_massive health from 5000 to 2000
○	made update_UI_text more modular

●	3.05
○	Deleted unused game_states
○	updated ReadMe for typos
○	removed grenade dropping when player is dead/None (only added for my testing)
○	randomised shrub health 
○	made zombie_hives bleed when shot
○	decreased gauss_rifle_bullet so it doesnt destory concrete_blocks instantly
○	fixed square_project so it doesnt automatically stop all things
○	decreased grenade health to 0.5seconds  – more satisfying
○	increased normal and fast zombie speeds
○	decreased normal and massive zombie melee arcs
○	investigated massive zombies seemingly not taking damage – no error found
○	battle would not restart (while True loop with no exit) - fixed
●	3.04
○	made zombie_massive turn faster
○	draw_overlay for game_state and sims (bars, paths, indicators, etc)
○	added health bars for zombie_hives
○	reinstated sim indicators (as people dont like hunting zombies for ages), will make an option in the future so purists can turn indicators off
○	stopped corpses going through blocks (turned on collision detection)
○	made pickups square_project with blocks in collision
○	added in trees to tech demo
○	add fire to the tech demo
●	3.03
○	Calculated whether sim “on screen” by location instead of position (speed increase optimisation)
○	changed max_fps from 50 to 30  (speed increase optimisation)
○	rebalanced bipeds speeds, accelerations, melee_damage, health, turn rates, etc (to make it play better at high speeds)
○	changed zombie_hive placement to be more distributed.
○	Allowed sim placement in opaque (and unblocked) squares.
○	Renamed game_states to be more (obviously) extensible
○	modified make_level and restart_level control flow logic to be better
○	changed buildleveltext.text to show what tech demo is doing

●	3.02
○	Removed unused timers when sims removed
○	changed constants.BURNTEMP_GRANITE from 10000 to 20000
○	decreased weapons from 40 to 10
○	decreased constants.LASER_PULSE_TEMP from 20 to 5
○	changed constants.MAX_AMMO from 2000 to 500
○	changed cell.Deposition “eval” code to let tech demo run
○	added game states
○	added game state – menu
○	added game state – help
○	added game state – tech demo
○	Changed visible heat map so intersects player.visible_tiles