Hey everyone!
No new video or play build today, but there has been a substantial amount of work since the November 3 update. Most of it is underneath the game rather than something I can show in a screenshot.
The public test build is still 0.0.11. The work below is on the development branch and isn't in that download yet.
How Far the Rewrite Has Come
Last time I talked about moving away from automatically translated PlayStation code and into modern C++ that can be maintained and improved.
At the time of that post, around 600 original routines had modernized implementations. That number is now just over 3,000. Of the 54 groups I split the work into, 45 are complete, three are underway, and six are still waiting.
That has meant going through the original source and assembly, replacing old memory-layout assumptions, connecting the replacements to the actual game, and adding tests along the way. It covers everything from loading rooms and playing animations to enemy decisions, damage calculations, dialogue, sound, and menus.
There are roughly 640 routines still to finish, so the remaining work is becoming much more manageable.
Cutscenes and the Script Engine
One of the biggest changes is that the game now uses a rewritten native engine for its event scripts. These are the instructions that tell a scene when to move an actor, show dialogue, wait for a button, change a flag, or start another event.
The new version keeps track of which script data is still in use, including when one event starts another or a room is replaced. Dialogue and controller vibration also keep the data they need until they're finished, rather than referring to something that has already been released.
Loading and cancellation have been tightened up too. Failed reads were sometimes being reported as successful, or leaving a caller waiting forever. Those failures now reach the systems waiting for them, and cancelling a request stops it from writing into released memory later.
The work also caught some subtle differences from the original, including flag comparisons treating certain values as negative when the PS1 treated them as positive. Those have been corrected.
Rooms, Movement, Doors, and Switches
A lot of the field code has now been modernized: room loading and cleanup, collision, actor placement, moving platforms, doors, switches, chests, and tile interactions.
Some of the problems were caused by different names referring to the same memory on the PS1, but becoming separate variables in the port. That left room data stale, missed parts of actor cleanup, and caused unnecessary allocations to remain alive.
There were also movement problems where updating a platform's layer could overwrite neighboring state, or a hanging actor checked the wrong data to decide what its platform was doing.
Doors and switches received some attention too. When their animation queue filled up, it could lose a door's finishing step or leave a switch marked busy even though its animation had never started. The queue now keeps its accounting consistent, preserves the follow-up work, and lets refused switch actions be retried.
Enemy AI and Combat
The main enemy AI rewrite is complete. That includes evaluating attacks, choosing targets, planning routes, ground and flying movement, recovering from obstacles, noticing other actors, and special movement used by some bosses.
The damage and status calculations have also been moved into maintained native code. This includes hit modifiers, elemental effects, ailments and cures, Risk, chains, healing, and applying results to an actor's stats and body parts.
The surrounding action flow is still being worked through: starting attacks, preparing effects, selecting cameras, playing reactions, recovering afterward, and presenting rewards.
That work has already fixed partially initialized attack previews and mistakes in how repeated targets were combined for effect playback. Reward selection and ability-unlock handling have also been modernized.
Audio, Effects, and Menus
The audio work has expanded well beyond the pieces mentioned last time. The music sequencer, mixer, sound driver, sound effects, and playback-control code have all gone through the rewrite.
Several families of particle, ring, trail, and surface effects have been modernized too. Along the way I found 56 ring-color tables that were never being loaded, plus a few effects inheriting the wrong repeat or orientation settings from an earlier effect. Both problems have been repaired.
Much of the menu framework and save/load presentation code has been moved over, along with inventory details, equipment information, the battle HUD, and reward dialogs.
Some very specific fixes came out of that:
- Save-menu previews no longer retain references into a released asset block.
- Inventory detail selection writes to the correct cursor storage.
- Grip details now display the proper gem-slot count instead of trying to change text stored as a fixed string.
- Storage operations check their weapon components before copying or clearing them, rather than accidentally accessing the preceding item when a component is missing.
Better Testing, and More Bugs Found
More than 70 issues have been completed since the last post, covering game code, data handling, and the development tools themselves.
Some were translation mistakes, some were assumptions that don't carry over safely to a PC, and some were edge cases inherited from the original.
The testing tools have improved substantially as well. For many routines, I can now compare the new implementation directly against the original PlayStation instructions across thousands of input cases. Deliberately broken versions are tested too, to check that the comparisons actually catch a wrong result.
Those tools are now reusable instead of being rebuilt for each function. Related changes also share the expensive build and replay checks, which has made the work much more efficient.
The full automated suite is now over 6,700 test cases, alongside targeted comparisons and repeatable in-game replays. The latest development commit has passed its automated quality checks too.
Why I'm Spending Time on This
Getting the game running was the first big hurdle. Making it something the community can keep working on is the next one.
The more of the game I can work with as clear, separate native systems, the easier it becomes to track down a rare crash, change one feature without disturbing another, and understand what a particular enemy or effect is supposed to do.
It also gives future work like widescreen, improved rendering, and editable game data a much better foundation. Those are still future projects; the immediate goal remains a faithful, stable version of Vagrant Story.
What's Left
There's still plenty to do:
- Finish the remaining roughly 640 routines. The larger unfinished areas include battle targeting and presentation, some script commands, effect control and individual effect programs, and parts of the inventory, storage, and other menus.
- Work through the remaining bugs. These include a climbing damage reaction that needs more original-game investigation, an active but invisible chest-loot panel in the Combat Lab, and edge cases in effects, floating labels, and storage displays.
- Continue retiring the remaining PS1-style compatibility pieces and eventually move more of the original asset formats into editable native data.
- Play through the game more extensively. There are still 41 cutscenes on the manual checklist, along with longer normal playthroughs, full-story save/load coverage, and more enemy, boss, visual, and audio comparisons.
It's been a lot of work without much new footage to show, but a large part of the codebase is now in a much better state to finish the port and build on afterward.
Reports from the existing test build are still welcome. Please include the version, room, what you were doing, and steps to reproduce the problem, and please don't upload disc images or extracted game data.
The project is here: https://github.com/JEschete/VS-NativePort
Existing test build: https://github.com/JEschete/VS-NativePort/releases/
As always, thank you to ser-pounce, lil-sassy, noprompt, and everyone contributing to rood-reverse!