Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Maze3d

Reply to topic Goto page Previous  1, 2, 3  Next
Author Message
  • Joined: 03 Oct 2020
  • Posts: 14
Reply with quote
Post Posted: Sun Oct 09, 2022 10:29 pm
under4mhz wrote
This version fixes some of the bugs and adds a few minor features.

The door open button is now the B button. This saves me writing extra logic around not firing the gun when opening a door.

The chance of hitting a guard at all at a distance was set to 1/4. The guard will now always be hit at a distance, with the greater distance causing less damage. I increased the restart ammo to 14 from 7.

The dog no longer drops ammo. Not sure where he was keeping it.

The enemies now move towards the player when alerted. This makes having the dogs sensible. The soldiers won't fire unless on the screen, or at point blank range. This saves me having a ray cast from the enemy to the player, to check if he's behind a wall. I may do that later.

When the enemy comes into view the enemy state will restart to running towards the player. Before the state was cycling between running and shooting, even if out of view.

The enemy should now be clipped when one the edge of the screen instead of wrapping around.

Enemies now block movement, so you can't just run through them.

I've added some place holders for sound until I do some sound effect development. For now I've used waon to convert the original adlib sound effects to midi then to psg. Many of them will be changed to use the periodic noise channel, such as the door open, and collect ammo and food.

The Gameboy port is working. I was going over the 4K boundary in the first rom slot, so I had to massage that a bit. It still has a view visual glitches I'll fix later. Each port tends to take a few days to get going, so I tend to leave the ports till last.

Now you can win the game (in theory). It comes up with the "you win" screen once you get to the end of the 9th level, though the stats are wrong. Hans is shown and works for SMS. For SMS he's limited to 3x scale to fit, but I doubt you'll be able to get closer anyway. For SG and GB he crashes because he's too wide. I'll probably have to use zoom sprites to show him on those two systems.

The SS and officers are slightly larger and are too large to fit in the vdu at the largest zoom, so I'll have to reduce the size of these to the same as the guards so they'll show on the screen without missing parts.

I've limited the game to 10hz. If I were to account for overclocked systems, it would be to make the movement steps and rotation finer. I suspect the majority of users don't have an overclocked system though, so I probably won't. Most emulators on turbo will speed up the vdu clock rate as well, not just the cpu, so I can't account for it.

The little number is frame rate x 10 (based on 60hz). I use that to tell me if my speed optimisations actually work. Obviously frame rate is rather critical, since it's pushing the system hard.

Next is fixing some graphical glitches and sound, adding some niceties such as animating the end level screen and adding bonuses. Possibly some speed optimisations. Making sure it's playable and the difficulty is reasonable.


Great job so far, but the gameboy controls are messed up on real hardware. Left is stuck strafing, pressing right turns but fires the gun at the same time. Is there any fix for this? I used both ezflash and everdrive and this is still a problem. This isnt a problem on gbc, so I'd assume it's the bootrom of the og dmg, can you somehow fix this?


Edit- controls even work on the super gameboy, but not original dmg units, so I'm not sure what it is, it works fine in emulicious with the bootrom, but that could just signal emulator inaccuracy, so is there any way you could fix this so controls work properly on a real dmg model, it appears that bgb is the only emulator which emulates the same problems with controls like real hardware, so if you were to fix it, use bgb for reference here?

Use bgb and enable bootrom while setting it to dmg mode not cgb and you will get the same results as real hardware with messed up controls. bgb use bgb it behaves with the incorrect controls.
someone mentioned this: "your problem is you read the joypad immediately after the write to change the line. you need more reads, to delay when you read it for real.". this may help.
  View user's profile Send private message
  • Joined: 15 Aug 2019
  • Posts: 258
  • Location: Lancashire UK
Reply with quote
Post Posted: Thu Oct 13, 2022 10:07 am
Shameless self promotion I know but I really like this little game and so made a video for my YouTube channel with a back to back with the Mega Drive version. Thought I'd share:

  View user's profile Send private message Visit poster's website
  • Joined: 09 Jun 2014
  • Posts: 365
Reply with quote
Post Posted: Fri Oct 14, 2022 9:07 am
Nice video!

I noticed it has blue bars on top and bottom in your video. Perhaps under4mhz can change them to grey (color 0?).

Btw The face is actually animated in the sms version.
  View user's profile Send private message Visit poster's website
  • Joined: 15 Aug 2019
  • Posts: 258
  • Location: Lancashire UK
Reply with quote
Post Posted: Fri Oct 14, 2022 4:29 pm
Thanks for watching and yes I realised it was when I watched it back. Don't think I'll be retiring early to become a famous youtuber any time soon LOL



slogra wrote
Nice video!

I noticed it has blue bars on top and bottom in your video. Perhaps under4mhz can change them to grey (color 0?).

Btw The face is actually animated in the sms version.
  View user's profile Send private message Visit poster's website
  • Joined: 03 Oct 2020
  • Posts: 14
Reply with quote
Post Posted: Fri Oct 14, 2022 5:22 pm
I have a suggestion, can you please make select button swap weapons on the gameboy version once the controls are fixed?
  View user's profile Send private message
  • Joined: 18 Oct 2022
  • Posts: 3
Reply with quote
Post Posted: Tue Oct 18, 2022 9:12 pm
I really appreciate this whole Project.
But i think, this game is missing an important feature:
A Level Select menu!
Why do we need that?
Because it will be very bothersome, if you play the First level Everytime you turn off and come back another time!
make it for the sms, as well as for the gameboy port please.
  View user's profile Send private message
  • Joined: 17 Jan 2020
  • Posts: 118
  • Location: Brisbane, AU
