Working Raycasting example! WolfenLöve 3D if you will...

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
jfroco
Prole
Posts: 24
Joined: Fri Jan 06, 2012 5:14 pm

Re: Working Raycasting example! WolfenLöve 3D if you will...

Post by jfroco »

Hello... yes. I just realized it.. I edited my original post :)
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Working Raycasting example! WolfenLöve 3D if you will...

Post by Jasoco »

Note: Deleted my previous post to make my edits seem new and let people know I made progress so this first quote was from an hour ago or so. The rest from more recently.
jfroco wrote:Hello... yes. I just realized it.. I edited my original post :)
Hello, yes. I know, I just edited my post. :ultrahappy:

Going to examine your code and do some experimentation...

Edit: CLOSE!
Image

Edit again: And it's a BINGO! That's what they say, right?
Image

After DAYS of scratching my head, we finally got it. If it weren't for your help, it wouldn't have been done.

You will notice the jagged edges. This is unavoidable with the method being used. If only Löve had the same capabilities as Java with image manipulation and speed. (See: Prelude of the Chambered for perfect floors) But hell, this is SOMETHING! It'll open up so many possibilities! Including animated floors (Just change the ground canvas, but not the entire one to save speed) and other things.

It also does have some bleeding of darkness around edges which I will try to fix. For instance, note that the angle is jagged on the floor but smooth on the walls. Should be simple to fix if done right. Once again unavoidable.

Now I just need to do the ceiling for levels with no sky and make proper textures.

This is a GOOD DAY! Thanks JFROCO! The world is now safe from evil... except that little guy in the blue boots staring at me... what's his problem? He keeps following me but never says anything. Maybe I should give him a personality...

Next up... DOORS.
jfroco
Prole
Posts: 24
Joined: Fri Jan 06, 2012 5:14 pm

Re: Working Raycasting example! WolfenLöve 3D if you will...

Post by jfroco »

Great work!!! Looks awesome. Congrats
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Working Raycasting example! WolfenLöve 3D if you will...

Post by Jasoco »

Doors are gonna be a bit harder I can tell.

I figured out so far how to change the wall textures on the inside edges of the doors to door frames. I now just need to figure out when the ray is entering a door tile and stop casting and draw the door at halfway between tiles. It's more complicated than that but I'll do my best.

Notch made it look so easy when he created that Prelude game in 48 hours. His doors are actually 3D too.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Working Raycasting example! WolfenLöve 3D if you will...

Post by Robin »

Oh man, so awesome!
Help us help you: attach a .love.
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: Working Raycasting example! WolfenLöve 3D if you will...

Post by josefnpat »

This is incredible! I can't wait to sift through the code :)
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
User avatar
NÖÖB
Prole
Posts: 41
Joined: Thu Jul 31, 2008 10:57 pm
Location: Norway

Re: Working Raycasting example! WolfenLöve 3D if you will...

Post by NÖÖB »

This thread makes me happy \o/

That's clever; I tried making something like that -actually it was far from it, it was a slow textured quad, plotting every pixel.. I'm looking forward to an eventual release :)
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Working Raycasting example! WolfenLöve 3D if you will...

Post by Jasoco »

The first video of many I will post as I add new features. Newest additions are floors, door frames for when I get doors in place, an initial editor. A feature I didn't show was higher rooms because it's not ready yet and is low priority. This video is Hidden for now until release because I hate when people comment "WHERE CAN I DOWNLOAD THIS GAEM!!!??" when it's so obviously not freaking finished.


As I said, I won't be creating an official thread or offering a download until I get the most important pieces in place. That includes working doors, item pickups, initial enemy AI and better collision detection.

Other things to do are ceiling casting, better lighting, (Make it so when the light level is low, the raycaster will stop searching sooner* and give the game better framerate if it casts into an area that would be 100% black anyway) scripts and switches, NPC's, transparent walls that actually allow casting to continue passed them.

*Raycasting is the most expensive part of the game. It has to check every grid square from your position to the first wall it finds, then do it a couple hundred more times for every line across the screen. It performs a lot of math calculations to do this. The higher your resolution, the more rays it has to cast. And the bigger a room, the longer it takes to cast the ray. Which is why framerate jumps when you are right up against a wall.
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: Working Raycasting example! WolfenLöve 3D if you will...

Post by MarekkPie »

WHERE CAN I DOUNLOOD DIS GAEM!?
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Working Raycasting example! WolfenLöve 3D if you will...

Post by Jasoco »

Exactly. *sigh* Well, what do you think sooooo far?
Post Reply

Who is online

Users browsing this forum: swuare and 4 guests