Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

RE: Supply Revisions

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

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> World in Flames >> RE: Supply Revisions Page: <<   < prev  1 2 [3]
Login
Message << Older Topic   Newer Topic >>
RE: Supply Revisions - 6/6/2010 8:40:24 PM   
Shannon V. OKeets

 

Posts: 22063
Joined: 5/19/2005
From: Honolulu, Hawaii
Status: offline

quote:

ORIGINAL: Froonp

Maybe it was said below, but an idea to save time in calculating supply, would be to have units stacked with another non hq unit from the same country to use the same supply path as that unit.

Yes. Thanks.

There are several ways to do that. I'll choose one of them.

However, each unit will have its own copy of the path stored with the unit's information. That's so if the unit moves I do not have to worry about others units which had the 'same' supply path.

_____________________________

Steve

Perfection is an elusive goal.

(in reply to Froonp)
Post #: 61
WIfCon 2010 - 6/7/2010 3:15:37 AM   
sajbalk


Posts: 264
Joined: 7/11/2005
From: Davenport, Iowa
Status: offline
Hello All

WiFCon 2010 is this August in Lansing, Michigan, USA. I would encourage everyone to attend or at least visit the website at wifcon.org.

Hope to see you there.



_____________________________

Steve Balk
Iowa, USA

(in reply to Shannon V. OKeets)
Post #: 62
RE: WIfCon 2010 - 6/8/2010 9:52:57 PM   
Incy

 

Posts: 336
Joined: 10/25/2003
Status: offline
I have a proposal for the unlimited supply determination algorithm.

Instead of trying to trace paths, you could tray to trace a 'bag' and check if something is inside or outside the bag.
The bag could be centered either on the unit being tested, or on a primary supply source. I suspect the latter is better and will assume this.

To construct the bag you would start on a random primary supply source and trace a straight line in a random direction (disregarding supply cost, rail, etc) until you can't trace supply any further, this is an edge hex/Seazone. Then you recursively find all adjacent hexes that are also on the edge of your supply capability. Continue until the edge forms a full circle.

You'll also have to check for the two special cases that there is a separate bag inside of or outside of the current bag. This is easily done by checking if you can trace to all other primary sources from your starting source. You might also want to construct 'sub-bags' for parts of paths that are overseas, to solve some difficulties calculating edges when seazones are involved.

Once you have the bag in place (or several bags), determining unlimited supply becomes a matter of detecting if a unit is inside a bag or not. All units outside of a bag are unlimited OOS. Hopefully you have a good way of determining this.

Also, you could store the path of the edge around the bag just as you do with unit supply paths. This will allow you to detect potential changes in the shape of bag, and make a delta calculation everytime a bag changes.

Also, if you calculate bags, you can safely tag all units outside a bag as OOS, and you'll never have to recalculate them (until the a bag expands to put them back in unlimited supply).

(in reply to sajbalk)
Post #: 63
RE: WIfCon 2010 - 6/9/2010 4:01:53 AM   
Shannon V. OKeets

 

Posts: 22063
Joined: 5/19/2005
From: Honolulu, Hawaii
Status: offline

quote:

ORIGINAL: Incy

I have a proposal for the unlimited supply determination algorithm.

Instead of trying to trace paths, you could tray to trace a 'bag' and check if something is inside or outside the bag.
The bag could be centered either on the unit being tested, or on a primary supply source. I suspect the latter is better and will assume this.

To construct the bag you would start on a random primary supply source and trace a straight line in a random direction (disregarding supply cost, rail, etc) until you can't trace supply any further, this is an edge hex/Seazone. Then you recursively find all adjacent hexes that are also on the edge of your supply capability. Continue until the edge forms a full circle.

You'll also have to check for the two special cases that there is a separate bag inside of or outside of the current bag. This is easily done by checking if you can trace to all other primary sources from your starting source. You might also want to construct 'sub-bags' for parts of paths that are overseas, to solve some difficulties calculating edges when seazones are involved.

Once you have the bag in place (or several bags), determining unlimited supply becomes a matter of detecting if a unit is inside a bag or not. All units outside of a bag are unlimited OOS. Hopefully you have a good way of determining this.

Also, you could store the path of the edge around the bag just as you do with unit supply paths. This will allow you to detect potential changes in the shape of bag, and make a delta calculation everytime a bag changes.

Also, if you calculate bags, you can safely tag all units outside a bag as OOS, and you'll never have to recalculate them (until the a bag expands to put them back in unlimited supply).

