.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Dominions 3: The Awakening (http://forum.shrapnelgames.com/forumdisplay.php?f=138)
-   -   Unit Limit / Save the Megagame (http://forum.shrapnelgames.com/showthread.php?t=37167)

Hadrian_II December 16th, 2007 10:02 AM

Unit Limit / Save the Megagame
 
The megagame (Perpetuality) might now come to a very disapointing end, as we have hit the unit limit, and now summons and spells like earth attack and ghostriders had stopped working properly.

I know that a game on a 1000 province map and 65 nations on it is a bit out of the bounary of the game, but its still a bug and it might be fixed (*pleeease*).

Dumb question to the end, why is there such a limit anyway?

Kristoffer O December 16th, 2007 11:23 AM

Re: Unit Limit / Save the Megagame
 
The limit is there as it lowers hosting time. Hosting time is proportional to the unit limit IIRC. All possible unit nbrs are cycled through every turn I think. Thus games would take longer time to host regardless of the actual number of units in the game. The current limit was set *too* high. 1000 province maps were not on our maps when we set the limit.

I'll ask JK and see what he says. There is a patch around the corner anyway. I hope it will make it to christmas. It would be fitting. Unfortunately I only have a few free days left, so it might become the 2008 new year patch instead.

vfb December 16th, 2007 11:35 AM

Re: Unit Limit / Save the Megagame
 
Whenever it's released, Christmas or New Years, please know that it is very much appreciated!

Dedas December 16th, 2007 12:30 PM

Re: Unit Limit / Save the Megagame
 
Maybe one should be able to set the limit oneself? Longer hosting times should not be a problem for megagames.

Agrajag December 16th, 2007 12:55 PM

Re: Unit Limit / Save the Megagame
 
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 could see how hosting times could get huge with a very high unit limit if you actually reach that limit (since then all numbers up to that limit are used and therefore must be cycled through), but I'm guessing that if you reached the limit, then a longer hosting time won't be a problem for you. (so an even bigger limit won't be a problem.)
A limit that does make sense to me is if you are reaching a point where you risk overflow.

Though obviously I don't have access to the code, so I can't be sure http://forum.shrapnelgames.com/images/smilies/happy.gif

capnq December 16th, 2007 01:10 PM

Re: Unit Limit / Save the Megagame
 
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.

DrPraetorious December 16th, 2007 03:06 PM

Re: Unit Limit / Save the Megagame
 
You could raise the unit limit dynamically as the game went on - but an engine change like that would almost certainly introduce horrible memory bugs that would eat our computers alive, drive us into cannibalism and madness, and lead to the downfall of western civilization.

And, yes, your excellent work on the patch is greatly appreciated.

Agrajag December 16th, 2007 03:07 PM

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.

DrPraetorious December 16th, 2007 04:29 PM

Re: Unit Limit / Save the Megagame
 
Actually, I think the game only keeps track of dead units which are either pretenders or in the hall of fame.

So newly recruited units will already steal old unit #s - you can tell when this starts happening because newly recruited commanders will no longer appear at the bottom of the screen (I think.) I assume that what it does is start at some index value, and progress through the array until it finds enough empty spaces for the new recruits.

This actually happens quite quickly - whereupon, each turn, you cycle through all (say) 10,000 unit id#s to see which ones are currently in use. And if you raised the limit to 100,000, this would take 10 times as long each host, once the 100,000th unit had been recruited (including dead ones) which would happen pretty fast.

What you *could* do is start with a unit limit of 1,000. Keep that unit limit until the search for vacant unit #s on recruitment fails, and then double the unit limit.

But this would require memory management which I think is to be avoided, because it's generally time consuming and, frankly, there are other things I'd rather see than a fix to enable ginormous maps with autospawners to keep going past turn 100, which is a pretty specialized issue.

Hadrian_II December 16th, 2007 05:16 PM

Re: Unit Limit / Save the Megagame
 
I dont think the problem is that the number of units is limited due to a loop that checks them all every turn. As a simple check if something exists is very fast, and even medicore computers could do a few millions of them per second, so this might only be a problem, if this loop is checked a gazillion times per turn.

Also to implement a static barrier to break big games when they else just would take longer seems pretty strange to me, so i suppose there is something other going on. But it might be that we just have hit 65536 (2 ^ 16) units, and now some variables begin to flow over and so causing mischief.

Also i suspect that some parts of dom3 are the same as in dom1 and just got extended with new features, and are so now looking quite hacky. (As i cant see the code this is solely based on speculation, but there where dev comments in other threads succesting such things)

NTJedi December 16th, 2007 05:47 PM

Re: Unit Limit / Save the Megagame
 
Quote:

Kristoffer O said:
The limit is there as it lowers hosting time. Hosting time is proportional to the unit limit IIRC. All possible unit nbrs are cycled through every turn I think. Thus games would take longer time to host regardless of the actual number of units in the game. The current limit was set *too* high. 1000 province maps were not on our maps when we set the limit.

I'll ask JK and see what he says. There is a patch around the corner anyway. I hope it will make it to christmas. It would be fitting. Unfortunately I only have a few free days left, so it might become the 2008 new year patch instead.

Yes increasing the unit limit and commander limit would help my huge SP game as well.

Ideally an adjustable game setting would work best! As time passes we all will build/recieve/purchase more and more powerful computers. The adjustable game setting would allow more powerful computers to process larger games with a simple setting change.

PyroStock December 16th, 2007 06:56 PM

Re: Unit Limit / Save the Megagame
 
I'm around turn 100 on a SP 700 province map. I only have a 2700 computer, but it still does all the "AI thinking" and turns in about 20minutes. I'm far more worried about hitting a unit cap then a 60+minute wait. edit:99% of the map is conquered terrority.

Loren December 16th, 2007 07:18 PM

Re: Unit Limit / Save the Megagame
 
I think there is a problem with how some things are looked up. Try to do army setup with 10,000 units in the province. It can get insanely slow. This only makes sense if the system is recalculating a bunch of stuff it should be precalculating.

Zeldor December 16th, 2007 07:24 PM

Re: Unit Limit / Save the Megagame
 
The additional problem is that Dominions does not want to consume more processing power. Nor CPU nor RAM. I would really like to see it taking 70-90% of my power to make turns faster. Now I gain practically nothing from a faster computer.

K December 16th, 2007 07:28 PM

Re: Unit Limit / Save the Megagame
 
Why don't you guys just band together and kill LA Ermor.

I'll bet dollars to donuts that he is currently holding 3/4ths of the available units.

DrPraetorious December 16th, 2007 07:31 PM

Re: Unit Limit / Save the Megagame
 
Because Velusion, whose silver tongue is enameled with lies, is the friendliest and most internationally popular Dark Lord ever.

sector24 December 16th, 2007 07:38 PM

Re: Unit Limit / Save the Megagame
 
You guys are avoiding the real issue, which is that you're not warlike enough. Every unit that you kill opens up a spot for your future SC. All peace treaties are broken, and 48 hour passes are rescinded. To War! http://forum.shrapnelgames.com/images/smilies/happy.gif

Hadrian_II December 16th, 2007 07:39 PM

Re: Unit Limit / Save the Megagame
 
Ermor is surrounded by puppet states since the early game, so engaging him would not make too much sense, but soon all puppets will be under attakcs, and rlyeh will fight ermor.
Or rather would fight, as random spell failure might break the game.

Twan December 16th, 2007 08:20 PM

Re: Unit Limit / Save the Megagame
 
I think the best solution for you is to mod out all the useless units (make all militias and maenads aquatic, all Rlyeh aquatic auto spawn lands unit, give 0 base hp to half the undeads freespawn types, etc...)

Considering the advantage freespawn nations seem to have in this kind of game it would also make the balance better IMO.

DrPraetorious December 16th, 2007 08:55 PM

Re: Unit Limit / Save the Megagame
 
I could certainly do that. EDIT: Extremely stupid and backwards thing removed.

If we're worried about the game being buggy, though, making major changes to the mod script in the middle of a game may not be the best policy http://forum.shrapnelgames.com/images/smilies/happy.gif

Meglobob December 16th, 2007 09:02 PM

Re: Unit Limit / Save the Megagame
 
I played LA Ermor in starfall and even though the game ended turn 60'ish, there was a problem with the unit limit. None of the summon allies worked on the elemental kings and queens. Wether anyone got there summons largely depended on how many of my undead died.

I am really surprised the megagame lasted this long without reaching the unit limit.

If there is any future megagame you probably need to ban La Ermor. Possibly consider banning La Ryleh, plus Ea and Ma Pan (or at least not letting them take turmoil 3 luck 3) but they are no where near as bad as a runaway La Ermor.

Oh yea, well done to everyone who made it too the end btw... http://forum.shrapnelgames.com/images/smilies/happy.gif

Twan December 16th, 2007 10:47 PM

Re: Unit Limit / Save the Megagame
 
Quote:

If we're worried about the game being buggy, though, making major changes to the mod script in the middle of a game may not be the best policy http://forum.shrapnelgames.com/images/smilies/happy.gif

Dynamic modding seem to work fine technically. After it's more a matter of "which units can be modded out without breaking some nations ?" (ie Rlyeh can probably work without aquatic summons, and all nations without militias and other human indie units, but of course Ermor without freespawns is more problematic ; and as long Ermor keeps freespawns other nations need some massable chaff too, etc..)

Velusion December 17th, 2007 06:17 PM

Re: Unit Limit / Save the Megagame
 
Quote:

DrPraetorious said:
Because Velusion, whose silver tongue is enameled with lies, is the friendliest and most internationally popular Dark Lord ever.

http://forum.shrapnelgames.com/images/smilies/laugh.gif

I like to think of it as evil tyrants working together for a darker future.

Hadrian_II December 17th, 2007 06:52 PM

Re: Unit Limit / Save the Megagame
 
Quote:

Velusion said:
Quote:

DrPraetorious said:
Because Velusion, whose silver tongue is enameled with lies, is the friendliest and most internationally popular Dark Lord ever.

http://forum.shrapnelgames.com/images/smilies/laugh.gif

I like to think of it as evil tyrants working together for a darker future.

Even now when the game is over, he lets his vassals believe that they had free will at any point. http://forum.shrapnelgames.com/image...es/biggrin.gif


All times are GMT -4. The time now is 03:37 PM.

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