Simple LOVE Raytracer Code (both untextured and textured)

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
IndieKid
Citizen
Posts: 80
Joined: Sat Dec 22, 2012 7:05 pm
Contact:

Re: Simple LOVE Raytracer Code (both untextured and textured

Post by IndieKid »

jordan4ibanez wrote:Wow that's actually really cool! I modified it a little bit to give it a more traditional feel:
-Pitch (Up/Down) Is limited
-It uses WASD instead
-You use the mouse to look around
-There's a sensitivity for mouse x/y axis

That's really brilliant btw :) I get 60 fps solid with textured mode
I'm not sure but I think that there are better FPS in your version. Good. But mouselook doesn't work.
User avatar
Ubermann
Party member
Posts: 146
Joined: Mon Nov 05, 2012 4:00 pm

Re: Simple LOVE Raytracer Code (both untextured and textured

Post by Ubermann »

If someone is geek enough to remember a game called Dungeon Master maybe can tell me what method is used in such game for drawing the walls, floors and ceilings.

I don't think it is using raycasting or raytracing. I would say it is more like a perspective trick, but then, I
guess how they were able to create corridors with + shape or some other complex structures that are beyond a simple perspective corridor. I know that game only has 90° corners and no slopes and only allows 90° fixed rotations that is why I am almost sure they were using simple perspective. And they released the game befor Wolfenstein3D, if I'm not wrong.

Anyone knows some online place where this is discused and/or explained?

Because with an engine like that we can create pretty amazing games with a farly simple code and without losing framerate that look really nice, and with some more work we can get out a X-axis freelook.
User avatar
IndieKid
Citizen
Posts: 80
Joined: Sat Dec 22, 2012 7:05 pm
Contact:

Re: Simple LOVE Raytracer Code (both untextured and textured

Post by IndieKid »

Ubermann wrote:If someone is geek enough to remember a game called Dungeon Master maybe can tell me what method is used in such game for drawing the walls, floors and ceilings.

I don't think it is using raycasting or raytracing. I would say it is more like a perspective trick, but then, I
guess how they were able to create corridors with + shape or some other complex structures that are beyond a simple perspective corridor. I know that game only has 90° corners and no slopes and only allows 90° fixed rotations that is why I am almost sure they were using simple perspective. And they released the game befor Wolfenstein3D, if I'm not wrong.

Anyone knows some online place where this is discused and/or explained?

Because with an engine like that we can create pretty amazing games with a farly simple code and without losing framerate that look really nice, and with some more work we can get out a X-axis freelook.
Interesting... As for me I think that it will be great to make game like The Elder Scrolls: Arena. Because it uses some very interesting techniques that I like.
scutheotaku
Party member
Posts: 235
Joined: Sat Dec 15, 2012 6:54 am

Re: Simple LOVE Raytracer Code (both untextured and textured

Post by scutheotaku »

jordan4ibanez wrote:Wow that's actually really cool! I modified it a little bit to give it a more traditional feel:
-Pitch (Up/Down) Is limited
-It uses WASD instead
-You use the mouse to look around
-There's a sensitivity for mouse x/y axis

That's really brilliant btw :) I get 60 fps solid with textured mode
Very nice job! It all works really well for me :)
IndieKid wrote:
jordan4ibanez wrote:Wow that's actually really cool! I modified it a little bit to give it a more traditional feel:
-Pitch (Up/Down) Is limited
-It uses WASD instead
-You use the mouse to look around
-There's a sensitivity for mouse x/y axis

That's really brilliant btw :) I get 60 fps solid with textured mode
I'm not sure but I think that there are better FPS in your version. Good. But mouselook doesn't work.
Hmm, strange, the mouselook is working fine for me.

As far as FPS, I'm getting about the same in both versions.
Ubermann wrote:If someone is geek enough to remember a game called Dungeon Master maybe can tell me what method is used in such game for drawing the walls, floors and ceilings.

I don't think it is using raycasting or raytracing. I would say it is more like a perspective trick, but then, I
guess how they were able to create corridors with + shape or some other complex structures that are beyond a simple perspective corridor. I know that game only has 90° corners and no slopes and only allows 90° fixed rotations that is why I am almost sure they were using simple perspective. And they released the game befor Wolfenstein3D, if I'm not wrong.

Anyone knows some online place where this is discused and/or explained?

Because with an engine like that we can create pretty amazing games with a farly simple code and without losing framerate that look really nice, and with some more work we can get out a X-axis freelook.
IIRC, games like Dungeon Master, Eye of the Beholder, and the GoldBox games rendered these "3D" spaces simply by placing pre-drawn perspective images onto the screen. This is one good reason why most of these games had a very near "fog." For example, for any one wall texture there might be 5 images: straight on, left side of hallway, right side of hallway, left side of hallway a little further down, right side of hallway a little further down - though, of course, some of the engines were probably capable of scaling the side wall images (so you'd only need one for each side).

Here are some links that may prove useful:
https://www.google.com/url?sa=t&rct=j&q ... JcZDHoI1og <<<PDF explaining Eye of the Beholder's engine
http://uaf.sourceforge.net/ <<<an open source Forgotten Realms Unlimited Adventures clone (this was a GoldBox game that included a full quest editor; this clone does too. Its editor, if not its code, may help you understand how these engines work)
http://blog.rag.no/post/Building-a-pseu ... rTile.aspx <<<a guy talking about creating a Dungeon Master-style engine
http://www.dungeoneye.net/ <<<an open source Eye of the Beholder II clone (includes a map editor, which might also help you understand how these engines work)
http://eob.wikispaces.com/eob.vmp <<<an explanation of Eye of the Beholder's VMP files
IndieKid wrote:
Ubermann wrote:If someone is geek enough to remember a game called Dungeon Master maybe can tell me what method is used in such game for drawing the walls, floors and ceilings.

I don't think it is using raycasting or raytracing. I would say it is more like a perspective trick, but then, I
guess how they were able to create corridors with + shape or some other complex structures that are beyond a simple perspective corridor. I know that game only has 90° corners and no slopes and only allows 90° fixed rotations that is why I am almost sure they were using simple perspective. And they released the game befor Wolfenstein3D, if I'm not wrong.

Anyone knows some online place where this is discused and/or explained?

Because with an engine like that we can create pretty amazing games with a farly simple code and without losing framerate that look really nice, and with some more work we can get out a X-axis freelook.
Interesting... As for me I think that it will be great to make game like The Elder Scrolls: Arena. Because it uses some very interesting techniques that I like.
Any info on these techniques? I've always been interested in Arena's engine, but have never been able to find much info on it except that it used a raycasting engine which IIRC Todd Howard described as being "similar to Doom's" (though it doesn't look nearly as good/advanced). I've always assumed that it was based off of the Terminator Rampage engine (developed and released by Bethesda in 1993), though that engine was basically Wolf3D + textured floors and ceilings.
User avatar
IndieKid
Citizen
Posts: 80
Joined: Sat Dec 22, 2012 7:05 pm
Contact:

Re: Simple LOVE Raytracer Code (both untextured and textured

Post by IndieKid »

scutheotaku wrote:
IndieKid wrote:Interesting... As for me I think that it will be great to make game like The Elder Scrolls: Arena. Because it uses some very interesting techniques that I like.
Any info on these techniques? I've always been interested in Arena's engine, but have never been able to find much info on it except that it used a raycasting engine which IIRC Todd Howard described as being "similar to Doom's" (though it doesn't look nearly as good/advanced). I've always assumed that it was based off of the Terminator Rampage engine (developed and released by Bethesda in 1993), though that engine was basically Wolf3D + textured floors and ceilings.
By "technique" I mean the way how the game works. That's awesome. Do you remember how to hit with weapon? That is great. It would be really interesting to make such a thing in Löve.
User avatar
Ubermann
Party member
Posts: 146
Joined: Mon Nov 05, 2012 4:00 pm

Re: Simple LOVE Raytracer Code (both untextured and textured

Post by Ubermann »

scutheotaku wrote:IIRC, games like Dungeon Master, Eye of the Beholder, and the GoldBox games rendered these "3D" spaces simply by placing pre-drawn perspective images onto the screen. This is one good reason why most of these games had a very near "fog." For example, for any one wall texture there might be 5 images: straight on, left side of hallway, right side of hallway, left side of hallway a little further down, right side of hallway a little further down - though, of course, some of the engines were probably capable of scaling the side wall images (so you'd only need one for each side).

Here are some links that may prove useful:
https://www.google.com/url?sa=t&rct=j&q ... JcZDHoI1og <<<PDF explaining Eye of the Beholder's engine
http://uaf.sourceforge.net/ <<<an open source Forgotten Realms Unlimited Adventures clone (this was a GoldBox game that included a full quest editor; this clone does too. Its editor, if not its code, may help you understand how these engines work)
http://blog.rag.no/post/Building-a-pseu ... rTile.aspx <<<a guy talking about creating a Dungeon Master-style engine
http://www.dungeoneye.net/ <<<an open source Eye of the Beholder II clone (includes a map editor, which might also help you understand how these engines work)
http://eob.wikispaces.com/eob.vmp <<<an explanation of Eye of the Beholder's VMP files
Incredible useful links. Specially the PDf one and the 3rd link. They don't give much source code but I think we could easily create a Dungeon Master-like game with just that info.
basically a Roguelike game with pseudo-3d screen output shouldn't have hard at all knowing the method to output that fake 3d

But still, I remember that Lands of Lore allows a smooth turning movement instead of just instant 90º rotations, that is why I think that in Lands of Lore they are using some variation of the method explained in your links.
At first sight I can't say if they are using for a perspective engine where textures get rotated, scaled and "poligonized" for different distances in base of an original texture, or if they are using the Dungeon Master technique with some other minor tweaks.

Anyway, creating a Dungeon Master game would be a good start.
scutheotaku
Party member
Posts: 235
Joined: Sat Dec 15, 2012 6:54 am

Re: Simple LOVE Raytracer Code (both untextured and textured

Post by scutheotaku »

IndieKid wrote:
scutheotaku wrote:
IndieKid wrote:Interesting... As for me I think that it will be great to make game like The Elder Scrolls: Arena. Because it uses some very interesting techniques that I like.
Any info on these techniques? I've always been interested in Arena's engine, but have never been able to find much info on it except that it used a raycasting engine which IIRC Todd Howard described as being "similar to Doom's" (though it doesn't look nearly as good/advanced). I've always assumed that it was based off of the Terminator Rampage engine (developed and released by Bethesda in 1993), though that engine was basically Wolf3D + textured floors and ceilings.
By "technique" I mean the way how the game works. That's awesome. Do you remember how to hit with weapon? That is great. It would be really interesting to make such a thing in Löve.
Ah, ok, gotcha. But yeah, that game had a lot of great gameplay mechanics! I've only played a little bit of it tbh, but now I sort of want to give it another try :D
Ubermann wrote:
scutheotaku wrote:IIRC, games like Dungeon Master, Eye of the Beholder, and the GoldBox games rendered these "3D" spaces simply by placing pre-drawn perspective images onto the screen. This is one good reason why most of these games had a very near "fog." For example, for any one wall texture there might be 5 images: straight on, left side of hallway, right side of hallway, left side of hallway a little further down, right side of hallway a little further down - though, of course, some of the engines were probably capable of scaling the side wall images (so you'd only need one for each side).

Here are some links that may prove useful:
https://www.google.com/url?sa=t&rct=j&q ... JcZDHoI1og <<<PDF explaining Eye of the Beholder's engine
http://uaf.sourceforge.net/ <<<an open source Forgotten Realms Unlimited Adventures clone (this was a GoldBox game that included a full quest editor; this clone does too. Its editor, if not its code, may help you understand how these engines work)
http://blog.rag.no/post/Building-a-pseu ... rTile.aspx <<<a guy talking about creating a Dungeon Master-style engine
http://www.dungeoneye.net/ <<<an open source Eye of the Beholder II clone (includes a map editor, which might also help you understand how these engines work)
http://eob.wikispaces.com/eob.vmp <<<an explanation of Eye of the Beholder's VMP files
Incredible useful links. Specially the PDf one and the 3rd link. They don't give much source code but I think we could easily create a Dungeon Master-like game with just that info.
basically a Roguelike game with pseudo-3d screen output shouldn't have hard at all knowing the method to output that fake 3d

But still, I remember that Lands of Lore allows a smooth turning movement instead of just instant 90º rotations, that is why I think that in Lands of Lore they are using some variation of the method explained in your links.
At first sight I can't say if they are using for a perspective engine where textures get rotated, scaled and "poligonized" for different distances in base of an original texture, or if they are using the Dungeon Master technique with some other minor tweaks.

Anyway, creating a Dungeon Master game would be a good start.
I'm glad they were helpful!
Yeah, the actual rendering shouldn't be that hard. You'd just need a basic raycasting system to figure out what can be viewed, and then you'd just have to draw it (which is much easier when you don't have to worry about angles as much).

It's worth mentioning that LOVE user SiENcE is (or was?) working on a game in this style:
viewtopic.php?f=3&t=2198&start=480#p72275

As for as Lands of Lore, I've never played any of those so I can't really say...except I'm pretty sure that the second or third one (or both?) were full 3D.
User avatar
Ubermann
Party member
Posts: 146
Joined: Mon Nov 05, 2012 4:00 pm

Re: Simple LOVE Raytracer Code (both untextured and textured

Post by Ubermann »

scutheotaku wrote:I'm glad they were helpful!
Yeah, the actual rendering shouldn't be that hard. You'd just need a basic raycasting system to figure out what can be viewed, and then you'd just have to draw it (which is much easier when you don't have to worry about angles as much).
Without any raytracing technique we can create the engine. Just drawing walls from farthest to closest.

If we only use pre-rendered images for left, right and front walls.

But if you are thinking in something more complex, then, yes, I think raycasting/tracing would be the way to go.
scutheotaku wrote: It's worth mentioning that LOVE user SiENcE is (or was?) working on a game in this style:
viewtopic.php?f=3&t=2198&start=480#p72275
Quite impressive IMO. It would be a shame that he stopped development on it. I will try to PM him about it.

scutheotaku wrote:As for as Lands of Lore, I've never played any of those so I can't really say...except I'm pretty sure that the second or third one (or both?) were full 3D.
In Lands of Lore, the player can only turn 90º or -90º. He cannot stop at 45º or 30º or any other angle. But when the player press left or right the engine doesn't immediately turns to the -90º or 90º, it rotates smoothly the view, like a freelook or raytracing engine, but the player doesn't have any control over this smooth rotation. And this effect can be turned on/off in game options.
Something similar happens when the player walks forward & backwards, the game doesn't immediately move. Instead, the scene moves to the next cell smoothly.

And that is why I think that Westwood Studios where using a different method here, more like a realtime texture perspective transformation than a prerendered textures like in Dung.Master.

But I'm not sure we can make something like that with LÖVE without having to mess with raytracing/casting since LÖVE doesn't allow to create poligonal shapes with textures. And without having to create with GIMP thousand textures for simulating smooth turnings. Maybe we can do it with forward and backward movements.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Simple LOVE Raytracer Code (both untextured and textured

Post by Nixola »

LÖVE will probably support that in 0.9.0
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
SiENcE
Party member
Posts: 792
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

Re: Simple LOVE Raytracer Code (both untextured and textured

Post by SiENcE »

scutheotaku wrote: It's worth mentioning that LOVE user SiENcE is (or was?) working on a game in this style:
viewtopic.php?f=3&t=2198&start=480#p72275

As for as Lands of Lore, I've never played any of those so I can't really say...except I'm pretty sure that the second or third one (or both?) were full 3D.
Yeah, currently i'm writing a game in löve, it's called "Aeon of Sands".

The love2d-webplayer prototype is working, but currently not availabe. We are hard working on a demoversion.

Our aim is to create a game in the style of the old Dungeon Master and Eye of the Beholder classics. We don't focus on the graphicengine. We want todo a game with real challenging quest (not like LoG) and not only hack & slash like dungeoning.

Now about the engine:
I proofed several options before starting the game. 2.5D Dungeon Master, real 3D and Raycasting. We ended up using the 2.5 Dungeon Master Style with predefined wallsets. We made this decision, because we want to run the game on all hardwares from mobiles (android) to low-end pc to webbrowser (love-webplayer). Also it don't look the same, if you render the side walls via a texture or via sprite (predrawn).

Thats why i coded my own EoB engine. But thats the easy step. The hard one is all the additional stuff. Displaying monsters & items, monster ai, combatsystem, aso. The raw engine was made by me in half a week, but since a year i'm working with two other guys on the game! I'm writing in my blog about my experience while coding the game. Last post was about scaling pixelgraphics is a pain (<- suggestions appreciated).

Now about EoB or Lands of Lore:
A very good ressource to understand how EoB or LoL works is ScummVM. The games are perfectly playable in scummvm and the sources are available. LoL does the smooth movement and rotation by applying a trick. They use nearly the same technique like Dungeon Master, but they pan & zoom the scene and than switch to the next tile (look into the sources).

Here are some links i collected to 2.5D engine infos.
http://www.andy2.net/archives/eob3-engine.htm
http://captive.atari.org/Technical/View ... dering.php
http://wayofthepixel.net/index.php?topic=6685

What I would still like to add is lighting and shadowing. Since this is real 2d i carefully read the thread about lighting with pixelgraphics => viewtopic.php?f=5&t=11076 . This is very interesting!

But implementing this needs much time and because we are focussing on the completion of the demo, we have no time for this :-/ .

I hope this helps. sorry for my bad english!

cheers
Last edited by SiENcE on Thu Mar 22, 2018 9:04 am, edited 1 time in total.
Post Reply

Who is online

Users browsing this forum: No registered users and 45 guests