I've recently started pico-8, and its been fabulous. I normally am a game developer in the Godot engine, so I don't have much experience with programming graphics, so I decided to make a raycaster. It went well, albeit with a lot of reconsideration about my life. Anyways, so I have everything mostly working how I expected it to have, except for this weird thing. The lines that I render to the screen as fine from a distance, but as I get closer to them they warp. This isnt the standard fisheye affect that other raycasters have, or maybe it is, but I dont think it is. I'm stumped. I'll be eternally grateful if anyone can figure out what I'm doing wrong.
edit: sO I removed the big fish-eye effect, that was easy and I already knew how to go about fixing that, but I still have the issue where going close to walls makes them warp inwards... It's weird.
Welcome to pico-8! I've done a couple of raycasters, and have found that the Lode Vandene raycasting tutorial is invaluable for this type of thing. You can find it here: https://lodev.org/cgtutor/raycasting.html
It goes over all of the math and gives code examples, which shouldn't be too hard to translate into pico-8. It's quite a long tutorial when following it for the first time, so feel free to take breaks to understand what's going on! good luck, I'd love to see what you do as you move forward.
Happy to help! That tutorial is useful as well, because it can be extended later on to enable more complicated features for a nice challenge. Feel free to ask for help! You can get some ideas later on by looking at the work of @Powersaurus on twitter, and I'm also logging my development of something similar with @ValerADHD on twitter.
[Please log in to post a comment]