GSOC: Concluding Remarks

The final evaluation round for GSoC 2019 has ended, and I would like to this moment to summarize the work that I have done for the past 3 months. In case you just want to look at the code, here is the PR link.

Hyperspace Delivery Boy

My project revolved around building a game engine for the Monkeystone game Hyperspace Delivery Boy. The project description for the same can be found here.

My early work on the project feels so long ago that is quite difficult to remember the exact steps I took, and the problems I faced through them. Thankfully, some of the more difficult ones are mentioned in this blog. To summarize, my work included building core systems such as AI, LuaScript, Map, Sound and much more that mimicked the interface and functionality of the original HDB source code.

Once the core functionalities were added, I used them to link the Lua scripts to the engine and define the in-game logic that was present in the engine. This included things such as enemy movement, hit detection, dialog rendering, map-loading, the save system and much more.

I took a STUB-oriented way towards the project, upon Eugene’s suggestion. Whenever I needed some functionality that didn’t exist yet, I would create a warning for it and come back to it later. It made the process of navigating and translating a large codebase much more linear, and simple to understand.

Changes Since Last Time

In my last update, I mentioned that a few bugs remained in the PPC version, which made it unplayable. Those problems have been rooted out, and the game can be completed with the PPC data files as well. In fact, from the playtesting that I have conducted so far, I can say that the game should be completable for all available platforms – Windows, Linux and PocketPC.

What’s next?

For now, I would like to work towards getting the project properly merged into the main ScummVM repo. There is also a scaling bug in the PPC version that still exists. It is far from game-breaking (in fact, some might say it makes the game easier) but I would like to rectify it in order to stay true to the original.

Once again, I would like to thank Eugene(sev) and Arnaud(strangerke) for their help and support throughout this project. I wouldn’t have made it even half the way here without their help.

GSOC Update: Week 12

This is the last week of the GSoC program, and the PPC rendering problem has been fixed. I have created a PR for the HDB engine, and I’ll spend this week preparing Work Product Submission and fixing existing bugs.

The PR moving the Lua code to Common was also merged this week.

Current Problems

There are a few bugs left in the PPC version, and the Linux and PPC demos are crashing for one reason or another. For the Linux demo, I’m aware that the problem lies with the Sound data. When it is processing the Vorbis stream data, it crashes in the refill function. I’ll look there for the reason of the crash

Accomplishments

  1. Fixed rendering issues with the PPC version
  2. Added mouse cursor for PPC version
  3. Fixed double click for PPC
  4. Finished lua-merge PR
  5. Fixed PPC updateFade function
  6. Fixed PPC Deliveries screen

Thanks to Eugene(sev) for help with the rendering code, updating the save system for PPC among other things and thanks to Arnaud(Strangerke) for help cleaning up the codebase.

Objectives

  1. Complete level testing
  2. Ensure PPC and Linux demos are working
  3. Fix remaining bugs in PPC version

GSOC Update: Week 11

I have only a few weeks left until I have to make my Work Product Submission, and most of the larger problems have been dealt with. I have added support for the PPC version of HDB, so that should be playable.

Current Problems

There are a number of rendering bugs in the current PPC code. From pictures that are inverted, to font that is rendered as gibberish. Aside from that, I have found a few bugs in the codebase. They weren’t a problem in the Windows version, but seem to crash the game now. These issues need to be fixed before support for the PPC version can be considered final.

Another issue is that the PPC version is supposed to played with a stylus. As such, it does not have a cursor graphic. This is a problem since the game needs to be played on platforms that do not have a stylus.

Accomplishments

  1. Added support for Linux version
  2. Sectioned off Windows/Linux specific code
  3. Added PPC-specific Delivery/Inventory code
  4. Fixed PPC crashes
  5. Fixed Player Input in PPC version

Thanks to sev(Eugene) for help with the PPC crashes, the Fade-In problem and thanks to Arnaud(Strangerke) for help with simplifying the codebase.

Objectives

  1. Fix rendering issues with the PPC version
  2. Add mouse cursor for PPC version
  3. Ensure that Linux and PPC demos are working properly
  4. Complete level testing

GSOC Update: Week 10

My university has finally openned for a new term, so it has been a hective schedule. Nevertheless, I have managed to get in a decent amount of work this week.

Current Problems

The current build for the PPC version is crashing and I suspect it is crashing because of the Windows-only code that is executed by default. Hence, my immediate objective is to section off the Windows-only code. If that still doesn’t work, I suppose I’ll have to find the cause of the crash through the debugger.

A few levels remain to playtest. The problem isn’t that they’re bugging, but that I haven’t figured out yet how to beat them! A number of the puzzles near the end of the game are greatly challenging.

Accomplishments

  1. Fixed the AudioStream Bug
  2. Added support to FileMan for reading MSD files
  3. Added support for compressed game files
  4. Sectioned-off PPC-exclusive code
  5. Converted Platform-specific Constants from enums into variables

In my previous post, I had described a bug with the AudioStream code. The AudioStream was getting deallocated after playing, regardless of whether I created the stream with DisposeAfterUse::YES or DisposeAfterUse::NO. The problem was deceptively simple. The playStream() function has a DisposeAfterUse condition of its own for some reason, which is independent of the DisposeAfterUse condition of the stream that is being played. Moreover, it is set to DisposeAfterUse::YES as a default parameter, so if you’re not paying attention to those, you could end up using it by accident.

This is what I was doing wrong. The deletion was carried out through a callback (an SDL callback in my case) which made it difficult to find when debugging the Main Thread with the debugger. Setting DisposeAfterUse to NO in the playStream function fixed the problem.

Thanks to Eugene(sev) for help with the Windows Demo, adding the Platform code for PPC and improving the rendering pipeline and fade-in code.

Objectives

  1. Complete adding support for the PPC version
  2. Implement syncSoundSettings
  3. Add support for the Linux versions
  4. Ensure that the PPC and Linux demos are working