Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Raycasting (Pseudo-3D) Engine - First Major Program
Index -> Programming, Turing -> Turing Submissions
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Shanethe13




PostPosted: Tue May 12, 2009 2:55 pm   Post subject: 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



Raycasting.rar
 Description:

Download
 Filename:  Raycasting.rar
 Filesize:  271.74 KB
 Downloaded:  1020 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Shanethe13




PostPosted: Thu May 14, 2009 2:40 pm   Post subject: 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.




PostPosted: Thu May 14, 2009 5:10 pm   Post subject: RE:Raycasting (Pseudo-3D) Engine - First Major Program

This is amazing especially because it's your first attempt at raycasting. Good job!
Shanethe13




PostPosted: Thu May 14, 2009 6:39 pm   Post subject: RE:Raycasting (Pseudo-3D) Engine - First Major Program

Thanks Very Happy 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




PostPosted: Thu May 14, 2009 6:39 pm   Post subject: 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




PostPosted: Thu May 14, 2009 6:41 pm   Post subject: Re: RE:Raycasting (Pseudo-3D) Engine - First Major Program

corriep @ Thu May 14, 2009 6:39 pm wrote:
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




PostPosted: Thu May 14, 2009 8:03 pm   Post subject: Re: Raycasting (Pseudo-3D) Engine - First Major Program

i like it, i get good frame rate also for turing 20-23 fps
Shanethe13




PostPosted: Fri May 15, 2009 7:08 am   Post subject: Re: Raycasting (Pseudo-3D) Engine - First Major Program

Homer_simpson @ Thu May 14, 2009 8:03 pm wrote:
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.
Sponsor
Sponsor
Sponsor
sponsor
DanTheMan




PostPosted: Fri May 15, 2009 8:43 am   Post subject: 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




PostPosted: Fri May 15, 2009 9:55 am   Post subject: 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




PostPosted: Fri May 15, 2009 2:18 pm   Post subject: Re: RE:Raycasting (Pseudo-3D) Engine - First Major Program

SNIPERDUDE @ Fri May 15, 2009 9:55 am wrote:
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 Very Happy
Homer_simpson




PostPosted: Fri May 15, 2009 3:26 pm   Post subject: 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




PostPosted: Fri May 15, 2009 4:28 pm   Post subject: Re: Raycasting (Pseudo-3D) Engine - First Major Program

Homer_simpson @ Fri May 15, 2009 3:26 pm wrote:
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




PostPosted: Fri May 15, 2009 4:59 pm   Post subject: Re: Raycasting (Pseudo-3D) Engine - First Major Program

Homer_simpson @ 15th May 2009, 3:26 pm wrote:
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.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Kharybdis




PostPosted: Fri May 15, 2009 7:20 pm   Post subject: 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.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 17 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: