Page 2 of 5

Re: "A FPS Game" Online Game

Posted: Mon Jan 26, 2009 3:00 pm
by LeonBlade
Thanks,

I'm not so good with physics... lol
But everything else is easy stuff...

Re: "A FPS Game" Online Game

Posted: Mon Jan 26, 2009 5:25 pm
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.

Re: "A FPS Game" Online Game

Posted: Mon Jan 26, 2009 8:04 pm
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:

Re: "A FPS Game" Online Game

Posted: Mon Jan 26, 2009 9:24 pm
by LeonBlade
Yes... this was already explained on the other page, lets try and not give yourself more power than you have

Re: "A FPS Game" Online Game

Posted: Mon Jan 26, 2009 10:03 pm
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.

Re: "A FPS Game" Online Game

Posted: Mon Jan 26, 2009 10:09 pm
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:

Re: "A FPS Game" Online Game

Posted: Tue Jan 27, 2009 8:09 am
by LeonBlade
LOL that is a phone post alright ;)

Re: "A FPS Game" Online Game

Posted: Tue Jan 27, 2009 3:06 pm
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:

Re: "A FPS Game" Online Game

Posted: Tue Jan 27, 2009 3:23 pm
by LeonBlade
Phone post!

Re: "A FPS Game" Online Game

Posted: Wed Jan 28, 2009 1:35 pm
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?

Re: "A FPS Game" Online Game

Posted: Wed Jan 28, 2009 2:15 pm
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

Re: "A FPS Game" Online Game

Posted: Wed Jan 28, 2009 2:22 pm
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:

Re: "A FPS Game" Online Game

Posted: Wed Jan 28, 2009 2:40 pm
by LeonBlade
You need the XN-gay framework... lol

Re: "A FPS Game" Online Game

Posted: Wed Jan 28, 2009 3:13 pm
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);
	}
};

Re: "A FPS Game" Online Game

Posted: Wed Jan 28, 2009 3:39 pm
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...