Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

cumulated casualties number overflow in long campaign?

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [Current Games From Matrix.] >> [World War II] >> Steel Panthers World At War & Mega Campaigns >> cumulated casualties number overflow in long campaign? Page: [1]
Login
Message << Older Topic   Newer Topic >>
cumulated casualties number overflow in long campaign? - 9/25/2006 1:52:34 PM   
deadcat

 

Posts: 9
Joined: 9/25/2006
Status: offline
hello,

playing 8.4 long campaign, german side.
the result screen after each scenario shows, as i understood, cumulated casualties for my and the enemy side for the entire campaign.
now, the number of casualties i incurred on the oponent went over 32.767 and the number switched negative and subsequent casualties incurred on the oponent are being now substracted from -32.767 (or 32.768?).

anyone else noticed this?
cheers
Post #: 1
RE: cumulated casualties number overflow in long campaign? - 9/25/2006 8:14:58 PM   
Procrustes

 

Posts: 633
Joined: 3/30/2003
From: Upstate
Status: offline

Cool - the number of casualties must be stored in a two-byte var (2^15=32768) - when you went over it switched the sign bit.  I expect it will keep working - let us know.

(in reply to deadcat)
Post #: 2
RE: cumulated casualties number overflow in long campaign? - 9/25/2006 11:44:49 PM   
deadcat

 

Posts: 9
Joined: 9/25/2006
Status: offline
yeah i thought that the data type for the casualties variable is a "short int" ("unsigned short int" would've made more sense tho).
it does work in subsequent scenarios. by now, i have to calculate the overall casualties with the formula 32767 + modulo(32767 - modulo(shown_total)).
i was a bit perplexed when i first noticed the - in front of the figure, but then i remembered 2^15 is a *magic* number, hehehe.
would've made sense to make the variable an unsigned int, i guess, as it should't ever be negative.

(in reply to Procrustes)
Post #: 3
RE: cumulated casualties number overflow in long campaign? - 9/26/2006 12:31:47 AM   
Riun T

 

Posts: 1848
Joined: 7/31/2004
Status: offline
Congradulations deadcat, for joining the ranks of fellow "score wrappers", that takes some doin!!

(in reply to deadcat)
Post #: 4
Page:   [1]
All Forums >> [Current Games From Matrix.] >> [World War II] >> Steel Panthers World At War & Mega Campaigns >> cumulated casualties number overflow in long campaign? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

1.813