Worklog: Boulderdash

Started by Xerra, May 29, 2020, 00:27:00

Previous topic - Next topic

Xerra

After finishing Validius for the latest competition I decided not to slack off from coding for a couple of weeks, like I usually do, and jump straight into something else. I didn't want to start a new game so I went back to the first game I created on my own when I purchased Gamemaker Studio 2.

My first game technically was a conversion of Paradroid which a friend and I started to learn the system - and we even got Andrew Braybrook to give us some advice on the transfer game. We were about 80% finished on that when we decided that it was a bit too ambitious for us at the time so I decided to try and recreate Boulderdash from scratch instead.

This was around 4 years ago and I stalled on that game too as I'd approached the game creating it entirely with tiles rather than controllable objects and, as a result I could not replicate the AI of the Butterflies and Fireflies successfully. At the time of dropping it and moving onto something else I had almost the entire game in place with all the original maps and it was fully playable - with a level skipper to bypass the maps where you needed the enemies to work so you could kill them to progress. The only parts I had left to do was the enemy AI, magic walls and the expanding amoeba which is present on a couple of the levels.

I've left this almost-finished game alone for all this time because it seemed like a chore to start again as my coding style has changed since creating the game and I knew in my head just what I would need to do to actually finish it now.

So, to keep it in simple terms, the game worked by scanning each tile on the current map every frame and processing based on the tiles around it. So a rock is found at one location so the script would check underneath it for a space and, if so, move it down. It then moves on to the next tile and checks the conditions for that as well. The player himself was also a tile but processed from a separate script that let you move it around the standard directions. It was easy enough to implement the digging function where you press fire to dig out dirt around you rather than move into the area and also collect diamonds instead of running over them, as it just involved clearing tiles.

The whole simplicity of this system meant that scanning every tile from top left to bottom right was more than fast enough to make it a playable game. In fact I had to put in a speed control for levels because it made a game that could be too quick for some people otherwise.

Before starting work on getting the enemies working I went full-steam ahead and did all the normal game stuff like title screen, intermissions, transition screens, all the sound effects, adding music and so on because I was working at my own pace and felt I could do it in any order I wanted to. Bad idea, as it turned out, because I'd been arrogant enough to think that I would have no further problems finishing the actual gameplay as I'd got this far already without any major hitches. Ironically enough, I made this mistake a year or so later when I wrote Rockman, and I only got that finished and submitted 4 minutes before the competition deadline as a result.

So then it came to the bad guys and I had documentation I'd researched that showed how the enemies had moved in the original game so I could emulate that. The enemies had direction settings that the game stored so it could update them as required and would only change direction whenever it came to an obstruction. As I was using tiles there were no variables stored with each tile for me to store a direction setting so I got round this by duplicating the tile graphic four times and macro'ing the id numbers so you could see a few butterflies on screen all looking exactly the same but they could be TILE_BUTTERFLY_LEFT or TILE_BUTTERFLY_DOWN as an example.

This meant that I just had different conditional movement statements for each butterfly tile, depending on which direction it was already going, which I knew based on the tile_ID Macro. So what happened is I was reading from the top left to the bottom right of the play area which meant that they could all move left and up correctly but, because one moved right or down, it would get caught more than once in the complete tile-update sequence, so the little gits moved all the way to the next obstruction without pausing.

It's an obvious issue when I look at it now but it took me quite a while to work out what was going wrong at the time because it was my first time using tiles and I was new to GMS 2 itself. And, despite trying all sorts of systems like arrays to keep track of positions of any tiles that were enemies, and all sorts of other hacks, I eventually gave up. I meant to just leave it for a couple of weeks and come back to it later but, as always, I got involved with other stuff and the code lay in limbo for a few years.

So I've been working for the last week or so on getting this game completely reworked into objects so I can finally finish the thing.

M2 Pro Mac mini - 16GB 512 SSD
ACER Nitro 5 15.6" Gaming Laptop - Intel® Core™ i7, RTX 3050, 1 TB SSD
Vic 20 - 3.5k 1mhz 6502

