September 29, 2020, 04:14:59 PM

Author Topic: Worklog: Boulderdash  (Read 717 times)

Offline Xerra

  • Hero Member
  • *****
  • Posts: 1098
    • Retro Evolved
Worklog: Boulderdash
« on: May 29, 2020, 12:27:00 AM »
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.


Offline blinkok

  • Full Member
  • ***
  • Posts: 244
Re: Worklog: Boulderdash
« Reply #1 on: May 29, 2020, 01:23:08 AM »

Offline Xerra

  • Hero Member
  • *****
  • Posts: 1098
    • Retro Evolved
Re: Worklog: Boulderdash
« Reply #2 on: May 29, 2020, 06:12:23 PM »
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.

Offline blinkok

  • Full Member
  • ***
  • Posts: 244
Re: Worklog: Boulderdash
« Reply #3 on: May 29, 2020, 10:43:48 PM »
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

Offline Xerra

  • Hero Member
  • *****
  • Posts: 1098
    • Retro Evolved
Re: Worklog: Boulderdash
« Reply #4 on: May 30, 2020, 04:08:48 PM »
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.

Offline blinkok

  • Full Member
  • ***
  • Posts: 244
Re: Worklog: Boulderdash
« Reply #5 on: May 31, 2020, 01:35:44 AM »
Awesome and Good luck!

Offline Xerra

  • Hero Member
  • *****
  • Posts: 1098
    • Retro Evolved
Re: Worklog: Boulderdash
« Reply #6 on: May 31, 2020, 06:36:02 AM »
Awesome and Good luck!

Thank you. I'll be sticking it on my Itch.io page as soon as I'm finished.

Offline Xerra

  • Hero Member
  • *****
  • Posts: 1098
    • Retro Evolved
Re: Worklog: Boulderdash
« Reply #7 on: June 12, 2020, 11:22:01 PM »
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.

Offline hosch

  • Jr. Member
  • **
  • Posts: 83
Re: Worklog: Boulderdash
« Reply #8 on: June 13, 2020, 01:16:12 PM »
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?

Offline hosch

  • Jr. Member
  • **
  • Posts: 83
Re: Worklog: Boulderdash
« Reply #9 on: June 13, 2020, 01:16:56 PM »
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  :))

Offline Xerra

  • Hero Member
  • *****
  • Posts: 1098
    • Retro Evolved
Re: Worklog: Boulderdash
« Reply #10 on: June 13, 2020, 05:16:57 PM »
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.


Offline Xerra

  • Hero Member
  • *****
  • Posts: 1098
    • Retro Evolved
Re: Worklog: Boulderdash
« Reply #11 on: June 13, 2020, 07:33:32 PM »
Boulderdash on Itch.io link.

https://xerra.itch.io/boulderdash


Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 1911
Re: Worklog: Boulderdash
« Reply #12 on: June 14, 2020, 05:44:45 AM »
on mac - app is damaged and cant be run :(

Offline Xerra

  • Hero Member
  • *****
  • Posts: 1098
    • Retro Evolved
Re: Worklog: Boulderdash
« Reply #13 on: June 14, 2020, 11:32:12 AM »
on mac - app is damaged and cant be run :(

Just unzip then drag it into a new folder. That usually works.

Online Steve Elliott

  • Hero Member
  • *****
  • Posts: 2783
  • elgol 2021
Re: Worklog: Boulderdash
« Reply #14 on: June 14, 2020, 10:27:34 PM »
Cool, I'll try this tomorrow.
Windows 10, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
MacOS Catalina, 64-bit, 8Gb RAM, CPU Intel i5, 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB
Linux Mint 19.3, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
Raspberry Pi 3 and 4

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal