Perhaps I'm being naive, but:
- Won't the floor and ceiling always be "behind" walls? Can't you just draw it without any raycasting, like a background, and draw over it with the walls?
- Wouldn't a mesh object make short work of any necessary perspective (and maybe tiling, if co-ordinates beyond the image dimensions will repeat)?
Textured Raycaster [Multiple Levels! Door Covers! Jumping!]
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Textured Raycaster
Not to my recollection. My last Wolf engine was static screen size and used no pixel effects.Davidobot wrote:Hhm? Yeah, it had like a choice of resolutions and stuff.Jasoco wrote:I don't think my version has an getMode or pixel effects in it.Davidobot wrote:I did, but I'm too lazy to change all of your code to 0.9.0
So much getModes and modes and pixelEffects!
Re: Textured Raycaster
You cat take a look at this (raycast5 version)
viewtopic.php?f=5&t=35876
I think this version has all the raycasting related stuff moved to a single file, so if You don't mind my chaotic coding it should be useful
This version has vev graphical bugs here and there and of course the florcasting is based on Jasoco's
viewtopic.php?f=5&t=35876
I think this version has all the raycasting related stuff moved to a single file, so if You don't mind my chaotic coding it should be useful
This version has vev graphical bugs here and there and of course the florcasting is based on Jasoco's
Re: Textured Raycaster
Well, they need to rotate with you.Clouds wrote:Perhaps I'm being naive, but:
- Won't the floor and ceiling always be "behind" walls? Can't you just draw it without any raycasting, like a background, and draw over it with the walls?
I have never dealt with mesh objects, so I don't know. But from my quick glance at the wiki page, I think it wouldn't work.Clouds wrote: - Wouldn't a mesh object make short work of any necessary perspective (and maybe tiling, if co-ordinates beyond the image dimensions will repeat)?
No clue. Maybe I'm using an old version?Jasoco wrote: Not to my recollection. My last Wolf engine was static screen size and used no pixel effects.
I used some examples from that topic actually.Wojak wrote:You cat take a look at this (raycast5 version)
viewtopic.php?f=5&t=35876
I think this version has all the raycasting related stuff moved to a single file, so if You don't mind my chaotic coding it should be useful
This version has vev graphical bugs here and there and of course the florcasting is based on Jasoco's
EDIT: Fixed it! It works now <3 (With the exception of weird jittering)
Second EDIT: Updated main file.
Now it is.jjmafiae wrote:Better than wolfenstein3D.
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Re: Textured Raycaster
it took a while but here it is:Jasoco wrote: Either way, a properly written shader could definitely do it. Don't ask me how to code that shader though. lol
http://love2d.org/forums/viewtopic.php?p=172749#p172749
this proves that love blog has awesome tutorials
Re: Textured Raycaster
Thanks! I'll try this out to to compare the different methods.Wojak wrote:it took a while but here it is:Jasoco wrote: Either way, a properly written shader could definitely do it. Don't ask me how to code that shader though. lol
http://love2d.org/forums/viewtopic.php?p=172749#p172749
this proves that love blog has awesome tutorials
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Re: Textured Raycaster
Wouldn't it be easier to pass arguments instead of hard coding the wood and red floor tiles?
Code: Select all
function drawInnerGround()
love.graphics.setCanvas(groundInner)
local on = false
for x = 1, #map[1] do
for y = 1, #map do
love.graphics.setColor(255,255,255,255)
if on then
love.graphics.draw(img[6], x * 64, y * 64)
on = not on
else
love.graphics.draw(img[7], x * 64, y * 64)
on = not on
end
end
end
love.graphics.setCanvas()
end
Re: Textured Raycaster
Yes, but that's just to demonstrate that the floor is not all one tile. Best way is to have 2 or 3 maps. (Walls, floor, ceiling)Rukiri wrote:Wouldn't it be easier to pass arguments instead of hard coding the wood and red floor tiles?Code: Select all
function drawInnerGround() love.graphics.setCanvas(groundInner) local on = false for x = 1, #map[1] do for y = 1, #map do love.graphics.setColor(255,255,255,255) if on then love.graphics.draw(img[6], x * 64, y * 64) on = not on else love.graphics.draw(img[7], x * 64, y * 64) on = not on end end end love.graphics.setCanvas() end
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Textured Raycaster
Mesh's are terrible at perspective. In that they do not do perspective at all. I find them useless and disappointing personally. I had hoped they'd solve my problem but eh. Whatever. The library I use that was created by xXxMoNkEyMaNxXx (I hate typing that name!) works perfectly and after testing performs exactly the same FPS-wise. If and when I ever do another Raycaster (Probably my next project) I will use it for my floors and ceilings.Clouds wrote:Perhaps I'm being naive, but:
- Won't the floor and ceiling always be "behind" walls? Can't you just draw it without any raycasting, like a background, and draw over it with the walls?
- Wouldn't a mesh object make short work of any necessary perspective (and maybe tiling, if co-ordinates beyond the image dimensions will repeat)?
Re: Textured Raycaster
whenever I run into a wall I seem to get this error.
Error
floor.lua.54: bad argument #2 to 'draw' (Quad expected, got nil)
Traceback
[c]: in function 'draw'
floor.lua.54: in function 'drawfloor'
main.lua.92: in function 'draw'
[c]: in function 'xpcall'
Who is online
Users browsing this forum: No registered users and 1 guest