Reply with quote
Post Posted: Sun Oct 30, 2022 2:20 am
Latest release of Maze 3D

I’ve added the high colour title and end level screens (thanks slogra). I’ve reduced the colours of the title down to 22 colours, since that’s all I could fit on using both tile and sprite palettes. Probably a smarter use of the palettes would be able to fit the other colours, but I’m just using a brute force first-come-first-serve approach. It hadn’t occurred to me to use the sprite palette to increase the number of colours for static images.

The biggest challenge with the title page is actually the number of tiles. A full screen image is 768 tiles, and there’s only 448 available. To fit the entire image, I’ve re-used tiles around the walls. I’ve also moved the light around so it fits within a single tile, instead of crossing two tiles.

I’ve set the border colour to grey. I usually set the border to black, but since palette is at a premium and black isn’t a default colour in this game. I don’t usually run with the borders on, so I forget they exist.

I’ve added a simple level select menu before the start. I used a separate page so I didn’t have to try and fit in the tiles needed for more text.

Gameboy can change the weapon using the select button. I also fixed the Gameboy button issues. Calindro kindly updated Emulicious to have the same behaviour as the original Gameboy hardware. I needed a few wait states between selecting the button group and reading the value. There’s an issue with the Gameboy where guards are shooting too soon or when they are off screen.

I’ve added some sound effects for the door, collecting ammo and food and the guard alert and falling. I still have to fix the bonus collection sound effects. I tried PSGTalk, but it was written for Windows, and the type sizes are different on Windows (long is 32bits on Windows, 64bits on Linux). I updated it to use fixed size ints (uint32_t etc) but it crashed, so I gave up.

I fixed an issue where the guards were walking through walls. I was checking the current tile, not the tile ahead. You can walk through guards as they’re falling, so you can move onto the next one. I also fixed repeatly pressing the fire key is more responsive (still an issue on GB).

Mostly just speed optimisations and rendering glitches next. Let me know what else you think needs to be done.
Maze3dSMS-38.png (645 B)
Maze3dSMS-38.png
Maze3dSMS-37.png (8.62 KB)
Maze3dSMS-37.png
Maze3d-GB-1.09.zip (95.05 KB)
Maze3d-SMS-1.09.zip (135.87 KB)
Maze3d-SG-1.09.zip (97.96 KB)

  View user's profile Send private message Visit poster's website
  • Joined: 18 Oct 2022
  • Posts: 3
Reply with quote
Post Posted: Sun Oct 30, 2022 3:45 pm
thank you ever so much for the level select.
this is a thing that i really needed!
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3763
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Mon Oct 31, 2022 8:13 am
under4mhz wrote
I tried PSGTalk, but it was written for Windows, and the type sizes are different on Windows (long is 32bits on Windows, 64bits on Linux). I updated it to use fixed size ints (uint32_t etc) but it crashed, so I gave up.


I compiled it on Linux (64) without touching the source code and, as you said, it crashes.

$ ./psgtalk sonic.wav
PSGTalk 0.3 - furrtek 2017

Frames: 0
Overlap: 25%
Samplerate: 189408057797700Hz -> 8192Hz
Resolution: 64Hz
Update rate: 2/frame (120Hz @ 60fps)
PSG channels: 3
Mode: vgm
C0=5248Hz
C1=5248Hz
C2=5248Hz
ComputingSegmentation fault (core dumped)


I'm puzzled about the fact you assume it's because of the different size of long, how did you get to that conclusion?
  View user's profile Send private message Visit poster's website
  • Joined: 17 Jan 2020
  • Posts: 118
  • Location: Brisbane, AU
Reply with quote
Post Posted: Tue Nov 01, 2022 12:04 am
Quote
I compiled it on Linux (64) without touching the source code and, as you said, it crashes.

[code]$ ./psgtalk sonic.wav
PSGTalk 0.3 - furrtek 2017

Samplerate: 189408057797700Hz -> 8192Hz


samplerate_in was very high, and looking into it the size was incorrect, which came from reading too many bytes for size from the wav file.

https://stackoverflow.com/questions/384502/what-is-the-bit-size-of-long-on-64-bi...

I ran it again, and it seemed to work with my updated version. Maybe a different wav file.

I'm happy to start a new topic on it, if you'd prefer.

  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3763
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Tue Nov 01, 2022 8:51 am
under4mhz wrote
samplerate_in was very high, and looking into it the size was incorrect, which came from reading too many bytes for size from the wav file.


I totally missed that. :facepalm:

In fact, simply changing one load.c line from
fread(&samplerate_in, sizeof(long), 1, f);

to
fread(&samplerate_in, 4, 1, f);

seems to be enough to fix it

$ ./psgtalk sonic.wav
PSGTalk 0.3 - furrtek 2017

Frames: 1210
Overlap: 25%
Samplerate: 44100Hz -> 8192Hz
Resolution: 64Hz
Update rate: 2/frame (120Hz @ 60fps)
PSG channels: 3
Mode: vgm
C0=64Hz
C1=64Hz
C2=64Hz
Computing frame 1210/1210. Done.

Output file written.
Size: 26kB


