Jump to content
  • Advertisement
Sign in to follow this  
P@u1

Some Questions

This topic is 2643 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everyone,


I have three questions:

1.: How fast is the speed of a typical LAN connection (local and not internet) (upload and download)?

2.: If I would make an rts game and want to use lockstep networking, should i then avoid float/double, or should I use them and make sure that I have floating point determinism? (Is this also possible with C#/.Net?)

3. Which networking model is best suited for a platformer game (e.g. imagine a mario game with multiplayer support)? I think server/client, but what do you think? Would lockstep work out, too? Or anything else maybe?

Share this post


Link to post
Share on other sites
Advertisement

1.: How fast is the speed of a typical LAN connection (local and not internet) (upload and download)?

Depends on the network, and also depends on your definition of speed.

As for data transfer rate in bits per second, this is usuaully specified as part of the network.

Wired Ethernet can range in the 20 gigabit range for high end setups to gigabit, hundred megabit, ten megabit, through 2.9 megabit. A regular consumer might buy "gigabit" network cards and switches these days, a datacenter system might buy "ten gigabit" cards and switches, a home user will often be fine with "fast ethernet" which is usually 100 megabit, also called HME, or 100baseT. Few machines use slower than 100 gigabit for wired network devices these days.

Wireless Ethernet can range from 300 megabit on the high end to under 1 megabit on the low end. You normally hear these based on their standards. They are part of the IEEE 802.11 family. 802.11n, also called WiFi N, is the latest and fastest of these. Others commonly used are 802.11b, and 802.11g. Many home consumer networking devices say things like "Wireless b/g/n" meaning it supports those specific standards.

The actual performance will also vary based on network saturation, electrical noise, physical layout, and of course how the programs are actually written.


2.: If I would make an rts game and want to use lockstep networking, should i then avoid float/double, or should I use them and make sure that I have floating point determinism? (Is this also possible with C#/.Net?)
[/quote]
That doesn't make much sense at all. Somewhat like asking: If I want to design a formula-one racecar engine, should I color the car red or blue?

The choice to run your game in lockstep or not is one decision. There are pros and cons to either direction.

The choice about the format to transmit your data across the wire is a separate decision. Send whatever data is necessary to keep your games in sync.

And yes, both options are available in C#.



3. Which networking model is best suited for a platformer game (e.g. imagine a mario game with multiplayer support)? I think server/client, but what do you think? Would lockstep work out, too? Or anything else maybe?
[/quote]

Um.... yes? Anything above is certainly viable for that.

Please go read the forum's FAQ. It's at the "[color=#515151][size=2]Networking and Multiplayer FAQ" link at the top of this page.


The FAQ has lots of links to articles that will help you answer the questions.

For what you describe just about any of the existing networking engines listed in the FAQ could handle a straightforward multiplayer platformer game.

Share this post


Link to post
Share on other sites
Thanks for your answers.






2.: If I would make an rts game and want to use lockstep networking, should i then avoid float/double, or should I use them and make sure that I have floating point determinism? (Is this also possible with C#/.Net?)

That doesn't make much sense at all. Somewhat like asking: If I want to design a formula-one racecar engine, should I color the car red or blue?

The choice to run your game in lockstep or not is one decision. There are pros and cons to either direction.

The choice about the format to transmit your data across the wire is a separate decision. Send whatever data is necessary to keep your games in sync.

And yes, both options are available in C#.
[/quote]

with float/double I was not talking about what I'm transfering across the wire, but I was talking about how to maintain fully determinism, which is required for a lockstep simulation. I know 2 solutions to this:

- avoid float/double in all relevant parts of the code

- make sure that your program will run with 100% ieee754 compliance.




So I wanted to ask, which of these two methods usually is used and if and how I can get this ieee754 compliance with C#.

Share this post


Link to post
Share on other sites

[quote name='P@u1' timestamp='1316540944' post='4863906']
2.: If I would make an rts game and want to use lockstep networking, should i then avoid float/double, or should I use them and make sure that I have floating point determinism? (Is this also possible with C#/.Net?)

That doesn't make much sense at all. Somewhat like asking: If I want to design a formula-one racecar engine, should I color the car red or blue?

The choice to run your game in lockstep or not is one decision. There are pros and cons to either direction.
[/quote]

I disagree that it doesn't matter. Specifically, Intel CPUs use 80 bits for internal registers, but AMD CPUs use 64 bits. This means that an Intel CPU and AMD CPU may arrive at different output values for the same input values and same instruction sequence. To avoid this, you want to set the FPU control word to truncate to 64 bits in internal registers, even for Intel CPUs. C#/.NET does not give native control of the FPU control word -- you have to P/Invoke to a DLL that uses inline assembly or similar to get at that functionality.

Evenso, if your JIT uses SSE for floating point, then different CPUs will not be deterministic, too. It's a sad but true state of things. If you are on iPhone, Android, or similar platforms, determinism is even worse -- different ARM implementations will have different FPUs and may potentially run some or all of your instructions in floating point emulation. You're probably better off using fixed-point math for deterministic simulations if they are on a large scale.

Share this post


Link to post
Share on other sites

[quote name='frob' timestamp='1316542554' post='4863919']
[quote name='P@u1' timestamp='1316540944' post='4863906']
2.: If I would make an rts game and want to use lockstep networking, should i then avoid float/double, or should I use them and make sure that I have floating point determinism? (Is this also possible with C#/.Net?)

That doesn't make much sense at all. Somewhat like asking: If I want to design a formula-one racecar engine, should I color the car red or blue?

The choice to run your game in lockstep or not is one decision. There are pros and cons to either direction.

The choice about the format to transmit your data across the wire is a separate decision. Send whatever data is necessary to keep your games in sync.
[/quote]

I disagree that it doesn't matter. Specifically, Intel CPUs use 80 bits for internal registers, but AMD CPUs use 64 bits. This means that an Intel CPU and AMD CPU may arrive at different output values for the same input values and same instruction sequence. To avoid this, you want to set the FPU control word to truncate to 64 bits in internal registers, even for Intel CPUs. C#/.NET does not give native control of the FPU control word -- you have to P/Invoke to a DLL that uses inline assembly or similar to get at that functionality.

Evenso, if your JIT uses SSE for floating point, then different CPUs will not be deterministic, too. It's a sad but true state of things. If you are on iPhone, Android, or similar platforms, determinism is even worse -- different ARM implementations will have different FPUs and may potentially run some or all of your instructions in floating point emulation. You're probably better off using fixed-point math for deterministic simulations if they are on a large scale.
[/quote]


I didn't say that the choices didn't matter. I said that the two decisions are independent.

You can have a simulation run in lockstep and also still have whatever floating point settings you want. A simulation can run lockstep or not with double precision, it can run lockstep or not with single precision.


You are right that thanks to the nastiness of chip design, along with the annoyance of other libraries modifying and adjust your FPU behind your back it is already extremely difficult to maintain precision. One simulation ultimately needs to be authoritative, even in lockstep.

Share this post


Link to post
Share on other sites

One simulation ultimately needs to be authoritative, even in lockstep.
[/quote]
Then it is not really lockstep (as I suspect the OP, and others would typically define it in this context). You are talking about a client/server architecture with particularly heavy amounts of client simulation.

Sure, you could lock the simulation steps in the latter, but I don't think anyone is seriously talking about such an architecture.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!