New Game: Laser Puzzle

Use this forum to share and discuss Uzebox games and demos.
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

New Game: Laser Puzzle

Post by Artcfox »

I recently completed my second game. It's an Uzebox implementation of a laser puzzle board game that my daughter loves to play.
LaserPuzzle.png
LaserPuzzle.png (30.67 KiB) Viewed 9119 times
The implementation was relatively straightforward, and it fell under the size limit without needing a size-optimization pass, so the source code should be fairly easy to follow. It's just a simple mode 3 non-scrolling game.

The music isn't original, but the source was a "chiptune" written for the MONOTONE tracker application. I spent three days hand-transcribing each note, while looking at the notes scroll by in the tracker. I'm sure that it's possible to write a program that would automatically translate the MONOTONE file format into a MIDI, but I don't know x86 ASM, nor Pascal (MONOTONE was written to run on an 8088, but it runs fine in dosbox), so I just transcribed all of the notes by hand, and that allowed me some "artistic freedom."

This was also the first time that I used PCM sound effects in a Uzebox game, and it was really nice not having to worry about the voice stealing algorithm impacting the background music.

One cool trick that I used (thanks Lee!) was to point sprite bank 1 to the same tileset as the background tiles, which allowed me to implement transparent pixels during the drag-and-drop. When pieces are placed on the board, they are background tiles, but when picked up with the cursor, they become mega-sprites, and when dropped back on the board, they become background tiles again.

The laser simulation was fun to write, especially having to take into account a beam splitter, and the potential for infinite loops. I dealt with the problem by simulating the laser at the photon level. Each time a photon hits a beam splitter, a random number is generated and that decides whether the photon passes straight through or takes the bounce. Then all I had to do was send enough photons through the simulation, while superimposing their paths on top of each other, and that automatically took care of the multiple path problem and any potential infinite loops.

Instructions are included with the game, since my play-testing indicated that they were necessary. On the other hand, making sure that people actually read the instructions before dismissing them may be impossible. ;)

Let me know what you guys think!
Attachments
laser.uze
(59.98 KiB) Downloaded 1077 times
laser.hex
(167.3 KiB) Downloaded 763 times
User avatar
D3thAdd3r
Posts: 3289
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: New Game: Laser Puzzle

Post by D3thAdd3r »

Artcfox wrote:), so I just transcribed all of the notes by hand, and that allowed me some "artistic freedom."
Those are the most memorable moments, when you are doing something very technical and slightly tedious and error prone for an extended period of time. Then thinking "why am I doing all this", and realizing it is a labor of love to get it done. I never heard the original, but the transcription sounds top notch. It does sound like a daunting process you went through to capture that, which is extra points in cool factor it came out that well.

Fun game, I could not put it down and have completed through level 40(was stuck on 40, and was going to ask you if you tested this one was possible)!! There are some tricky situations in there, but especially what I like about the mechanics here is every time it really seems impossible, then it's "aha!" and "tadah!". There is some "emotional" reward figuring it out. Definitely my kind of game here, it holds my attention...I was going to play this game to try for 5 minutes, then finish making dinner. Well I finished the game, and not in 5 minutes either! So dinner is not done I am willing to be hungry if something catches my interest enough. :lol:

It's quite charming, the graphics are pretty, the sound is catchy, and the gameplay is very interesting. Is there more levels that could be available, it seems they could be compressed very well to the point space is not an issue and content generation is. Maybe no RPG epic is needed or anything, but some tiny little "ending", just a screen with some text or little animation or so would add a bit to completing it. Anyway this is a pleasant surprise this afternoon and I am impressed with how you pulled this together. Not much else I can really think to say on it, it is just really well done and speaks for itself.
User avatar
uze6666
Site Admin
Posts: 4812
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: New Game: Laser Puzzle

Post by uze6666 »

Nice!! I really like these kinds of little puzzles. So music is one track only? Pretty awesome and pretty catchy. :)

It took me some time to adapt to the controls, for some reason I was using the lower left corner of the cursor to point...so I could not switch levels! Perhaps putting a little tail to that cursor would help idiots like me. :oops:
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: New Game: Laser Puzzle

Post by Artcfox »

D3thAdd3r wrote:Those are the most memorable moments, when you are doing something very technical and slightly tedious and error prone for an extended period of time. Then thinking "why am I doing all this", and realizing it is a labor of love to get it done. I never heard the original, but the transcription sounds top notch. It does sound like a daunting process you went through to capture that, which is extra points in cool factor it came out that well.
Thanks! I don't even think I can put into words the sinking feeling that I had on day three, with just four measures left to transcribe, when I realized that my understanding of the octaves was wrong. Embarrassingly, I thought that A3 and B3 were below C3, rather than above, so every single A and B note was an octave lower than it should have been, and I had to go back to the beginning and move them all up an octave, and then re-calculate every single slide that involved those notes. I had a better understanding of how the "portamento down" and "portamento to note" frequencies were calculated, so on the second pass I fixed all of those to be more accurate.
D3thAdd3r wrote:Fun game, I could not put it down and have completed through level 40(was stuck on 40, and was going to ask you if you tested this one was possible)!! There are some tricky situations in there, but especially what I like about the mechanics here is every time it really seems impossible, then it's "aha!" and "tadah!". There is some "emotional" reward figuring it out. Definitely my kind of game here, it holds my attention...I was going to play this game to try for 5 minutes, then finish making dinner. Well I finished the game, and not in 5 minutes either! So dinner is not done I am willing to be hungry if something catches my interest enough. :lol:
It took me quite some time to beat level 40 as well. Sorry for making your dinner late! :lol:
D3thAdd3r wrote:It's quite charming, the graphics are pretty, the sound is catchy, and the gameplay is very interesting. Is there more levels that could be available, it seems they could be compressed very well to the point space is not an issue and content generation is. Maybe no RPG epic is needed or anything, but some tiny little "ending", just a screen with some text or little animation or so would add a bit to completing it. Anyway this is a pleasant surprise this afternoon and I am impressed with how you pulled this together. Not much else I can really think to say on it, it is just really well done and speaks for itself.
Thanks! I didn't bother compressing the levels. I did come up with a scheme involving bit-packing that would have reduced the level size from 55 bytes each down to 27 bytes, but it would have made the source code more complicated to understand, and it would have involved writing a separate "level packer" program that reads in the uncompressed level format and spits out the compressed format. It never crossed my mind to make any sort of ending, because I was so focused on emulating the physical board game. Once I can get myself back into a tutorial making mood, I might use this game as the starting point for a "how to optimize," since there is a lot of low-hanging fruit.

