Posted December 06, 2019 by Yal
YaruFPS is one of my oldest projects, and I was on the verge of forgetting it existed when I in quick succession ran into a bug report and a ´work-in-progress Doom WAD loader for GMS2. So I figured it was time to brush off some of the worst dust and make sure YaruFPS is still working in modern versions of Game Maker!
If you already own the project, the updated source files should be available free of charge!
If you're working on a project (which is currently working as expected without technical issues) in YaruFPS and wonder how to integrate the new features... you don't really need to, actually, since this update basically is a port of the outdated files to a newer version, both GMS1-side and GMS2-side. You might wanna import the source file to a blank project so you can access the new music and sound effects, but there's no major code changes.
But if you do have issues, then? I'll cover the issue-fixing code changes here. These were all relatively small fixes that can be applied by hand: the hard part was finding the root causes.
If you get an error about missing arguments in some functions: add dummy variables so that every argument is referenced. GameMaker will warn that the variables' values aren't used, but this can be safely ignored. (The reason this issue arises is because for some shapes, we have the same collision data for every coordinate and just ignore the coordinate arguments entirely, so we ignore them by design - they still need to be there to make the collision function have the expected argument footprint)
If you imported a GMS1 version of a YaruFPS project into GMS2, the game ran without issues, but the terrain got inexplicably messed up so you couldn't keep working on the project, here's how to work around the bug. The root cause seems to be background-layer size being unreadable, resulting in the maps loading incorrectly (since the "grid" background was used to figure out the size of layers).
First, change terrain_flat_to_3d to use a global variable instead of reading background width:
Second, add the variable to every room, setting it to a value corresponding to the layer-chunk width used in the room:
(e.g. if using back_grid_640, you should set it to 640 for that room. In this room, the back_grid_2560 was used, so we set the width to 2560.)