Game Dev

Welcome to my game dev section.

Here you can find out about my current hobby work in progress.

For some ancient history about me check out the intro.

To give it a whirl get the latest build here!!!

I’ll be adding troubleshooting info soon.

For now, just enjoy the latest screenshots.

5 Responses to “Game Dev”

  1. Borealis Says:

    Hey Sharky,

    As promised I checked out your game. I just ran it on the Xbox360.
    I tried several game modes and planes. Did not experience a crash or slow down.

    Hope this helps.

    Bino

  2. Sharky Says:

    Thanks heaps.

  3. Oli Says:

    Awesome game Sharky : D
    Can you help me?
    I wanna create AI that mmoves towards a given point
    how do I do this?

  4. Sharky Says:

    Thanks Oli.

    Well in simplest terms, you’d probably want to start with getting the Vector between your AI position and the target position.

    e.g. (not sure if this compiles – doing it from memory – but you’ll get the idea)

    //assuming you have a TargetThing object and an AIThing object, both with Position
    //(vector3) properties defining their position in the world.

    Vector3 targetPosition = TargetThing.Position;
    Vector3 aiPosition = AIThing.Position;

    //the difference between these to vectors gives you an offset vector
    //from one to the other

    Vector3 offsetToTarget = targetPosition – aiPosition;
    float distanceToTarget = offsetToTarget.Length();

    //you probably don’t want your AI to warp jump straight to that position
    //so we normalize the offset vector (turns it into a vector heading the same direction,
    //but with a length of exactly 1.

    Vector3 moveDirectionVector = Vector3.Zero;
    if (distanceToTarget > 0) //Normalize would get odd result if the positions were the same.
    {
    moveDirectionVector = offsetToTarget
    moveDirectionVector.Normalize();
    }

    //now to actually move your AIThing in that direction
    //you’ll want something kind of like this.
    //Note: your games Update method would likely have a gameTime parameter.
    //AIThing.MaxSpeedPerSecond would be a float value defining how far something would move in a Second.
    //gameTime.ElapsedGameTime.TotalSeconds is how many seconds
    // (likely fraction of a second) have passed since the previous Update.
    //We use it to even out the perceived movement regardless of the
    //game’s Framerate which fluctuates.

    Vector3 velocity = moveDirectionVector * AIThing.MaxSpeedPerSecond * gameTime.ElapsedGameTime.TotalSeconds;

    //add the velocity to your AI’s position to move it.

    AIThing.Position = AIThing.Position + velocity;

    Hope that helps?

  5. Elbows Says:

    It surely helped me, i was looking for some kind of idea into this problem, thanks for the grant help, although it was out of the blue that i found this, it really gives me a leg up

Leave a Reply