BATTLEZONE 1.5.2 CHANGELOG

1.5.2.11 (2013-05-03)
* Updated UnitTask ordnance avoidance
- Skip sniper shots since they're invisible
- Take the unit's velocity into account
- Take the ordnance's radius into account
- Apply evasion properly in GotoForce
* SeismicWave sets its object radius to the wave radius
- Units avoid its area of effect if they see it coming
* NetPlayer uses netPlayerByTeam to track used teams
* Fixed potential floating-point exception in PointVelPoly
- If vd was denormalized, t could become infinity
* SelectionDisplay player name display skips negative team number
- Units briefly have a team number of -1 after being cleaned up
- This may fix the Font_Get_String_Dimensions crash seen in MPI
* ChunkEffect and Craft tolerate missing explosion classes
- This happens when using content from the 0.7 beta demo
* Treat deploying and undeploying craft as immovable
- Makes collision with them work better
* TurretTank and Producer have their own PostSimulate
- Call HoverCraft PostSimulate while undeployed
- Call Craft PostSimulate and discard collision otherwise
* PathSpawn handles save/load a bit better
- Search for existing spawned items on startup
- It still loses spawn delay timers, though
* TurretTank and TurretCraft update terrain ownership properly on team change
- MAS Grenade revealed a flaw in the previous implementation
* Added MPI to the map filter list (use M in netmis.txt) [Dx]
- Put map filter list in alphabetical order
- Added new KOTH and MPI icons
- Requires updated netmis.txt and the icons in the addon folder
* Turn off player smoke, dust, and engine effects while in edit mode
* Fixed uninitialized values in Scheduleglue buildingtype
* Pilots don't get stuck when the vehicle they're going towards gets destroyed
* Units ignore enemies carried by a Tug
* Build menu can read the name of a weapon powerup from the weapon it gives
- This is how the weapon powerup itself gets its name
* Shell update
- Renamed MPI-ST to "Mission" map type ('M')
- Added MPI-DM as "Action" map type ('A')
* Updated project file with new mission type bitmaps
* Fixed SAV weapon pitch
* Added debug display showing hardpoint types and locations
- Toggle with "showguns" cheat code
- Color indicates slot: 1=red, 2=yellow, 3=green, 4=cyan, 5=blue
- Letter indicates type: C=cannon, R=rocket, M=mortar, S=special
* Run simulation during a D3D device reset in MP
* Added cutoff distances for hardpoint and collision debug displays
* Disabled MP "death cam" view until I come up with something better
* Set KOTH icon back to king.bmp
- Allows full backwards compatibility
- Asset version can look different
- Resource version is never used anyway
* Shell handles missing MPI icons gracefully
- Use [D] if [A] is missing
- Use [S] if [M] is missing

1.5.2.10 (2013-04-24)
* Fixed Torpedo double-speed movement
* Fixed ReticleDisplay when selectObj got deleted out from under it
- It now uses a DeleteObject callback instead of DeleteEntity
* Added GetTarget accessor to Missile
* UnitTask evades ordnance at Very Hard difficulty
- Sidestep incoming projectiles
- Attempt to dodge homing missiles
- Priority over line-of-fire evasion
* Added weaker line-of-fire avoidance at Hard difficulty
* Added random movement after being shot by an enemy
* Fixed SAV double-speed movement
* GroundCheck takes current time to impact into account
- Now gets the earliest time to impact
* Updated PowerUp collision handling
- Moved ground check into a protected method
- Clamp time of intersection to a minimum of 0
- Moved airborne collision landing to PostSimulate
* Updated Torpedo collision handling
- Use PowerUp GroundCheck method
- Clamp time of intersection to a minimum of 0

1.5.2.9 (2013-04-14)
* SeismicWave can move floor-owning buildings
* Rolled back some terrain editor changes that broke things
* Updated terrain editor camera rotation
- Turn rate is now independent of frame rate
- Halved turn rate so the camera is more controllable
- Reduced filtering so the camera is more responsive
* New ScriptUtils functions
- IsValid: returns true if the handle is valid and false otherwise
- IsDamaged: returns true if the handle is valid and the game object is damaged
* Scrubbed mission scripts of GameObjectHandle::GetObj and calls to GameObject methods
- Replaced them with ScriptUtils equivalents (many of them new to 1.5.2.x)
* Clear out team-to-net-player map after the session ends

