.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 3: The Awakening

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old December 16th, 2007, 03:07 PM
Agrajag's Avatar

Agrajag Agrajag is offline
Lieutenant Colonel
 
Join Date: Jul 2004
Location: Israel
Posts: 1,449
Thanks: 4
Thanked 8 Times in 2 Posts
Agrajag is on a distinguished road
Default Re: Unit Limit / Save the Megagame

Quote:
capnq said:
Quote:
Agrajag said:
Quote:
All possible unit nbrs are cycled through every turn I think.
As a hobbyist programmer:
That sounds unlikely, why would you need to access a unit number for a unit that doesn't yet exist?
I can take a guess at that.

At minimum, you have to check every unit number up to the highest one assigned so far, even if thousands of lower numbered units have already been destroyed. Renumbering the units to account for casualties would be even more time consuming than just cycling through the range.
That's almost what I said - at most you have to check every unit number up to the highest one assigned so far, so there's no reason to go beyond that and reach all the way to the unit limit.
Furthermore, I don't think there could ever be any renumbering going on because IIRC the game intentionally keeps track of dead units.
But if it didn't, renumbering would actually be a piece of cake:
When unit dies:
1) Replace unit number between current one and last one.
2) "Kill" the dead unit that's now at the end.
And if renumbering is impossible due to engine constraints (for example, if a global spell remembers that it has been cast by unit #n and not the other way around), you could still reuse old numbers by merely making dead units "inactive" and whenever a new unit is created it can "steal" the dead unit's number.
__________________
I'm in the IDF. (So any new reply by me is a very rare event.)
Reply With Quote
 

Bookmarks


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 12:02 PM.


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