no need for a separate topic, the OT terminates here (but please provide your patch to furrtek's repository ♡ )
  View user's profile Send private message Visit poster's website
  • Joined: 11 Mar 2018
  • Posts: 56
  • Location: New Zealand
Reply with quote
Post Posted: Sat Nov 05, 2022 2:09 am
Hi Under4Mhz,


I think I have found a bug with compatibility when playing on the Megadrive:

* The first part of the bug, which I've observed both on Maze3d and on Klondike Solitaire, is that the "Under4Mhz" animation at the start is skipped.

* The second part of the bug, is that controller input doesn't work on Maze3d, so the game can't be started.

From what I can tell, it comes down to the content of bit 5 of the I/O port 0xDD. This bit is always set on the Master System and Game Gear. However, this bit is always unset on the Megadrive. I wonder if the bit is being interpreted as an extra button that's always held down...


Fantastic work on the game though, it's great to see raycasting running on the Master System :3
  View user's profile Send private message Visit poster's website
  • Joined: 17 Jan 2020
  • Posts: 118
  • Location: Brisbane, AU
Reply with quote
Post Posted: Tue Nov 08, 2022 11:24 pm
JoppyFurr wrote
I think I have found a bug with compatibility when playing on the Megadrive


Thanks. I'm not sure there's an emulator that even supports that arrangement.

I've attached a fix for it.
Maze3d-SMS-1.10.zip (135.82 KB)

  View user's profile Send private message Visit poster's website
  • Joined: 08 Apr 2005
  • Posts: 474
  • Location: Netherlands
Reply with quote
Post Posted: Sun Nov 13, 2022 10:17 pm
Was finally able to give this a proper playthrough on my Game Gear with Everdrive. Mighty impressive! The frame rate is fine with me.

Here's some suggestions, do whatever you want with them:

-Enemy shot hit ratio is very high and does far too much damage.It might have been close to this in the original version on the highest difficulty but only if enemies were closer. Seems somewhat unfair now.

-Soldiers would usually die with 2/3 knife hits. They take too many hits.

-I would shorten the time of the flash effect when you pick up an item. It's kind of annoying, especially if there's multiple pickups close to each other. (Perhaps don't start a new flash when a current one is still visible?)

-Soldier/item placement seems too high up on the Y axis. I would lower them somewhat. They seem to float.

-Was it possible to leave a black/grey/blank tile on the door near the handle? It would give them more character.

-Many empty rooms. Some kind of sprite (a chair/the blood splats of the original etc.) would be neat.

-'Get psyched!' screen would also be neat.

-Some BGM's work a treat, others (like level 8) not so much.

-I would love an update of the GG version with the same weapon (mapped to the GG's start button) and the press start at the beginning mapped too (probably already is the case?).

-Secret doors...could these remain open/disappear once triggered? It can be quite hard to find your way back out because they don't have a different colour than the other walls.

Again: amazing work so far!
  View user's profile Send private message Visit poster's website
  • Joined: 18 Oct 2022
  • Posts: 3
Reply with quote
Post Posted: Tue Nov 22, 2022 5:17 pm
do you know, what we really need?
a NES PORT of this masterpiece, since there is an gameboy port.
  View user's profile Send private message
  • Joined: 11 Mar 2018
  • Posts: 56
  • Location: New Zealand
Reply with quote
Post Posted: Tue Nov 22, 2022 9:02 pm
Tomkinsfan wrote
do you know, what we really need?
a NES PORT of this masterpiece, since there is an gameboy port.


I'd assume that would require a total rewrite, due to the different processor.

The Gameboy on the the other hand at least shares a large number of instructions with the z80
  View user's profile Send private message Visit poster's website
  • Joined: 17 Jan 2020
  • Posts: 118
  • Location: Brisbane, AU
Reply with quote
Post Posted: Sat Dec 24, 2022 4:47 am
Thanks for the feedback.

I've played with the hit ratio and damage amounts a bit. It's a bit difficult to get right since there's a fairly thin line between making it too hard and too easy. I also increased the knife damage amount, so it should only take 2 or 3 hits. It's still random, so it can be more.

All the objects were 48 pixels high instead of 64, so it made all the objects appear too close to the centre of the screen. This was the size of the guard, so I incorrectly used this as the reference size. The scaling wasn't quite right either, because I was using distance instead of 1/distance to determine the correct sprite scale to use.

I've added a door handle. Adding an actual handle wasn't much harder than using a blank tile since I'd already implemented objects, it just needed a bit of wall texture code to place it.

Most of the empty rooms should now have objects in it. I've tended to favour the skeleton since it's a good size, but the other objects are all available. Size becomes an issue, since only 8 sprites are available at maximum zoom. I've added in the odd light in empty hallways. I had to go through all the maps and cull most of the objects except the few I wanted to display. Most of the objects have their own palette, so can't be displayed with other objects, as long as the 8 sprites limitation. I need to parse each object position every iteration to determine which are close enough, so too many objects will slow it down.

I've added the Get Psyched dialog. It's there for appearance, since loading is fairly quick from the rom.

The object pick up effects will continue if already showing.

The background music was all reworked. I was trying to fit too many midi channels in the 3 psg channels available. I only use specific selected channels from each piece and only play those. I've also made each level have its own song instead of repeating the first four.

I've started using rle instead of lz4 as the decompression algorithm, so the frame rate is slightly faster when sprites are on screen. I'm not particularly filling the banks, so the larger size wasn't too much effort. I did have to shuffle a few of the banks around, particularly for the status bar items.

The secret doors act more like doors and will remain open, until the next door is opened. Top open them, press the B button like a regular door.

I'll start looking at the Game Gear port. Each release I have to go back and fix all the bugs that show up for each platform and they can take quite some time to fix. For the Game Gear I've been specifying the palette which is different from the SMS. I'll probably try to reuse most of the SMS assets directly to save the extra work over moving them across. I'll look at the GameBoy port as well. Just having a few glitches from the compression method change.

A nes port is theoretically possible, since I’ve written it all in C. Only the low level platform specific parts have assembler, and even then, not that much. But creating a new port is a fair bit of work. The nes also has the disadvantage that the vdu can only be written to during vblank, and you can't tell when it finishes. So I’ll have to write a little caching routine to cache the writes and blit them during vblank. The GameBoy is a bit better since there’s a flag that can be read, and I can just wait around till the next vblank if a write takes too long. If I do that, I'll use similar code for the GameBoy port, which may make it slightly faster.

The SG-1K version now uses video memory to store the object information, so all the objects/enemies are available for all levels. Previously these were limited to 80.
Maze3dSMS-44.png (1.7 KB)
Maze3dSMS-44.png
Maze3dSMS-39.png (2.23 KB)
Maze3dSMS-39.png
Maze3dSMS-40.png (2.3 KB)
Maze3dSMS-40.png
Maze3dSMS-41.png (2.28 KB)
Maze3dSMS-41.png
Maze3dSMS-42.png (2.2 KB)
Maze3dSMS-42.png
Maze3dSMS-43.png (2.38 KB)
Maze3dSMS-43.png
Maze3d-SG-1.11.zip (114.11 KB)
Maze3d-SMS-1.11.zip (155.74 KB)

  View user's profile Send private message Visit poster's website
  • Joined: 25 Feb 2006
  • Posts: 864
  • Location: Belo Horizonte, MG, Brazil
Reply with quote
Post Posted: Sat Dec 24, 2022 12:08 pm
This gets more awesome with each version! 😆
  View user's profile Send private message Visit poster's website
  • Joined: 19 Aug 2006
  • Posts: 74
  • Location: Brazil
Reply with quote
Post Posted: Sat Dec 24, 2022 12:36 pm
haroldoop wrote
This gets more awesome with each version! 😆


It has reached commercial/professional levels!
  View user's profile Send private message
  • Joined: 08 Apr 2005
  • Posts: 474
  • Location: Netherlands
Reply with quote
Post Posted: Sun Dec 25, 2022 11:19 pm
Wow, what an update!! Looking forward to giving this a test drive soon. Thank you :)
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3763
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Mon Dec 26, 2022 4:01 pm
under4mhz wrote
I've started using rle instead of lz4 as the decompression algorithm, so the frame rate is slightly faster when sprites are on screen. I'm not particularly filling the banks, so the larger size wasn't too much effort.


I'm curious to know what compression ratio you get with RLE and how fast it's to decompress. Also, you might want to check my stc0 compression, which has a similar compression to LZ4 but it's way faster to decompress.
  View user's profile Send private message Visit poster's website
  • Joined: 08 Apr 2005
  • Posts: 474
  • Location: Netherlands
Reply with quote
Post Posted: Fri Dec 30, 2022 10:26 pm
Gave it a testrun. Wow! The gameplay really feels 'right' now. That, coupled with the added sounds and improvements really impressed me! It's so playable and fun now. The door handles and extra sprites add so much.

I think there's little to moan about. There's no big flaws left imo, but here's a few smaller suggestions (but I'm sure you're aware of them);

*Gun spread/hit box looks to be a little wide. I think it could be narrowed down a bit.
*The doors look like they're in an alcove. Diagonal lines look at bit funny.
*Enemies/items glitch through doors.
*Palettes(?) get corrupted on enemies from time to time for a few frames, probably during the palette/tile swap.
*It looks like the machine gun has a few stray pixels on the bottom left.

I'd love to create a GG/SMS specific episode when it's done :)

Again: amazing work!
  View user's profile Send private message Visit poster's website
  • Joined: 03 Oct 2020
  • Posts: 14
Reply with quote
Post Posted: Wed Jan 18, 2023 10:44 pm
Will there be an update for the gameboy version any time soon?
  View user's profile Send private message
  • Joined: 09 Jun 2014
  • Posts: 365
Reply with quote
Post Posted: Thu Jan 19, 2023 10:54 pm
What was the reason to use lower resolution "Get Psyched" text?
The original size should fit, right? Or were you limited to a certain amount of tiles?

This is the the text in original size in SMS colors. I only slightly improved the border and nails colors manually.

I suppose you can move the text a bit lower on the 8x8 grid to conserve a few tiles.


And perhaps you can change the background of the screen to dark green blue color (005555), like the original game.
get_psyched.png (1.38 KB)
get_psyched.png

  View user's profile Send private message Visit poster's website
  • Joined: 17 Jan 2020
  • Posts: 118
  • Location: Brisbane, AU
Reply with quote
Post Posted: Fri Jan 20, 2023 11:45 pm
sverx wrote
I'm curious to know what compression ratio you get with RLE.


I did a comparison of the compression techniques. The first at original size and scaled x2. The original size would be a more typical case since the x2 is the same pixel copied four times, so there's more repeated data.


wolf3d_boss1_alert_x1
Method      Size % of original   Avg frames to decompress
rle         64% (1539/2368)      1.9
stc0        56% (1342/2368)      1.9
zx0         41% (980/2368)       8.8
none        100% (2387/2368)     0.9

wolf3d_boss1_alert_x2
Method      Size % of original   Avg frames to decompress
rle         44% (2734/6176)      3.9
stc         52% (3220/6176)      5.9
zx0         24% (1507/6176)      20.6
none        100% (6195/6176)     1.9




I'd say stc0 will be superior in most cases where the sprites aren't just scaled versions of the original.

  View user's profile Send private message Visit poster's website
  • Joined: 17 Jan 2020
  • Posts: 118
  • Location: Brisbane, AU
Reply with quote
Post Posted: Sat Jan 21, 2023 12:00 am
Cavencruiser wrote
Will there be an update for the gameboy version any time soon?

I'm working on the gameboy version. It has a few quirks that I'm working around with cpu bugs and the width changes the maths a little, so the objects weren't showing up in the right place.
  View user's profile Send private message Visit poster's website
  • Joined: 17 Jan 2020
  • Posts: 118
  • Location: Brisbane, AU
Reply with quote
Post Posted: Sat Jan 21, 2023 12:04 am
slogra wrote
What was the reason to use lower resolution "Get Psyched" text?
The original size should fit, right? Or were you limited to a certain amount of tiles?

I think I just scaled everything down to 256/320 so it was the same ratio. I should have enough tile space, since I'm loading it into the tile sprite area.

Thanks for the images, I'll look at using them this week.

I used the grey background since it transitions to floor colour nicely without clearing the screen. I'll see what I can do with the dark cyan.
  View user's profile Send private message Visit poster's website
  • Joined: 17 Jan 2020
  • Posts: 118
  • Location: Brisbane, AU
Reply with quote
Post Posted: Sat Jan 21, 2023 12:06 am
S.F wrote

*Gun spread/hit box looks to be a little wide. I think it could be narrowed down a bit.
*The doors look like they're in an alcove. Diagonal lines look at bit funny.
*Enemies/items glitch through doors.
*Palettes(?) get corrupted on enemies from time to time for a few frames, probably during the palette/tile swap.
*It looks like the machine gun has a few stray pixels on the bottom left.

I'd love to create a GG/SMS specific episode when it's done :)


Thanks for the bug reports. I'm looking into fixing them now. Yes, I did notice those issues, but I wasn't sure how important they were to fix.

I'll do up something to be able to edit the episodes. They're just png images, so you should be able to create new levels.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3763
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Mon Jan 23, 2023 10:12 am
under4mhz wrote
I'd say stc0 will be superior in most cases where the sprites aren't just scaled versions of the original.


well, in your case RLE seems better suited anyway, as it's never slower than stc0

Thanks for your test! :)
  View user's profile Send private message Visit poster's website
  • Joined: 02 Jun 2010
  • Posts: 4
Reply with quote
Post Posted: Thu Jan 26, 2023 1:15 pm
This is impressive but Wolfenstein 3D is too complex for the master to keep the gameplay similar enough. Did you consider Catacomb 3D in this engine?
  View user's profile Send private message
  • Joined: 03 Oct 2020
  • Posts: 14
Reply with quote
Post Posted: Thu Jan 26, 2023 2:33 pm
My exact thoughts, I'd think it be pretty cool to actually see a port of the original topdown catacombs to sms and gameboy too
  View user's profile Send private message
  • Joined: 02 Mar 2011
  • Posts: 165
  • Location: Valencia,Spain.
Reply with quote
Post Posted: Fri Jan 27, 2023 5:35 am
Hi, It is an impressive work. I have a question.
Have you considered to include a 3D mode compatible with the Sega glasses?.