1.5.2.8 (2013-04-09)
* Fixed editor setting the wrong build teams
* Fixed video mode switch changing camera settings
- This particularly affected the terrain editor view
* Clamp visibility ranges to maximum far clipping plane
* Halved memory used by tile mix cache
* Updated terrain editor
- Moved non-rendering functionality to Simulate
- No longer changes view distance when switching views
* Deployed craft ignore collision and ordnance impulses
- They are now as immovable as buildings :)
* Call PostSimulate for destroyed game objects
- Updated PostSimulate to handle this
- Fixes units "hanging" in midair when killed
* Fixed crash on exit when running a DM mission from the command line
* Fixed a crash in GotoTask when the path was NULL

1.5.2.7 (2013-04-07)
* Fixed a potential buffer overrun in PathSpawn
* Turned off DR_Debug memory allocation message spam
* Moved ParameterDB::FileData struct out of the header
* Turned off PARAMETERDB_REPORT_WRONG_SECTIONS
* Switched polygon collision to local space
- Now works more like box collision
- Fully supports animated models
- Improves precision
- Tested with buildings (though currently disabled)
- Floor geometry still in world space
* Streamlined collision geometry structures
- One memory allocation per collision geometry
- Flat array of vertices, indices, and faces
* Added collision debug display
- Toggle with cheat code "drawcoll" (type while holding SHIFT+CTRL)
- Shows entity bounding box in grey
- Shows other collision shapes in team color
- Supports spheres (in theory), boxes, and poly
* Fixed crash when showing Goals or Priorities for a team with no strategic AI
* AI team checks relations when counting enemy buildings and units
- It previously assumed all other teams were enemy :|
* BREAKING CHANGE: strategic AI requires opt-in
- Single-player missions default to team 2
- Multi-player missions default to none
- SetAIControl function overrides default AI control
- NOTE: this only takes effect during pre-load!
* Allocate strategic AI mapgrid goals from a memory pool
- This speeds up initialization of large maps in Debug
* Added Team::GetAllies method returning the allies bitfield
* Track team ownership of terrain cells
- Replaces "team hazard" mechanism
- Works correctly for all teams
- Takes team alliances into account
* Fixed material cost calculation
- Derp de derp...
* Fixed cliff force for teams 3-15
* Fixed team ownership for team 15
- SLAB_STRIP was stomping its ownership bit
* Fixed a crash in path editing
* Added new path editing features
- Delete removes the selected path point instead of the last point
- Holding control inserts points after the selected path point
* Fixed units on AI teams not counting towards kills
- There's three different places keeping track of score...
* Prevent terrain access from reading outside the world
- The world effectively "wraps around" at the edges
* Revised craft collision
- Resolves interpenetration better
- Reduce friction/stickiness of continous contact
* Reorganized how collision detection works
- Simulation updates linear and angular velocity
- Collision detection uses the updated values
- PostSimulate applies collision response and sets final transform
- This improves collision accuracy (especially continuous contact)
* Added GeomBox collision
- Fixes some missed collisions
* BoxGeom doesn't assume that geom is stationary
- It used to be but isn't any more :)
- TO DO: make it more efficient
* Fixed CLASS_ID_VEHICLE not colliding with buildings
- Collision previously required one entity use CLSN_TYPE_CAR
- Vehicle load now preserves car collision data for CLASS_ID_VEHICLE
- Collision will use that car collision data when necessary
* Combine identical vertices in the collision geometry
- Ideally this would be done once as part of a shared structure
* Use GeomBox check for tall units in addition to CLASS_ID_VEHICLE
- This is a hack to fix Walkers not colliding with per-poly buildings
* Fixed ConstructionRigProcess class crash in misn09.bzn
- Handle CMD_STOP more like other producers
* Added extended teams (8-15) to the Build Team menu
* Fixed clients crashing when a player killed an AI team unit
* Inst03Mission supports Lua mission scripts
- This allows play01.bzn to act as a Lua testing sandbox

