Doom 3D ZX81 style

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
Post Reply
Bukster
Posts: 93
Joined: Wed Sep 12, 2018 9:44 am

Doom 3D ZX81 style

Post by Bukster »

Here's something I've been working on for a few months. How about a 3D game where unlike 3D monster maze, etc you actually can turn your head and walk forwards or backwards? Here's a proof of concept game. All you can do is pick up the spinning ankh treasure which releases a key. When you pick up the key, a portal opens to the next stage. Obviously nothing really to do, but shows what it might look like. Clearly, this isn't going to render Doom Eternal at 60 frames per second, but that would be a bit ambitious for a ZX81.
I'm imaging a sort of Mummy's Tomb type game so this will need some enemies and weapons to complete the game. Any thoughts? This bare bones game could be the basis for anybody out there who wants to make something with it. Anybody interested?
Screenshot 2021-10-03 142354.jpg
Grab the treasure
Screenshot 2021-10-03 142510.jpg
Grab the key
Screenshot 2021-10-03 143148.jpg
Get to the portal
3D Draw 021021.p
(7.7 KiB) Downloaded 126 times
Here's an emulator file in case anybody would like a go with it. Q/A = forward/backward. O/P = left right turn. Press zero to reset the room
User avatar
SafePit
Posts: 43
Joined: Mon Feb 20, 2012 7:06 pm
Location: Boise, ID
Contact:

Re: Doom 3D ZX81 style

Post by SafePit »

Very cool. Played the demo for a bit trying it out. I'm interested. I wonder if it could be used for a simple maze game or even a dungeon crawler. The walls feel distorted though—seems to grow wider faster than taller.
Image
Image
Bukster
Posts: 93
Joined: Wed Sep 12, 2018 9:44 am

Re: Doom 3D ZX81 style

Post by Bukster »

This is an unusual program in that it needs a kind of calibration. There are scaling tables to calculate the size of objects and the walls. So those tables will need to be tweaked to make a better size transition.

One good thing about making the computer draw the frames is that it's very memory efficient. This isn't even 8kb. Models are just a few instructions in a table, things like draw a line, circle etc. So my 3D skeleton maze game used a lot of memory for graphics. That was kind of swapping memory for speed as it didn't have to do as many calculations. However, it only had four directions you could look or move in.

It uses two display files, one for viewing and one for drawing. When a new frame is drawn, the screen is flipped to the alternate value. So the screen addresses alternate at being the draw and view screens. So I've probably used most of 10kB once that's taken into account. Still, that leaves the ability to define a lot of objects and monsters etc. I wanted to have more monsters in the skeleton maze game, but there just wasn't enough room in 16k.

So far it's only able to draw a square room, however you could define a really long room as a corridor. Rooms can be from $0A to $2F long and wide.
Bukster
Posts: 93
Joined: Wed Sep 12, 2018 9:44 am

Re: Doom 3D ZX81 style

Post by Bukster »

Here's the Flat Assembler source code for the 3D room game. In this simple demo, grab three treasure items. A key appears and when you get that, the portal to the next room appears. I've added support for ZonX sound and Chroma colour.

There are plenty of comments (mainly to help me remember what everything does) in the code. I'm calling dibs on a pyramid raider type game, but feel free to make your own game based on it. ZX81 Doom might be a bit much but here's what it might look like.
Attachments
3D Room.asm
(86.08 KiB) Downloaded 104 times
User avatar
bobs
Posts: 325
Joined: Thu Aug 27, 2009 10:49 pm
Location: UK
Contact:

Re: Doom 3D ZX81 style

Post by bobs »

Some time ago I coded a ray-casting engine in the style of Wolfenstein 3D. It is probably too slow in its ‘textured’ form, but like yours, could work in wireframe…

https://twitter.com/bobsstuffgames/sta ... 85127?s=21
User avatar
SafePit
Posts: 43
Joined: Mon Feb 20, 2012 7:06 pm
Location: Boise, ID
Contact:

Re: Doom 3D ZX81 style

Post by SafePit »

This sent me down a rabbit hole of researching ray casting. Interesting ideas. Both are actually pretty decent speed on the ZX81, all things considered. I really need to finish my other game before digging further, but would be fun to do more with these ideas.
Image
Image
Bukster
Posts: 93
Joined: Wed Sep 12, 2018 9:44 am

Re: Doom 3D ZX81 style

Post by Bukster »

bobs wrote: Tue Oct 19, 2021 6:16 pm Some time ago I coded a ray-casting engine in the style of Wolfenstein 3D. It is probably too slow in its ‘textured’ form, but like yours, could work in wireframe…

Wow, that makes my efforts look pretty lame. I was hoping to get similar speed out of the system but it's pretty slow and only draws a room with objects you can pick up. A Wolfenstein type game would have been pretty amazing on a ZX81. It looks a little like some of my earlier efforts to make a 3D room. I had actual wall panels that could morph depending on angles. It didn't really grab me and was also pretty slow so I abandoned it and went with wire frame.
User avatar
bobs
Posts: 325
Joined: Thu Aug 27, 2009 10:49 pm
Location: UK
Contact:

Re: Doom 3D ZX81 style

Post by bobs »

I do have a version of that demo which has fully textured walls, which sample correctly according to distance / angle. However, getting it to handle moving & scaling enemies (ala Wolfenstein) was getting difficult and slow, and I felt that a simple ‘find the key to escape’ game wasn’t much fun.

Was tempted to add a single dinosaur called ‘Rex’ though ;)
Bukster
Posts: 93
Joined: Wed Sep 12, 2018 9:44 am

Re: Doom 3D ZX81 style

Post by Bukster »

bobs wrote: Wed Oct 20, 2021 1:33 pm I do have a version of that demo which has fully textured walls, which sample correctly according to distance / angle. However, getting it to handle moving & scaling enemies (ala Wolfenstein) was getting difficult and slow, and I felt that a simple ‘find the key to escape’ game wasn’t much fun.

Was tempted to add a single dinosaur called ‘Rex’ though ;)
I don't supposed you published the source code. I'm very impressed with the speed of it and the way it draws the walls. I wouldn't have thought a ray traced system would have been much good at all, so I went with a wire frame program. Perhaps I should look into ray tracing more and see if I can work with it.
User avatar
bobs
Posts: 325
Joined: Thu Aug 27, 2009 10:49 pm
Location: UK
Contact:

Re: Doom 3D ZX81 style

Post by bobs »

Bukster wrote: Fri Oct 22, 2021 9:40 pm I don't supposed you published the source code. I'm very impressed with the speed of it and the way it draws the walls. I wouldn't have thought a ray traced system would have been much good at all, so I went with a wire frame program. Perhaps I should look into ray tracing more and see if I can work with it.
I haven’t published the code - but I can see if I’ve still got it anywhere. It was a bit of a hack-job on top of a completely different game, so it would be a mess anyway! The fully textured version was slightly slower than that video, but (if I remember correctly) that wireframe version is actually textured but with a blank graphic, so a ‘true’ wireframe version would be somewhat faster
Post Reply