Thank you!.
  View user's profile Send private message
  • Joined: 25 Feb 2006
  • Posts: 864
  • Location: Belo Horizonte, MG, Brazil
Reply with quote
Post Posted: Fri Jan 27, 2023 8:51 am
Aranya wrote
Hi, It is an impressive work. I have a question.
Have you considered to include a 3D mode compatible with the Sega glasses?.

Thank you!.


I imagine it wouldn't be able to render things fast enough for the effect to work...
  View user's profile Send private message Visit poster's website
  • Joined: 17 Jan 2020
  • Posts: 118
  • Location: Brisbane, AU
Reply with quote
Post Posted: Sat Jan 28, 2023 1:04 am
haroldoop wrote
Aranya wrote

Have you considered to include a 3D mode compatible with the Sega glasses?


I imagine it wouldn't be able to render things fast enough for the effect to work...


That's a great idea and would definitely be awesome. Unfortunately, the Sega Glasses need to be running at 60Hz to be fast enough. I'd have to render two frames and it's only running at 7fps. Besides, only a few people would be able to enjoy it since the hardware is not very common, so I personally prefer to put the effort into projects that can be enjoyed by more people
  View user's profile Send private message Visit poster's website
  • Joined: 17 Jan 2020
  • Posts: 118
  • Location: Brisbane, AU
Reply with quote
Post Posted: Sat Jan 28, 2023 1:55 am
maxi wrote
This is impressive but Wolfenstein 3D is too complex for the master to keep the gameplay similar enough. Did you consider Catacomb 3D in this engine?

I knew about Catacomb 3D, but I hadn't really considered doing that one. My feeling is that gamers want the more popular games ported to their favourite console, e.g. Halo for the 2600, and don't mind that it's a bit simplified, particularly for a 3D game on an 8-bit platform. Sonic and Mortal Kombat were simplified for the SMS compared to the Mega Drive, but we had fun playing them.

I have been wondering what other games could be possible with a raycasting engine.
  View user's profile Send private message Visit poster's website
  • Joined: 17 Jan 2020
  • Posts: 118
  • Location: Brisbane, AU
Reply with quote
Post Posted: Sat Jan 28, 2023 2:17 am
A new release of Maze3d. This release is mostly fairly minor visual fixes.

The doors are now half way between walls. I was concerned this wasn't possible, but it turned out to be fairly simple. Since I've implemented door handles anyway, I've add the door opening animation. Like the door handle, the door opening needed the texture calculation to determine how far along the wall segment each ray hit. I've also fixed the thin wall section so they're angled.