Nice in theory, but for the US, all of the US & Canada would be in one bag. And for the USSR it would include all of Siberia. One problem is that supply is different not only for each major power, but also for each minor country. That's a lot of bags to keep up-to-date.

_____________________________

Steve

Perfection is an elusive goal.

(in reply to Incy)
Post #: 64
RE: WIfCon 2010 - 6/9/2010 2:45:23 PM   
Anendrue


Posts: 817
Joined: 7/8/2005
Status: offline
What if you used both methods. A bag based on primary sources for each country. Which could eliminate a lot of units needing to trace individual supply. Then check the few remaining units that are still not supplied.It might speed up the process or might not.


_____________________________

Integrity is what you do when nobody is watching.

(in reply to Shannon V. OKeets)
Post #: 65
RE: WIfCon 2010 - 6/9/2010 5:32:01 PM   
Incy

 

Posts: 336
Joined: 10/25/2003
Status: offline
I think large bag size is not a problem, I think it's an advantage. The larger the bag, the more you earn by only computing the edge (and not every possible path within the bag).

The america, siberia and africa bags would normally not change much during a game, most of the edge would remain static. The west and east edges of siberia, and the north edge of africa would see some adjustments, but for the main part they'd simply hug coast/boarder along the same path the entire game. Delta calculation of edges would not be very difficult to implement either.

The biggest gain would be that you never have to recalculate supply for anything outside of a bag.
You'd also never have to recalculate unlimited OOS status for any unit (which is probably an expensive calculation, that might have to be repeated very often, depending on your algorithm). All that is needed if you implement bags is to toggle a units 'unlimted OOS status' whenever it passes over the edge, or the egde passes over it.

I agree that it wil be somewhat complex to code (probably many days), so if you are able to solve well both
-unlimited OOS calculations
-calculating when units are brough back in supply
then you definately shouldn't consider this idea.


PS: You can eliminate the need for bags 'per minor' by calculating one bag that everyone on a side can use, and then add sub-bags for those parts only acsessible by some countries on a side. If/when the need arises I'll be happy to write out a more detailed algoritm for this.

(in reply to Shannon V. OKeets)
Post #: 66
RE: WIfCon 2010 - 6/9/2010 6:50:58 PM   
Shannon V. OKeets

 

Posts: 22063
Joined: 5/19/2005
From: Honolulu, Hawaii
Status: offline
quote:

ORIGINAL: Incy

I think large bag size is not a problem, I think it's an advantage. The larger the bag, the more you earn by only computing the edge (and not every possible path within the bag).

The america, siberia and africa bags would normally not change much during a game, most of the edge would remain static. The west and east edges of siberia, and the north edge of africa would see some adjustments, but for the main part they'd simply hug coast/boarder along the same path the entire game. Delta calculation of edges would not be very difficult to implement either.

The biggest gain would be that you never have to recalculate supply for anything outside of a bag.
You'd also never have to recalculate unlimited OOS status for any unit (which is probably an expensive calculation, that might have to be repeated very often, depending on your algorithm). All that is needed if you implement bags is to toggle a units 'unlimted OOS status' whenever it passes over the edge, or the egde passes over it.

I agree that it wil be somewhat complex to code (probably many days), so if you are able to solve well both
-unlimited OOS calculations
-calculating when units are brough back in supply
then you definately shouldn't consider this idea.


PS: You can eliminate the need for bags 'per minor' by calculating one bag that everyone on a side can use, and then add sub-bags for those parts only acsessible by some countries on a side. If/when the need arises I'll be happy to write out a more detailed algoritm for this.


I think there are too many intricacies in the supply rules for this to work. Here are a couple of the anomalies that supply has to deal with:

AOI unit - has 3 home countries.
Ski units - can ignore enemy zones of control.
Weather - changes the number of basic path hexes in a supply line (so the bags would have to be recalculated every time the weather changes); it also affects whether a port is iced in or not.
Optional rules - change how supply is calculated through sea areas.
Control of a sea area - affects supply through a straits hex.
Control of a city - has to be continuous for the entire turn for it to be a supply source
HQs can becomes primary supply sources - for a turn or for an impulse depending on optional rules
DOWs - affect which countries cooperate, which affects supply dramatically
Tertiary supply source - (secondary that can not trace to a primary but can trace to a secondary that is in supply) have to be determined within a'while' loop (or recursively, if you prefer).

That list is just off the top of my head, there are probably several more that I don't remember at the moment.

