# Tag Info

122

I tried it. Splashes (springs) As that tutorial mentions, the surface of water is like a wire: If you pull on some point of the wire, the points next to that point will be pulled down too. All points are also attracted back to a baseline. It's basically lots of vertical springs next to each other that pull on each other also. I sketched that in Lua using ...

27

this is because there is no inertia in your speed computation. you just compute it as an absolute consequence of engine rpm and gear. but when you compute the new rpm after gear shift up, you empirically lower it by fixed 3600 rpm steps. This is your mistake. the rpm dropdown is not fixed between gears. you can fix it by making a second array storing the ...

22

On one driving game I worked on, we had multiple samples per car - the engine held at certain rev intervals, and a sample each of the car ascending and descending the rev scale IIRC. All of these were recorded from the exhaust, the sides, the front, and inside the real-life car so the sound could change as you moved the camera. Then we blended between ...

18

To understand how to simulate aerodynamic flight, one first has to understand which forces affect the movement of an aircraft. The actual trajectory of an aircraft is the sum of all of these physical effects: Newton's first and second law of motion An object moves at a constant velocity, unless acted upon by a force. The acceleration of a body is directly ...

14

Sounds like a similar problem to that of inputs: you have 100+ keys on the keyboard but don't want to check each individual key on every frame, so what do you do? Two answers: polling or system messages. Polling = at any point when it would actually matter in the game, query the state of the keyboard keys (or the objects, in your case). The rest of the ...

14

Calculate the new RPM based on the new gear and current speed of the car. speed = (int) ((float)rpm / (float)maxRPM) * (float)maxSpeedsPerGear[gear - 1]); so: instead of: rpm -= 3600; // Drop the RPM by a fixed amount use: rpm = max(maxRPM,(float)maxRPM * (float)speed / (float)maxSpeedsPerGear[gear - 1]); The speed will now be the same before and ...

13

There is an excellent SIGGRAPH presentation on PixelJunk Shooter 2's lighting and physics simulation, including fluid mechanics, available on youtube.

13

I tried it. Brown is generated hair. The red circle is the hairbrush. The hairstyles were achieved by brushing the hair with the hairbrush. Here's how that works: The Hair Hairs are like this: Bendy. Like a bezier curve. Quadratic ones are pretty simple. Finite. They start and end somewhere. They also have some fixed length. Coloured. They've got ...

13

The elements you can use to present emotions I can think of are: Visual character animations (walking upright, bowed or hobbling, arms near the body when cold) especially facial expressions textures or decals (injury, blood, scratches) particles (sweat, blood) Gameplay player abilities (movement speed, jumps, reaction time, attack strength) body ...

12

A lot of physics engines operate at a scale of 1 unit = 1 meter. Unity isn't any different, as you can see in the manual. The size of the your GameObject's mesh is much more important than the mass of the Rigidbody. If you find that your Rigidbody is not behaving exactly how you expect - it moves slowly, floats, or doesn't collide correctly - consider ...

12

Your question inspired me to play around with the RUBE editor to find a nice solution. Here's what I came up with: Setup 1 Let's start with the simpler one on the left. It has the following setup (from the bottom up): A wheel body that can roll back and forth A small box (chassis) attached to the wheel via a revolute joint. The chassis body is not ...

11

every time I tried to simulate water I just ended up applying a lowpass filter on a texture representing water level. It's very simple to implement but it fails whenever you get massive changes in water level which may generate large waves. In this method there are some places where water always have some constant level, like river ends. in those cases you ...

11

You can either copy an existing battle system, or create a new one. Copy. This is obvious, use Google to find information about some RPG mechanics (e.g. AD&D or Fallout) or play your favorite game and this will be inspiring enough. Problem with this solution is the fact that better systems are more popular and players are more bored with them. Create. ...

11

Script one (or two or three) bouncing paths for the ball to follow. Adjust the rotation of your wheel model to cause the correct slot to land underneath the ball's final destination. A bouncing path: construct complex animations made from many small movements of the ball over time, such that it appears to be natural physical motion around the structure of ...

