"A FPS Game" Online Game

Anything related in any way to game development as a whole is welcome here. Tell us about your game, grace us with your project, show us your new YouTube video, etc.

Moderator: PC Supremacists

User avatar
LeonBlade
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 1314
Joined: Thu Jan 22, 2009 12:22 am
Current Project: Trying to make my first engine in C++ using OGL
Favorite Gaming Platforms: PS3
Programming Language of Choice: C++
Location: Blossvale, NY

Re: "A FPS Game" Online Game

Post by LeonBlade »

Thanks,

I'm not so good with physics... lol
But everything else is easy stuff...
There's no place like ~/
User avatar
Aeolus
Chaos Rift Regular
Chaos Rift Regular
Posts: 179
Joined: Fri Jan 16, 2009 2:28 am

Re: "A FPS Game" Online Game

Post by Aeolus »

There a admin has seemed to clean this thread, lol so please stay on topic about your game and no more racism.

Thanks Superadmindude.
Hyde from That 70's Show wrote:Woman are like muffins... Once you have a muffin you will do anything to have another muffin... And they know that.
User avatar
Ginto8
ES Beta Backer
ES Beta Backer
Posts: 1064
Joined: Tue Jan 06, 2009 4:12 pm
Programming Language of Choice: C/C++, Java

Re: "A FPS Game" Online Game

Post by Ginto8 »

Aeolus wrote:There a admin has seemed to clean this thread, lol so please stay on topic about your game and no more racism.

Thanks Superadmindude.
:roll: Did you notice that you are straying off topic by saying that? :lol:
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
User avatar
LeonBlade
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 1314
Joined: Thu Jan 22, 2009 12:22 am
Current Project: Trying to make my first engine in C++ using OGL
Favorite Gaming Platforms: PS3
Programming Language of Choice: C++
Location: Blossvale, NY

Re: "A FPS Game" Online Game

Post by LeonBlade »

Yes... this was already explained on the other page, lets try and not give yourself more power than you have
There's no place like ~/
User avatar
Aeolus
Chaos Rift Regular
Chaos Rift Regular
Posts: 179
Joined: Fri Jan 16, 2009 2:28 am

Re: "A FPS Game" Online Game

Post by Aeolus »

Yeah i always tend to go off topic, especially when im typing on my phone while driving.

You can tell in my posts when im on my phone (short messages and they go offtopic sometimes) and when im on my desktop where they are long line this and us correct grammar.
Hyde from That 70's Show wrote:Woman are like muffins... Once you have a muffin you will do anything to have another muffin... And they know that.
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: "A FPS Game" Online Game

Post by eatcomics »

Aeolus wrote:Yeah i always tend to go off topic, especially when im typing on my phone while driving.

You can tell in my posts when im on my phone (short messages and they go offtopic sometimes) and when im on my desktop where they are long line this and us correct grammar.
^Phone post?
:lol:
Image
User avatar
LeonBlade
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 1314
Joined: Thu Jan 22, 2009 12:22 am
Current Project: Trying to make my first engine in C++ using OGL
Favorite Gaming Platforms: PS3
Programming Language of Choice: C++
Location: Blossvale, NY

Re: "A FPS Game" Online Game

Post by LeonBlade »

LOL that is a phone post alright ;)
There's no place like ~/
User avatar
Ginto8
ES Beta Backer
ES Beta Backer
Posts: 1064
Joined: Tue Jan 06, 2009 4:12 pm
Programming Language of Choice: C/C++, Java

Re: "A FPS Game" Online Game

Post by Ginto8 »

eatcomics wrote:
Aeolus wrote:Yeah i always tend to go off topic, especially when im typing on my phone while driving.

You can tell in my posts when im on my phone (short messages and they go offtopic sometimes) and when im on my desktop where they are long line this and us correct grammar.
^Phone post?
:lol:
well... (most of) his grammar is correct; he just needs to work on spelling. :lol:
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
User avatar
LeonBlade
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 1314
Joined: Thu Jan 22, 2009 12:22 am
Current Project: Trying to make my first engine in C++ using OGL
Favorite Gaming Platforms: PS3
Programming Language of Choice: C++
Location: Blossvale, NY

Re: "A FPS Game" Online Game

Post by LeonBlade »

Phone post!
There's no place like ~/
User avatar
Aeolus
Chaos Rift Regular
Chaos Rift Regular
Posts: 179
Joined: Fri Jan 16, 2009 2:28 am

Re: "A FPS Game" Online Game

Post by Aeolus »

Haha don't make me start a thread where you need to guess if i have made a phone post or a desktop post. Lol it could be fun though. Oh and what spelling do i need to work on? I spell almost everything correctly. Unless its on my phone hahaha.

Anyways back on topic, Any update on the game?
Hyde from That 70's Show wrote:Woman are like muffins... Once you have a muffin you will do anything to have another muffin... And they know that.
User avatar
LeonBlade
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 1314
Joined: Thu Jan 22, 2009 12:22 am
Current Project: Trying to make my first engine in C++ using OGL
Favorite Gaming Platforms: PS3
Programming Language of Choice: C++
Location: Blossvale, NY

Re: "A FPS Game" Online Game

Post by LeonBlade »

Ahh... the game...