I've reduced the gun hit box since it was too wide. It's still a bit wide, since I want the enemy to be always able to be in range of the player with rotation only. Since the rotation step is so large, this means the hit range needs to be wide. So you can still hit the enemy even if visually he's not actually centred on the gun. It confuses things when I went to play the original, I kept missing.

Enemies can now open doors. If he's in visual range (even if he's not on screen), he'll come after you. If he hit's a door, he'll open it. It saves me from implementing a ray cast from the enemy to the player (can the enemy see the player?) or any sort of A* search algorithm (is he in the same room?).

I've readjusted the palettes so they're more in line with each other. Common colours between the various objects are always in the palette at the same place, so when the next palette is loaded there's no flicker. It also ensures when multiple objects are on the screen, they at least look reasonable. For example, the jewels and guard colours are fairly different, so you'll see the jewels are darker when they're on the screen together.

The gun graphics have been cleaned up updated. The gun now comes up a little bit more when it fires. I updated the loading page to be the original size, and used dark cyan as the background colour. I also fade in/out on most screens to make the transition smoother.

I've updated the GameGear and GameBoy versions. I've used the same assets for the GameGear as the SMS (except the status bar), so the colours are approximated versions of the SMS. I rewrote part of my GameBoy vdu blitter code in assembler, that managed to get it up to around 7fps, same as the SMS. I've also largely fixed the sound for the GameBoy.

I've started using sdcc with max-allocs-per-node to 100,000 with this release which gives it extra 0.5fps. I've had problems in the past were I'd get issues with the wall rendering when it was turned up, but those seem to have been resolved.

I plan on tweaking the levels a bit so there's not so many objects, on the floor in total or bunched together, so to keep the frame rate up to around 6fps. Even with no enemies or objects the ray-casting engine still only runs at around 8fps.

Feedback is welcome, it helps clarifies what's important and gives me motivation to work on it. Even if it's something I've fixed and I haven't quite got right, I don't mind hearing about it.

https://under4mhz.itch.io/wolfenstein-maze-3d
Maze3dSMS-54.png (2.23 KB)
Maze3dSMS-54.png
Maze3dSMS-53.png (2.2 KB)
Maze3dSMS-53.png
Maze3dGB-2.png (3.43 KB)
Maze3dGB-2.png
Maze3dGB-4.png (1.1 KB)
Maze3dGB-4.png
Maze3d-GB-1.12.zip (110.06 KB)
Maze3d-GG-1.12.zip (150.05 KB)
Maze3d-SG-1.12.zip (114.66 KB)
Maze3d-SMS-1.12.zip (159.43 KB)

  View user's profile Send private message Visit poster's website
  • Joined: 02 Mar 2011
  • Posts: 165
  • Location: Valencia,Spain.
Reply with quote
Post Posted: Sat Jan 28, 2023 5:51 am
In my opinion the 3D mode would be only an addition and not a 3D based game. Remember that all 3D compatible games can be played in 2D mode, even Line of Fire has a secret 3D mode unlockable with a cheat.

I think there is no homebrew compatible with the 3D glasses.

I have another idea, Would It be possible to play your game with the pad in one hand and light phaser in the other one?. I mean, you grab the pad in vertical position with the left hand, being LEFT direction like UP direction, DOWN direction like LEFT direction, etc and with the right hand the light phaser for shooting enemies.

Thank you for your time and effort.

Regards from Spain.
  View user's profile Send private message
  • Joined: 25 Feb 2006
  • Posts: 864
  • Location: Belo Horizonte, MG, Brazil
Reply with quote
Post Posted: Sun Jan 29, 2023 11:17 am
Very nice improvements!

A suggestion for the GB version: the Game Boy's sound hardware is capable of playing 4-bit PCM voices with very little CPU involvement; in other words, it would theoretically be possible to make that version play the original game's voices without decreasing the frame rate too much. Since the wave channel can only store 32 samples (16 bytes), it would be necessary to set up an interrupt to update the wave channel's RAM with more samples at the correct moments, but it would be doable.

Please, take a look at: https://github.com/gbdk-2020/gbdk-2020/tree/develop/gbdk-lib/examples/gb/wav_sam...
  View user's profile Send private message Visit poster's website
  • Joined: 29 Jan 2023
  • Posts: 1
Reply with quote
Post Posted: Sun Jan 29, 2023 4:10 pm
I've been developing a CGA / DOS version of Wolfenstein 3D and someone pointed me here. This project is fantastic, really interesting to follow!

I wanted to ask, for the music are you automatically converting from the original Adlib music or are you recreating them by hand? I've been playing around with automatically generating music for the Tandy 1000 which uses the same sound chip as the Sega Master System. So far I've had mixed results with some tracks sounding better than others.
  View user's profile Send private message
  • Joined: 02 Jun 2010
  • Posts: 4
Reply with quote
Post Posted: Sun Jan 29, 2023 11:36 pm
under4mhz wrote
maxi wrote
This is impressive but Wolfenstein 3D is too complex for the master to keep the gameplay similar enough. Did you consider Catacomb 3D in this engine?

I knew about Catacomb 3D, but I hadn't really considered doing that one. My feeling is that gamers want the more popular games ported to their favourite console, e.g. Halo for the 2600, and don't mind that it's a bit simplified, particularly for a 3D game on an 8-bit platform. Sonic and Mortal Kombat were simplified for the SMS compared to the Mega Drive, but we had fun playing them.

