=========================
==    Introduction     ==
=========================
This is a source code release of Half-Life 2: Wars v0.5.
It includes both a solution file for visual studio 2005 and 2008.

=========================
==     Licensing       ==
=========================
You are free to use any of the modified code that is included.
If you use large chunks of the modified code I would like to see credits for it.

=========================
==   How to compile    ==
=========================
1. Open the 2005 or 2008 solution file
2. Release and Debug: Change the paths in the "custom build step" to point to your steam folder
3. Compile

=========================
== Guide through code  ==
=========================
All new files are placed in the HL2Wars folder. In the project solution you can find the files under the HL2Wars filter.
But I also modified a lot of other files.

== Movement ==
The movement code is in GameMovement.cpp/.h, which is actually not very nice.
Mods are actually supposed to create a derived class from CGameMovement.
The main movement function is RTSMove. The code is similar to the noclip movement.
The player simply floats in the air looking down.
It also checks against all map boundary entities to check if the move is possible. 

== Player ==
The player code deals with the selection and orders of units. 

== Global resource ==
Global resource ( (c_)rts_global_resource.* ) is an entity that contains all information about all sides, like colors and factions.

== HUD / RTS Interface ==
hud_interface.cpp/h: The main HUD file. It creates a new HUD element and draws the background + updates the stats like amount of units and resources.
                     It creates three sub panels: the minimap, units panel and abilities panel.
weapon_selection.cpp/.h: Contains additional code to bind keys 1 ... 9 to the group selection when in RTS mode, while still keeping the weapon selection code in fps mode.

== Input/Mouse == 
The mouse is made visible by making the ViewPort a popup (adding "MakePopup( false );" to baseviewport.cpp in the constructor).
The main modifications are done in "in_main.cpp" and "in_mouse.cpp".
The mouse aim is calculated and the amount of movement that needs to be added when moving the mouse around the edge of the screen.
A new variable is added to the UserCmd to send the mouse aim vector to the server and can be used to retrieve what the player is 
pointing at.

== Selection circles ==
The selection circles are created with the shadow manager (ClientShadowMgr.cpp/.h).
I added three new functions to it: CreatePTUnlit, UpdatePTUnlitState and DestroyPTUnlit. It projects the shadows straight down on the ground.

== Fog of war ==
The logical side of the fog of war is only done on the client in the global resource. It loops through all units and updates a
2d boolean field of 512x512 that determines the visibility.
The visual side is done by a procedural texture (tex_fogofwar.*). It's not very efficient, but it works more or less.
The texture is drawn as a 2d quad in the map, so it will only look good if you look straight down.

== Units and Abilities Scripts ==
To make it easier to change and spawn units I made a small script system similar to the weapon scripts.
The scripts store stuff like the name, description, hud images, etc.

== Units AI ==
The main function that I changed is SelectSchedule in CAI_BaseNPC.
Before it will select a new schedule based on the npc state, it will first check the order queue.
If an order is in the queue it will select a schedule based on that.

Furthermore I made stripped version of the original npc's, prefixed with hlw_*.
The SelectSchedule function of those npc's are replaced with the new code for specific abilities.
For example the stalker gets code added to place buildings, while the "random walking around" code is removed.

== Buildings ==
The class CBaseBuildingModel is the base class for all buildings. It contains code for the construction and destruction of the building.
The class CBuildingModel has in addition the ability to produce units. CBuildingBrush is the brush version, but has more or less the same
functionality.

== Contact == 
Sander
vannoortsander@gmail.com