1.5.2.6 (2013-03-22)
* Fixed mistyped objective file name in misns1 (submitted by Dx)
* Removed AudioMessage for nonexistent sound in misns4 (submitted by Dx)
* Updated PathDisplay
- Always show a label over the user object
- Added a slight rollover effect for game objects
* Consolidated memory allocations in Numerical Recipes matrix creation functions
- They were previously allocating a header and then one block per row
* Backed out revision 1404
- GlobalSetLocal/GlobalSetRemote doesn't work well at runtime
- It didn't solve the ownership problem for remote players
* Backed out GlobalSetLocal changes from revision 1403
- These got rolled up into the big ParameterDB change
* Track team ownership based on team number instead of network player id
- This works because each player is on their own team...
- Disambiguates MPI AI teams from the host player
- Non-player teams should migrate properly during host migration
* Destroying units on a non-player team counts as a kill
* Non-player teams display kill and death messages like player teams
* Removed unused team remapping feature from AiMission
- Only MultDMMission ever used it
- Increasing MAX_TEAMS made it obsolete
* Remove the oldest scrap piece when out of game object slots
- This is a last-ditch recovery attempt to avoid a crash
* Don't show a health bar for indestructible objects
- This fixes geysers showing a health bar when targeted
* GoodScrapPosition and GoodMinePosition take a region parameter
- Updated RecycleTask (Scavenger AI) and MineLayerProcess accordingly
- This lets them take region pathability into account
* Don't place scrap pieces in bad locations
- ScrapField uses a non-region variant of GoodScrapPosition
* Try to make player-controlled APCs less exploitable
- Only deploy when within 75m of a (potential) target
* Moved path spawn functionality into a shared PathSpawn class
- Replaces separate copies in Inst03Mission and MultDMMission 
- Added to Inst04XMission and MultSTMission
- Fixed a few issues with it

1.5.2.5 (2013-03-14)
* ParameterDB no longer tries to resize its string pool
- Its string pointers would become invalid if the pool moved
- This fixes crashes when run outside the debugger
* Added more ScriptUtils functions from BZ2
- GetPerceivedTeam
- SetTarget, GetTarget
- SetOwner, GetOwner
- SetPilotClass

1.5.2.4 (2013-03-13)
* PathDisplay updates
- Show strategic AI goals and priorities for the build team if not default
- Label resources as Team 1 and Team 2 instead of American and Soviet
- Fixed build ODF teams beyond 2 appearing black
* Use aiName2 for any non-player team, not just team 2
- This makes AI team production units go to geysers autonomously
* ParameterDB supports ODF sections like the BZ2 version
- Prefer the label in the requested section
- Look in other sections if it is not found
- BZ1 ODF sections aren't always named correctly...
- Debug build reports misplaced labels
* Use GlobalSetLocal for objects not belonging to a player
- This fixes AI-controlled teams using the host's name and flag
- This should also make them survive a host migration
* ParameterDB uses reference-counted shared data internally
- Reduces redundant allocation, parsing, and freeing
- Improves load performance
* Added int and bool ParameterDB::Get functions
* Fixed section validation for labels with no section
* Ported some GetODF functions from BZ2
- OpenODF
- GetODFBool
- GetODFInt
- GetODFFloat
- GetODFString
* Don't run strategic AI on client machines
* Don't set up Lua if there's no Lua script
* Fixed Instant Action save games

1.5.2.3 (2013-03-08)
* LuaMission updates
- Call Setup from the constructor so it gets done in LoadDefaultMission too
- Fixed the Lua script asset not getting unlocked when it failed to load or run
- Made the absence of a Lua script a trace message instead of a dialog warning
- Load but discard any saved Lua values when the script has no Load function
* Removed LuaMission::PostLoad since it was useless
- Mission PostLoad functions only do handle conversion
- Most script functionality didn't work when called from PostLoad
* Re-parented Inst04XMission, MultDMMission, and MultSTMission from AiMission to LuaMission
- These are the three mission scripts that user-created maps are likely to use
- They can now run Lua scripts in addition to their normal fixed-function logic
- MP-related Init and Respawn functions have no Lua script hooks (yet)
* Added .odf and .lua to the misson extensions that crc32mission checks
* Display the Zoom Factor in the Editor (submitted by Dx)
* Strategic AI update
- Replaced 32m "scheduler tiles" with standard 10m terrain grid
- Manages the Construction Rig as an infinitely-reusable construction crew
- Can build buildings in semi-reasonable locations
- Doesn't know about power requirements yet :(
- Continuously updates team base position
* Added all-in-one CMD_BUILD to Construction Rig
- This makes it easier for the strategic AI to control
* Path Display (shift-F9) shows AI goals as colored borders
- No goal: none
- Defend base: bright green
- Attack troops: dark red
- Siege: bright red
- Exploration: blue
- Scripted (scrap): white
- Perimeter: dark green
- Recon: cyan
- Resource: white
- Other: black
- Escort: dark grey
* More ScriptUtility functions
- GetCurrentWho
- HopOut
- KillPilot
- RemovePilot
- HoppedOutOf
- IsNetGame
- IsHosting

1.5.2.2 (2013-03-02): emergency hotfix...
* Fixed AISchedule stuff crashing on starup in multiplayer
* Fixed incompatibility with older save games
* Howitzers check the flight path of their projectile

