
-----------------------------------
Shanethe13
Tue May 12, 2009 2:55 pm

Raycasting (Pseudo-3D) Engine - First Major Program
-----------------------------------
Yesterday during programming class I decided that I would start working on my final assignment a bit early, so I started working on what, for lack of creativity on my part, is currently known as "Raycasting Demo."  I am nowhere near completing the program, but after an hour or two of tinkering with trigonometry, I have a pretty decent engine working, and all that is left is optimization, gameplay, and a few more features such as shading.

When you start the program, you will see an extremely temporary splash screen with a title, and three buttons; play, level editor, and quit.  I've yet to make a level editor, but you can click on play to see what I have working so far.  The WASD keys will move you forwards, backwards, and allow rotation of the camera.

Anyways, feel free to offer some criticism, ideas, or even ask a few questions if you ever wanted to make your own raycasting engine, it really isn't too difficult.  I would be posting the source code, but at this point the coding isn't my best, and it has very few comments.

This is also my first Turing program that has consisted of more than just a basic pong game, so don't be surprised if you find some major bugs or flaws in the design, I love criticism though, so bash my program to the point that I lose all faith in my talents as a programmer!

Change Log:
-Added a level editor
-Optimized the code slightly
-Fixed various bugs

-----------------------------------
Shanethe13
Thu May 14, 2009 2:40 pm

RE:Raycasting (Pseudo-3D) Engine - First Major Program
-----------------------------------
I wasn't able to find a list of rules for this section, so I'm not sure whether this form of bumping is allowed or not, but I've uploaded a new version of the program.

The level editor works almost perfectly, save for a bug that occurs if you press more than one button with one mouseclick through dragging over them. 

When using the editor, the left mouse button will place the currently selected wall type, the middle button will set the spawn point to the current position, (no visual indicator as of yet) and the right mouse button will delete the currently selected wall.

-----------------------------------
andrew.
Thu May 14, 2009 5:10 pm

RE:Raycasting (Pseudo-3D) Engine - First Major Program
-----------------------------------
This is amazing especially because it's your first attempt at raycasting. Good job!

-----------------------------------
Shanethe13
Thu May 14, 2009 6:39 pm

RE:Raycasting (Pseudo-3D) Engine - First Major Program
-----------------------------------
Thanks :D It still has a lot of work to go, but once I iron out all the current bugs, it's easy to add in additional features.  I'd say the next step would be textures, then floor/ceiling shading.

-----------------------------------
corriep
Thu May 14, 2009 6:39 pm

RE:Raycasting (Pseudo-3D) Engine - First Major Program
-----------------------------------
Quick bug I found, when you make your own level but don't include a wall, the program will error out when you try to go outside the map

-----------------------------------
Shanethe13
Thu May 14, 2009 6:41 pm

Re: RE:Raycasting (Pseudo-3D) Engine - First Major Program
-----------------------------------
Quick bug I found, when you make your own level but don't include a wall, the program will error out when you try to go outside the map

Yep, that's one of the bugs I was referring to in the post I made at literally the same time you posted.  I can't see it taking more than a line or two to fix, I'll take a look at it tomorrow since  I'm busy writing an essay on Shakespeare now.

-----------------------------------
Homer_simpson
Thu May 14, 2009 8:03 pm

Re: Raycasting (Pseudo-3D) Engine - First Major Program
-----------------------------------
i like it, i get good frame rate also for turing 20-23 fps

-----------------------------------
Shanethe13
Fri May 15, 2009 7:08 am

Re: Raycasting (Pseudo-3D) Engine - First Major Program
-----------------------------------
i like it, i get good frame rate also for turing 20-23 fps
Thanks, but I'm thinking the frame rate is high because I haven't added textures or anything in yet.  Judging from the other raycasting programs I've seen made in Turing, the program runs fine until you add textures.

-----------------------------------
DanTheMan
Fri May 15, 2009 8:43 am

RE:Raycasting (Pseudo-3D) Engine - First Major Program
-----------------------------------
I would love it if you would post the source code, but I'm not in any sort of mood to ruch you.

-----------------------------------
SNIPERDUDE
Fri May 15, 2009 9:55 am

RE:Raycasting (Pseudo-3D) Engine - First Major Program
-----------------------------------
I rather enjoyed how you sepparated each wall using shades based off of whether it was vertical or horrizontal.

For mine I originally had the shade based off the distance, which is a little too much for Turing's speed.  This is a great alternative.

+15 bits

-----------------------------------
Shanethe13
Fri May 15, 2009 2:18 pm

Re: RE:Raycasting (Pseudo-3D) Engine - First Major Program
-----------------------------------
I rather enjoyed how you sepparated each wall using shades based off of whether it was vertical or horrizontal.

For mine I originally had the shade based off the distance, which is a little too much for Turing's speed.  This is a great alternative.

+15 bits

I had actually originally done it based off of distance, but then a friend of mine suggested doing it based on wall orientation.  I believe that is also how it was done on Wolfenstein, but I'm not positive.

Either way, thanks for the bits :D

-----------------------------------
Homer_simpson
Fri May 15, 2009 3:26 pm

Re: Raycasting (Pseudo-3D) Engine - First Major Program
-----------------------------------
turing is definitly too slow for texturing, i would suggest you move on to a more powerful programming language

-----------------------------------
Shanethe13
Fri May 15, 2009 4:28 pm

Re: Raycasting (Pseudo-3D) Engine - First Major Program
-----------------------------------
turing is definitly too slow for texturing, i would suggest you move on to a more powerful programming language

Well I actually have a bit of experience in C++, and lots in C#. I'm just using Turing since I'm in the grade 10 computer science course right now.

-----------------------------------
Dan
Fri May 15, 2009 4:59 pm

Re: Raycasting (Pseudo-3D) Engine - First Major Program
-----------------------------------
turing is definitly too slow for texturing, i would suggest you move on to a more powerful programming language

I have seen raycasting texturing done in turing before so it deftaly is posible to do and having running at a resnobale rate.

-----------------------------------
Kharybdis
Fri May 15, 2009 7:20 pm

RE:Raycasting (Pseudo-3D) Engine - First Major Program
-----------------------------------
Impressive engine, for a first try. I would have loved to be in your grade 10 class, sounds like fun.

-----------------------------------
Homer_simpson
Sat May 16, 2009 2:17 am

Re: Raycasting (Pseudo-3D) Engine - First Major Program
-----------------------------------
turing is definitly too slow for texturing, i would suggest you move on to a more powerful programming language

I have seen raycasting texturing done in turing before so it deftaly is posible to do and having running at a resnobale rate.

you're right http://compsci.ca/v3/viewtopic.php?t=16174&highlight=raycast 
i forgot about this one. the quality of texture isn't too crazy tho. but it's impressive.

-----------------------------------
Shanethe13
Thu May 28, 2009 6:19 pm

Re: Raycasting (Pseudo-3D) Engine - First Major Program
-----------------------------------
Thanks for the comments :D
I was away all last week, so I wasn't able to make any changes until the past few days.  I did manage to add in some textures, but the frame rate drop was too big for it to be worth it.  Either way, here is a newer version with a few changes;

Guns, shooting, and rudimentary reloading
A few images
Joystick support
Bug fixes
