FPS ???

General Stuff about Armagetron, That doesn't belong anywhere else...
Post Reply
User avatar
jgirl
On Lightcycle Grid
Posts: 10
Joined: Tue Aug 17, 2004 12:13 am

FPS ???

Post by jgirl »

can somebody explain why I can setup a local game with 10 ais and get around 18 fps but when I play online in a server with 10 players I only get 4 or 5 fps

I cannot see any logical reason for this
User avatar
Zapple
Shutout Match Winner
Posts: 876
Joined: Sun Mar 07, 2004 2:42 am
Location: Halo 2
Contact:

Post by Zapple »

When your doing a local game your only connected to one computer so you dont get as much lag=higher FPS,

when your playing connected to 11 computers it makes more lag so its less FPS
User avatar
pepsi
On Lightcycle Grid
Posts: 13
Joined: Wed Jul 14, 2004 1:44 pm

Post by pepsi »

Lag should not effect fps in any way what so ever because the program still keeps updating bike positions and redrawing the screen *(using previously received data)* while waiting for new data from the server.

Once the new bike positions/speed have been received from the server the client then updates its variables if nessary.

So jgirl's question still has not yet been answered.

I have no idea why the fps should be lower for online games, it should be no different.
User avatar
Lucifer
Project Developer
Posts: 8743
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas

Post by Lucifer »

Zapple was actually close to the reason, near as I can tell.

When you're playing a local game, there's no net connection from Armagetron at all. Just making a net connection takes some CPU time.

Then, as more players get added to the server, the game itself gets more objects to draw/track/animate, and that means more CPU time.

More CPU time = fewer FPS

3d acceleration only goes so far, you still have to figure out where everybody is in the arena before sending it to the 3d accelerated video card. ;)

I would wager, though, that the socket connection is the biggest part of the drop in FPS, because of the CPU time it sucks away.
User avatar
iceman
Reverse Adjust Outside Corner Grinder
Posts: 2448
Joined: Fri Jan 09, 2004 9:54 am
Location: Yorkshire, England. Quote: Its the fumes, they make one want to play
Contact:

Post by iceman »

i also have the same problem with online games being much lower fps than local games

and the small amount of data that has to be processed from the server (and we are talking real small) shouldnt effect the speed by as much as it does

there must be something really wrong with the code to run that slowly (did microsoft write that part of the program ? :lol: )

it looks like this section of the program needs some heavy optimizing
Image He who laughs last, probably has a back-up
Image
Image
sorry about the large animated gif
User avatar
/dev/null
Shutout Match Winner
Posts: 819
Joined: Sat Sep 04, 2004 6:28 pm
Location: Chicago-ish

lag and fps.

Post by /dev/null »

Ive noticed the same on linux also, although linux generally gets higher framerates than windows, lag greatly effects my fps, i get anywhere from 400 to 600 on local games, and between 150-350 on net games, depending on the amount of lag.
Also of note, if someone feels like finding the bottleneck in the windows version thats holdin back the fps im sure youll be worshipped as a god by many.
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6712
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

It's SDL that messes with the FPS, I think. It reduces it to closer to your refresh rate in windows, so you aren't doing extra work. At least, that's my theory.
Image
User avatar
iceman
Reverse Adjust Outside Corner Grinder
Posts: 2448
Joined: Fri Jan 09, 2004 9:54 am
Location: Yorkshire, England. Quote: Its the fumes, they make one want to play
Contact:

Post by iceman »

tank i often get 3-6 fps in armagetron and thats no where near my windows refresh rate lol
Image He who laughs last, probably has a back-up
Image
Image
sorry about the large animated gif
User avatar
/dev/null
Shutout Match Winner
Posts: 819
Joined: Sat Sep 04, 2004 6:28 pm
Location: Chicago-ish

refresh rate

Post by /dev/null »

You know, that sounds just about right, and iceman, its multiples and divisables of your refresh rate i would guarentee, just to keep everything in sync.
User avatar
Lucifer
Project Developer
Posts: 8743
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas

Post by Lucifer »

iceman wrote: and the small amount of data that has to be processed from the server (and we are talking real small) shouldnt effect the speed by as much as it does
First off, I don't know if this is true about Armagetron specifically...

Net connections are basically a matter of opening a socket, and sockets require a certain amount of overhead. When you open the socket, you are immediately and uncontrollably depending on several layers worth of kernel and a certain amount of overhead. Most programs (I'd say all but I have to leave room to be right) slow down when they open a socket to anything, including other local applications. The only program I know that is an exception to this is X, but it could just be that UNIX domain sockets are really fast comparatively speaking. This is the only real difference between an internet game and a local game, so it's the most logical reason, assuming the rest of the code is properly organized and compartmentalized and so forth. Bottom line: sockets have overhead, and it *will* affect the rest of the game no matter what.

Solution? The only solution I know of is to run the actual net connection in a different process and connect to that process. I'm not entirely certain that running the net connection in a different thread would solve the problem.

Now, I could be completely wrong about it, but I can also dig up citations to back it up, so take it for what it's worth, whatever that is. ;)
User avatar
iceman
Reverse Adjust Outside Corner Grinder
Posts: 2448
Joined: Fri Jan 09, 2004 9:54 am
Location: Yorkshire, England. Quote: Its the fumes, they make one want to play
Contact:

Post by iceman »

question:

when a slow pc is really busy drawing the graphics does the function that receives the server data and calculates the bike positions still run or is the program linear ie each function runs in a list and has to wait for the previous funtion to finish ?


linear would really suck and totally mess up the ping
Image He who laughs last, probably has a back-up
Image
Image
sorry about the large animated gif
Post Reply