Well, there is "some" progress... but until I get collision working, there will be no progress at all!
However, luckily for you, I got the source code for you all to download and you can try your hand at my game...
I have some sort of collision detection going on...

Note: The code is VERY unorganized and not OO (lol)

Just look for the CheckCollisions() method on you should see what I'm trying to do...
You may download this here
There's no place like ~/
User avatar
Ginto8
ES Beta Backer
ES Beta Backer
Posts: 1064
Joined: Tue Jan 06, 2009 4:12 pm
Programming Language of Choice: C/C++, Java

Re: "A FPS Game" Online Game

Post by Ginto8 »

LeonBlade wrote:Ahh... the game...

Well, there is "some" progress... but until I get collision working, there will be no progress at all!
However, luckily for you, I got the source code for you all to download and you can try your hand at my game...
I have some sort of collision detection going on...

Note: The code is VERY unorganized and not OO (lol)

Just look for the CheckCollisions() method on you should see what I'm trying to do...
You may download this here
:( The binary isn't working... and I'm too lazy to compile it myself. :lol:
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
User avatar
LeonBlade
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 1314
Joined: Thu Jan 22, 2009 12:22 am
Current Project: Trying to make my first engine in C++ using OGL
Favorite Gaming Platforms: PS3
Programming Language of Choice: C++
Location: Blossvale, NY

Re: "A FPS Game" Online Game

Post by LeonBlade »

You need the XN-gay framework... lol
There's no place like ~/
User avatar
M_D_K
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 1087
Joined: Tue Oct 28, 2008 10:33 am
Favorite Gaming Platforms: PC
Programming Language of Choice: C/++
Location: UK

Re: "A FPS Game" Online Game

Post by M_D_K »

Code: Select all

        private void CheckCollisions()
        {
            for (int i = 0; i < 6; i++)
            {
                if (player.Center.X < objects[i].Center.X + 200)
                {
                    player.VelocityX = 0f;
                    player.PositionX += 1f;
                    
                }

                if (player.Center.Z < objects[i].Center.Z + 200)
                {
                    player.VelocityZ = 0f;
                    player.PositionZ += 1f;
                }

            }
        }
That will never work. Since your using BoundingSpheres you need to do something like

Code: Select all

//put this somewhere
enum
{
        axisX = 1,
        axisY = 2,
        axisZ = 4,
}
private void CheckCollisions()
{
        for(int i = 0; i < 6; i++)
        {
                //I'm guessing the 200 is the radius
                //playerRadius and objRadius are 200
                if(SphereCollision(player.Center, objects[i].Center, playerRadius, objRadius) == true)
                {
                        if(SphereCollisionOnAxis(player.Center, objects[i].Center, playerRadius, objRadius, axisX) == true)
                                player.Velocity.X = 0.0f;
                        if(SphereCollisionOnAxis(player.Center, objects[i].Center, playerRadius, objRadius, axisY) == true)
                                player.Velcoity.Y = 0.0f;
                        if(SphereCollisionOnAxis(player.Center, objects[i].Center, playerRadius, objRadius, axisZ) == true)
                                player.Velocity.Z = 0.0f;
                }
                //And why the hell were you adding 1f to player position when you wanted to stop movement
        }
}
Sphere collision will probably be along the lines of

Code: Select all

private bool SphereCollision(Vector3 objA, Vector3 objB, float radiusA, float radiusB)
{
        //I'm almost certain this whole thing is wrong since it used to check if a point was in a circle not a Sphere, and not Sphere to Sphere
        //checking
        float x_delta = objA.X - objB.X;
	float y_delta = objA.Y - objB.Y;
	float z_delta = objA.Z - objB.Z;

	float r_delta = sqrt((x_delta * x_delta + y_delta * y_delta + z_delta * z_delta));

	return r_delta<=(radiusA + radiusB);
};

private bool SphereCollisionOnAxis(Vector3 objA, Vector3 objB, float radiusA, float radiusB, long axis)
{
	if(axis == axisX)
	{
		float x_delta = objA.X - objB.X;
		float r_delta = sqrt((x_delta * x_delta));
		return r_delta<=(radiusA + radiusB);
	}

	if(axis == axisY)
	{
		float y_delta = objA.Y - objB.Y;
		float r_delta = sqrt((y_delta * y_delta));
		return r_delta<=(radiusA + radiusB);
	}

	if(axis == axisZ)
	{
		float z_delta = objA.Z - objB.Z;
		float r_delta = sqrt((z_delta * z_delta));
		return r_delta<=(radiusA + radiusB);
	}
};
Gyro Sheen wrote:you pour their inventory onto my life
IRC wrote: <sparda> The routine had a stack overflow, sorry.
<sparda> Apparently the stack was full of shit.
User avatar
LeonBlade
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 1314
Joined: Thu Jan 22, 2009 12:22 am
Current Project: Trying to make my first engine in C++ using OGL
Favorite Gaming Platforms: PS3
Programming Language of Choice: C++
Location: Blossvale, NY

Re: "A FPS Game" Online Game

Post by LeonBlade »

What is "delta" and "<=" (not an operator I assume)

Also, I was using the 1f to the player position because when I stop all velocity to the player, it doesn't work...
There's no place like ~/
Post Reply