|
|
C&C Generals - game dev question
|
|
|
|
Mac Elite
Join Date: Mar 2001
Location: München, Deutschland
Status:
Offline
|
|
What are the possible problems in a Mac<->PC game networking? For example, in C&C Generals Asypr claimed they couldn't solve them. I'd like to hear an opinion from other developers!
Regards,
PB.
|
Aut Caesar aut nihil.
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status:
Offline
|
|
Originally posted by Powerbook:
What are the possible problems in a Mac<->PC game networking? For example, in C&C Generals Asypr claimed they couldn't solve them. I'd like to hear an opinion from other developers!
Regards,
PB.
It's really simple. Games that use Microsoft's DirectX programming APIs for networking cannot play cross-platform. It's one of those monopoly things.
|
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Sep 2000
Location: UK
Status:
Offline
|
|
Actually, I heard that the problem with C&C was that it was impossible to keep the floating point calculations in sync with the PC version.
The problem is similar to the threads that popped up in the OS X forum about the calculator not being able to add properly. The foating point calculations are only accurate to a certain degree, at which point the inaccuracies between the Mac & PC calculations start to diverge and code that requires the results to be the same for the client & the server thinks that something's wrong, and decides to quit the game.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Sep 2000
Location: in front of the keyboard
Status:
Offline
|
|
It's called poor design. period. end of discussion.
how does RTCW, UT, etc work (not to mention every other app that uses sockets, tcp/ip, udp, etc)?
The people who wrote C&C generals didn't do a good enough job generalizing the design of protocols to allow upgrades/cross platform portability.
|
signatures are a waste of bandwidth
especially ones with political tripe in them.
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Sep 2000
Location: Texas
Status:
Offline
|
|
Originally posted by Kristoff:
It's called poor design. period. end of discussion.
how does RTCW, UT, etc work (not to mention every other app that uses sockets, tcp/ip, udp, etc)?
The people who wrote C&C generals didn't do a good enough job generalizing the design of protocols to allow upgrades/cross platform portability.
Exactly. When designing cross-platform games/programs, you have to keep many things in mind. This is why it is good to learn how to write a program that works across the different *nixes and windows... A taste of all things.
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Aug 2001
Location: Vienna, Austria
Status:
Offline
|
|
Originally posted by calumr:
The problem is similar to the threads that popped up in the OS X forum about the calculator not being able to add properly. The foating point calculations are only accurate to a certain degree, at which point the inaccuracies between the Mac & PC calculations start to diverge and code that requires the results to be the same for the client & the server thinks that something's wrong, and decides to quit the game.
One thing that your learn very early in CS is that you can NEVER rely on the absolute accuracy of floats. They might even get problems with new Intel Chips, AMD chips and other things (for example, Virtual PC has the same problem).
Using floats, even 3/3 = 1 does not evaluate to true.
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Sep 2002
Status:
Offline
|
|
Using floats, even 3/3 = 1 does not evaluate to true
I'd be rather surprised if that were the case.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status:
Offline
|
|
Originally posted by amonitzer:
One thing that your learn very early in CS is that you can NEVER rely on the absolute accuracy of floats. They might even get problems with new Intel Chips, AMD chips and other things (for example, Virtual PC has the same problem).
Using floats, even 3/3 = 1 does not evaluate to true.
Not true:
Code:
[dshaw@flybook ~] cat floats.c
#include <stdio.h>
int main(int argc, char *argv)
{
float f = 3.000000000000;
float g = 3.000000000000;
float h = f/g;
printf("Result: %f\n", h);
printf("Result: %0.0f\n", h);
}
[dshaw@flybook ~] cc -o floats floats.c
[dshaw@flybook ~] ./floats
Result: 1.000000
Result: 1
|
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Dec 2002
Status:
Offline
|
|
<snip sample code>
I hate to be pedantic, but:
- The sample code you posted doesn't prove your point. The float formatting of (s)printf will round values in many cases. A proper test would be:
Code:
if (h == 1.00000000) {
// Do something
}
- Even though amonitzer chose a poor example ((3/3) == 1 is true in IEEE 754 floating point), his general assertion is correct. IEEE floats are inexact representations of ideal real numbers. I suspect you know this, but I just wanted to be clear to any non-developer readers of the thread.
Arkam's original post is likely the real explanation, DirectX's network isn't ported to Mac (and probably never will be). I'd be surprised if the floating point drift story was true, virtually all processors use IEEE representations and calculations using the standard should be equivalent.
Alex
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Sep 2002
Status:
Offline
|
|
Even though amonitzer chose a poor example ((3/3) == 1 is true in IEEE 754 floating point), his general assertion is correct
To call it a 'poor example' is paying it a compliment. Any floating point representation that can't correctly calculate x/x as being unity (barring certain values of x, such as NaN, 0 and infinity) is going to be completely useless.
A better example is the fact that FP arithmetic is not associative. That is
(a+b)+c /= a+(b+c)
in general. An a simple test is to use FP to sum
\Sigma 1/n
The series is formally divergent, but will converge on a real machine. Start from n=1, and sum the terms until the sum stops changing. Keep track of how many terms you summed. Then, sum the sequence in reverse, and compare the results.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Mar 2001
Location: München, Deutschland
Status:
Offline
|
|
Originally posted by Arkham_c:
It's really simple. Games that use Microsoft's DirectX programming APIs for networking cannot play cross-platform. It's one of those monopoly things.
And C&C is using this very API parts???
If yes: Why wasn't it clear from the beginning that there can't ba a mac port of these networking parts? Why all the "still trying, working on blabla" ? They either have the appropriate license for this code part or not. "There is no try" (Yoda)
Also: Why is it in MS' interest to keep these networking code parts Wintel only??? Wouldn't porting it be a WIN/WIN sitation? MS gets license royalties, game/etc companies get a(nother) safe networking code.
---> I don't get it.
PB.
|
Aut Caesar aut nihil.
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Aug 2001
Status:
Offline
|
|
Originally posted by Powerbook:
And C&C is using this very API parts???
If yes: Why wasn't it clear from the beginning that there can't ba a mac port of these networking parts? Why all the "still trying, working on blabla" ? They either have the appropriate license for this code part or not. "There is no try" (Yoda)
Also: Why is it in MS' interest to keep these networking code parts Wintel only??? Wouldn't porting it be a WIN/WIN sitation? MS gets license royalties, game/etc companies get a(nother) safe networking code.
---> I don't get it.
PB.
Porting DirectX to the Mac (and doing it well) would be incredibly difficult and expensive. MS really doesn't gain enough for it to be worth it.
|
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
Originally posted by Powerbook:
And C&C is using this very API parts???
No. Try reading the discussion above.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|