(0.9.0) Another raycasting demo 19.12.2013

Showcase your libraries, tools and other projects that help your fellow love users.
scutheotaku
Party member
Posts: 235
Joined: Sat Dec 15, 2012 6:54 am

Re: Another raycasting demo

Post by scutheotaku »

Looks neat; nice work! I too had experimented with a raycasting engine in LOVE (basing my code off of Lode's tutorials), though I never made a game or got very far. Hopefully someone actually makes a game with one of these raycasting engines! :D
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Another raycasting demo

Post by Jasoco »

Someone has to make a game like Gun Godz. The more twich shooters the better. I mean it was my original intention to create a game like this when I was working on it. But it's on hold for now. Still... this thing right here.. man... wow.



The above of which is totally possible in Löve utilizing these "3D" methods. It just requires the right person for the job.

Make it. I will play it. It will be awesome.
scutheotaku
Party member
Posts: 235
Joined: Sat Dec 15, 2012 6:54 am

Re: Another raycasting demo

Post by scutheotaku »

Jasoco wrote:Someone has to make a game like Gun Godz. The more twich shooters the better. I mean it was my original intention to create a game like this when I was working on it. But it's on hold for now. Still... this thing right here.. man... wow.



The above of which is totally possible in Löve utilizing these "3D" methods. It just requires the right person for the job.

Make it. I will play it. It will be awesome.
It's worth mentioning that with LOVE 0.9's new geometry features something like that should be (is? I've yet to try the current pre-release version of 0.9) much easier to make (and with faster results). These features will allow us to fairly-easily do BUILD and Doom style engines, which is really the best way to do this sort of thing (as opposed to just standard raycasting). There was a lot of talk about this later in my raycasting thread (not trying to spam haha, I think that the conversation here will be genuinely useful): http://love2d.org/forums/viewtopic.php? ... raycasting
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Another raycasting demo

Post by Jasoco »

Someone will have to perfect the use of geometries first. From what I've seen since there's no "3D point data" or whatever the texture doesn't know how to distort itself correctly. So until that's fixed I have to stick to 0.8.0 and xXxMoNkEyMaNxXx's Perspective.lua library.
Purdy Flowers in the Wind.gif
Purdy Flowers in the Wind.gif (1.58 MiB) Viewed 3931 times
Wojak
Party member
Posts: 134
Joined: Tue Jan 24, 2012 7:15 pm

Re: Another raycasting demo

Post by Wojak »

Inny wrote:Those two raycasters at the top of google's search results have gotten implemented in Lua/Love so many times :P

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.
Well the best thing about this method of floorcasting is that as long you keep the players eyes in the middle, you need to run 99% of floorcasting calculations only once (not once per frame, but exactly one time! – I discovered it just after uploading the latest version…) The only things that need to be done per frame are transforming the canvas and calculating how many horizontal slices to draw

As for making a game, well I’m bad at finishing what I started but I got two RPG games in plans
For one of them (I think its just in my reach) I just need a good battle system, a inventory system, character development system, good game art and sounds (I think the current raycasing engine is sufficient), rest is here: http://love2d.org/forums/viewtopic.php?p=70518#p70518

The second one is only in my dreams and I would need to upgrade the engine a lot…

EDIT:
Jasoco wrote:Someone will have to perfect the use of geometries first. From what I've seen since there's no "3D point data" or whatever the texture doesn't know how to distort itself correctly. So until that's fixed I have to stick to 0.8.0 and xXxMoNkEyMaNxXx's Perspective.lua library.
Purdy Flowers in the Wind.gif
Mind blown :death:
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Another raycasting demo

Post by Jasoco »

Wojak wrote:
Inny wrote:Those two raycasters at the top of google's search results have gotten implemented in Lua/Love so many times :P

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.
Well the best thing about this method of floorcasting is that as long you keep the players eyes in the middle, you need to run 99% of floorcasting calculations only once (not once per frame, but exactly one time! – I discovered it just after uploading the latest version…) The only things that need to be done per frame are transforming the canvas and calculating how many horizontal slices to draw
You would only need to calculate it once even if your eye level was up higher. Just record it for both separately. As long as the camera never moves. But if you're planning on making the camera move up or down you'd be doing the calculations every frame, even if it's just for a death animation like in GunGodz.

If and when I get around to making an FPS, I will probably use my SuprEffex Engine for it instead of raycasting. Then I can do a bit more with the camera much easier.
User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: Another raycasting demo

Post by Inny »

Actually, I don't think you'd have to recalculate the floor canvas to enable the type of looking up and looking down I'm talking about. The way it works is by changing the horizontal line on screen that's considered where the horizon is. Another way to look at it is to imagine that the game screen isn't 320x200, but rather 320x400, but only 200 pixels worth of vertical space is visible at any moment. Looking up and down via these means is to change which 200 is visible, by sliding that window up and down.

Now that's not really vertical looking, but for raycasters it's about as good as you can get. In games like Rise Of The Triad and Duke Nukem 3d, this is how they provided the looking, which I can demonstrate with a screenshot from the game: http://www.3drealms.com/duke3d/images/w ... _small.jpg

You can see the ceiling doesn't quite touch the tops of the walls when you look around this way.
Wojak
Party member
Posts: 134
Joined: Tue Jan 24, 2012 7:15 pm

Re: Another raycasting demo 13.10.2013

Post by Wojak »

New version 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)
DOWNLOAD IN THE OP

Forgot to mention it in the legend – use space to interact

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
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: Another raycasting demo 13.10.2013

Post by Roland_Yonaba »

Wojak wrote:New version available...
Sir Wojak, I love you.
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Another raycasting demo 13.10.2013

Post by Jasoco »

One of these days I'm going to get back to my FPS game. What method did you use for the floors and ceilings?
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests