• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.


  • Content count

  • Joined

  • Last visited

Community Reputation

126 Neutral

About yenal

  • Rank
  1. Hello,   I recently started a personal game project using Ogre3D. One of the first things I've implemented was a nested finite state machine library. It's not heavily tested but it seems to be working fine this far. I'd appreciate the feedback. Feel free to use it in your personal or commercial project.   https://github.com/yenal/libFSM   Thanks, Yenal
  2. One more question... How do you decouple the rendering from the game logic? e.g. You have Entity instances you use in Ogre for rendering. Would your game object have some renderable object as a member? Is a regular game loop something like this? while(gameIsRunning) { ProcessInput(); ExecuteGameLogic(); // here the input is applied to game objects and their properties like direction, speed is updated UpdateScene(); // here the renderable objects are updated with correct positions and such RenderScene(); // render the whole scene }
  3. I totally agree with you. I have used SDL in my master's project and it was so simplified. I have heard about Lua scripting. How is the game logic implemented via the Lua scripting? Can you give me a simple example (pseude code)?
  4. Even though Tetris is simple, I would like to create some base library that I can use in my games. Actually I have used SDL before and it was not object oriented at all if I remember correctly.
  5. Hello all, I have a couple of questions: 1. Is there any open source game that has commercial quality code (C++ preferred since I am interested in object oriented design. I know that Quake 3 code is out there but in C)? 2. I am planning to use the following components to create a game: - DXUT as graphics engine (may go with Ogre as well) - OIS for input - CEGUI for GUI - No sound I guess :) - Nvidia Physx or Intel Havoc (not needed for my first game which is Tetris :) ) What kind of class design can I use to combine all of them in one game? What kind of game loop should I implement? I know these questions are very open in nature but please help me as much as you can. 3. I am 28 years old and in my 7 years of professional software career, I did work on C and C++ for around 1.5 years. Rest is mostly C#. Am I too late in the game to switch industries (to the game dev industry)? Thanks everyone, Yenal
  6. I will check all of them. I may ask more questions after reading the articles though. Thank you so much.
  7. The issue is I cannot represent this problem with nodes (Or maybe I did not understand this concept well enough). Here is how the car's position change at any time T. if going straight: mPosition += ( mDirection * float( elapsedTime ) * mCurrentSpeed ); if turning left or right: // Calculate the angular velocity float angularVelocity = CalculateAngularVelocity( mCurrentSpeed, elapsedTime, turningAngle ); // Get the 360 modulus of the angle if ( angularVelocity >360.0f ) angularVelocity -= 360.0f * ( int( angularVelocity ) / 360 ); // Update the car's direction mDirection = mDirection.rotateAboutGlobalZ( DEG2RAD( angularVelocity ) ); // Calculate the rotation angle based on the direction vector mRotationAngle = RAD2DEG(atan2f( -mDirection.y, mDirection.x )); if ( mRotationAngle < 0.0f ) { mRotationAngle *= -1.0f; mRotationAngle += 90.0f; } else mRotationAngle = 90.0f - mRotationAngle; // Calculate the new position mPosition = GetNewPositionAfterRotation( mRotationCenter, mPosition, angularVelocity ); Basically calculate the angular velocity based on the time elapsed between the frames. Update the direction vector. Calculate the new position. By the way you exactly understood the problem.
  8. I really need some help about this. At least any web links to a similar problem would be helpful. I am sure some of the other game devs have seen this problem before.
  9. Actually I think it's better if I rephrase the issue to make it more understandable. There are boundaries which the vehicle should never hit. If it crashes any boundary GAME OVER! I am trying to land the vehicle first on some good point (T) parallel to the border. Then I will follow the real target. When the real target is not close to any border it's easy to target it (I have an algorithm which works fine). But when the real target is close to the border I have to apply this strategy. So what I want is basically to land the vehicle parallel to the border that the real target is close to. Whenever the vehicle reaches the T it's direction vector should be parallel to the border. So I can follow the border and when the time is right I can direct the vehicle to the target. ____________________________________________ | | | | | | | | | | | | | .V-> Vehicle direction | | vector pointing right | | | | | | | | | | | | | | | | | | | |____V->T_________________Real Target here___
  10. Actually I am not even sure if this is a pathfinding problem. Here is the brief overview of the problem. Please see this image first: http://img88.imageshack.us/my.php?image=pathfindingproblemjq2.jpg There is an AI controlled vehicle. This vehicle has circular and direct movement. At any given time the vehicle can choose to turn left, turn right or go straight. It is OK to turn right when you were turning left and vice versa. This vehicle is trying to reach a target. We need to find a path where it can reach the target. (There is a keypoint missing in the drawing. Target T is on a line. When the vehicle reaches T it should make a 90 degree angle with the line). I am really stuck in this problem. Is this a very common situation or it's really harder than I think. By the way the path need not to be optimum (shortest length). Please help.
  11. Like I have specified before, this is not a car simulation. It's a solution to a classical problem. There is only a turning radius and speed involved. Nothing else. But thank you for pointing that out.
  12. I solved the problem like this: void Game::Car::Move( float turningAngle, double elapsedTime ) { if ( turningAngle == 0.0f ) { mPosition += ( mDirection * float( elapsedTime ) * mCurrentSpeed ); } else { // If the turning angle has changed then calculate the rotation center again if ( mLastTurningAngle != turningAngle ) { float angleToFindRotationCenter = 90.0f; // Set the rotation center //if ( turningAngle < 0.0f ) // Turning right // angleToFindRotationCenter = -90.0f; Vec3 tmpPosition = mPosition + ( mDirection * GetTurningRadius( turningAngle ) ); mRotationCenter.x = cosf( DEG2RAD( angleToFindRotationCenter ) ) * (tmpPosition.x - mPosition.x ) - sinf( DEG2RAD( angleToFindRotationCenter ) ) * (tmpPosition.y - mPosition.y); mRotationCenter.y = sinf( DEG2RAD( angleToFindRotationCenter ) ) * (tmpPosition.x - mPosition.x ) + cos( DEG2RAD( angleToFindRotationCenter ) ) * (tmpPosition.y - mPosition.y); mRotationCenter += mPosition; } // Calculate the angular velocity float angularVelocity = ( ( mCurrentSpeed * float( elapsedTime ) ) / ( 2.0f * PI * GetTurningRadius( turningAngle ) ) ) * 360.0f; // Update the car's direction mDirection = mDirection.rotateAboutGlobalZ( DEG2RAD( angularVelocity ) ); // Update the current angle of the car, used in sprite drawing mRotationAngle += angularVelocity; if ( mRotationAngle > 360.0f) mRotationAngle -= 360 * ( int( mRotationAngle ) / 360 ); // Calculate the new position Vec3 tmpPosition = mPosition; mPosition.x = cosf( DEG2RAD( angularVelocity ) ) * (tmpPosition.x - mRotationCenter.x ) - sinf( DEG2RAD( angularVelocity ) ) * (tmpPosition.y - mRotationCenter.y); mPosition.y = sinf( DEG2RAD( angularVelocity ) ) * (tmpPosition.x - mRotationCenter.x ) + cos( DEG2RAD( angularVelocity ) ) * (tmpPosition.y - mRotationCenter.y); mPosition += mRotationCenter; } // Assign the last turning angle mLastTurningAngle = turningAngle; } I am sure this is not the most efficient way to do it. Comments are appreciated.
  13. I think I know what is wrong but I do not know how to formulate it. In each update, the car is moved in a straight line. This is fine as long as you have a solid framerate. But to be accurate the car's movement should follow the circle. Correct me if I am wrong. Thanks.
  14. Ok I took it this far: // ( mHeight * 0.75f ) -> this is my wheelbase, mHeight is the sprite's height. float turningRadius = ( mHeight * 0.75f ) / ( 2.0f * cosf( TORAD( 90 - mMaxTurningAngle / 2 ) ) ); // This is the change in angle for the time elapsed. float angularVelocity = ( ( mMaxSpeed * elapsedTime ) / ( 2.0f * PI * turningRadius ) ) * 360.0f; // This is just for drawing the sprite mRotationAngle += angularVelocity; // I rotate the Direction vector by the amount of angularVelocity mDirection = mDirection.rotateAboutGlobalZ( TORAD( angularVelocity ) ); // Here comes the problematic line mPosition += ( mDirection * mMaxSpeed * elapsedTime ); As long as the simulation runs constantly this line works expected. But if the app stops for a while the elapsedTime becomes too high and car moves too much. How can I fix this behavior? Maybe I can fix the issue by figuring out if the game is not running. In SDL when you drag the window it somehows stops rendering. But still this solution seems like frame rate dependent. Some help would be appreciated. Thanks. Yenal
  15. Quote:Original post by Cybernator How about this? (haven't tested it, might be erroneous) Position vector += Directrion vector * Current speed Direction vector.x = Direction vector.x * cos (Turning angle) - Direction vector.y * sin (Turning angle) Direction vector.y = Direction vector.x * sin (Turning angle) + Direction vector.y * cos (Turning angle) Where Direction vector is the absolute orientation (and unit vector, of course), and Turning angle is relative to the Direction vector. I don't think that would work because that's the regular rotation by the angle. I need a way to calculate the new direction vector. Thanks