24 comments

[ 3.2 ms ] story [ 73.3 ms ] thread
The other day I was working on my wolf 3d game clone when I noticed this cool bug. My maps for the game are defined as an object with width, height and an array of arrays for the data. When working on a map that was supposed to be 14 in width and 16 in height, I forget to update the values (8 x 8) and end up creating a infinite level.

you can look at the error here: https://victorribeiro.com/raycast2/js/map.js

You need a keyboard to walk around the game. Arrow keys walk around, space bar opens doors.

Can you explain in more detail how forgetting to change (8,8) to (14,16) resulted in an infinite level?
I cannot. I need it to debug it further to fully understand whats going on
It doesn't seem infinite.... after 3 minutes I was just crawling along a wall, waiting for a left turn that would expand outwards. Never came
Did you walk for 3 minutes? I need to try that. I was walking for a long time and noticed that the maze repeated for as long as I was walking; but I did not time it.
I think it's infinite, just not in all directions. It keeps repeating in one direction though.
"I kept crawling along a wall with no end in sight" sounds pretty infinite to me?
Only if there's no repetition . . .
Reminds me of Marathon's non-euclidean maps. The engine traversed adjacent portals to determine what polygon-based cells to draw/interact with. Very mind bending in its day. Some of the multiplayer maps make strong, obvious use of this, if memory serves.

In fact, apparently the entire series is open source and free to play: https://store.steampowered.com/app/2398450/Classic_Marathon/

Highly recommend checking it out.

Amazing game.

That rocket launcher, that grenade launcher. The suicide Bobs.

Duke Nukem 3D had a stock level (E2L11, "Lunatic Fringe") that did something similar. The main structure of the map was a 720-degree loop. I remember it took me a good long while to figure out what was going on the first time I played it.
Just displaying a static image on the iPhone?
That "static image" is actually the game screen. If you had arrow keys on your iPhone, you could make it dynamic.
I just added some controls and better render for mobile devices. let me know if this works for you now
Apparently this post was brought back and I'm just now seeing the traffic.
I think it has wrong perspective culling. Seems like the rays are not properly clipped in the view plane so it appears like the view has a "fish eye" effect.