Progress on the Unified SDK
SDK Changes
- Added checks to prevent entities with class none from becoming hostile to player (e.g. if a scientist is killed near the G-Man the G-Man is marked as suspicious which makes him hostile. He'll try to attack the player but, lacking weapons, resorts to stalking the player like a Terminator instead)
- Prevent
allow_follow
being set on script entities
- Added check to prevent level changes from breaking if they are too close to each-other in relative space. The game will instead notify players who touch broken level changes that the level change is incorrectly placed
- Reduced size of fixed size containers to optimize memory usage in sentence system
- Use lookup table to get sounds to speed up lookup
- Eliminated unnecessary conversion from sound index to name and back again when starting sounds
- Clamp health before conversion to int when showing entity info (prevents entities with huge health values from showing up as having negative health)
- Properly set scientist head when using random head setting to prevent other body groups from being changed
- Fixed allied human grunts continuing to fire for a few seconds after killing the last enemy in an area
C# Changes
- Update
env_spritetrain
sounds when upgrading maps (same as func_train
)
- Added hack to install default
config.cfg
file with correct key bindings
- Added
MapUpgraderDocGenerator
: converts XML documentation generated by C# compiler for the MapUpgrader.Upgrades
library to Markdown for use in documentation
Asset Changes
- Added polygons under bigrat paws
- Create valid sequences for unused HD zombie sequences
- Added test maps to test level changes being too close to each-other
- Added studio property to a few entities in fgd file
- Added files used by prototype scripting system
Broken level change detection
If you go through a level change and you're touching a level change immediately after loading into the next map then all level changes will break. This has been fixed so that the level change responsible is instead disabled and a warning is shown to make this clear:
The new sound system had some performance issues that have been fixed:
- The memory used by the client-side sentences list has been reduced by about 3/4th from 2 MiB to just under 600 KiB. This was done by reducing the size of the fixed size buffer used to store sentence names and the list of sentence words. For names and word counts that exceed the buffer size additional memory will be allocated. The new buffer sizes were chosen based on the minimum, maximum, average and median counts for both to minimize waste of memory
- Sound lookup on the client side was too inefficient due to having to compare sound names against every sound used by sentences before regular sounds precached by the server were checked. This now uses a lookup table to dramatically reduce lookup time
- Sounds and sentences started on the server side are no longer converted from an index back to a name and then back to an index again, which eliminates the need to perform a lookup altogether
These were the only outliers in SDK code that showed up when checking the game with a performance profiler. Most of the game's CPU time is spent in the engine which can't be analyzed more thoroughly due to a lack of access. Memory usage is pretty good with no notable outliers.
Prototype scripting system
The prototype Angelscript-based scripting system has been made available in the Git branch
nonfunctional-prototype-scripting
.
This prototype implements a number of features that can be used as a starting point for a more complete and functional scripting system:
- Plugins and map scripts
- trigger_script
- Event System
- Scheduler
- Call functions from C++ using helper functions and types
- Entity APIs
- Custom Entities
- Per-Entity User Data
- Console Commands
A more complete overview is included in the
documentation. The documentation explains the concepts behind these features, how they work and where the design can be improved.
I updated the prototype to include all changes made to the project and i added a couple more features i thought people might need an example for but as noted in the documentation this prototype is nowhere near ready for use. You'll need to put in a fair amount of effort to get it working.
As i noted in the Closing Thoughts you should evaluate other scripting languages to choose the right one for the job. Angelscript is powerful but that also makes integrating it into a program difficult, and when something goes wrong (and it will) you'll need advanced level C++ knowledge to understand what's happening.
Documentation and changelog
I've added documentation for as much as i can. The documentation covers everything from new features, new, modified and removed entities, tools, scripts and prototypes.
I've also added a changelog listing all changes made in the Unified SDK project (not including changes made in the Updated projects):
https://github.com/SamVanheer/halflife-unified-sdk/blob/master/UNIFIED_CHANGELOG.md
The changelog is about 13 A4 pages when exported to PDF.
The
main documentation readme acts as a hub for the documentation to allow navigation to the documentation and links to other projects related to this one.
Potential Upgrades
Remaining open Github issues have been moved to a "Potential Upgrades" project. I've also added issues from my TODO list to this project.
These are issues that could be worth investigating and cover bug fixes, API changes and new features. They are by no means required to be added at any point, they're just things that are worth investigating.
Remaining work to be done
- Update changelog to include all changes (mostly complete)
- Write documentation for all new features (mostly complete)
- Review all changes (done)
- Stress test the four campaigns and fix issues that show up (second test done)
- First release candidate build
There are a couple things left to be done before development is wrapped up, mostly testing the four campaigns again to check for any issues worth fixing.
I'd like to thank malortie for helping to get the project ready for release. He's done a lot of good work on the project and helping to test the game. The project would not have gotten to this point without him.