Home General Discussion

Quake-like movement

matheboy
polycounter lvl 17
Offline / Send Message
matheboy polycounter lvl 17
Hello everybody.
I am designing a game engine, and I would like to know how to implement a function that moves my camera and weapon together like in quake. The pure Quake style movement with polar coordinates would be great, but enough moving camera and weapon together.
If someone knows, or knows about tutorials, or whatever... please help!

Replies

  • KeyserSoze
    Options
    Offline / Send Message
    KeyserSoze polycounter lvl 18
    Well, I know the lazy way is to just use a physics engine like NGD (Newton Game Dynamics) or ODE (Open Dynamics Engine) to handle all of the collision detection and character/object movement. Other than that, I have no suggestions because I know very little about designing a game engine.
  • KDR_11k
    Options
    Offline / Send Message
    KDR_11k polycounter lvl 18
    Um, if you're wondering about THAT maybe you should rethink your decision to make an engine?

    Attaching something to the camera is trivial, just copy the camera matrix and add some translation.
  • matheboy
    Options
    Offline / Send Message
    matheboy polycounter lvl 17
    that was very easy indeed!. I didn't knew the beautifull function glGet(); that returns information about all your states in OpenGL. I just don't know how could live without.

    Many thanks for the help KeyserSoze.

    What about some information about the tipycal Quake movement, keyboard = position, mause = orientation. ??
  • PfhorRunner
  • KDR_11k
    Options
    Offline / Send Message
    KDR_11k polycounter lvl 18
    Come on, that movement stuff is trivial! Read up on some linear algebra and use your head a little! I don't know what collision detection and BSP will do to you otherwise.
  • Downsizer
    Options
    Offline / Send Message
    Downsizer polycounter lvl 18
    I will echo the others statements, that you have a long way to go if you can't figure basic movement out.

    What you are describing is Q3 rendering elemets to screen coordinates as opposed to world coordinates. The player model is not drawn while in first person. The wepon models and animations stand alone and are draw to the screen and simply animated to synch up with the actual shooting/whatever functions. What really determines the hit or actions is an invisible TAG geometry tri on the 3rd person model.

    I think that will get you started. Look up mods for wep replacements in Q3 and you should get the general idea.
  • matheboy
    Options
    Offline / Send Message
    matheboy polycounter lvl 17
    I asume you don't know
  • KDR_11k
    Options
    Offline / Send Message
    KDR_11k polycounter lvl 18
    Read up on maths, try again. This stuff is trivial, mostly very simple math (like ray-plane intersection, matrix operations, etc) that has been solved by many already. Any basic university level maths should have included that.
  • matheboy
    Options
    Offline / Send Message
    matheboy polycounter lvl 17
    I didn't tried because I am working on other parts of the engine. That is a question just because I am curious. I thought like you that is trivial and I could get an answer quickly, but all I got is "do it yourself".
    It sounds like you would be able to do it if you want and you enjoy saying that. Ok, I can do it too gays, but I have no time right now for this, and no time to explain my reasons.
    If some one knows and have something that helps great, other ways shut up.
  • Mark Dygert
    Options
    Offline / Send Message
    You'll find on forums dealing with game creation, especially when a large percentage of the community is self taught. That when you ask simple questions you get simple answers, normally that answer is "use google, find a tutorial like we did and learn to teach yourself".

    The game industry rewards those who can keep themselves educated in the sea of ever evolving technology. Those that need constant help, actually refuse to look things up and demand that someone give them the simple answer instead of simply finding it on thier own, don't last long.

    If you are serious about getting into 3D Programming there are a TON of programming books, sites, and other reference material "out there". Lastly after reading:
    [ QUOTE ]
    If some one knows and have something that helps great, other ways shut up.

    [/ QUOTE ]
    I wouldn't give you the answer if I knew it, you sound like a raging cock on an ego trip that seriously needs to let a few billion PSI out of his head before asking ANYONE for help.

    You get more flies with honey than vinegar.

    Edit: oh and it is someone (one word) and otherwise not other ways.
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    *cough*
    Lots of info across the board in there.

    Now for movement what you are talking is taking keyboard input, assuming you have an input handler class, and instructing the game engine to update the player entity's world position x units (coresponding to its speed per second divided by update time) along a vector facing in the same direction as the player entity per key press/hold. OF course that's forward movement, and every other direction is relative to that anyway. Rotation is the same way but with mouse axial input coresponding to rotation rate updated and transformed from the player entity's local coordinate space to world space for drawing etc.
    Part of the other reason for these responses is that movement like this is implicitly covered in a basic 3d math tutorial. If you want a "Use X function in Y Library" answer, you won't get one, as that is far to specialized to your individual engine than any of us could know.
  • Downsizer
    Options
    Offline / Send Message
    Downsizer polycounter lvl 18
    Sorry if our comments are not what you want to hear. But they are the right steps. The thought process for me was 'if this guy can write a rendering engine, he sure as hell can figure out simple plane collisions and screen draw.'

    are you truely using your own engine or something like darkbasic? also last I checked. the q3 source was public.
  • matheboy
    Options
    Offline / Send Message
    matheboy polycounter lvl 17
    OK, I found myself the solution to the problem so you don't need to worry about that. You need polar coordinates as I first supposed. As you said to me, if you want to know more find out for yourselves.
    I understood the method you follow to speak each other and I don't like it but if you are happy with it is up to you. I find better just help each other with this stupid thinks and use resources and time with other more interesting but... as I said I respect that.
    And yes q3 is free, but I am developing a game engine from the scratch like a good friend advice me. I was testing the culling system when I thought it could be funnier move around like in quake. I apologize for all the mess.
    Aufwiedersehen.
  • Ninjas
    Options
    Offline / Send Message
    Ninjas polycounter lvl 18
    Polar coordinates weren't used in Quake if I remember correctly. That's why you could move so fast on a diagnal. Anyway, the method that you use for moving your character doesn't have much to do with having the movement match up with the gun. In fact all you have to do is "just copy the camera matrix and add some translation". That was in the second post. Asking the wrong question is your fault, not the fault of this user community.
  • KDR_11k
    Options
    Offline / Send Message
    KDR_11k polycounter lvl 18
    Actually I think they were used, they just added the forward and sideways vectors separately instead of adding and "normalizing" them.
Sign In or Register to comment.