Raycaster Experiment

Use this forum to share and discuss Uzebox games and demos.
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Raycaster Experiment

Post by D3thAdd3r »

Yep this is jhhoward stuff right here. I'm amazed at this not much else I can say besides the doom shotgun is awesome. Going stippled/monochrome-unfilled makes all of this just work. The only time the frame rate drops is when you are so close to the enemy, that collision wouldn't have even let you there so I'd say this is a complete proof of concept.

I notice this is not strictly orthogonal geometry on the back wall, is this a special case for 45 degree walls or is this actually running some kind of sector based system?
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Raycaster Experiment

Post by uze6666 »

Man, this is impressive! Never thought I would see something like this on the Uzebox. It's really smooth so far and if you fix the big sprite issue that will be a killer game. You really have solid ucc2016 stuff here. :D
CunningFellow
Posts: 1445
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Raycaster Experiment

Post by CunningFellow »

yes - definitely impressive. May have to rethink my UCC2016 plan.
hpglow
Posts: 269
Joined: Wed Apr 14, 2010 6:06 am

Re: Raycaster Experiment

Post by hpglow »

Every year someone comes up with something awesome. Then I have to go into the code and dissect the code and try and figure it out. I don't always follow 100% but it is nice to see thinking on this level.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Raycaster Experiment

Post by uze6666 »



I could not resist trying it out with the Doom music! I ported the song to the MOD engine and it sound pretty damn good I think. :ugeek:
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Raycaster Experiment

Post by D3thAdd3r »

uze6666 wrote:And I didn't expect the music! Damn you Lee, now we totally need Doom on the Uzebox! :D
Damn you Alec, how can I beat that!? :lol:

I'm guessing this is not yet in rom format, but is that sample rate 15khz? I'm also beginning to suspect you have a tutorial in your head and/or some Uzebox VST you are not sharing with the rest of the class! Surely this must end up using channel 5 for percussion for this to sound like also? The drums are out of control :mrgreen:

Interesting thing, some people say E1M1 has elements from Metallica "No Remorse" or "Master of Puppets". Maybe, but listen to Slayer "Behind The Crooked Cross" for about 30 seconds it's hard to deny the main riff is nearly a direct copy. Doom music has huge amounts of Slayer, Metallica, Pantera, and Alice In Chains riffs with altered tempos or what not.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Raycaster Experiment

Post by uze6666 »

It indeed uses channel 5 but only for the for the snare and bell ride cymbals. It could probably be cut out, but that snare adds alot the the groove. I reused a lots of instruments from the T2K module, so it was a quick conversion. So plain mod tracking and use just 1 effet, vibrato. And that's why it's not in ROM format yet because it is not yet supported in the engine. But shall be soon if the game progress -- and wants to use that song of course. :) And about a VST instrument...that would be the cream of the crop indeed. Maybe Nebososo has some time for this now his done with the path tool. ;)
User avatar
jhhoward
Posts: 76
Joined: Fri Feb 07, 2014 8:11 pm

Re: Raycaster Experiment

Post by jhhoward »

D3thAdd3r wrote: I notice this is not strictly orthogonal geometry on the back wall, is this a special case for 45 degree walls or is this actually running some kind of sector based system?
Ah yes, forgot to mention that the walls aren't restricted to a grid like in Wolfenstein. In the demo, the ends of the walls can be at any arbitrary points. I was thinking about creating a sector based system where each sector is restricted to a convex shape, with sectors joined by portals. There are some assumptions and potential optimisations that can be made about sectors being convex when it comes to rendering and collision detection.
CunningFellow wrote:yes - definitely impressive. May have to rethink my UCC2016 plan.
Thanks! I haven't entered UCC2016 yet as I don't know if I would have time to make this into a full game :)
uze6666 wrote:I could not resist trying it out with the Doom music! I ported the song to the MOD engine and it sound pretty damn good I think. :ugeek:
Haha quite fitting with the music :)
I noticed in your video that the shotgun sometimes flickers on/off which is strange as the double buffering should prevent this. I might have to take another look.

I was having a think again about a texture mapped video mode, and I think it would be possible to do in 12 cycles / pixel whilst still retaining the 1bpp overlay buffer for sprites. The horizontal resolution would be reduced from 144 to 120 though, which might be a bit too low. The mode would work a bit like this:

Code: Select all

; Texture mapped video mode:
; 120 x 128 resolution
; Memory layout:
; * A 256 byte texture bank space in RAM aligned to 256 byte boundary
; * A (64?) byte look up table aligned to 256 byte boundary
; * A column buffer of texture base address and wall size for each column (240 bytes x 2 buffers)
; * An overlay buffer at 1bpp for 120x64, double buffered = 1920 bytes

; Setup:
; X is pointer to the column buffer
; ZH is the upper byte of the texture scaler look up table
; (LUT is updated for each scanline during the HBLANK)
; YH is the upper byte for the texture bank

; Pixel routine (12 cycles):
ld ZL, X+       ; Load the wall size, which is an offset into the LUT
ld YL, X+       ; load the texture base offset
ld r16, Z       ; look up texture offset from LUT
add YL, r16     ; add the offset
ld r16, Y       ; load the texture colour
sbrs OVERLAY_REG, OVERLAY_BIT   ; check overlay mask
mov r16, OVERLAY_COLOUR         ; set overlay colour if bit is set
out r16         ; output pixel
Texture data would be organised in a set of vertical strips, where the first pixel in the strip is the ceiling colour, and the last is the floor colour (with the bits in between being the actual wall texture). The column buffer would have a base offset into the texture bank and the size of the wall. The look up table (that would have to be updated for each scanline, probably just copied from program memory) is then used to index into the strip to find the correct colour.

There is some wastage, as floor and ceiling colours have to be encoded into each texture strip. However, it should be possible to compress textures that have repeating patterns by only storing unique vertical strips. It should be possible to have several simple 8x8 texture patterns.

Now I will just have to find some time to see if this actually works. The main problem I foresee is having enough cycles to update the LUT in the HBLANK. for 64 bytes, it would take at least 320 cycles which might be too much (5 cycles per byte for lpm/st in an unrolled loop). One option is to update the LUT over two scanlines which effectively halves the vertical resolution, but it would match up with the overlay buffer this way.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Raycaster Experiment

Post by uze6666 »

I noticed in your video that the shotgun sometimes flickers on/off which is strange as the double buffering should prevent this. I might have to take another look
I thought it was a feature as it only happened when I hit the fire button! :lol:

So for the later code you showed, the wall would be texture mapped? That would be impressive and I would mind the decreased resolution if the frame rate is high enough.
User avatar
danboid
Posts: 1937
Joined: Sun Jun 14, 2020 12:14 am

Re: Raycaster Experiment

Post by danboid »

Did jhhoward ever upload any source to his 3D demo?

I'm very impressed with the Megadrive Wolf3D port and jhhoward's Catacombs of the damned. It would be cool to see that ported to UB!
Post Reply