Latest game - https://xerra.itch.io/Gridrunner
Blog: http://xerra.co.uk
Itch.IO: https://xerra.itch.io/


Xerra

Quote from: blinkok on May 29, 2020, 01:23:08
This webpage helped me a lot (especially for level design)
https://codeincomplete.com/articles/javascript-boulderdash/

The laval logic really did my head in

Yes, I looked at that one as well as a downloaded pdf file which explained a lot of the games processes very well. That was when I realised I'd screwed up initially by trying to do it all with  tiles. It's cool watching that video as it reminded me how the amoeba actually worked. Once they got to a point where they couldn't move into either an empty space or overwrite a dirt block then each block converts to a diamond. I think I should be able to track this by switching on a flag when the game first starts if there is an Amoeba object present and then checking each amoeba object during the step event cycle to see if there's any room around it. If so then it's a 1 in 10 chance that i'll replace either the dirt or space char with Amoeba instead.

In theory that should work ok but it'll need some testing to make sure.

One thing that's always stuck in my mind , ever since I first saw the game back in the early Eighties, is how great a game it actually is. An absolute classic on the C64, even if it was a bit hard.
M2 Pro Mac mini - 16GB 512 SSD
ACER Nitro 5 15.6" Gaming Laptop - Intel® Core™ i7, RTX 3050, 1 TB SSD
Vic 20 - 3.5k 1mhz 6502

Latest game - https://xerra.itch.io/Gridrunner
Blog: http://xerra.co.uk
Itch.IO: https://xerra.itch.io/

blinkok

#3
I'm not sure if you want go 2D or 3D but i have a lot of graphics assets for a 3D version of the game.
I never finished my version so you're welcome to use them if you want

ps: One thing i noticed was that the way the rocks fell was very important. If you look at the second level they have a very specific order of movement and if it's not right it won't unblock the path

Xerra

Quote from: blinkok on May 29, 2020, 22:43:48
I'm not sure if you want go 2D or 3D but i have a lot of graphics assets for a 3D version of the game.
I never finished my version so you're welcome to use them if you want

ps: One thing i noticed was that the way the rocks fell was very important. If you look at the second level they have a very specific order of movement and if it's not right it won't unblock the path

This was my first game with GMS2 and my plan is basically just to get it rewritten as it was meant to be, which is practically a clone of the original game. No plans for anything beyond the original scope, and certainly not 3D, as it's way beyond me at present. Thanks for the offer, though.

I don't think i'll have any issues like you describe for the second level. I got specific info on how each entity moved and coded the original scripts to replicate it. Second level works just fine based on what i'm using.
M2 Pro Mac mini - 16GB 512 SSD
ACER Nitro 5 15.6" Gaming Laptop - Intel® Core™ i7, RTX 3050, 1 TB SSD
Vic 20 - 3.5k 1mhz 6502

Latest game - https://xerra.itch.io/Gridrunner
Blog: http://xerra.co.uk
Itch.IO: https://xerra.itch.io/

blinkok


Xerra

Quote from: blinkok on May 31, 2020, 01:35:44
Awesome and Good luck!

Thank you. I'll be sticking it on my Itch.io page as soon as I'm finished.
M2 Pro Mac mini - 16GB 512 SSD
ACER Nitro 5 15.6" Gaming Laptop - Intel® Core™ i7, RTX 3050, 1 TB SSD
Vic 20 - 3.5k 1mhz 6502

Latest game - https://xerra.itch.io/Gridrunner
Blog: http://xerra.co.uk
Itch.IO: https://xerra.itch.io/

Xerra

I've been beavering away at this for the last couple of weeks and it's ended up being a much bigger job than I even realised before. A friend said I should have just started from scratch and done a total rewrite but I'm determined to get this game written properly even if I have now probably modified at least 80% of the code.