1.5.2.1 (2013-02-28): 15th Anniversary Build!
* Misn09Mission: made turret setup around the CCA base reliable (submitted by Dx)
* Changed the horrible STRUCTURE2 audio to something better (submitted by Dx)
* Return focus back to the MapList for host selection (submitted by Dx)
* Updated Save/Load Shell (submitted by Dx)
- Requires new "saveload.bmp"
* Updated Pop Up Shell window buttons (submitted by Dx)
- Enabled WM_MOUSEMOVE
* NameDlgProc InvalidateRect IDC_EDIT_NAME (submitted by Dx)
* SaveDlgProc InvalidateRect IDC_EDIT_GAMEDESC (submitted by Dx)
* Made the selected paths a bit easier to read in the editor. (submitted by Dx)
* Improved game object selection
- Uses the larger of bounding radius and collision radius
- These correspond to the circles drawn around objects
- Picks the object closest to the cursor
* Enhanced Edit Object mode
- Show labels above objects that appear as an oriented box with circles
- Highlight the object under the mouse cursor (rollover)
- Reduced unintentional movement when clicking game objects
- Use the point clicked on the game object as a "handle" when moving it
* Enhanced Edit Path mode
- Show the path label over the first node (also with Show Paths)
- Reduced unintentional movement when clicking path nodes
- Use the point clicked on the path node as a "handle" when moving it
* Support getting team players
- Assign remote players to TEAM_SLOT_PLAYER
- Added GetPlayerHandle variant that takes a team
* Back-ported some ScriptUtils from BZ2
- Set object team number
- Modify and query team alliances
- Get and set current health
- Get and set maximum health
- Get and set current ammo
- Get and set maximum ammo
- Add ammo
* Fixed up some scripting weirdness with Misn08Mission
- AddObject was assigning objects to the wrong handles
* Updated ScriptUtil
- Use TeamNum typedef more consistently for team numbers
- Most functions taking a path name also take an optional point index
- Added path variants of GetNearestObject, GetNearestBuilding, and GetNearestEnemy
* Preliminary implementation of LuaMission
- AiMission framework for user-created mission scripts
- Matches any mission file starting with "lua"
- Reads the .lua script named after the mission (e.g. luatest.bzn reads luatest.lua)
- Supported script functions: Load, PostLoad, Save, AddObject, Update
- This has not been thoroughly tested yet...
* Revised LuaMission
- Fixed problems with Handle lightuserdata
- Now works with a real .lua mission script
* Added more ScriptUtils functions from BZ2
- GetWhoShotMe
- GetLastEnemyShot
- GetLastFriendShot
* Added LuaCheckStatus to consolidate error reporting
* Added basic Lua serialization and deserialization
- Supports nil, boolean, lightuserdata (handles), string, and table
- Does not preserve complex reference structures like lua-marshal
* More LuaMission tweaks
- Only call script Save and Load for save games
- Added some comments to code
- Debug build enables Lua os and io libraries
* LuaMission displays a message when it can't find a Lua script
* Switched to Lua 5.1.5
- Lua 5.1 has better tool support than 5.2
* Spiffied up PathDisplay (Shift-F9 view)
- Made it easier to click on small objects
- Show menu item keys with sprites instead of [text]
- Show item keys only for currently-selectable items
- Show menu selection state using color
- Use translucent backgrounds for unselected labels
* More PathDisplay tweaks
- Hold right mouse button to rotate the selected object
. It turns to face the mouse position
. This was actually in the previous commit...
- Placing a game object makes it the selected object
. This makes it easy to rotate
* LuaMission matches any mission with a corresponding .lua script
- For example, it matches misn02l.bzn if misn02l.lua exists
- This only applies when creating the mission in the first place
- CAVEAT: it uses the msn_filename value (like Inst04XMission)
* Improved DistributedObject bandwidth throttling
- Take reliable packets into account
- Take UDP packet header overhead (40 bytes) into account
* SetAIP takes a team number argument
- It defaults to 2 for backwards compatibility
* AIPs can control any team, not just team 2
- This has not been thoroughly tested yet...
- Controlling a player team will have unknown effects
* Fixed LuaMission::Save dropping the last data value
* Added more ScriptUtils functions from BZ2
- GiveWeapon
- IsDeployed
- Deploy
- IsSelected
* Made HasCargo safe to use with non-Tug units
- Returns false in that case
* Improved how LuaMission gets and pushes Handle values
- Push nil for a zero handle so Lua logic can test for it
