Saturday, April 14, 2018

Working my way through Dark Side

I've spent the last week with an in progress working my way through Dark Side of Xeen. As of last night, I've mapped out the bulk of the southern side of the map up to the mountains, released the first stage of Queen Kallindra's castle, finished the Temple of Bark, and am just winding up clearing Sandcaster and it's sewers of enemies. I've identified and fixed multiple problems as I went, and not all of them were specific to Dark Side.

For example, one bug I'd been meaning to fix for a while was finally resolved - when monsters were triggered to hate & attack the entire party at the same time, they were originally only ever attacking the first party member. This made the Dragon Caves on the Clouds side *so* much easier.. all the dragons would wail away on my first character, even after he was dead, leaving the rest of my party to kill them at their leisure. By the time I left the dragon caves, my first party member was below -5000HP :) Another, ironically, coincidental script problem meant the dragon containers didn't tax me when I walked past them, so I didn't even have to worry about losing gold and gems.

I also fixed some bugs in the sound system that could cause crashes when multiple sound effects were played in rapid succession, and a bug in the combat system that could case a crash when recalculating the order that characters and monsters fight in based on their speed. The later I'm particularly hoping will help resolve the outstanding rare crashes I was previously getting with extended combat. It may be naive.. I'll have to wait and see whether any further crashes occur.

So yeh, things are progressing, and the engine is getting more and more stable; I'll keep working my way through the game. I've got a long weekend coming up tomorrow, but honestly, I'm not sure how much time over the weekend I'll end up playing the game. I think I'll keep the bulk of it for some R&R and doing other things. We'll see how it goes.

Tuesday, April 10, 2018

Clouds of Xeen is now completable

Good news on the progress of the Xeen engine in ScummVM. As of the weekend, I finally finished my first playthrough of Clouds of Xeen! I finally got to give smackdown on Lord Xeen, and watch the ending cutscene. Which I've admittedly previously seen multiple times when I was first implementing the code, but there was the emotional satisfaction of seeing it properly, rather than just using the mirror cheats. Though I will confess that I got so overeager to finally finish the game, that I lacked the patience to do it properly (with well/fountain stat raises), and instead used my debugger cheats instead. But it doesn't take away from the fact that the first game is confirmed as completable. \o/

Now, it's onto Dark Side. There were actually more bugs due to changes done for Dark Side (code I'd implemented but not yet tested) than I anticipated. I already fixed multiple different bugs on the weekend that were causing hangs and crashes. Currently I'm looking into a somewhat complicated problem with how wall decorations are handled.. it causes a crash that makes Ellinger's Tower impossible to complete. So Dark Side definitely isn't completable, and needs further testing. On the plus side, though, it shouldn't take as long to test and finish Dark Side than my Clouds testing took, since Dark Side benefits from all the fixes I've already done for Clouds.

At this rate, my initial play through & tests of both Dark Side and Swords should be done within the next month, and  the game will likely be stable enough for a public testing period. Not long now :)



Tuesday, April 3, 2018

Work on Xeen is up in the air

As tempting as it would be to write this post yesterday on April Fools, I've left it to today to make a status update on my playthrough through Xeen. Work has been proceeding well. I've fixed lots of bugs that were identified by both myself and Dark-Star, who's been assisting me with preliminary testing. As of yesterday, I've:
- Finished the Dwarf Mines
- Mostly finished Rivercity (except for the Knights behind the training area)
- Completed the Witch Tower. Hence the post title.. the levitate spell works, and I've been walking around on the clouds :)

Many of the bugs were crashes and hangs, so it highlights that the game still isn't ready for general public testing. The Witch Tower, for example, required two fixes to get it to work.. one where I wasn't setting whether the party had the key (so it was never letting you in), and one where I incorrectly implemented the "return from subroutine" script opcode, so trying to go back into the Witch Tower from the stairs in the Witch Tower clouds hung the game. Ironic that both ways into the tower were glitched. :)

I think combat is also more settled now. Previously, there were various crashes, and none of the combat spells worked. Now, though, I'm able to properly cast them, so the monsters around Rivercity are much more manageable to defeat. Though I did still experience a problem once where the party wasn't immediately registered as dead after all being killed, so obviously still needs a bit of polishing to fix such remaining issues. Speaking of spells, I decided it was acceptable, given the circumstances, to cheat to give myself extra funds to purchases all the spells for each character. There was little point in delaying matters, trying to accumulate wealth. It also meant I was able to buy pathfinding and mountaineering skills for my party so I wouldn't be constrained where I could travel. It already proved useful, as I was able to identify and fix several bugs with the close-up rendering of forests, where they weren't properly being scaled, and were drawing outside of the scene area.

