Author Topic: Number rollover in Security Nexus  (Read 3375 times)

0 Members and 1 Guest are viewing this topic.

Online Buster's Uncle

  • In Buster's Orbit, I
  • Ascend
  • *
  • Posts: 49271
  • €440
  • View Inventory
  • Send /Gift
  • Because there are times when people just need a cute puppy  Soft kitty, warm kitty, little ball of fur  A WONDERFUL concept, Unity - & a 1-way trip that cost 400 trillion & 40 yrs.  
  • AC2 is my instrument, my heart, as I play my song.
  • Planet tales writer Smilie Artist Custom Faction Modder AC2 Wiki contributor Downloads Contributor
    • View Profile
    • My Custom Factions
    • Awards
Number rollover in Security Nexus
« on: April 25, 2013, 06:47:09 PM »
I've got approximately 327 superantigravhovertankformers ("Former") in my latest game - check the numbers in the F7 Security Nexus screen:



That screeny's from v 2.0.  I checked it in my scient-Iffic beta copy, and the problem is still present. 

Obviously, the numbers roll over at 255.  If anyone wants to go to the trouble to do an actual count, they're all parked in bases in the save attached.  The numbers down in the corner clearly didn't roll over at 255, but certainly don't add up to reflect the reality.

-Also obviously, people mostly aren't obsessive-compulsive enough to run out the clock on won games and won't accumulate these kinds of 255+ unit numbers, so this one isn't highest priority to fix.  But still, a bug's a bug, and gotta report these glitches when we find them...

Offline scient

Re: Number rollover in Security Nexus
« Reply #1 on: April 25, 2013, 08:01:28 PM »
The information is stored in a BYTE so maximum you'll ever be able to see is 255.  The information is lost when it rolls, so this isn't a matter of information not being displayed.  You'd have to restructure the massive FACTION internal structure to solve this issue beyond simple band aid patch to fix roll over issue.  I don't really see a point since this only will happen in rare late game circumstances and it won't even be a correct value anyway.

Offline gwillybj

Re: Number rollover in Security Nexus
« Reply #2 on: April 25, 2013, 08:05:02 PM »
-Also obviously, people mostly aren't obsessive-compulsive enough to run out the clock on won games-
I wondered why my ears were ringing ??? The game ain't over 'til it's over ;nutz; OCD is one of a few wonderful things I take special pills for :help: :P ;aaa ;lol
Two possibilities exist: Either we are alone in the Universe or we are not. Both are equally terrifying. ― Arthur C. Clarke
I am on a mission to see how much coffee it takes to actually achieve time travel. :wave:

Online Buster's Uncle

  • In Buster's Orbit, I
  • Ascend
  • *
  • Posts: 49271
  • €440
  • View Inventory
  • Send /Gift
  • Because there are times when people just need a cute puppy  Soft kitty, warm kitty, little ball of fur  A WONDERFUL concept, Unity - & a 1-way trip that cost 400 trillion & 40 yrs.  
  • AC2 is my instrument, my heart, as I play my song.
  • Planet tales writer Smilie Artist Custom Faction Modder AC2 Wiki contributor Downloads Contributor
    • View Profile
    • My Custom Factions
    • Awards
Re: Number rollover in Security Nexus
« Reply #3 on: April 25, 2013, 08:07:24 PM »
I can usually turn those tendencies on and off at will, but why should I when I'm having fun?


The information is stored in a BYTE so maximum you'll ever be able to see is 255.  The information is lost when it rolls, so this isn't a matter of information not being displayed.  You'd have to restructure the massive FACTION internal structure to solve this issue beyond simple band aid patch to fix roll over issue.  I don't really see a point since this only will happen in rare late game circumstances and it won't even be a correct value anyway.
No big thang - I know you like to look into anomalies for a greater understanding of the program - I haven't reported many bugs I actually care about seeing fixed...

Offline Yitzi

Re: Number rollover in Security Nexus
« Reply #4 on: April 25, 2013, 09:14:53 PM »
The information is stored in a BYTE so maximum you'll ever be able to see is 255.  The information is lost when it rolls, so this isn't a matter of information not being displayed.  You'd have to restructure the massive FACTION internal structure to solve this issue beyond simple band aid patch to fix roll over issue.  I don't really see a point since this only will happen in rare late game circumstances and it won't even be a correct value anyway.

Is it stored in the unit structure or the faction structure?  If in the unit structure, that might make the restructuring somewhat easier, though still probably fairly difficult.

Offline scient

Re: Number rollover in Security Nexus
« Reply #5 on: April 25, 2013, 09:43:50 PM »
No, faction.  It should be a 512 byte array (maximum # of diff type of units).  I dunno why they made the "units lost" array a WORD and "active" a BYTE.  I guess they figured no one would have more than 255 of same type of units in a normal game.

0096D238 ; char FACT_struct_stats_unit_type_active[]

0096D638 FACT_struct_stats_unit_type_lost dw 512 dup( ?)

Offline Yitzi

Re: Number rollover in Security Nexus
« Reply #6 on: April 25, 2013, 10:02:23 PM »
No, faction.  It should be a 512 byte array (maximum # of diff type of units).

But aren't there a maximum of 128 types for a single faction?  (64 premade and 64 from the workshop)?

Offline scient

Re: Number rollover in Security Nexus
« Reply #7 on: April 25, 2013, 10:05:34 PM »
Oh, maybe.  That actually makes more sense.  The array for units lost is 512 WORDs tho.

Offline Yitzi

Re: Number rollover in Security Nexus
« Reply #8 on: April 29, 2013, 02:28:36 PM »
It occurred to me...it may be possible to bypass the "units active" array entirely when it's 255 or over (which can be done just by having it not increment after 255, and bypass if it's past 255), and just count them directly from the unit data.  The only concern is that if you have a huge number of units, it may slow down the game.

 

* User

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

* Community poll

SMAC v.4 SMAX v.2 (or previous versions)
-=-
24 (7%)
XP Compatibility patch
-=-
9 (2%)
Gog version for Windows
-=-
103 (32%)
Scient (unofficial) patch
-=-
40 (12%)
Kyrub's latest patch
-=-
14 (4%)
Yitzi's latest patch
-=-
89 (28%)
AC for Mac
-=-
3 (0%)
AC for Linux
-=-
6 (1%)
Gog version for Mac
-=-
10 (3%)
No patch
-=-
16 (5%)
Total Members Voted: 314
AC2 Wiki Logo
-click pic for wik-

* Random quote

Now it's day and night the irons clang, and like poor galley slaves
We toil and toil, and when we die, must fill dishonored graves
But some dark night, when everything is silent in the town
I'll shoot those tyrants one and all, I'll gun the flogger down
I'll give the land a little shock, remember what I say,
And they'll yet regret they've sent Jim Jones in chains to Botany Bay.
~'Jim Jones', Traditional

* Select your theme

*
Templates: 5: index (default), PortaMx/Mainindex (default), PortaMx/Frames (default), Display (default), GenericControls (default).
Sub templates: 8: init, html_above, body_above, portamx_above, main, portamx_below, body_below, html_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 45 - 1228KB. (show)
Queries used: 40.

[Show Queries]