June 18th Combat No Phake Physics Jun 18, 2015 18:37:37 GMT -8
Post by Chrissy The Blesser on Jun 18, 2015 18:37:37 GMT -8
COMBAT: NO PHAKE PHYSICS
Today we are going to talk about how we have been using physics on the Combat Strike Team.
Unity comes with a pretty robust physics system right out of the box, so our first order of business was to make this work in a client/server environment. Not an easy feat, but well worth the effort since our goal is to use realistic physics in as many of the gameplay aspects as possible. We suspect it will create a ton of emergent gameplay since it’s really hard to predict the results of throwing around massive Minotaur and Centaur like Pachinko balls in a fight. It could be really awesome, or really terrible. Our goal is to setup the world with this realistic physics simulation, give each archetype some fun physics toys, and let the players see what they can do with it. Then we adjust to keep the fun stuff, and remove the stuff that just doesn’t work.
Players tend to have some specific expectations about what characters can do in games – the standard in MMOs for the past decade has been to allow character to run at 90 miles per hour, come to a halt immediately, and turn on a dime. Silly as it may sound, this is pretty normal for a variety of factors and ultimately it makes the gameplay feel better.
Most people are used to seeing things in MMOs that LOOK like physics, but in reality are largely smoke-and–mirrors FX between the game server and the player’s client. Setting up fake physics events involves extreme amounts of time and effort to get the FX to look good. This is another reason we would like to use the out of the box Unity solution; we can get more toys in the players’ hands much more quickly.
You may have seen a character in an MMO execute an ability where they hook a character with a magic chain from a long distance and pull that character to them. Generally it looks pretty good as the target arcs through the air towards the attacker. There are a couple of things going on behind the scenes, though, to make this effect happen. In most cases, the attacker is required to have a valid line of sight on a valid target. (No rocks or world objects--like chairs--can be in between the two.)
The server then teleports (or warps) the targeted character to the feet of the attacker. Both players’ clients witness a fancy animation of one character flying through the air to the other, but it isn’t real. It’s fake. The end result is that one player can pull another player of any size (the server doesn’t care if it’s a teeny tiny character or a giant) to their feet as long as they can see them. This is not real physics. Yet it does tend to look pretty good since it has all been synced up in animation and any blemishes are covered over with particle FX.
In Crowfall, we handle this chain pull a bit differently.
Each character has a variety of physics settings, such as mass and drag, which we set on an archetype-by-archetype basis for what we think would make the most sense. We use values that are comparable to what we think a human or a centaur would use, bearing in mind that our human is 2 m tall, runs at 6 m a second (12.2 mph), and can jump 15 m in the air in full plate armor. Quite the beast!
The chain pull, when executed, fires an invisible Raycast towards the center of his HUD reticule. Currently that Raycast is set to penetrate so even after it touches one target, the Raycast continues to the max range of the power, acquiring even more targets. (Don’t travel in straight lines to hide your numbers or you might ALL get hit by a single pull!) The Raycast applies an inverse velocity to anything it touches in the direction of the knight, be it a world object like a barrel or another player. Based on the mass of the target, and the strength of the velocity, the physics engine determines how fast the targets get launched across the ground towards the knight. (We found early on we needed to also temporarily increase the mass of the knight during this power so he doesn’t get knocked around when all these objects slam into him!) The implications are pretty far-reaching: you can use objects to move other objects; you can move players (and objects) into and out of AoE ranges. Layer this system on top of a destructible environment and things get really interesting!
Since we can adjust the mass of each character on a per-archetype basis, and adjust it in real time, we control how easily each one can be pulled or pushed around by the various physics-based forces in the game. This is vastly different from most MMOs on the market where the smallest characters are affected equally by character abilities just as much as the largest characters. Usually you do this to ensure consistency in gameplay, but we are willing to take some risk on this thinking it will lead to some fun gameplay. (And, to be honest, if it really doesn’t work too well, we can always go back and normalize values.)
Some of the key values we have been experimenting with:
The mass of the object in (totally arbitrary) units. We decrease/increase this value to make objects get knocked around more/less.
This value is roughly equivalent to air resistance. We use this value to make objects more like a feather, or more like a bus. The knight was “floating” too far when he jumped so we tweaked this and he falls to the earth much quicker. This makes his jumps not travel as far and he feels like he has weight behind him when he falls. Using this value we can make the fae have a ’feather fall’ effect, or to allow a forgemaster to ‘hard land’ at the end of a super-leap power. We really want to make each archetype feel really different when you play them rather than have a normalized character in a different skin suit.
We have a couple of friction types we can and have been playing with. Static Friction is the friction of a still object on a surface and Dynamic Friction is the friction when an object is already moving. Generally we like the player capsule to feel like sandpaper when it rubs on another object rather than sliding off like a smooth slippery surface.
We have a few other values we can use such a ‘bounciness factor’ to make a surface feel bouncy, but haven’t gotten to the point where we are trying to bounce things around. (Maybe we can make fireballs treat the knight’s shield as bouncy and reflect them off towards other targets.)
We have a long list of different physics toys we are going to try. We even plan on making a category of powers called iFrames, which remove the player from the physics simulation while that attack is being used. We generally use these for attacks where the player leaves the ground or need to go through other player’s capsules. Powers with this effect can be used as a dual purpose defensive power if you really need to avoid being knocked around.
This is one of our biggest areas of experimentation, and we’re very hopeful that the results will be worth waiting for! If nothing else, even if none of the crazy powers work, the benefits of a more realistic system will lead to a better play experience (as moving characters around in a realistic way will make the game more naturally tactical, and goes a long way towards cheat prevention).
We hope you enjoyed this peek into the Combat Strike Team’s efforts as they continue to march towards the first playable!
Thomas “Blixtev” Blair