From here, I'll keep on working my way through the game, fixing bugs as I go. Given I'm already significantly into the game (at least for Clouds), I don't anticipate there'll be any major impediments to my progress. Apart from tracking down remaining issues with combat, hopefully the rest of the game will just be fixing minor problems, like that which prevented me from entering the Witch Tower.



Saturday, March 24, 2018

Xeen playthrough in progress

The Xeen playthrough is finally in progress, having been restarted last night. And by the time I went to work this morning, the first town of Clouds, Vertigo, was completable. Huzzah. \o/. I did identify and fix some further problems, such as armor not equipping, reading the note in the Vertigo warehouse, and getting the experience from the mayor. Next stop will be the Dwarf Mines, which I don't anticipate having much, if any, problems. Particularly since I've done some previous testing in them, though I've not yet been beyond the first level.

This is a good omen for completing the rest of the game. Particularly given the amount of care I've already given to fixing bugs I'd introduced in my reimplementation of the combat system. And the fact that all the various towns share the same code base for implementing the different tavern, guild, etc. locations. I'm expecting/hoping that the rest of the game will be straightforward. Indeed, most of the fixes I did last night were fairly straightforward to fix once I'd identified the bugs in question.

Of course, it's been years since I played the game, and honestly I only really remember some of the highlights of the Dark Side. So this playthrough will be a chance to re-experience the games once again. And my unfamiliarity will ensure I go poking into every nook and cranny. Though the downside is that I may not notice minor things not working, such as searching specific locations not giving the expected items, monsters, or loot. Once I've finished my first playthrough, hopefully some more experienced Xeen players can be enticed to play through the game as well.

Well, better get back to work. It may be Friday, but I still have the entirety of the work day to get through before I can get back to my playtesting :)

Thursday, March 22, 2018

Xeen there, done that

After all the time spent both in development, and in hiatus, work on the Xeen engine nears it's completion. Last weekend, I finally considered the engine finally stable enough to start my first playthrough of the game. Though, unfortunately, that idea rapidly crashed and burned.. I immediately discovered a variety of bugs in my exploration of Vertigo that my previous casual testing hadn't revealed, particularly with the Guild display and purchase of spells.

Thankfully, I fixed all those, and over the course of the week so far I've also since discovered further minor issues that I've also been fixing as I identify them. As of today, I'm once again at a point where I'm not aware of any other bugs, so I'm once again going to restart my playthrough and start playing my way through the game. As last weekend showed, it's better for me to finish my own playthrough first before I announce official testing, since it will be a chance to fix all of the more obvious errors that crop up, and ensure anyone else that tests the game will have a smoother, more enjoyable experience. And speaking of testing, some good news.. rather than concentrating on just getting World of Xeen working, I've also implemented the necessary extra functionality and main menus for Clouds and Dark Side individually, as well as for Swords of Xeen. That means three separate games as well as the combined World will be playable using this new engine.

Recent discussions on the GOG forums have also got me to thinking about what the future could hold for this engine. Whilst I'm definitely going to move onto working on other games after this, and likely take a break to play some games, there are some fertile areas someone with a knowledge of C++ could work on and submit patches to the ScummVM group for. First of all, this GOG thread talks about "Ludmeister's mod". It seems to have been abandoned by the author without ever having an official release. But it did have a description of all the changes it introduced. Since ScummVM also allows for game-specific options in the launcher dialog, someone could add checkboxes for enabling/disabling the functionality and add relevant code to the engine to implement them. Some of the mod's changes sounded nice, particularly regarding the passage of time.

Another thing I'd love to see is for this to revive some interest in creating new areas and/or content. Not to spoil things too much, but I couldn't resist adding some new content of my own. I'll leave it up to players to see if they can discover it. If we're lucky, maybe it will help spur others to create further new content for the game. After all, Swords of Xeen was original a mod done by fans. With the engine source code as a guide, maybe someone can cannibalize the scene rendering code and build a visual world editing tool around it.

Thursday, January 11, 2018

Christmas holiday round-up

Over the course of the Christmas holidays, I took the opportunity to take a break from working on completing the Might & Magic Xeen engine to do some further work reverse engineering and implementing code for my Legend Entertainment games engine in ScummVM. The result can be seen in a demonstration video on Youtube.


For now, I've been focusing on disassembling two of the Legend Entertainment games, Frederick Pohl's Gateway, and Companions of Xanth. The former is one of the earlier games with a combined picture and text parser, whilst the latter is the more standard point-and-click type of adventure game. Both share a lot of code in common; though as I've discussed previously in details, the two have some key differences.. Xanth is a full 8-bit point-and click game, but it uses a very annoying overlay manager that makes dissasembling and debugging the code really trouble. Gateway, being an earlier EGA game, is much easier to do.