I have been wondering what other games could be possible with a raycasting engine.

Yes, but MK2 is still pretty close to what it should be. Sonic is a new game designed for the hardware limitations and Halo 2600 is Halo in name only.
Also, would be possible to render the game in half resolution to improve the framerate, like the Doom ports for example? I think would be better than run in 8fps.
For other games, there's also Faceball and the very first FPS Hovertank 3D. And you can also use the engine to develop a racer, like people did with Wolf 3D for the Mega Drive, or even a RPG with 1st person dungeons easier to navigate than Phantasy Star.
  View user's profile Send private message
  • Joined: 17 Jan 2020
  • Posts: 118
  • Location: Brisbane, AU
Reply with quote
Post Posted: Mon Jan 30, 2023 6:51 am
haroldoop wrote
Very nice improvements!

A suggestion for the GB version: the Game Boy's sound hardware is capable of playing 4-bit PCM voices.


Thanks, I'll have a look into it. It's a bit of an advanced feature - it rather depends on how many Gameboy players there are. Gameboy mostly has been the second port.
  View user's profile Send private message Visit poster's website
  • Joined: 17 Jan 2020
  • Posts: 118
  • Location: Brisbane, AU
Reply with quote
Post Posted: Mon Jan 30, 2023 7:04 am
jhhoward wrote
I wanted to ask, for the music are you automatically converting from the original Adlib music or are you recreating them by hand? I've been playing around with automatically generating music for the Tandy 1000 which uses the same sound chip as the Sega Master System. So far I've had mixed results with some tracks sounding better than others.


I used midi files I found at http://www.geocities.ws/TimesSquare/Castle/3573/w3d_mus.html

I've written a utility that converts midi files into c arrays for each channel, with each element containing { midi note, duration }. I convert the midi note to the psg value with a look up table at run time, since midi notes can fit into a unsigned char. I've manually picked only three channels to play, by playing a single midi channel on timidity and listening to which three channels give the most value. The tool I wrote filters only these midi channels. I've got some reasonably simple code that plays each note on a per channel basis in the user timer tick.

Midi's a pain. It seems like a simple format but it gets pushed to the limits by some tunes, which makes it difficult to implement all those nuances.
  View user's profile Send private message Visit poster's website
  • Joined: 17 Jan 2020
  • Posts: 118
  • Location: Brisbane, AU
Reply with quote
Post Posted: Mon Jan 30, 2023 7:25 am
maxi wrote
Also, would be possible to render the game in half resolution to improve the framerate, like the Doom ports for example? I think would be better than run in 8fps.

I agree. I'm going to look into getting the engine going as fast as possible, then I'll try to rework the levels to have less items. Level 1 runs quite fast at 7.5fps with 73 items, where as level 3 slows down to 5.4fps with 184.

The GameGear port is what you've said - the SMS version clipped to 20 columns, and it runs around 8ps. It would also be possible to use 16 pixels as the base width instead of 8, it would be faster, but much blockier. I was hoping to avoid this if possible, and use the full screen for SMS.

I think that for an 8bit platform players are reasonably forgiving for 3D games. Faceball doesn't look like it runs much past 5fps. Other games like HardDrivin for the ZX are much slower. I remember playing Test Drive 3 for DOS, and that must have been running at only 2fps. I would have been ecstatic to have Wolf3d on my SMS even at 5fps.

The Wolf3d racer might be interesting. I was wondering about a flight simulator, if that would be possible.
  View user's profile Send private message Visit poster's website
  • Joined: 09 Jun 2014
  • Posts: 365
Reply with quote
Post Posted: Mon Jan 30, 2023 9:24 am
I have to say the music sounds great.
I was wondering if you considered using channel3 + 4 to get the low bass notes in music (i'm not sure how to call this effect). Sounds like you already use it for sound effects.
Some bass heavy tunes might sound better (more accurate) with a lower bass. I'm curious how the low strings would sound in the menu theme called "Wonder" for example.
The disadvantage is of course that you need 2 channels for 1 instrument, and no noise (drums) can be used at the same time.

Also, if there are certain midis that need manual rework to get the best out of the 3 channel/4channels, then i can give it a shot. I'm not sure what songs are the best candidates for this (sound worst atm) though.

Edit: i've attached a slightly altered version of "Wonder" assuming you can use low bass which is the sawtooth in channel 3 of the midi. Only thing i changed is the instruments and i've combined channel 7 and 8 of the original midi. 8 is used in the intro, but is replaced (silenced) when the actual melody starts in channel 7.

Edit2: The volume of channel 2 (channel 7 in the original) is quite low. I wonder if you can hear it on the Sms. I can increase the volume of course if needed.
Wonder_edit01.zip (1.34 KB)

  View user's profile Send private message Visit poster's website
  • Joined: 03 Oct 2020
  • Posts: 14
Reply with quote
Post Posted: Tue Jan 31, 2023 10:52 pm
under4mhz wrote
A new release of Maze3d. This release is mostly fairly minor visual fixes.

The doors are now half way between walls. I was concerned this wasn't possible, but it turned out to be fairly simple. Since I've implemented door handles anyway, I've add the door opening animation. Like the door handle, the door opening needed the texture calculation to determine how far along the wall segment each ray hit. I've also fixed the thin wall section so they're angled.

I've reduced the gun hit box since it was too wide. It's still a bit wide, since I want the enemy to be always able to be in range of the player with rotation only. Since the rotation step is so large, this means the hit range needs to be wide. So you can still hit the enemy even if visually he's not actually centred on the gun. It confuses things when I went to play the original, I kept missing.

Enemies can now open doors. If he's in visual range (even if he's not on screen), he'll come after you. If he hit's a door, he'll open it. It saves me from implementing a ray cast from the enemy to the player (can the enemy see the player?) or any sort of A* search algorithm (is he in the same room?).