11

Thousands of things probably isn't that big of deal. As you note, even older games like SimTower could do this pretty reasonably. Consequently the first thing I'd suggest you do is the simple, straightforward option: foreach(Thing t in AllOfTheThings) { t.Simulate(elapsedTime); } Once you've done that, if your game still runs acceptably, then you're ...

10

If you had searched for "easing formulas" it would've been the first result. http://www.gizma.com/easing/

10

This is exactly the way we solved this problem in Stendhal. In our case there are lots of things that happen periodically, but not every turn: Healing spells, plants growing a little further, corpse degenerating, items on the ground expiring. We have a turn number that is increased in every turn. And we maintain a map of future turn numbers pointing to a ...

10

Here is one, with source Fluid simulation for video games series : Part 1 - 9

10

You can calculate this based on the properties of the vehicle. Using Ackermann steering geometry you can calculate the center of the turning circle. This will take into account the length and width of the car and simulate accurately the maximum steering radius you can take. The reason you're unable to find a definitive answer is because it varies from car ...

9

See "Capturing Engine Sounds for Games" for ideas about how the pros do it. The article references this SDK, which I worked on. Unfortunately, it is no longer supported. It was free, so there may be copies floating around somewhere.

9

So I'm going to take a step back from implementation and review the question from a design perspective. Do you have a solid plan for displaying all the detail you want to include in this simulation? For example: Can the player tell the difference between an animal with an empty stomach and an animal with a full one? Does this information matter to them in ...

9

PixelJunk shooter from Q-Games has nice set of fluids. There is a GDC paper they have published here: http://fumufumu.q-games.com/gdc2010/shooterGDC.pdf (PDF!) Jos Stam from Alias Maya fame (now Autodesk) wrote paper on real time fluids in games here: http://www.dgp.toronto.edu/people/stam/reality/Research/pdf/GDC03.pdf (PDF!) And he wrote a simple FFT ...

9

Just brainstorming here... Interestingly enough, network lag is your friend in this case. As in you WANT a delay to occur for some data packets, at least if it's about drawing. But instead of a base lag each player would normally have for all data packets impacted by just their network speed, you need to apply specific lag for each event to each player ...

9

One easy-ish approach is to keep old loading functions around. You need only a single save function that writes out only the latest version. The load function detects the correct versioned load function to invoke (usually by writing out a version number somewhere in the beginning of your save file format). Something like: class GameState: loadV1(stream)...

8

I had a similar problem on a game I worked on a few years back - the simulation of objects was complex and couldn't really be performed in detail on every object in the world. The solution was to use the LOD concept to the simulation. Objects within the view of the player would run the full simulation. Objects far away from the player ran a highly ...

8

Several solutions. For Box2D, set b2_velocityThreshold in b2Settings.h file. In my case, I set it to 0.0f and it worked! Mass, friction, damping were NOT problem. Check this discussion thread for more details. http://www.box2d.org/forum/viewtopic.php?f=3&t=6906&p=30782#p30782 Using other physics engine. Newton Game Dynamics configured performing ...

8

You have an opposing force called "friction", which is proportional to speed. This is how objects falling in an atmosphere are modeled, for example. If your impulse force is F, a constant, and you have a mass m, your acceleration is the constant a = F/m Let's call the friction force Q, and the acceleration caused by that q. We have that Q = k*v ...

7

The master's thesis Parallel Simulation of Particle Fluids by Mattias Linde might offer some insight into data partitioning and algorithms for large-scale simulation. His paper is geared towards Smoothed-Particle Hydrodynamics, which for the naive solution tends to use Spatial Hashing with a bucket size around the size of the kernel footprint of the ...

7

For the solution (mathematically speaking you can solve the problem with the solving of differential equations, but im sure they don't do it that way) of creating waves you have 3 possibilities(depending on how detailed it should get): Calculate the waves with the trigonometric functions (most simple and the fastest) Do it like Anko has proposed Solve the ...

Only top voted, non community-wiki answers of a minimum length are eligible