Jump to content
  • Advertisement

PhilVaz

Member
  • Content Count

    452
  • Joined

  • Last visited

Everything posted by PhilVaz

  1. Hello, I'm getting an unresolved external symbols on DirectInput. Trying to do a basic init keyboard and mouse, then display keyboard and mouse data. No compile errors, but some link errors. Maybe some library I'm forgeting? I have manually included dinput8.lib and dinput.h but getting this: Linking... DirectInputDemo.obj : error LNK2001: unresolved external symbol _IID_IDirectInput8A DirectInputDemo.obj : error LNK2001: unresolved external symbol _GUID_SysKeyboard DirectInputDemo.obj : error LNK2001: unresolved external symbol _GUID_SysMouse dinput8.lib(dilib2.obj) : error LNK2001: unresolved external symbol _GUID_Key dinput8.lib(dilib1.obj) : error LNK2001: unresolved external symbol _GUID_ZAxis dinput8.lib(dilib1.obj) : error LNK2001: unresolved external symbol _GUID_YAxis dinput8.lib(dilib1.obj) : error LNK2001: unresolved external symbol _GUID_XAxis Release/DirectInputDemo.exe : fatal error LNK1120: 7 unresolved externals Something to do with GUID? Source here: DirectInputDemo.cpp DirectInputDemo.zip Phil P
  2. PhilVaz

    DINPUT8 unresolved

    That was it, thanks. Been using GetAsynchKeyState and Win32 for mouse, got some lag, so I figure I'd switch over. www.VazGames.com Phil P
  3. Hey this is exactly my question. It must be a popular one. :-) One way is to use atan2(dz,dx) where dz = how much to move on z, and dx = how much to move on x. It should work and is shorter than having to take dot/cross products. The formula to convert to degrees would be angle = atan2(dz,dx) * 180 / PI My thread above Rotation on Y If your Z is into/out of the screen, and your X is left/right, then you want to rotate on Y (up/down). In OpenGL glRotatef(Enemy.Angle, 0.0f, 1.0f, 0.0f); // rotate on Y Phil P
  4. PhilVaz

    Tank 3D Rotation on Y

    This may get asked a lot since it seems to be a basic game math problem. What I need is the rotation angle on Y so that my game model faces the direction it is running. I believe this is called "angle between vectors." I have MD2 models running on the ground, but they do not face the direction they are running. dx and dz (the x and z vectors) is how much to move on x and z each frame, dy = 0 since no movement on y. From my VazTank.cpp (OpenGL, Win32, Visual C++) source: Enemy.dx = dx; Enemy.dy = 0.0f; Enemy.dz = dz; Enemy.Angle = ??? // FIX: FIND CORRECT FACING ANGLE The angle gets put in here (for example): glRotatef(Enemy.Angle, 0.0f, 1.0f, 0.0f); // rotate on Y RenderModel(&model_copter, ENEMY_COPTER); // FIX: PASS INSTANCE OF MODEL What is the formula for angle in terms of dx and dz? I have read something about atan2( ) but it doesn't seem to work. Is atan2( ) what I need? For those interested, full CPP source and game I am working on: VazTank2 CPP source (VC 6 project files, source, sounds and resources) VazTankGame EXE (EXE game, bmp textures and MD2 models) VazGames.com (games and demos) Current problems in VazTank2 that need fixing: rotation angle on Y, and animation stutters since I need to pass multiple instances of the MD2 models, rather than the same pointer. Or I need to keep track of unique animation positions for each model instance on screen. Phil P
  5. PhilVaz

    Tank 3D Rotation on Y

    You know what, that may be it. I made a typo dz,dy above. I meant to type dz,dx. I think I had it right in the game however, atan2(dz,dx). Thanks for the insights. Phil P
  6. PhilVaz

    Tank 3D Rotation on Y

    Thank you, I am on the right track then with atan2( ). Good. The way I've tried the formula is simply Enemy.dx = dx; Enemy.dy = 0.0f; Enemy.dz = dz; Enemy.Angle = (GLfloat)(atan2(dz,dy) * 180.0 / PI); As far as how it is not working, it seems to generate random angles. What is weird is if I simply do above Enemy.Angle = 0.0f this also seems to generate random angles. If angle = 0 however I should see all MD2 models facing the same way in the game, right? Assuming they are standard MD2 models (I got them from Planet Quake). The struct for Enemy (tank, dragon, goblin, etc) typedef struct // Struct for Enemy tanks { bool alive; int state; // NORMAL, DIED, CRAWL, TAUNT ? //t3DModel model; // Model anims, etc ??? GLfloat x; GLfloat y; GLfloat z; GLfloat dx; GLfloat dy; GLfloat dz; GLfloat Angle; // rotate angle on y (facing direction) int type; // type 1 = tank, 2 = copter, 3 = goblin, 4 = dragon, etc int count; // count wait to adjust position, fire, death anim, etc // int currAnim; // current animation // int currFrame; // current frame of animation } ENEMY_STRUCT; Besides the Y rotation problem, I get stutters in the animation. That is because I do not pass unique pointers to the model struct. So when there is more than 1 goblin or more than 1 dragon, the animation stutters and does not loop correctly. I think I have to keep track of the currAnim and currFrame of each model on the screen (but we'll save that for later). Right now I want to fix this darn Y rotation problem. All the source and game is linked above. Phil P
  7. Wild Pointer said: this summer(after school) i will start on a missle command project. Missile Command is awesome, state of the art for 1980. :) Cool game. Missile Command 1 Missile Command 2 You've been given some good advice, SDL is probably easiest since you don't have to learn Win32. Basic 2D GDI, DirectDraw, and 3D OpenGL at my page, including some of the math involved. VazGames.com Phil P
  8. PhilVaz

    actual GAME tutorials

    Wild Pointer said: i cant figure out how to get the missle from the base to move toward the point that was clicked. like how to calculate the x and y speeds. Good question, here is one solution that doesn't require Trig, just a square root function, and basic math operations. The steps are: in 2D: // get the difference in x and y between player and enemy (or target) dx = Player.x - Enemy.x dy = Player.y - Enemy.y // compute the magnitude or distance between player and enemy (or target) m = SQRT (dx * dx + dy * dy) // divide dx dy by m times speed to get respective x, y vectors xmove = (dx / m) * SPEED ymove = (dy / m) * SPEED The xmove and ymove vectors would be how much to add to the x, y coordinates of bullet or enemy each game frame. SPEED can be a number like 5 depending how fast you want the bullet or missile to move each frame. So that is how you "aim" a bullet or missile. 3D is similar, you just add a value for z and you get a z vector. Missile Command is a classic, I was actually 15 when the original Atari arcade game came out in 1980. I wrote a Introduction to Windows Game Programming that explains more.... Phil P
  9. PhilVaz

    Need Help for making 2D sprites.

    PaulC << try switching from the brush to the pencil tool >> Yeah I should have thought of that. I gave ColonyScout the old PhotoDelux, the pencil tool will give you small pixels. Brush is for filling in an area, not for fine pixel drawing I guess. Very helpful people in here, just don't ask "How do I make an MMORPG with GIMP or Graphics Gale?" :-) Phil P
  10. PhilVaz

    VazTank 3D shooter

    VazTank 3D shooter complete. Took about 4 months. OpenGL, straight C, basically took Nehe World 3 demo and turned that into a full game. Great for beginners in OpenGL and the book Beginning OpenGL Game Programming was most useful. ZIP | source | notes Download the ZIP, unzip all in same folder. No install, just double-click the exe. Tested on 10 computers from 500 Mhz to 3.0 Ghz, various graphics cards. You should get 60 FPS or better if running correctly. Although this is a Tank sim, this game contains all the basics to make any 3D shooter using OpenGL. Go ahead and Email or reply here if you like it or hate it. :) Source included in zip but not the resources (sounds). VazGames.com Phil Porvaznik
  11. PhilVaz

    VazTank 3D shooter

    One more thing, your player tank increases and decreases speed with up and down arrows. If you want to stop immediately, press X on keyboard. Phil P
  12. PhilVaz

    VazTank 3D shooter

    Yeah, firing a bit slow since I'm using my WinProc to read the mouse, rather than DirectInput which I haven't learned yet. Hold the left mouse button down for a second or 2, also CTRL is fire. It will fire every time. You can hold those down for "rapid" fire. Fire is about .75 to 1 seconds between shots, I did that on purpose, otherwise its too easy. I have some tank models, problem is they are 10,000 polygons (triangles) or more. I'll work on how to load a real "textured" model in my next game. Plus the copter flies backward, there is a formula to figure out my rotation angle on Y, I should add that and make it fly straight. I put a delay in the menu, sometimes it does skip selections. A few bugs there, but it should run okay. The mouse movement is very sensitive. Phil P
  13. PhilVaz

    VazTank 3D game

    << Dude you have been working on that game for a LONG time. >> Started in July. Took a few months off. It will get done, got stuck on 3D model format, not sure what to do. I'll figure something out. Bullets firing in a few days.... Phil P
  14. PhilVaz

    VazTank 3D game

    Okay, I figure I'd ask for comments. Working with OpenGL the past few months. Here's what I've come up with. Hopefully done by Thanksgiving. Having problems with some of my graphics leaving "artifacts" (not sure what to call them). For example, you can see the top of my textures when you hit "C" to change tank cam position. Pretty basic OpenGL, I stole Nehe World 3 which he wrote like 5 years ago, and turning that into a 3D tank game. VazTank.zip | VazTank.cpp No install, just unzip into the same folder. Shows how to set up a primitive 3D "world" in OpenGL. Blessed Halo 2 day to you all. VazGames.com Phil P
  15. Bare minimum DirectDraw and Win32 Game Loop if you want to use these. Straight C style. See demos middle of page, near the bottom. VazGames A bit more set up than SDL which has built in 2D graphics functions. So SDL probably easier, haven't used it yet myself. Phil P
  16. PhilVaz

    VazTank 3D game

    << Is this suppose to be where you are at right now with the game or there is something wrong? >> Yeah that's it. Sorry, maybe should have waited until more is done. I'm surprised I got this far! Not sure how to do the "enemies".... I'm thinking a simple 3D model format, but not sure what to use. Wrote a ASC (3ds) model loader.... anyway, if you can look around, see some boxes and pyramids, then that's it. You can fire (CTRL) but no bullets appear yet. :) It's a bare skeleton of a 3D game. Phil P
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!