Page 7 of 14

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

Posted: Fri Jan 27, 2012 2:39 am
by jfroco
Hello... yes. I just realized it.. I edited my original post :)

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

Posted: Fri Jan 27, 2012 4:19 am
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.

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

Posted: Fri Jan 27, 2012 7:23 am
by jfroco
Great work!!! Looks awesome. Congrats

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

Posted: Fri Jan 27, 2012 8:48 am
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.

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

Posted: Fri Jan 27, 2012 12:53 pm
by Robin
Oh man, so awesome!

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

Posted: Fri Jan 27, 2012 9:01 pm
by josefnpat
This is incredible! I can't wait to sift through the code :)

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

Posted: Sat Jan 28, 2012 12:56 am
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 :)

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

Posted: Sat Jan 28, 2012 1:03 am
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.

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

Posted: Sat Jan 28, 2012 1:12 am
by MarekkPie
WHERE CAN I DOUNLOOD DIS GAEM!?

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

Posted: Sat Jan 28, 2012 1:12 am
by Jasoco
Exactly. *sigh* Well, what do you think sooooo far?