How have you been doing? The Beamdog team has been hard at work on the next Neverwinter Nights: Enhanced Edition patch! Today, we are shipping release 8193.31 to the development branch of NWN:EE.
This is a huge beta patch, with many new and exciting features. We appreciate your assistance in helping us test them, and reporting any/all issues you find.
Highlights
- Significant renderer performance improvements & better shadows.
- New Curated Content: A Hunt Through The Dark, by Markus Schlegel.
- Scriptable UI.
- Apple M1.
- Many other new features, script commands & fixes.
Renderer Improvements
Many improvements have been made to the rendering and shadows engine:
- Greatly reduced the amount of CPU time spent on rendering shadows (50-90% less) by moving more work to the shaders and just doing things more intelligently.
- Reduced buffer transfers related to rendering shadows (perf+)
- Fixed some common shadow rendering issues related to "behind" stencil tests. It does not fix every issue, however, and in rare cases, some issues may become more apparent - but all in all, the benefits should outweigh the drawbacks. The old approach can be restored with using "shadowfliporder 1" in the console.
- Shadow and beam volumes now use their own unique shaders.
- Fixed a number of other shadow rendering issues by doing view frustrum clipping in the vertex shaders. This (beyond improving performance) alleviates issues with shadows sometimes being cut off in odd places (and similar).
- The game now uses tiledata bounding box to determine lower clip of shadow volumes. This fixes shadows not being applied to geometry below the z position of the tile.
- The game now adjusts shadow alpha based on the vertical distance between the shadow plane used for drawing projections and the projection source. This gives a more correct shading.
- Removed the “experimental optimized shadow rendering” toggle. It is now always enabled.
- Added some minor refinements that help reduce the visual oddities caused by shadows being projected by erroneous models.
- Fixed dynamic shadow rendering performance dropping significantly on certain devices due to the new streaming setup.
- Added new debug outputs that help content artists to debug models from within the game. This includes rendering mesh bounding boxes, pivots (centers), emitter and light ranges, as well as shadow volumes. The options are accessible through the normal debug panel (ctrl+shift+f12).
- Optimized generation of shadow volumes to better fit the size of the shadow plane used for rendering shadows. Improves performance in GPU limited situations.
- Fixed an issue that made shadows fade out too quickly at low view angles.
- Fixed an issue with the scene manager that made geometry culling less effective.
- Made the game automatically downsize textures larger than the client GPU supports (instead of just failing to render).
- Optimized the size of the baked font textures to minimize texture memory footprint.
- Tweaked the subsurface light algorithm and made the normal debug outputs also apply for water.
- Removed some redundant GPU data buffer uploads.
- Fixed soft particles reading the screen depth at an offset position, resulting in occasional halos appearing around objects.
- Fixed automatic tile texture rotation (`rotatetexture 1`) causing normal and displacement maps to malfunction.
- Added a new console command ‘printvertexdata’. Prints an overview of the amount of memory currently used for vertex data (model geometry) to the client log.
- Fixed rendering unlit models with envmap (chargen colour picker shader issue; Halaster model issue).
- Fixed object view culling not respecting visual transforms, resulting in objects sometimes not appearing if transformed into view.
- Fixed some static parts being removed after having been auto-combined, resulting in erroneous shadows for some static geometry.
- Fixed skinmesh bone hierarchy to initial model layout. This solves certain issues caused by skinmeshed bodyparts being dynamically attached and removed.
- Fixed low quality render mode darkening water too much.
Curated Content: A Hunt Through The Dark
by Markus Schlegel
Presenting the classic six-part campaign by Markus Schlegel - A Hunt Through The Dark!
Did you ever want to play the dark side, the bad, the evil, the worst of all, the drow?
Take part in a hunting trip through the Underdark. It is on you to enslave goblins, betray comrades and spoil the plans of your leader Mistress Piwiewien – or not.
Scriptable UI
Modules can now spawn custom UI panels, either defined in NWScript or JSON datafiles.
- The layouting is done via a constraints solver and currently presents as a row/layout flow.
- Most native widget types available, including lower-level drawing primitives to create your own.
- Data binding is two-way between clients and the module, and allows synchronising sliders, input fields, buttons, and window geometry/properties. Mouse input events are supported as well.
- There is a new include file: nw_inc_nui.nss. There is also a demo script (nw_nui_demo.nss) that showcases some basic widget types. Finally, there is a more complex inspector example (nw_nui_insp.nss) that can show bind values for all open scripted windows.
- See the mentioned include file and demo for starting points. The new nwscript.nss API is reproduced at the end of this document.
NWScript JSON Datatype Support
NWScript now has a new native datatype, `json`. The API is documented at the end of these notes.
The engine can also serialise game objects to/from json, similar to how the sql data binder works. There is a new data format “.caf” for area objects that combines .are and .git, so you can de/serialise areas into a single json object. The serialisation format is compatible with neverwinter.nim.
There is a small helper library in nw_inc_gff.nss so you can construct GFF data on the fly (e.g. dynamic area/object creation and spawning).
The API also supports JSON Pointer, Diff, Patch and Merge. The SQLite API has been amended for both Campaign DB and custom databases.
Other Features
- Added more GUI events, some suppressible, when the player interacts.
- Added device property queries to get player screen width height and scale.
- Added VM commands to query the game resource manager.
- PLT textures can now be phenotype-specific.
- Added a setting that allows players to control their non-PC party members in the same way as DMs do (drag, ctrl+click, etc). This is off by default, and can be enabled in server settings.
- Mac: Provided universal binary with a build for Apple M1. If you are on M1 and on Steam, you will have to launch the game directly, NOT via Steam, for the binary to run natively. Otherwise, it will run via Rosetta.
- Mac only: GOG Galaxy SDK no longer supported on x64 and arm64 (no native M1 build for the library).
- Mac only: Steam SDK/Workshop not supported on M1 (no native M1 build for the binary).
- Toolset: Added support for custom caster classes.
- Curated Content UI: Added support for promotion panels to show links to the Vault, Wikis, etc.
Smaller Changes
- Script compiler now supports `\xFF` style escape sequences to put arbitrary bytes into a string literal. NB: \x00 will terminate the string, do not use.
- Cleaned up ovr/, moved everything except scripts into keybif.
- Debug UI: You can now use the RunScript/Chunk Debug UI in SP even when DebugMode is off (for testing convenience).
- VM: Store/RetrieveCampaignObject, SqlBindObject, SqlGetObject, ObjectToJson, and JsonToObject now support an additional parameter; bSave/LoadObjectState; which handles local variables, effects, action queue and transition info (for doors and triggers).
- Updated game credits for 2021, moved button out of OC Campaign to top level Movie menu.
Fixes
- Game: Fixed savegames causing creatures in areas re-triggering the OnAreaEnter event. This was causing HotU chapter 3 to malfunction after saving and loading.
- Game: Fixed a rare crash when doors were melee-attacked by a null creature (PW-specific crash).
- Game: Fixed not storing fog clipping distance for areas when saving games.
- Game: Fixed a crash when showing a polymorphed creature on the party bar.
- Game: Fixed Steam Workshop modules not showing up if the .mod extension wasn’t all lowercase.
- Toolset: Fixed inconsistencies with shadow rendering.
- Toolset: Fixed second story tile fade in “Always” mode not working correctly.
- Toolset: Areas are now considered modified when undo stack is changed
- Toolset: Undo now works for mouse wheel object scaling
- Toolset: Undo now works for Adjust Location dialog
- Toolset: Fixed a crash when right-clicking a tile with a recently-selected creature on it.
- Toolset: Fixed Replace All not working in backwards search mode.
- VM: Fixed crash in CreateArea() due to heap-use-after-free
- VM: Fixed a crash when SetResourceOverride was targeting a missing/invalid resource.
- VM: Fixed a memleak every time CopyObject, CreateObject or CreateArea was called.
- VM: Area serialisation: Do not save item state twice to GFF (this would needlessly duplicate temporary effects and local vars into savegames and serialised objects).
- Framelimiter: Opening up the radial menu is no longer considered background/modal.
- Nui: Fixed nuklear receiving input meant for the console.
- Nui: Fixed nuklear eating mouse clicks that should go to the radial menu instead.
Tyrants of the Moonsea
- Prevented use of the map inside the navigation cabin after traveling to a destination.
- Covered some poor camera rotations when transitioning out of the sea map.
- Removed an xp exploit in Ulblyn's conversation.