New Features From Faze :P

What do you want to see in Armagetron soon? Any new feature ideas? Let's ponder these ground breaking ideas...
Post Reply

Which of these new features would you like in the next version of tron?

Poll ended at Mon Mar 26, 2012 2:43 am

AUTO_ADJUST_MAX_SIMULATE_AHEAD_AMOUNT
2
33%
AUTO_ADJUST_MAX_OUT_RATE
1
17%
AUTO_ADJUST_MAX_IN_RATE
1
17%
CURRENT_PING_AVERAGE
1
17%
LONGTERM_PING_AVERAGE
1
17%
 
Total votes: 6

Fazeuout
On Lightcycle Grid
Posts: 36
Joined: Sat Dec 10, 2011 5:17 pm

New Features From Faze :P

Post by Fazeuout »

Here are some of the features I've been working on, I can't figure out how to build them, so Ill just post the source here and if someone else is kind enough to that'd be amazing. I'm a very new programmer and don't have much expeience with anything. Almost everything I know about programming is self tought except for a few weeks of ID Tech Camps. Hope you all like them. Let me explain them first.

1. AUTO_ADJUST_MAX_IN_RATE:

So when set to 1the server will automatically adjust the max Out rate when a player enters or leaves.
Here's How you use AUTO_ADJUST_MAX_IN_RATE

1. Set your MAX_IN_RATE to the amount that is the maximum bandwith you can use. So instead of coming up with how many kbps,mbps,gbps,tbps your going to use and dividing it by how many max players you'll have on the grid, you just put how much you can put into the server.
2. Then set the AUTO_ADJUST_MAX_IN_RATE to 1
3. Your done!

When there are 2 players in your server the rate will divide in 2, creating more fair lag, and lets say you have X amount of bandwith and yo u want it dealt with as fairly as possible, but you want to be able to have less lag when less players are in the server at the same time? Thats what this is for.

AUTO_ADJUST_MAX_OUT_RATE:

Same Exact Thing, just for MAX_OUT_RATE instead of MAX_IN_RATE.

AUTO_ADJUST_MAX_SIMULATE_AHEAD_AMOUNT:

Though MAX_SIMULATE_AHEAD is undocumented method of dealing with lag (basically no explenation on the wiki) ive found it very useful so I wanted to improve it. Here's how it works.

1. set AUTO_ADJUST_MAX_SIMULATE_AHEAD_AMOUNT to how much you want MAX_SIMULATE_AHEAD to adjust when players leave or enter the server. So lets say you have a 1000 MAX_SIMULATE_AHEAD rate and everytime someone leaves you want to subtract 50? Just set ahead to 50.
2. Set your MAX_SIMULATE_AHEAD setting to whatever 1 player would be best with, use the auto adjust to increase or decrease that number when players enter and leave

CURRENT_PING_AVERAGE:

By typing this in on the dedicated server console a line of text will appear displaying the average ping (all the users ping/number of users.)

LONGTERM_PING_AVERAGE:

By typing this in on the dedicated server console a line of text will appear displaying estimated average ping in the long run.

Faze --- Red Neck and AK-47 Owner
Attachments
Faze features.cpp
(475 Bytes) Downloaded 122 times
Faze features.h
(779 Bytes) Downloaded 123 times
Fazeuout
On Lightcycle Grid
Posts: 36
Joined: Sat Dec 10, 2011 5:17 pm

Re: New Features From Faze :P

Post by Fazeuout »

Now here are the two files I edited that are from the original code...
Attachments
eGameObject.h
(9.98 KiB) Downloaded 128 times
nNetwork.h
(37.09 KiB) Downloaded 145 times
User avatar
Z-Man
God & Project Admin
Posts: 11589
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: New Features From Faze :P

Post by Z-Man »

The most convenient way to publish changes is via source patches, and the easiest way to get them is by using bzr. Check out the sources using bzr, make your changes, make sure they compile. Then, on the command prompt, do

Code: Select all

cd <your source directory>
bzr diff > my_changes.patch
and attach my_changes.patch here.

As for your changes, I like the idea of the rate adjustments; they make it less fiddly to find the right settings to allow the maximum users your server can handle on. Mind you, you still need to find the right maximum user and player settings, because at some point, the server will just break down.

The max_simulate_ahead change doesn't make sense, though. Its value is supposed to be fixed relative to dedicated_fps, adapting it to the number of players is not a good idea.

The ping stuff, likewise, is not a good idea; the different averages are an implementation detail of the ping measurement and shouldn't be exposed to the user.

As for the implementation... oh boy, there's no way to put this nicely... you need to put code in the right place for it to work. And I don't think there is a right place for half of your lines, they don't work wherever you put them. Let's see how I can help you in one example.

Code: Select all

if (amountToAdjustBy = numHumans && sn_mir = 1);
	int MAX_IN_RATE = sn_maxRateIn*amountToAdjustBy;
Inside if() clauses, you usually want to use ==, not =. = is the assignment operator, == the comparison. Also, the amountToAdjustBy == numHumans comparison would be meaningless and always true assuming the line above that sniplet belongs there, it assigns amountToAdjustBy to just that.
If you put a semicolon after an if() clause, the decision has no effect. The expression in parentheses is just evaluated, but the next line is executed in all cases.
The MAX_IN_RATE assignment defines a new local variable and assigns only to that. Thus, it has no effect.
I'm quite sure from your description you want that to be sn_maxRateIn/amountToAdjustBy.

There's nothing wrong with being self-taught, I'm mostly self-taught myself; however, you need to actually write code, compile, run and test it. Practice makes you a good programmer.
Fazeuout
On Lightcycle Grid
Posts: 36
Joined: Sat Dec 10, 2011 5:17 pm

Re: New Features From Faze :P

Post by Fazeuout »

Thanks for the very thourough explanation Z-Man :D Ill fix that stuff, take out the other features
Post Reply