Whenever supply needs to be determined (which is continuously during land movment), the supply determination system hads to accommodate all those quirky rules. Add to the top of that Internet play, when multiple players on a side can be moving units simulataneously and affecting supply for both enemy and friendly units.

===
There's a good reason that the the new supply routines are 2650 + 1750 + 2350 + 975 = 7725 lines of code. And I haven't completed them yet. Somewhere around 9,000 to 10,000 lines of code is a likely final number. The basic algorithm isn't that hard to code, but all the odd bits take a lot of checking.

< Message edited by Shannon V. OKeets -- 6/9/2010 6:51:27 PM >


_____________________________

Steve

Perfection is an elusive goal.

(in reply to Incy)
Post #: 67
RE: WIfCon 2010 - 6/9/2010 7:07:12 PM   
Anendrue


Posts: 817
Joined: 7/8/2005
Status: offline
quote:

ORIGINAL: Shannon V. OKeets
... all the odd bits take a lot of checking.

I am a little off topic here.
In my opinion, that is the main issue of programming a game like WiF vs creating a simpler game like Strategic Commnad. Im SC you just eliminate or not use what is difficult. In MWiF the overwhelmining majority of those odd bits must still be included or it is no longer the game you started to prorgram.

Now back to the topic.
I understand not using a reverse spread of supply (bag theory) now. So I'll just bag my comments and go... (it's ok to groan, my jokes are very bad indeed)

_____________________________

Integrity is what you do when nobody is watching.

(in reply to Shannon V. OKeets)
Post #: 68
RE: WIfCon 2010 - 6/10/2010 12:21:58 AM   
Incy

 

Posts: 336
Joined: 10/25/2003
Status: offline
quote:

Weather - changes the number of basic path hexes in a supply line (so the bags would have to be recalculated every time the weather changes); it also affects whether a port is iced in or not


I think you misunderstand the proposal somewhat.

bags are intended to find the edge of what can be supplied by unlimited supply. Everyting not inside a bag is completely isolated.
Calculation of bags would not be affected by weather, rail, etc.

Bags would not need recalculation becuase of changing sea supply (use sub-bags that can be connected/disconnected to the primary bags whenever tracing overseas).
Ski troops would need to be checked even if outside a bag.
Disappearing primary: check if last in bag. If so, remove bag.
Appearing primary: check if inside existing bag. If not, create bag
Multiple states of war: handled with sub-bags as described above (Ex: Italian ZOC -> create connected sub-bag tagged 'peace_required_with<Italy>')
tertiary: not relevant

(in reply to Shannon V. OKeets)
Post #: 69
RE: WIfCon 2010 - 6/10/2010 12:28:18 AM   
Incy

 

Posts: 336
Joined: 10/25/2003
Status: offline
I'm proably starting to be annoying on this, so don't waste your time adressing this now.

Just remember the concept for later use if you run into trouble with unlimited supply/ or excessive time use by constant reconnect attempts for supply paths
If that happens, send me an email and I'll happily work with you on the details

btw, bags can probably be a quite useful concept for the AI too, but let's not go there yet.

(in reply to Incy)
Post #: 70
RE: WIfCon 2010 - 7/13/2010 6:00:57 AM   
brian brian

 

Posts: 3191
Joined: 11/16/2005
Status: offline
I noticed an obscure thing for the soon to be new supply routines do properly. Will they trace supply across frozen lake hexsides? They become river hexsides in winter. Then there are those extra tricky lakes that lay on weather boundaries.... just a thought to check the code with.

(in reply to Incy)
Post #: 71
RE: WIfCon 2010 - 7/13/2010 8:27:27 AM   
Shannon V. OKeets

 

Posts: 22063
Joined: 5/19/2005
From: Honolulu, Hawaii
Status: offline

quote:

ORIGINAL: brian brian

I noticed an obscure thing for the soon to be new supply routines do properly. Will they trace supply across frozen lake hexsides? They become river hexsides in winter. Then there are those extra tricky lakes that lay on weather boundaries.... just a thought to check the code with.

Supply is redetermined whenever the weather changes - obviously. Supply is not assumed to be the same as previously. It is just that the previous path is tested to see if it is still valid. Any units that were out-of-supply previously are always checked.

_____________________________

Steve

Perfection is an elusive goal.

(in reply to brian brian)
Post #: 72
Page:   <<   < prev  1 2 [3]
All Forums >> [New Releases from Matrix Games] >> World in Flames >> RE: Supply Revisions Page: <<   < prev  1 2 [3]
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

0.297