Over the week I spent on the games, and my engine, there were two main advances. Firstly, I increased my understanding of how the original did the core event handling and renderings. Renderings in particular were somewhat messy, with different parts of UI elements being drawn in different methods; some when the game window is first opened, and others as event changes occur. Using the listbox in particular as an example, I tracked down where the different parts were being drawn and cleanly re-implemented them together into their own draw method of a Listbox class.

Likewise, the Commset also proved useful in being a separate custom screen which nevertheless used many of the core engine's methods for creating windows, defining interactable regions of the screen, drawing, and event processing. I was almost to the point of implementing the initial text display within the Commset when the week ended.

The second major area was fleshing out my engine's event handling. As can be seen from the example video, game views can now be rendered, and the listbox interacted with. This represents a lot of modular code in my engine taking care of managing what the current view is, as well as gathering mouse events and dispatching them into a hierarchy of parent/child game views that can represent the game screen, and then individual elements within it like the Listbox. A lot of this draws inspiration from the Titanic engine, which heavily uses a hierarchy of game views, as well as message handling for passing messages between elements.

The result is that I'll be able to avoid, for example, a lot of hardcoding the original has for handling the two different listboxes. Instead, I can set up the listbox to generate a message when an item is clicked, and then have processing code in a parent "User Interface" class for the overall game screen that will handle replacing the listbox contents as necessary, as well as passing on selected words and/or phrases to the text entry widget where the player inputs their commands.

All this is to keep hardcoding to a minimum, particularly once I've got a better feel for the engine, and start working on Companions of Xanth in greater detail. The idea is to eventually make it easy to support other games, like Death Gate\, so the less hard-coding there is for specific games the better. This current design allows for a modular build up of game content, with an overall "project item" that contains the different views like the game interface, conversations, and so on. And visual elements like the game interface can be further build up of individual UI components like the game scene, inventory, command buttons, and so on. Much of which will be able to be cleanly re-used between the games.

Anyway, now that the holidays are over, I've returned to work on the Might & Magic Worlds of Xeen engine. I'm wary of calling it "nearly completed", but it certainly has a lot of functionality in it already. So it deserves to be finished, fun as continuing to work on the Legend games might be.

Once that's done, though, who knows when I'll next return to work on the Legend games. I may well do it directly after. Although, the recent discussions of AGS have also piqued my interest as well. Depending on whether or not anyone else has taken up the reins of working on it to any degree, I may refocus my effort onto it. And of course, there are the later MADS games like Return of the Phantom & Dragonsphere that could be worked on. Not to mention the Access engine, with Martian Memorandum. Plus various different other RPGs. It's always nice to have options :)

DreamMaster.



Monday, December 18, 2017

It has to be Xeen to be believed

Hi everyone,

Been a while since my last blog posting, despite regular protestations that I'd be posting more frequently. My bad. At least my development work has been proceeding with it's usual speed in the interim. The just released ScummVM 2.0 spurred me to write a blog posting.

So what's been happening? First of all, as most will know, I finished work on Starship Titanic. So with the new release, both the English and German versions of the game are now officially supported. I've been informed that there's also a French version, but it isn't available commercially (GOG only has the English and German versions). Given that, for now I'm unwilling to spend the multiple weeks worth of effort to add support for it. Maybe if GOG adds it in sometime in the future, support for it can be revisited.


Next, let's move onto what I'm currently working on, now that Titanic is done.. World of Xeen. Support for the game has already improved enormously over the last few weeks. You can walk around the starting town, fight monsters, then leave the town and wander around the outdoors. Even go to the Dwarf Mine and listen to the dwarf's cheesy intro. Not all maps are working yet, but at least it's getting there.



Still lots of other UI bugs to be looked into. I spent much of the past week cramming to implement all the various in-game cutscenes without testing them yet, so there's bound to be problems. The intro/endgame cutscenes for the games are also still only partly implemented. I'll also likely need to do further work on the savegame code, so the engine definitely isn't ready for any serious playing yet.

Anyway, with Christmas holidays coming up, I'll likely take a brief break for a few weeks from my resumed work on Xeen. Much of the work for reversing the game had already been previously done by the excellent work of WizardStan, and then further by myself. As such, a lot of the time I've spent simply implementing remaining missing code in ScummVM and lots of debugging. Since I've already spent so much time in debugging Starship Titanic code to get it working, I'm looking for a more relaxed, cerebral exercise of reverse engineering something fresh over the holidays.

I'll probably return to my preliminary work on the Legend entertainment games, Companions of Xanth and Gateway. Both share a lot of common engine though Xanth, the more recent, has a horrible overlay manager that makes it a pain to debug. As such, I've found working on the earlier game makes things easier to understand in many places. Though since the game uses EGA graphics, understanding how things are being written to the screen does get problematic in places. So a balanced effort reversing both at the same time is called for. An excellent mental challenge.

Everyone have a Happy Holidays/Year end/Christmas or whatever, as 2017 comes to a close. :)