Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > C&C Generals - game dev question

C&C Generals - game dev question
Thread Tools
Powerbook
Mac Elite
Join Date: Mar 2001
Location: München, Deutschland
Status: Offline
Reply With Quote
Apr 26, 2004, 09:56 AM
 
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.
     
Arkham_c
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Apr 26, 2004, 10:03 AM
 
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
     
calumr
Forum Regular
Join Date: Sep 2000
Location: UK
Status: Offline
Reply With Quote
Apr 27, 2004, 12:47 PM
 
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.
     
Kristoff
Mac Elite
Join Date: Sep 2000
Location: in front of the keyboard
Status: Offline
Reply With Quote
Apr 27, 2004, 02:10 PM
 
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.
     
djohnson
Professional Poster
Join Date: Sep 2000
Location: Texas
Status: Offline
Reply With Quote
Apr 27, 2004, 02:41 PM
 
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.
     
amonitzer
Forum Regular
Join Date: Aug 2001
Location: Vienna, Austria
Status: Offline
Reply With Quote
Apr 29, 2004, 04:13 AM
 
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.
     
Richard Edgar
Dedicated MacNNer
Join Date: Sep 2002
Status: Offline
Reply With Quote
Apr 29, 2004, 07:52 AM
 
Using floats, even 3/3 = 1 does not evaluate to true
I'd be rather surprised if that were the case.
     
Arkham_c
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Apr 29, 2004, 10:47 AM
 
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
     
Basilisk
Forum Regular
Join Date: Dec 2002
Status: Offline
Reply With Quote
Apr 29, 2004, 11:45 AM
 
Not true:
<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
     
Richard Edgar
Dedicated MacNNer
Join Date: Sep 2002
Status: Offline
Reply With Quote
Apr 30, 2004, 02:13 AM
 
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.
     
Powerbook  (op)
Mac Elite
Join Date: Mar 2001
Location: München, Deutschland
Status: Offline
Reply With Quote
May 6, 2004, 06:56 AM
 
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.
     
Catfish_Man
Mac Elite
Join Date: Aug 2001
Status: Offline
Reply With Quote
May 6, 2004, 12:32 PM
 
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.
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
May 6, 2004, 05:02 PM
 
Originally posted by Powerbook:
And C&C is using this very API parts???
No. Try reading the discussion above.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 07:34 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,