I've readjusted the palettes so they're more in line with each other. Common colours between the various objects are always in the palette at the same place, so when the next palette is loaded there's no flicker. It also ensures when multiple objects are on the screen, they at least look reasonable. For example, the jewels and guard colours are fairly different, so you'll see the jewels are darker when they're on the screen together.

The gun graphics have been cleaned up updated. The gun now comes up a little bit more when it fires. I updated the loading page to be the original size, and used dark cyan as the background colour. I also fade in/out on most screens to make the transition smoother.

I've updated the GameGear and GameBoy versions. I've used the same assets for the GameGear as the SMS (except the status bar), so the colours are approximated versions of the SMS. I rewrote part of my GameBoy vdu blitter code in assembler, that managed to get it up to around 7fps, same as the SMS. I've also largely fixed the sound for the GameBoy.

I've started using sdcc with max-allocs-per-node to 100,000 with this release which gives it extra 0.5fps. I've had problems in the past were I'd get issues with the wall rendering when it was turned up, but those seem to have been resolved.

I plan on tweaking the levels a bit so there's not so many objects, on the floor in total or bunched together, so to keep the frame rate up to around 6fps. Even with no enemies or objects the ray-casting engine still only runs at around 8fps.

Feedback is welcome, it helps clarifies what's important and gives me motivation to work on it. Even if it's something I've fixed and I haven't quite got right, I don't mind hearing about it.

https://under4mhz.itch.io/wolfenstein-maze-3d





The gamegear one crashes after I launch it on everdrive. The master system one does the same thing when launched on my everdrive gg, but if i press start, it starts playing unlike the gg version which sits on a black screen forever
  View user's profile Send private message
  • Joined: 17 Jan 2020
  • Posts: 118
  • Location: Brisbane, AU
Reply with quote
Post Posted: Wed Feb 01, 2023 6:23 am
Cavencruiser wrote
The gamegear one crashes after I launch it on everdrive. The master system one does the same thing when launched on my everdrive gg, but if i press start, it starts playing unlike the gg version which sits on a black screen forever


Oops. Thanks, I didn't test that. I'm trying to wait for an interrupt before setting up the vdu. I'll post an update soon.
  View user's profile Send private message Visit poster's website
  • Joined: 03 Oct 2020
  • Posts: 14
Reply with quote
Post Posted: Wed Feb 01, 2023 10:09 am
under4mhz wrote
Cavencruiser wrote
The gamegear one crashes after I launch it on everdrive. The master system one does the same thing when launched on my everdrive gg, but if i press start, it starts playing unlike the gg version which sits on a black screen forever


Oops. Thanks, I didn't test that. I'm trying to wait for an interrupt before setting up the vdu. I'll post an update soon.


When you post the update can you make the gamegear start button switch weapons?
  View user's profile Send private message
  • Joined: 03 Oct 2020
  • Posts: 14
Reply with quote
Post Posted: Wed Feb 01, 2023 11:56 am
under4mhz wrote
Cavencruiser wrote
The gamegear one crashes after I launch it on everdrive. The master system one does the same thing when launched on my everdrive gg, but if i press start, it starts playing unlike the gg version which sits on a black screen forever


Oops. Thanks, I didn't test that. I'm trying to wait for an interrupt before setting up the vdu. I'll post an update soon.


Small discovery- score overflows and resets very quickly, and time bonus doesnt work at end. Also, soldiers miss alot more than the real game and hardly shoot you, making it possible to just stab every soldier up close instead of shooting them or worrying about getting shot. Maybe adding difficulty options can fix this, to make enemies more accurate if you want a challenge. Also, it would be nice if the gameboy port had a pause button to pause the game. Start does nothing as of now
  View user's profile Send private message
  • Joined: 09 Jun 2014
  • Posts: 365
Reply with quote
Post Posted: Thu Feb 02, 2023 11:55 am
I quickly created a small section of the Wonder music in SnevenTracker, because i wanted to know how it could sound with a low bass.

What do you think?


The bass strings are using channel 3 and 4 effect.
However the short notes (in the normal non-bass channel) are also going lower than the SMS can handle, which i did not anticipate, so would need a second bass channel, instead i increased them by an octave.
There are some occasions where channels play the same frequency, which can cause very weird effects (like canceling eachother), but it's seems ok, in this case.


There are many songs in the game, so it will be too much work to recreate them all in a tracker. Trackers do not even have a midi import function.

If you like this sound then it might be worth it to change the conversion program so it can do something similar. It will need 2 extra functions:
- select a channel to be a bass channel
- select how many octaves up (or down) a channel should be played in

You will have to go though all the songs channels and make those selections.

You have worked magic so far, so i hope this is not too far fetched :).
It's just a suggestion, the music is not the highest prio, and it already sounds very nice.
wonder03.m4a (131.93 KB)


  View user's profile Send private message Visit poster's website
  • Joined: 03 Oct 2020
  • Posts: 14
Reply with quote
Post Posted: Fri Feb 03, 2023 2:51 am
Gamegear version works on everdrive now, great work! SS guard soldier cant die no matter how many times hes shot. Hes invincible for some reason. This should be fixed, it only happens on gg as far as I'm aware.
  View user's profile Send private message
Reply to topic Goto page Previous  1, 2, 3  Next



Back to the top of this page

Back to SMS Power!