I have resisted the urge to actually change anything at all about how the game looks and plays because, let's face it, Boulderdash is one the best games ever created. And I want the game to still remind me that it was my first solo project with GMS2 whenever I load it up again in future.

I finally have the enemies in and working correctly and fixed god only knows how many issues the original code had in it. How it played and looked like a mostly finished game in the first place I'll never understand. It's a much neater project now which makes my OCD very happy.

With the fixing of the enemies and most of the tidying up completed I really only have a few simple bits like credits, transitions into a map and finishing work on the Amoeba and magic walls for the game to be done. What I really could use would be some serious testing and feedback before I do throw it out to the world. Ideally a Mac user for now just so I don't have to play around doing multiple windows builds as I fix stuff but I'll take what I can get :)

When I do put the finished game up on Itch then I will have builds for Windows and OSX though - just like my other games.

Anyone interested in revisiting an old classic game and letting me know what they think? I'll also credit you in the game if you like.
M2 Pro Mac mini - 16GB 512 SSD
ACER Nitro 5 15.6" Gaming Laptop - Intel® Core™ i7, RTX 3050, 1 TB SSD
Vic 20 - 3.5k 1mhz 6502

Latest game - https://xerra.itch.io/Gridrunner
Blog: http://xerra.co.uk
Itch.IO: https://xerra.itch.io/

hosch

Quote from: blinkok on May 29, 2020, 22:43:48
I'm not sure if you want go 2D or 3D but i have a lot of graphics assets for a 3D version of the game.
I never finished my version so you're welcome to use them if you want

ps: One thing i noticed was that the way the rocks fell was very important. If you look at the second level they have a very specific order of movement and if it's not right it won't unblock the path

Wow, would love to see those assets! Did you want to make 2D in 3D or did you plan to take the Boulderdash formula and apply it to a 3D game?

hosch

Quote from: Xerra on June 12, 2020, 23:22:01
Anyone interested in revisiting an old classic game and letting me know what they think? I'll also credit you in the game if you like.

Will defnitly check it out! I have the game on my C64, but never progressed far  :))

Xerra

Quote from: hosch on June 13, 2020, 13:16:56
Quote from: Xerra on June 12, 2020, 23:22:01
Anyone interested in revisiting an old classic game and letting me know what they think? I'll also credit you in the game if you like.

Will defnitly check it out! I have the game on my C64, but never progressed far  :))

You're welcome to have a look at it as soon as you want. I'll create a private itch.io page for it later on so it's downloadable.

M2 Pro Mac mini - 16GB 512 SSD
ACER Nitro 5 15.6" Gaming Laptop - Intel® Core™ i7, RTX 3050, 1 TB SSD
Vic 20 - 3.5k 1mhz 6502

Latest game - https://xerra.itch.io/Gridrunner
Blog: http://xerra.co.uk
Itch.IO: https://xerra.itch.io/

Xerra

M2 Pro Mac mini - 16GB 512 SSD
ACER Nitro 5 15.6" Gaming Laptop - Intel® Core™ i7, RTX 3050, 1 TB SSD
Vic 20 - 3.5k 1mhz 6502

Latest game - https://xerra.itch.io/Gridrunner
Blog: http://xerra.co.uk
Itch.IO: https://xerra.itch.io/

iWasAdam

on mac - app is damaged and cant be run :(

Xerra

Quote from: iWasAdam on June 14, 2020, 05:44:45
on mac - app is damaged and cant be run :(

Just unzip then drag it into a new folder. That usually works.
M2 Pro Mac mini - 16GB 512 SSD
ACER Nitro 5 15.6" Gaming Laptop - Intel® Core™ i7, RTX 3050, 1 TB SSD
Vic 20 - 3.5k 1mhz 6502

Latest game - https://xerra.itch.io/Gridrunner
Blog: http://xerra.co.uk
Itch.IO: https://xerra.itch.io/

Steve Elliott

Cool, I'll try this tomorrow.
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb