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

Username:   Password: 
 RegisterRegister   
 My First 3d Prog! : )
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
SNIPERDUDE




PostPosted: Wed Oct 24, 2007 5:59 pm   Post subject: My First 3d Prog! : )

So I decided to lean about the math required for 3D programming, and I got the basics down. I kind of got the idea for this game from someone else's post (I forget who now) that diplayed a maze using raycasting (I used the same method, made my own from scratch though). Hope you like!

The game is called Labrynth : The Beginnings (my friend saw the program and came up with the name because it is very maze-like. I would of made bigger rooms [I will later] but it makes it slower - which reminds me: DOES NOT WORK WELL ON SLOW COMPS. The whole game started as a raycasting test, but then I added shading, then weapons, and so forth [LMAO]. So far there are 6 weapons (sorry I don't have all the icons and names done yet, I decided to do the weap icons using turing graphics), in this order:
1 - handgun
2 - machinegun
3 - semi-auto
4 - shotgun
5 - rifle
6 - sniper rifle

I also decided to add other cool features (other than the shading) such as:
visibility - how well the enemy can see you
day / night - on a timer, also determines the brightness of the environment
shells (didn't know what to call it) - umm, if you've ever played a d-day game or level in a war game, sometimes they have that thing where the camera shakes from artillery. That...
sniper breathing movements - just go into snipe mode to see what I mean...
I'm starting gadgets (so far all I have is flashlight)
Seasons - if you go to the text file (.../text/game/maps/2.txt), you can change the first line to either:
Fall
Winter
Summer
Spring
etc...

CONTROLS:
w - walk forward
d - walk back
a - strafe left
d - strafe right
q - turn 90 degrees left
e - turn 90 degrees right
SPACE - go into snipe mode
ALT - crouch
CTRL - flashlight
arrow keys (U/D) - change weap
DEL - reload
Mouse - shoot / look around

There are a few bugs (such as you can keep reloading after you're out of bullets, and a few easy fixables), and this is just the beginning - please ignore those things untill I post the rest. Honest opinions / sugestions / comments / questions / etc. welcome!



Labrynth - The Beginnings.rar
 Description:
Demo mode

Download
 Filename:  Labrynth - The Beginnings.rar
 Filesize:  13.06 MB
 Downloaded:  625 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
CodeMonkey2000




PostPosted: Wed Oct 24, 2007 7:26 pm   Post subject: RE:My First 3d Prog! : )

That's a great fish bowl effect you have there Wink.

Anyway, how are you loading up your maps? It seems even slower than my low-res raycasting engine, and that had textures.
SNIPERDUDE




PostPosted: Wed Oct 24, 2007 7:57 pm   Post subject: Re: My First 3d Prog! : )

how did you do your raycasting?
Then again it could be slower because of everything else (there was alot of RGB stuff going on too)
It's a normal speed when played on a good comp...
I hope it's not laging on you.

Anywho I loaded the map using the pic you see on the left half.
I just recorded the distance between your char and the wall and drew the height of that slice
(the screen on the right is just made up of vertical slices, 4 pix wide for 81?)
by scaling the dist (which creates that fishbowl effect you mentioned)

Maybe there's a faster way?
Ah well, this works for now. Do note this is my first attempt at this

Any ideas for the game tho?

That reminds me, I'm also going to add more weapon animations (like the handgun you see) and other animations as loading, etc. (I haven't done it yet cuz it's alot of work, lol)
SNIPERDUDE




PostPosted: Wed Oct 24, 2007 8:10 pm   Post subject: Re: My First 3d Prog! : )

where it says "81?" it's supposed to be 81 degrees.
CodeMonkey2000




PostPosted: Wed Oct 24, 2007 8:39 pm   Post subject: RE:My First 3d Prog! : )

There is a better way. I take it that you take an angle and cast a ray which increases at a constant rate right? There is a faster and much more complex way of doing it. It involves a bunch of assumptions, such as the fact that the world is a 2 dimensional grid made up of equal squares with different properties.

Anyway, here is a simple way to correct the fish bowl effect if you are interested.

distanceToWall = distanceToWall * cos(currentAngleCasted - viewAngle)

You will need to check if cos(currentAngleCasted - viewAngle) = 0 or else you will get a divide by zero error.
SNIPERDUDE




PostPosted: Wed Oct 24, 2007 9:46 pm   Post subject: Re: My First 3d Prog! : )

hmmm, I'll look into that grid idea...
thanks.

If you have any details on that method please let me know
shakin cookie




PostPosted: Wed Jan 02, 2008 6:03 pm   Post subject: RE:My First 3d Prog! : )

why is this post in turing submissions? It's not .t, it is .rar!
Saad




PostPosted: Wed Jan 02, 2008 6:08 pm   Post subject: RE:My First 3d Prog! : )

A rar file is a compressed file just like .zip, for windows use WinRAR to open the file, Also program looks good, although the program lags a tiny bit in some turns.
Sponsor
Sponsor
Sponsor
sponsor
Gooie




PostPosted: Thu Jan 03, 2008 1:10 am   Post subject: Re: My First 3d Prog! : )

How did you store the face values from the .obj file. I've been trying to figure it out. How can you have a flexible array, inside a flexible array? The number of faces is preset, and the number of vertexes, in a face aren't preset, I've seen 2 to 400 vertexes per face.
Carey




PostPosted: Mon Jan 07, 2008 12:46 pm   Post subject: RE:My First 3d Prog! : )

you can have
code:

var thing : flexible array 1..0, 1..0 of int

if that's what you're asking
SNIPERDUDE




PostPosted: Tue Jan 22, 2008 1:49 pm   Post subject: RE:My First 3d Prog! : )

wow, been a while since I've been on. Ummm, thanks for the comments, I will post an updated version later - I am currently working on an update for my GUI class.
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 1  [ 11 Posts ]
Jump to:   


Style:  
Search: