Rubber

From Armagetron
Revision as of 10:54, 6 March 2006 by Cortex (talk | contribs) (used unnumbered lists for the settings)

You have a gauge for it, but you don't know what it means. Or, you know what it means, but you think it's stupid. Here's what rubber is all about and why it's important.

Introduction

Rubber exists to compensate for network latency. That is, it's there to deal with the fact that when you hit a wall, and the server thinks you've hit the wall, it's a physical impossibility for you to be certain you're near the wall. So rubber makes it possible. In short, without rubber, there would be no internet game. Once upon a time, it was an internal mechanism that existed for server administrators to configure, allowing them to build different types of servers that were playable that might otherwise not have been so. It was never intended to be revealed to the player as a concept. Part of that is because different mechanisms to accomplish the same thing could be implemented, and the player never need deal with it. Now it's become a part of the game and players are aware of it, and knowing what it is and what it isn't is an important part of playing the game.

What Rubber Is

As mentioned in the introduction, rubber is a way to deal with network latency. It's very simple in concept, when you think about it. Let's say you connect to a server and your ping is 200 milliseconds. Now, some other guy and you are racing towards each other. Just before you would pass each other, the other guy turns and blocks your path. It will take you 200 milliseconds to get aware of this and send your reaction back to the server, assuming you yourself can react instantly. Of course, you don't have 200 milliseconds, you'll collide and be dead in, 100 milliseconds.

Enter: rubber. When you get close to a wall, rubber artificially slows your cycle at a certain distance from the wall. This change in speed is artificial, it doesn't affect your actual speed in any way. But the time it takes for you to crash against that wall is stretched. By making this stretch, it is possible for you to see that you are in fact touching the enemy wall that popped up in front of you, and to react to it, all in the 200 milliseconds your hypothetical connection has to send a turn to the server.

What Rubber Isn't

Rubber is nothing other than what it is. It is not a tool to make it possible to turn around against a wall. It is not a way to make it easier to get close to a wall. It is none of these things.

How Rubber Works

Rubber works two ways, depending on how the server is configured. You either have time-based rubber or distance-based rubber. Time-based rubber works by measuring how long (in milliseconds) it will take for you to hit the wall and applying rubber to it. Distance-based rubber works by measuring the actual distance between you and the wall. Both have the same intent, but work slightly differently.

Distance-based rubber is good for servers that have very little changes in speed. Some examples are the Tigers Classic servers, the Goshdarn clones, and a few others. Low cycle acceleration is what distance-based rubber is good for. And it's really good for that! This is the traditional behavior of rubber, and until v0.2.8 it was the only behavior of rubber available.

Time-based rubber is good for servers that have a lot of cycle acceleration, resulting in large differences in speed between cycles. In this case, the application of rubber will vary for each wall approach, but it will behave consistently and predictably for players.

After rubber kicks in, it begins to deplete. When it is depleted, you are touching the wall and the server destroys your cycle. When you leave the wall, you begin to recharge your available rubber until it is full. This unique system makes it possible to carefully plan a wall approach, run your rubber up to its maximum, and turn, making a very tight grind against that wall. Then, if you wish to turn towards the wall again too quickly afterwards, you will die, because you don't have enough rubber. In a tight maze, this means you might make the first couple of turns, but your chances of surviving drop with each grind because your rubber cannot recharge fast enough.

Rubber Settings

There are a number of settings that affect rubber. In a perfect world, you would only ever work with CYCLE_RUBBER, and all other settings will be left as they are. This is not, however, a perfect world. It may be necessary to work with some of the other settings in order to get the type of gameplay you are after. The rule of thumb is that you should only adjust any of these settings in order to compensate for other changes that cause the rubber system to break down. For example, if you change cycle acceleration to some really high amount, you will have a server where high speed players will tend to crash because they lack rubber. You probable want high speed players to be able to grind as easily as low speed players, so you might want to increase CYCLE_RUBBER to compensate. The flip side is that lower speed players will be able to grind deeper against the wall. There's always a tradeoff, so consider carefully what you are after.

It is generally considered a bad idea to increase rubber too terribly high. If you set it high enough, you can make death impossible on your server, and that's probably not a good thing. On the other hand, if you set it too low (or to a negative number), you make living impossible on your server. So you should only adjust rubber when it's needed to compensate for some other change you've made in your server.

Here is a brief description of each rubber setting available as of v0.2.8:

  • CYCLE_RUBBER 1.0 # niceness when hitting a wall
  • CYCLE_PING_RUBBER 3.0 # niceness when hitting a wall: bonus for higher ping players
  • CYCLE_RUBBER_TIMEBASED 0.0 # rubber usage is based on distance travelled if this is set to 0 (default) and the time passed if this is set to 1. Intermediate values and values out of these bounds are supported as well.


  • CYCLE_RUBBER_SPEED 40.0 # logarithmic speed of wall approximation when rubber is in effect (every second, you get closer to the wall by a factor of ~0.4^{this value} )
  • CYCLE_RUBBER_MINDISTANCE .001 # The minimal distance rubber code keeps cycles from walls
  • CYCLE_RUBBER_MINDISTANCE_RATIO .0001 # Additional distance for every length unit of the wall you have in front of you
  • CYCLE_RUBBER_MINDISTANCE_RESERVOIR .005 # Addidional distance if you have an empty rubber meter (gets faded out gradually as you use up all your rubber)
  • CYCLE_RUBBER_MINDISTANCE_UNPREPARED .005 # Additional distance for unprepared grinds; it gets applied when the cycle's last turn was just a fraction of a second ago and faded out preparation times larger than CYCLE_RUBBER_MINDISTANCE_PREPARATION.
  • CYCLE_RUBBER_MINDISTANCE_PREPARATION .2 # Timescale in seconds a cycle's last turn time is compared with to determine the effect of CYCLE_RUBBER_MINDISTANCE_UNPREPARED.


  • CYCLE_WIDTH 0.0 # the cycle's width. Attempts to enter tunnels that are narrower than this result in instant death. (not yet supported)
  • CYCLE_RUBBER_MINADJUST .01 # when adjusting to or 180ing into a wall, allow going closer by at least this amount (relative to the last distance)


  • CYCLE_RUBBER_LEGACY 1 # fallback to old, frame-dependant rubber code when old clients are present
  • CYCLE_RUBBER_TIME 10.0 # Timescale rubber is restored on


  • CYCLE_RUBBER_DELAY 0.0 # during this fraction of the cycle delay time, rubber efficiency will be multiplied...
  • CYCLE_RUBBER_DELAY_BONUS .5 # by this factor (meaning that rubber usage goes up by the inverse; a value of zero means rubber is completely disabled)