BATTLEZONE 1.5.2 BUILD NOTES

Version 1.5.2.15
Released 2013-09-30

Closing on on a final release for the 1.5.2 series...

This build fixes a few problems introduced in earlier versions and adds a bunch of handy new Lua functions for mission scripting.


What's New:


Stability

* Rolled back mission save/load culling unlabeled paths
- It turns out that mission files DON'T exclude AI state...
- Fixes crash when loading maps with AI state like Capt. Chaos

* Fixed a hang when using Texture32=1 in render.cfg
- Did this ever actually work?

* Fixed crash in UnitTask::UpdateWeapon when the unit has no active weapon


Scripting

* New Vector Lua functions
- DotProduct: dot product of two vectors
- CrossProduct: cross product of two vectors
- Normalize: scale vector to unit length
- Length: length of a vector
- LengthSquared: squared length of a vector
- Distance2D: 2D distance between two vectors
- Distance2DSquared: squared 2D distance between two vectors
- Distance3D: 3D distance between two vectors
- Distance3DSquared: squared 3D distance between two vectors

* New Matrix Lua functions
- BuildAxisRotationMatrix: build matrix from angle and axis
- BuildPositionRotationMatrix: build matrix from rotation angles and position
- BuildOrthogonalMatrix: build matrix from up vector and heading vector
- BuildDirectionalMatrix: build matrix from position and direction vector

* Many ScriptUtils functions accept position vector or transform matrix
- SetPosition
- GetDistance (second argument)
- GetNearestObject
- GetNearestVehicle
- GetNearestBuilding
- GetNearestEnemy
- Goto
- Mine
- Dropoff (ConstructionRig uses matrix orientation)

* Added BuildAt function for building at a specific location
- Armory and ConstructionRig use the location
- Recycler and Factory ignore the location
- Easier to use than the Build/Dropoff combo

* Added some scrap management functions
- GetRidOfSomeScrap: reduce global scrap to a set limit (default 300)
- ClearScrapAround: remove scrap within range of location

* Added new Start method to mission scripts
- Can use this instead of doing one-time start in Update
- LuaMission manages the one-time flag internally

* Added support for locking (and unlocking) team alliances
- Allows mission scripts to preserve pre-set alliances in multiplayer
- LockAllies(true) to lock
- LockAllies(false) to unlock

* Added Lua functions for getting terrain/floor height and normal
- TerrainGetHeightAndNormal
- FloorGetHeightAndNormal

* Ported more script utility functions from BZ2
- GetCircularPos: get ground position in distance and direction from center
- GetPositionNear: get ground position between min and max radius from center
- GetPilotClass: get pilot config from a game object
- SetCommand: general-purpose set command for power users
- GetMapTRNFilename: get name of TRN file for use with OpenODF

* Added AiCommand table to Lua globals for working with commands
- Convert between command names and numeric values


Networking

* Split reliable broadcast messages into separate sends
- The reliable broadcast queue can fill up if a player is unreachable
- Subsequent reliable broadcasts would then fail
- ...and a lot of important things use reliable broadcast

* Player list shows grey "?" for ping time of zero
- When ping hasn't been done yet
- When ping got 100% packet loss

* Keep Anet alive when leaving game and returning to shell
- Only destroy Anet if quitting by closing the window
- Fixes the shell blacking out
- Problem was introduced back in version 1.5.1.12

* Clear and rebuild player lists on entering the screen containing them
- Should flush out any leftover player list entries

* Turned off data execution prevention
- Should allow use of older known-working versions of Anet
- Newer versions of Anet don't time out disconnected players properly

* MultDMMission AddObject skips forwarding for neutral objects
- Prevents neutral vehicles from getting an AI process
- Fixes Z Monolilth's Revenge and other maps that spawn empty vehicles


Gameplay

* Turned off per-polygon collisions for bullets
- Should fix AI missing some buildings from some directions
- Ideally targeting would use something besides the geometric center

* Damage no longer affects Person physics parameters
- Restores the original and expected behavior
- Person had code for it but never used it

* Detonate Torpedo when close enough to its target building
- Prevents it from riding up over its target

* ConstructionRig cleans up its build location
- Snaps position vector to the floor height
- Flattens facing vector to eliminate pitch/roll
- Should fix the satellite view "sinkhole" bug


Editing

* Updated mission Load/Save dialog code
- Fixed filter strings, which needed an extra zero byte at the end
- Allow directory change for both missions and savegames

* Remove extension from filename before opening mission save dialog
- Prevents double extension (e.g. usrmisn01.bzn.trn or usrmisn01.trn.bzn)
