Page 5 of 8
Re: Raycasting Demo (like Wolfenstein3D, just veery basic)
Posted: Sun Feb 28, 2010 9:39 am
by pekka
This works quite well on my old computer with a 1.6 GHz proc. I get a framerate of 100 to 50 or so, with the fifties happening in the big area while viewing a lot of distant walls. Nice work for such a short bit of code
I think you've misspelled alpha as apha inside an if test, though. Lua doesn't warn you about that, it just treats apha as nil if it is not assigned a value anywhere.
A reminder about vsync: You can set many graphics cards to always disable or enable vsync. What you have in the config or the code is just a suggestion at best.
Re: Raycasting Demo (like Wolfenstein3D, just veery basic)
Posted: Sun Feb 28, 2010 10:18 am
by bartbes
I never set it in my vid card settings, but I really don't see a reason to ever disable vsync. (well, unless you're benchmarking or testing, but not for a released game)
Re: Raycasting Demo (like Wolfenstein3D, just veery basic)
Posted: Sun Feb 28, 2010 11:18 am
by pekka
The important situation here is when you distribute your game. Even if your game sets its vsync on (or off) just fine on your computer, it may not do so on all of your users' computers. It's just not guaranteed to work the same everywhere because someone might have a good reason to have other settings than what you expected.
Re: Raycasting Demo (like Wolfenstein3D, just veery basic)
Posted: Sun Feb 28, 2010 5:06 pm
by pygy
Thanks for spotting the alpha typo :-) It's not used in this game, and I never used it anywhere before, that's why I hadn't caught it (yet?).
Re: Raycasting Demo (like Wolfenstein3D, just veery basic)
Posted: Sun Feb 28, 2010 5:40 pm
by kalle2990
I get 15-25 FPS when I run at these configurations:
Code: Select all
config.width = 1680 -- width of window
config.height = 1050 -- height of window
config.fov = 60 -- field of view (degrees)
config.sliver_width = 1 -- thickness of each wall sliver (pixels)
config.ray_resolution = 1/5000 -- lower number = higher resolution = more accurate = more CPU
Re: Raycasting Demo (like Wolfenstein3D, just veery basic)
Posted: Mon Mar 01, 2010 3:13 am
by Jasoco
You need to make it so the player slides along the wall if walking into it rather than just stopping abruptly. Also, the player needs a radius. Right now it seems the player's view can go right up to the wall instead of pushed off a few pixels like it should.
I still say we look at the Wolfenstein 3D code. I just don't understand how to translate C++ or whatever they used to code it.
I have the installer, an old EXE for DOS. I'll load up DOSBox and install the code again and look at it. But there is a LOT of code. It's hard to figure out what file is just for the drawing engine.
I mean really, the hard part is figuring out the correct math. If only Löve could stretch images between points. As opposed to scaling them. I want to be able to say top X and Y are here, bottom X and Y are here instead of Place this image here and scale it up this much. Because without that, it's hard to make an engine that can do image mapped walls. JavaScript can do it with the Canvas feature. I think Löve should be able to too.
Re: Raycasting Demo (like Wolfenstein3D, just veery basic)
Posted: Mon Mar 01, 2010 4:18 am
by TechnoCat
Jasoco wrote:I mean really, the hard part is figuring out the correct math. If only Löve could stretch images between points. As opposed to scaling them. I want to be able to say top X and Y are here, bottom X and Y are here instead of Place this image here and scale it up this much. Because without that, it's hard to make an engine that can do image mapped walls. JavaScript can do it with the Canvas feature. I think Löve should be able to too.
http://love2d.org/forum/tracker.php?p=2&t=19
Re: Raycasting Demo (like Wolfenstein3D, just veery basic)
Posted: Mon Mar 01, 2010 4:33 am
by Jasoco
Niiiiiiice. When that's implemented, things are gonna be a lot more fun.
Re: Raycasting Demo (like Wolfenstein3D, just veery basic)
Posted: Mon Mar 01, 2010 4:37 am
by TechnoCat
That is a feature request, not something they will do.
Re: Raycasting Demo (like Wolfenstein3D, just veery basic)
Posted: Mon Mar 01, 2010 4:43 am
by Jasoco
But it IS something they should do. They must! For the sake of the future of Löve!!