• 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.

Koga73

Members
  • Content count

    17
  • Joined

  • Last visited

Community Reputation

125 Neutral

About Koga73

  • Rank
    Member
  1. Yeah as for rotating zero in my example I know it doesn't do anything it was just easy math for me to show what I expect the resulting point to be. As you stated above applying the rotation to (distance, 0, 0) does work! [code] var quat:Quaternion = new Quaternion(); quat.fromAxisAngle(new Vector3D(0, 1, 0), rot * MathConsts.DEGREES_TO_RADIANS); var mat:Matrix3D = new Matrix3D(); mat.position = new Vector3D(10, 0, 0); mat.append(quat.toMatrix3D()); plane.position = mat.position; [/code] This is good and all but now I want to abstract it out into a function that takes in an axis vector, an angle, and a distance. It doesn't seem like the same code above would work if the axis were not the Y due to the position being hard-coded to (distance, 0, 0). I guess at this point I'm just looking for what that vector should be? The magnitude should always be the distance but does it matter what value I start it at?
  2. In my case I have an XZ plane with the normal facing +Y. I am using the following for my quaternion: var quat:Quaternion = new Quaternion(); quat.fromAxisAngle(new Vector3D(0, 1, 0), rot * MathConsts.DEGREES_TO_RADIANS); var mat:Matrix3D = quat.toMatrix3D(); So now I have a rotation matrix... I am wanting to make the plane orbit around the origin... so for instance if my distance is 10 units and my origin is (0, 0, 0) and my angle is 0° then I would expect the plane's resulting position to be (10, 0, 0). I'm just not sure how to actually apply the distance and quaternion to get the planes resulting position?
  3. Hi, I'm new to quaternions and want to use the resulting rotation matrix to translate a point a towards the quaternion given a set distance. Without using quaternions or matrices I would do something like this: public static function calcVector(angle:Number, distance:Number = 1):Vector2D { var vec:Vector2D = new Vector2D(); vec.x = Math.sin(90 - angle) * distance; vec.y = Math.sin(angle) * distance; return vec; } How do I mimic this functionality using the quaternions resulting rotation matrix as my "angle" parameter? Assuming the starting point is at (0, 0, 0) and I have a rotation matrix from a quaternion how do I translate the starting point towards the quaternion with a set distance of say 10 units? I would like to keep everything in the form of vectors, quaternions, and matrices. Thanks for the help!
  4. OpenGL

    Thanks for the reply. I get that part.. the part I don't understand is how it projects the texture on a surface with perspective.
  5. Hi, I want to know the math behind how a texture is mapped to a plane using UV coordinates... I've looked online quite a bit but can't seem to find anything about the actual math and logic of how this is done outside of a graphics engine such as OpenGL. Thanks
  6. Hey, The game I'm working on is a real-time multiplayer flash game. It uses smart fox server to allow clients to communicate. The game does not run on the server, but rather on the clients and the server just serves as a form of communication between the players. This works for the most part, however I am having sync issues and need to get them worked out. I want to redo the sync system and here is what I am thinking: -One player "hosts" game. -Player logs in their game timers sync up -Whenever a keystroke or action is performed that action is sent through the host to all other players -When an event is received by another player it is placed into a queue -When the game time on the local machine hits the time stamp specified on the event in the queue the event fires -After the event fires the game timer stops and does not start back up until another event is received Will I have any problems with this? I figured I'd stop the game timer between events because otherwise if an event is received and the local game timer is already past the time stamp, what would I do? And also, concerning overclocked machines... their game timer will be running faster than normal. How will this effect syncing? Thanks
  7. Alright so I've really been struggling with getting the friction working over the past couple days. The problem I'm having is that the acceleration is half the max speed, so it will take half a second to reach max speed. That all works in a frictionless world... but as soon as I apply friction the friction value almost cancels out the acceleration so it takes FOREVER to reach max speed from a stationary position. On the same note, if I turn down the friction value then the player accelerates fine, but then slides and doesn't stop. I am having the hardest time finding a good mid-ground. Or perhaps I need a different approach. My Friction Function (actionscript 3): public static function applyFriction(toPawn:Pawn, overTime:Number):void { if (!toPawn._onPhysical){ return; } if (toPawn._speed._MPS._x == 0){ return; } var tSpeedModifierX:int = toPawn._speed._MPS._x / Math.abs(toPawn._speed._MPS._x); var tFrictionCoefficient:Number = toPawn._friction * toPawn._physicalBelow._friction; var tFriction:Number = -(15) * tFrictionCoefficient; var tDeceleration:Vector2D = new Vector2D((tFriction * tSpeedModifierX), 0); applyAcceleration(toPawn, overTime, tDeceleration); if ((toPawn._speed._MPS._x / Math.abs(toPawn._speed._MPS._x)) != tSpeedModifierX){ toPawn._speed._MPS._x = 0; //Check to see if we have gone past 0 } toPawn._speed.calcMPS(); }
  8. So I got most of it working. The thing that I am not seeing with your example is mass. The deceleration due to friction should take into consideration the mass of the object. As in the real world it will take much longer for a semi truck to stop than a car. Any suggestions to how mass can be worked in to work with friction?
  9. wow great stuff! I think this is exactally what I was looking for. They don't teach it like that in physics lol. I really appriciate all the help! I'm gonna work on implementing some of it tomorrow I'll let you know how it goes.
  10. Hmm... the project is an actionscript project so I have written the engine myself. So far everything works with the exception of friction. I wrote a class called Vector2D that stores the x and y components of a vector and has math operations in it. So far with all of the math I am doing I am mostly working with the x and y components of the vector independtly. This is really the first physics engine I have written. It is for a college project. Quote:You should not be concerned with theta, cosine, or independent components. (ie x, y, z) You should treat everything as vectors and use vector operations such as dot product and cross product. How can I apply cross/dot product to the problem at hand? Quote:You'd also need to integrate the force from gravity projected onto the normal. How do I project the force of gravity (9.81 m/s) to the normal of the surface since gravity acts in the y direction? Quote:If you apply friction after the acceleration of gravity, it should be able to diminish any gravity acceleration rate less than the friction rate, bringing the object to a stop. Gravity has already been calculated into the speed of the player before the friction function will be called. To keep it simple for now, lets say the friction coefficient is .8. How could the amount of friction ever be greater than the amount of gravity? Am I comparing mg*frictionCoefficient to mg? Like I've said so far I have been working with x/y components of my vectors. Is there a better solution? After re-examining the problem from a physics stand point I have realized that what I actually need to solve for is the new acceleration of the object, and then the acceleration values should slow the object down over time (unless the above ideas will work better)? Thanks for all your help
  11. Thanks for the suggestion but I'm not quite sure that is what I am looking for. I am looking for something more along the lines of a formula. Such as (keep in mind I am making this up) Vfx = Vix + (mg)(cos(theta)) * (frictionCoefficient) Or something similar to that so I can calculate the new speed of the player based on the initial speed of the player and factor in the slope of the incline and the friction coefficient.
  12. Quote:what's the coefficient of restitution? There isn't a coefficient of restitution. Only friction coefficient between the object and the surface Quote:can the object roll down the hill? no Quote:Why do you assume the object will continue to slide down the hill and not come to a stop? I do think that it will come to a stop. I'm hoping that when the object is on the slope it will already have an initial velocity vector. So I want to calculate the final velocity vector using the initial velocity when it hits the slope along with the friction coeffecient I have between the two objects, and of course theta. Quote:how accurate of a friction model are you interested in? Not super accurate. The physics engine itself is pretty basic. The objects all have acceleration and velocity vectors. Basic Bounding Box / Proximity collision models. I have the players working in game but they slide forever because there is no friction to stop them. I want to apply friction to my players on all surfaces, which could include slopes (defined by two x/y positions). Quote:Are you familiar with vectors? is this a 2d side scroller or a 3d game? 2d side scroller
  13. Hey, so in a 2d physics engine I have an inclined plane with a frictional value. Along with a "player" that has a mass. The player object will have an initial x and y velocity and hit an inclined plane that has a slope (theta) along with a friction coefficient. 1. How do I calculate the new speed using the initial speed, mass, gravity, friction coefficient of slope, and angle of slope for both the x and y directions over a period of time (delta). (This must work even if the slope is 0°) 2. How does acceleration factor in? You must accelerate down the slope, how is this calculated. Any help is appreciated! Thanks
  14. Ok, using the * instead of & I get no more compile errors, only linking errors: 1>------ Build started: Project: Block_Out, Configuration: Debug Win32 ------ 1>Compiling... 1>Tile.cpp 1>TileMap.cpp 1>Generating Code... 1>Linking... 1>Block_Out.obj : error LNK2001: unresolved external symbol "public: static class Texture * * Texture::_textures" (?_textures@Texture@@2PAPAV1@A) 1>TileMap.obj : error LNK2001: unresolved external symbol "public: static class Texture * * Texture::_textures" (?_textures@Texture@@2PAPAV1@A) 1>E:\C++ Projects\Block_Out\Debug\Block_Out.exe : fatal error LNK1120: 1 unresolved externals 1>Build log was saved at "file://e:\C++ Projects\Block_Out\Debug\BuildLog.htm" 1>Block_Out - 3 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== And Its happening here, I dont know why though: void TileMap::setTileMap(){ for (unsigned int i = 0; i < MAP_SQUARE; i++){ for (unsigned int j = 0; j < MAP_SQUARE; j++){ _tiles[(i * MAP_SQUARE) + j] = new Tile(i * Tile::WIDTH, j * Tile::HEIGHT, Texture::_textures[0]); } } }
  15. error C2664: 'Tile::Tile(float,float,Texture &)' : cannot convert parameter 3 from 'Texture *' to 'Texture &'