Log In  

Cart #rat_maze-5 | 2024-04-23 | Embed ▽ | License: CC4-BY-NC-SA
9

Okay, somebody has to do it. I'm going to try making a version of the 3D Maze. No rats yet. Sorry.

Update: This is usable as a screensaver now! There are more features from the original to implement, but I think it's already pretty fun as-is.

  • Press a to toggle automatic mode (on by default).
  • Out of automatic mode: Up/down keys to go forward/backward, left/right keys to turn, z/x keys to strafe.
  • In either mode: Press Enter to toggle map view and raycast render.

Changelog

  • v1.0 Changed textures and floor/ceiling to match the real screensaver. Added an automatic mode, which is on by default. This is the screensaver mode, where the player automatically follows the right wall in the maze. Added a maze, but it's always the same. Randomly generated mazes will come in a future update.

  • v0.5 Textured walls now pick their texture based on the map data.

  • v0.4 Implemented textured walls. It is very slow, but I haven't done any optimization yet so there's still hope. Changed movement to feel more natural in first-person mode.

    Currently drawing pixel by pixel because I need to learn how to draw only a vertical slice of a sprite (userdata). Does anyone know how? The userdata docs are a little over my head.

  • v0.3.1 Fixed an off-by-one bug that was causing some walls to be studded with spikes. What a relief.

  • v0.3 Calculate which wall is closer (vertical or horizontal). Add raycast view (press Enter to switch to it). I'm getting a weird spike artifact in the render. Colored vertical and horizontal walls differently, revealing that the incorrect wall is identified as "closer" during the spikes. I don't know what's causing that to happen. Finished Part 9 (drawing walls) of Permadi tutorial.

  • v0.2 First public version. Finished Part 7 (finding wall intersections) of Permadi tutorial.

    I'm going to start by working through Permadi's 1996 Ray Casting Tutorial. It's really cool to be implementing such an old graphics tutorial. Anyone know of any other gems out there?

    Question for those with more PICO8 experience than me: Is it worth using bit shift operations instead of multiplication/division by a power of two? I'm keeping it as-is for now for readability reasons, but after the raycasting logic is finished, it might be fun to see if it speeds it up.

P#145537 2024-04-03 03:28 ( Edited 2024-04-23 06:54)

All Comments

> "Question for those with more PICO8 experience than me: Is it worth using bit shift operations instead of multiplication/division by a power of two? I'm keeping it as-is for now for readability reasons, but after the raycasting logic is finished, it might be fun to see if it speeds it up."

I just tested it, and the answer is no, there is no difference between x=1<<1 and x=1*2 in terms of performance.

P#145542 2024-04-03 04:18

@Kaius Hmm, interesting. Could that be an edge case? (As in, could they be the same, but x = 1 << 4 be faster than x = 1 * 16?)

P#145644 2024-04-04 04:27

@Snail_God ...Nope, still no performance difference found between any of:

  • x=1<<4
  • x=1*16
  • x=3<<3
  • x=3*8
  • x=12<<5
  • x=12*32
P#145647 2024-04-04 05:35

@Kaius Strange! Thanks for checking.

P#145649 2024-04-04 06:58

no need for userdata per-se, look at sspr to draw a slice of the sprite, with scaling support.

P#146682 2024-04-15 07:38

@freds72 oh!! I completely misremembered what sspr was for, yeah that's exactly what I need. thank you for saving my life :')

P#146696 2024-04-15 15:06

[Please log in to post a comment]