I'm glad you found it enjoyable. :)
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: New Game: Laser Puzzle

Post by Artcfox »

uze6666 wrote:Nice!! I really like these kinds of little puzzles. So music is one track only? Pretty awesome and pretty catchy. :)

It took me some time to adapt to the controls, for some reason I was using the lower left corner of the cursor to point...so I could not switch levels! Perhaps putting a little tail to that cursor would help idiots like me. :oops:
Thanks! The music is 3 tracks (channels?). I spent a bunch of time trying to make the cursor look more like a mouse pointer arrow, but I couldn't get it to look good, so I just left it as a triangle.
User avatar
nicksen782
Posts: 714
Joined: Wed Feb 01, 2012 8:23 pm
Location: Detroit, United States
Contact:

Re: New Game: Laser Puzzle

Post by nicksen782 »

Wow! I'm going to have play some more of this. Nice job with the sounds too!
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: New Game: Laser Puzzle

Post by Artcfox »

nicksen782 wrote:Wow! I'm going to have play some more of this. Nice job with the sounds too!
Thanks! For the "mouse down" and "mouse up" sounds, I set my cell phone down next to my actual computer mouse, and recorded its down and up clicks, then cleaned them up with Audacity.

BTW: I tried the Uzebox Game Changer's "user supplied game" feature with this game, and it worked great. If you'd like, you can add it to the database.
User avatar
nicksen782
Posts: 714
Joined: Wed Feb 01, 2012 8:23 pm
Location: Detroit, United States
Contact:

Re: New Game: Laser Puzzle

Post by nicksen782 »

It is added! Glad you were able to make use of that user-supplied game feature. I use it whenever someone posts a .uze file.

I called it Laser Puzzle.

::EDIT:: Append ?gameid=214 to the URL and it will direct load your game.
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: New Game: Laser Puzzle

Post by Artcfox »

nicksen782 wrote:It is added! Glad you were able to make use of that user-supplied game feature. I use it whenever someone posts a .uze file.

I called it Laser Puzzle.

::EDIT:: Append ?gameid=214 to the URL and it will direct load your game.
Awesome, thanks! And I do love that ?gameid thing! That will make it so easy to share.
User avatar
Jubatian
Posts: 1569
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: New Game: Laser Puzzle

Post by Jubatian »

Nice game, it was too easy for me, though :) (took at most about half an hour to finish, I had never seen this before)

A feature which might be nice to have is when you move a piece over another one you can move around is swapping the two pieces (so what was previously in the slot would be dragged by the mouse). I expected this to happen when I was experimenting with the location of the splitter on one level.

Most levels seemed to be very straightforward to me, possible to deduct by simply knowing how the laser would react with the tiles (such as the positions where the mirrors have to be placed, where it is possible to split can be seen just by looking at the level). The first small block was maybe level 28, I don't remember the exact level number, the first which had targets in the toolbox as I wasn't aware first that they can also be rotated. Real challenge began with level 35. Nebososo's Trollen is a lot more difficult game, although there the difficulty curve isn't as nice (the first level in particular is very difficult to grasp the concept, then there are several easier levels) like here.

Maybe it would be interesting to try what Nebososo did, to devise some level generator using a solver or an "inverse solver". This game could well benefit from having a set of more difficult levels (as of now for me it ends just when it starts to get interesting).

Of course not that it is a poor game, by technology I think it is nice, well done, although the music gets a bit repetitive after a while. I like how the sprite-tile transitions are handled for drag & drop, and it feels like the mouse realized by the controller works as well as it should (it didn't feel awkward, I think using the controller well to pull this off, tried with real hardware). The only minor exception is that I felt a bit tedious to have to click on next after finishing each level (considering I zipped through the first 27 with little effort).

I see the ROM is very much filled up, wouldn't this game benefit from using Mode 13? (Or maybe it is not possible due to the many tiles you need, I can imagine it, every rotation of every object, then also with the laser drawn on them, 4 tiles / object, 4 rotations, there are 3 important objects: splitter, mirror and target, and 2 different states, no laser and with laser, this is 96 tiles already, then other graphics and the image of Heqet would very much tip over M13's 128 tile limit... M74 isn't really an option here, I see here there is a lack of appropriate video mode, wish if there was a 4bpp mode at 6cy/pixel with up to at least 192 tiles, not impossible with M13's 4bpp concept)
Post Reply