This demo (raycast5) in now compatible with LÖVE 0.9.0 + a little bonus
(bonus include resizeable window and the raycasting code moved to scripts/raycasting.lua file)
New version (raycast4) available, current futures include:
Animated 8 directional sprites
Variable resolution support
Variable player eye elevation and head tilt
Retexturing on the fly
Basic variable lighting
Basic world interactions
Other debug stuff
Frame limiter of sorts (needs tweaking)
All feedback is welcome, it would be awesome if you give me a performance report:
Computer specs, OS, resolution used, CPS limit used, amount of stuff on screen (rendering overall) and the FPS
http://www.youtube.com/watch?v=rXwtO4uS ... e=youtu.be
Well I wanted to know how hard it is to make something like this, and learn something in the process.
I used this tutorial:
http://www.permadi.com/tutorial/raycast/
I think its quite a good tutorial because it only explains math and concepts, so I had to write the code myself, and because I’m not that good at math, it took me some time to understand it.
This should be enough for making a simple FPP dungeon crawling game that should run well on low end machines (I hope). I’m casting 1 ray for every 2pixel*screenheight and I don’t think it looks all that terrible, there is even a sprite support (the ugly rats are my creations), and some kind of basic light effect.
The floor and ceiling… Well I’ve managed to figure out how to draw it the oldschool way, but it kills any machine even on small resolution… I think it is possible to make a playable game without the floor…
(0.9.0) Another raycasting demo 19.12.2013
(0.9.0) Another raycasting demo 19.12.2013
- Attachments
-
- raycast5.love
- (0.9.0)
- (32.67 KiB) Downloaded 1192 times
-
- raycast4.love
- new coll stuff (0.8.0)
- (37.13 KiB) Downloaded 431 times
-
- raycast3.love
- with floors (0.8.0)
- (8.08 KiB) Downloaded 475 times
Last edited by Wojak on Thu Dec 19, 2013 5:25 pm, edited 6 times in total.
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Another raycasting demo
If you were around when I was playing with raycasting, I was able to make a floor using canvases.
Which I also used when playing around with a Mario Kart type game.
I don't know if giving you the code I used to do it would work well for your code, but if you want it. It does require canvases. But you could always make it optional like Blake Stone was. (It had options to turn ceilings and floors off for slower computers.)
Here's my original project just as it was when I stopped working on it and put the idea on hiatus. I might go back to it one day but it'll be recoded from the ground up anyway... The important ground stuff is in game.lua and background.lua. Maybe other places. I was really unstructured back then. My coding improves every time I start a new project. This is before I was much better so it's a bit of a clean hot mess.
Which I also used when playing around with a Mario Kart type game.
I don't know if giving you the code I used to do it would work well for your code, but if you want it. It does require canvases. But you could always make it optional like Blake Stone was. (It had options to turn ceilings and floors off for slower computers.)
Here's my original project just as it was when I stopped working on it and put the idea on hiatus. I might go back to it one day but it'll be recoded from the ground up anyway... The important ground stuff is in game.lua and background.lua. Maybe other places. I was really unstructured back then. My coding improves every time I start a new project. This is before I was much better so it's a bit of a clean hot mess.
Re: Another raycasting demo
Well thank You, i certainly can learn a lot from your project, it is amazingJasoco wrote:
I don't know if giving you the code I used to do it would work well for your code, but if you want it. It does require canvases. But you could always make it optional like Blake Stone was. (It had options to turn ceilings and floors off for slower computers.)
Here's my original project just as it was when I stopped working on it and put the idea on hiatus. I might go back to it one day but it'll be recoded from the ground up anyway... The important ground stuff is in game.lua and background.lua. Maybe other places. I was really unstructured back then. My coding improves every time I start a new project. This is before I was much better so it's a bit of a clean hot mess.
And yet not a single 100% finished projectqaisjp wrote:Looks interesting.
I see you've been busy, Wojak
Re: Another raycasting demo
Bwahah, I know that feel (sorry I just have that temptation to not say "feeling", someone diseased me).Wojak wrote:And yet not a single 100% finished projectqaisjp wrote:Looks interesting.
I see you've been busy, Wojak
What are your plans with this demo ?
Lua is not an acronym.
Re: Another raycasting demo
most likely rewriting this into FPP:qaisjp wrote:Bwahah, I know that feel (sorry I just have that temptation to not say "feeling", someone diseased me).Wojak wrote:And yet not a single 100% finished projectqaisjp wrote:Looks interesting.
I see you've been busy, Wojak
What are your plans with this demo ?
http://love2d.org/forums/viewtopic.php? ... 399#p71399
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Another raycasting demo
It's not perfect, but at least it's fast. Just make sure to offer an option to disable them for people without canvas support.
Glad I could help. I forget who helped me with it back then. Could probably figure it out if we dug up my original thread. I want to say jfroco or something like that? It's been so long.
Glad I could help. I forget who helped me with it back then. Could probably figure it out if we dug up my original thread. I want to say jfroco or something like that? It's been so long.
Re: Another raycasting demo
Those two raycasters at the top of google's search results have gotten implemented in Lua/Love so many times
It looks good though, I never bothered to try and get floors/ceilings in, but it's pretty easy doing some Z-axis stuff. For instance, simulating looking up and down is basically as easy as changing where the middle line on the screen is. It's not a particularly useful thing to have in this kind of raycaster, but lets say you use it to make an RPG of some kind, looking down momentarily when opening a treasure chest is a neat effect.
It looks good though, I never bothered to try and get floors/ceilings in, but it's pretty easy doing some Z-axis stuff. For instance, simulating looking up and down is basically as easy as changing where the middle line on the screen is. It's not a particularly useful thing to have in this kind of raycaster, but lets say you use it to make an RPG of some kind, looking down momentarily when opening a treasure chest is a neat effect.
Re: Another raycasting demo
looks good will you make it into a game with storyline and gameplay?
or just like alot of other lövers just making it for having some thing todo and have some fun
or just like alot of other lövers just making it for having some thing todo and have some fun
Who is online
Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 7 guests