Posts

Showing posts from October, 2009

2D Physics Engine Tutorial – Part 3

Image
In part 2 we had a look at the collision detection part of physics engines. In this post we take a look at the collision response part and see what kind of mechanisms it involves. Movement Physics engines have the ability to move objects around both in linear and angular motion. It is done using linear and angular velocity (with speed and acceleration ), force and integrators . Velocity Velocity is a vector that describes the rate of change in position; the magnitude of the vector is the speed and the direction of the vector is the direction in which the speed is applied. Velocity definition v is the velocity vector, Δx is the displacement and Δt is the change in time. Force Force exist in many ways, but generally it is the agent that cause a body to change in motion or make a mass change its velocity. Force has both magnitude and direction and thus it can be expressed as a vector. Newton’s second law F is the force vector, m is the

User managed games and automatic server checks

Image
Let me ask you one thing: Why does network-enabled games utilize user controlled user management (like kick voting menus)? The answer is really simply: User management User management Network-enabled games need some kind of online-police that can control the game and its users. Imagine a rouge user that joins an online game just to create havoc and chaos. I have met several examples myself in my past as both server admin, game moderator and as a player. They all have one thing in common: Make people angry and laugh at their inability to act on it. Let us have a look at the different types of bad guys: The microphone guy The first case is a user that connects his microphone, turns up his music (Usually obnoxious repeating music designed to drive people crazy) and press the “talk” button. This can continue the whole game and it makes people furious. Players start to blame the game and game moderators that they are not doing anything about it, but fact is that they are powerless

Floating and fixed point arithmetic

Image
A user posted a question on the Farseer Physics Engine forums about fixed point math. The topic include numeral systems , implementation details and performance. A whole lot of posts have been written about it. I’m not going to provide a full introduction to fixed point math, I’m simply going to provide an abstract answer to the questions (one that apply to similar questions). Background Back in the good old days (before the Intel i486 CPU ) all applications used fixed point arithmetic. Floating point was something new where you could get a tradeoff between space, value range and precision, but at the cost of performance. Let us take a quick example: A fixed point number with the radix (point/dot) after the forth digit: 5186.3924, would be represented with a floating point as 51863924 with an exponent of 3: 5.1863924*10^3 = 5186.3924 Let us have a look at the up’s and down’s of floating point math. Positive side of floating point There are both positive and negative s