Simple LOVE Raytracer Code (both untextured and textured)

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: Simple LOVE Raytracer Code (both untextured and textured

Post by scutheotaku »

Ubermann wrote:
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.
Yeah, not raycasting for rendering. I just think that simple raycasting would be the easiest way to check what can actually be seen (to reduce overdraw), much like how one may code an AI entity's vision cone in a topdown 2D game.

Hmm, that's interesting on LOL. So it's sort of like Phantasy Star then? I'll have to check it out!
Nixola wrote:LÖVE will probably support that in 0.9.0
Support what? Textured polygons? If so - yay!
SiENcE wrote:
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".

More infos on our website:
http://aeonofsands.schattenkind.net

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
Thanks for chiming in SiENce! The game really looks great!

And I agree on focusing on the gameplay over the graphics engine. No matter how awesome they are to us, many of these "2.5D" graphics engines will seem pretty archaic to the average gamer, so it's a definitely a good thing if our games are actually fun!

Thanks for the great links. I never thought of looking at the sources through ScummVM, but that's a great idea - I'll definitely have to look into that.

As for suggestions on how you are handling screen resolution, perhaps this would be helpful: https://love2d.org/wiki/TLfres

EDIT:
Wow, those links you gave are REALLY useful :D
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:As for suggestions on how you are handling screen resolution, perhaps this would be helpful: https://love2d.org/wiki/TLfres
First I used TLfres, but after a while I had a lot of problems (i explained in my blogpost). So i reworked TLfres nearly 90% and adjusted the game. But without my game, the modifications aren't useable. First I have to recode it for sharing. Thats why i wrote the blogpost, to help people to understand whats wrong by scaling pixel to fullscreen.
scutheotaku wrote: EDIT:
Wow, those links you gave are REALLY useful :D
You are welcome :). I really should start a thread on love forum about my game. I have one at tigsource, but it seems the people only watching the thread and do not reply ... wish is really sad.
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 »

SiENcE wrote:
scutheotaku wrote:As for suggestions on how you are handling screen resolution, perhaps this would be helpful: https://love2d.org/wiki/TLfres
First I used TLfres, but after a while I had a lot of problems (i explained in my blogpost). So i reworked TLfres nearly 90% and adjusted the game. But without my game, the modifications aren't useable. First I have to recode it for sharing. Thats why i wrote the blogpost, to help people to understand whats wrong by scaling pixel to fullscreen.
scutheotaku wrote: EDIT:
Wow, those links you gave are REALLY useful :D
You are welcome :). I really should start a thread on love forum about my game. I have one at tigsource, but it seems the people only watching the thread and do not reply ... wish is really sad.
Ah, sorry, I didn't see your reference to TLfres in your blog post :)
Unfortunately, my experience with LOVE is limited so I don't have many more ideas...

You should definitely start a thread here on the LOVE forum though! You're project looks great and seems to be coming along nicely, and it really is a shame if interest/interaction on TIGSource is waning - it definitely deserves plenty of attention!

As a side note, I really enjoyed all the detail in your posts in the TIGSource thread :)
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:As a side note, I really enjoyed all the detail in your posts in the TIGSource thread :)
Thx :)
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 »

:awesome:
scutheotaku wrote:
Nixola wrote:LÖVE will probably support that in 0.9.0
Support what? Textured polygons? If so - yay!
Ah, that would be awesome.
Post Reply

Who is online

Users browsing this forum: No registered users and 33 guests