.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Air Command 3.0- Save $12.00
War Plan Pacific- Save $7.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 2: The Ascension Wars

Reply
 
Thread Tools Display Modes
  #1  
Old February 27th, 2004, 02:13 AM

alexti alexti is offline
First Lieutenant
 
Join Date: Dec 2003
Location: Calgary, Canada
Posts: 762
Thanks: 0
Thanked 0 Times in 0 Posts
alexti is on a distinguished road
Default Re: 2.08 and Incompatible Battle Reports

Quote:
Originally posted by Arryn:
quote:
Originally posted by alexti:
The idea of the standards is to be able to write code which will work correctly (meaning that as programmer specified in the source code - as opposite to what the programmer wants ) if compiled by any standard-compliant compiler.
The C/C++ standards do not address the issue that's been the focus of this interminable discussion. So your argument is sort of irrelevant.
That's exactly the point. If C/C++ standard does not specify the order of evaluation (I haven't seen it there, but it doesn't mean that it's not there though ) you can not rely on any particular order.
In the following example you can't rely on whether left call or right call will be evaluated first, but you can rely that both of them will be evaluated.
code:
  int print_empty_line()
{
printf("\n");
return 1;
}

void foo(int x)
{
if (x + print_empty_line() < 2 + print_empty_line())
...
}

Quote:
quote:
Optimizer should meet all criteria defined in the language standard concerning the produced binary code, so the only case when it is allowed to alter the results is when the programmer is using constructs which behaviour is undefined by the standard. And the programmer should not be using such constructs.
1) The compiler does comply with the standard.

Which case you considering? Concerning evaluation order it's standard-compliant, but if it replaces 2 calls with one, it's not.
Reply With Quote
  #2  
Old February 27th, 2004, 02:21 AM

alexti alexti is offline
First Lieutenant
 
Join Date: Dec 2003
Location: Calgary, Canada
Posts: 762
Thanks: 0
Thanked 0 Times in 0 Posts
alexti is on a distinguished road
Default Re: 2.08 and Incompatible Battle Reports

Quote:
Originally posted by E. Albright:
quote:
Originally posted by alexti:
Some Languages consider line feeds as a language element, but not C/C++.
code:
f(); f();

and
code:
f();
f();

are the same thing.
Fair enough. However, Arryn was suggesting that your example was not analogous because the calls were in seperate statements (tho' to be fair, she used the term "lines", so the confusion is understandable).

Here's where those examples came from:
Quote:
Originally posted by Arryn:
[qb]The problem comes in that the compiler's optimization will substitute the same call to the random number function for both die rolls. It won't make the two rand() calls the coders intend. What it does is make one call and plug the same value into both places. The optimizer does not know that in this circumstance, two calls to the same function do not return the same value.
And in all 3 cases f shall be called twice:
code:
  f(); f();

f(), f();

f()+f()

Edit: Fixed quotations. Again.
P.S. I want real forum/client

[ February 27, 2004, 00:23: Message edited by: alexti ]
Reply With Quote
  #3  
Old February 27th, 2004, 04:06 PM
Gandalf Parker's Avatar

Gandalf Parker Gandalf Parker is offline
Shrapnel Fanatic
 
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
Gandalf Parker is on a distinguished road
Default Re: 2.08 and Incompatible Battle Reports

OK master password is in now, but has anyone tried using it? I take it that it is only to override the player passwords? No AI access? I was hoping it would let me jump in midgame to check on what an AI was doing.
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
Reply With Quote
  #4  
Old February 27th, 2004, 05:26 PM

General Tacticus General Tacticus is offline
Sergeant
 
Join Date: Dec 2003
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
General Tacticus is on a distinguished road
Default Re: 2.08 and Incompatible Battle Reports

Quote:
Originally posted by Gandalf Parker:
DISCLAIMER Im just kidding.

There are no mismatched battle reports. You all just have cowardly messengers. "Ummm you won. Yeah thats it, YOU WON oh Mighty and Frightening Deity."

I dont have that problem. But then I usually take wimply little mages. I dont take big scarey two-headed snakes, or giant floating heads.
My messengers wouldn't dare report anything but the Truth ! First, it is official dogma that I, as a Pretender, am All-Knowing, therefore any effort at lying will be found out. And all my citizens are true believers of official dogma. Second, it is equally well known that bad news only result in a quick and painful death, while lying result in an eternal and even more painful afterlife. And finally, my majordomo knows that I don't like to be bothered by unsignificant events...

Of course, it helps that I never lose a battle, and that there are never bad news to report. And it helps that I have a first-class majordomo.

(Tacticus Sanguinus, God of Mictlan)
__________________
Read my Mictlan AAR :
A tale of Fire and Blood (in progress)
Reply With Quote
  #5  
Old March 5th, 2004, 02:11 AM
Johan K's Avatar

Johan K Johan K is offline
Brigadier General
 
Join Date: Aug 2003
Location: Mictlan
Posts: 1,767
Thanks: 12
Thanked 165 Times in 22 Posts
Johan K is on a distinguished road
Default Re: 2.08 and Incompatible Battle Reports

Quote:
Originally posted by alexti:
And if using MSVC5/6 one can optimize for size, it often produces faster code then optimization for speed (even if speed-optimized executable is sort of working).
I tried it and 'Minimize size' actually resulted in a faster program than 'maximize speed' (about 1% faster). Who would have guessed. I bet 'minimize size' makes it larger though
__________________
http://www.illwinter.com
Reply With Quote
  #6  
Old March 4th, 2004, 03:23 PM

alexti alexti is offline
First Lieutenant
 
Join Date: Dec 2003
Location: Calgary, Canada
Posts: 762
Thanks: 0
Thanked 0 Times in 0 Posts
alexti is on a distinguished road
Default Re: 2.08 and Incompatible Battle Reports

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting 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 On

Forum Jump


All times are GMT -4. The time now is 11:05 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.