GameMaker:Studio 2 support update!
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!
Changes
- Imported the source in Studio 2 and got it running! It's held together by duct tape and toothpicks (that is to say, the compatibility functions), but it's running surprisingly well considering it's mostly unchanged GM8 code that's been ported to modern versions of the IDE twice.
- The GMS2 source was tested and generated using IDE v.2.2.3.436, runtime v.2.2.3.344. Please let me know if there's any problems importing it in GMS2.
- If you want to port an existing project to GMS2, the biggest difference is that the terrain_flat_to_3d() script can't read the background width properly in Room Creation Code in GMS2, messing up the layers when building the 3D world.
- I solved this by adding a global variable and using that for the chunk width instead, setting it to the correct size manually in each room.
- I also added a stability check to the script to not change any coordinates if global.terrain_compressed is already set.
- Fixed the "unused arguments" bug in some collision checking scripts that several people have reported. This bug was caused by changes in the argument handling between different versions of GameMaker:Studio. Since the different scripts need to have the same generic argument footprint to be usable by the collision checking system, I solved this by adding dummy variables that uses the values of the arguments.
- Replaced most of the sound effects with more fitting samples. The unusable MIDI files have been replaced with MP3 / OGG renderings of the respective songs, too.
- Improved the debug text in the HUD a bit to show you how to play the game. Mostly useful in the demo.
If you already own the project, the updated source files should be available free of charge!
How to Apply to Existing Project
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.)
Files
Get YaruFPS Basic FPS Engine
YaruFPS Basic FPS Engine
A FPS engine with 3D collision checking and seamless room linking!
Status | Released |
Category | Assets |
Author | Yal |
Tags | 3D Platformer, engine, First-Person, FPS |
More posts
- Source code GMS2.3: small bugfixSep 17, 2021
Leave a comment
Log in with itch.io to leave a comment.