223 Open Daily games
2 Open Realtime games
    Pages:   12   (2 in total)
  1. #21 / 29
    Shelley, not Moore Ozyman
    Rank
    Brigadier General
    Rank Posn
    #40
    Join Date
    Nov 09
    Location
    Posts
    3449

    The grid system would need you to tell it how your grids are organized & named.  So for example adding a border from all artillery territories to all neighboring infantry territories:

    addgridborders; hex;I ([0-9]{2}) ([0-9]{2});A ([0-9]{2}) ([0-9]{2}); neighbor distance=1; +1 attack; one-way; artillery-only

    The important part is the

    I ([0-9]{2}) ([0-9]{2})

    which is a regular expression that matches your Infantry territories.  Let me break it down:

    [0-9]   ==>  match any digit

    {n}     ==> n copies of the previous match

    [0-9]{2} =====>  match 2 digits

     

    When we group stuff in parenthesis I can easily grab it from the territory name.  So you give me that pattern above, and I can iterate over all the infantry territories getting their row/column for each.

    Then I use the same "A [0-9]{} [0-9]{}" pattern to find every artillery territory and it's location on the board.

    Given 2 sets of row/columns I can tell if they border.  For example for a territory at row, column = r,c, I know all of its borders:

     

    if (r is odd)

    borders = (r+1,c-1), (r+1,c), (r-1,c-1), r-1,c)

     

    if r is even

    borders = (r+1,c), (r+1,c+1), (r-1,c), r-1,c+1)

     

    maybe not precisely, but something like that.

     

    This would of course not know about things like the river in your map, but it's not too hard to go in and delete those borders in the editor.

    One other problem is that your columns don't line up, so you'd have to rename your top row of your map.

    I could also make a grid territory creation form.   So you'd give an upper,left coordinate.  A left/right delta, and up/down delta and a pattern for the territory names, and it would make all the territories for you.

    I think gridded maps are a relatively popular type of board and are probably worth supporting better, and there may be other automatic things that could be applied to them.

     

    Edited Sun 18th Jan 01:24 [history]

  2. #22 / 29
    Shelley, not Moore Ozyman
    Rank
    Brigadier General
    Rank Posn
    #40
    Join Date
    Nov 09
    Location
    Posts
    3449

    Korrun wrote:

    Grid coordinates sound complicated. I was just thinking regex (exactly the same as the Modify Border), but distance might be nice also.

    Regex example:

    1. Create Borders; from Nuclear Bomb; to .*; +2 attack; one-way; artillery;
    2. Create Borders; from North American Satellite; to [NA]; one-way; vision; 
    3. Create Borders; from [tunnel]; to [tunnel]; +1 defense; two-way; default;

    1. Creates one-way artillery borders from the Nuclear Bomb territory to all territories on the map with +2 attack modifier.

    2. Creates one-way vision borders from the North American Satellite territory to all territories in north america.

    3. Creates default borders between all tunnel territories with +1 defense.

     

    I could also see distance being helpful.

    • Create Borders; from [city]; to .*; maximum distance 3; one-way; artillery;

    Creates artillery borders from every city territory to every territory on the map that is 3 hops away or less. This function should probably also not overwrite existing borders (that is the default borders that connect the city to it's neighbouring territories.

     

    I added an "add borders" functionality to the WGAME.  Right now it is not super friendly, because it only accepts hand edited command lines.  i.e. their is no gui to enter the values into.

    Instead you edit the command queue directly.  For example, this command:

    AddBorders;Capital;;;Territory;;;1;2;;;Artillery;One-way

     

    Adds borders from all territories that have "Capital" in their name to all territories that have "Territory" in their name.  These are one-way artillery borders with a +1/+2 to attack/defend.

    More specifically here are the arguments in order:

      '''
      args:
        0 - fromCSVList
        1 - fromRegex
        2 - fromContinent
        3 - toCSVList
        4 - toRegex
        5 - toContinent
        6 - FTAttackModifier
        7 - FTDefenseModifier
        8 - TFAttackModifier
        9 - TFDefenseModifier
        10 - borderType
        11 - borderDirection
      '''

    Eventually I will build a gui for this, but if you want to use it, it should be fully functional right now.  I did not add the "distance" metric yet, because that is more complicated, but I could do that eventually if someone thinks they will use it.


  3. #23 / 29
    Standard Member Korrun
    Rank
    Brigadier General
    Rank Posn
    #74
    Join Date
    Nov 12
    Location
    Posts
    842

    Looks good!

    I think this:

      '''
      args:
        0 - fromCSVList
        1 - fromRegex
        2 - fromContinent
        3 - toCSVList
        4 - toRegex
        5 - toContinent
        6 - FTAttackModifier
        7 - FTDefenseModifier
        8 - TFAttackModifier
        9 - TFDefenseModifier
        10 - borderType
        11 - borderDirection
      '''

    Should actually be this:

      '''
      args:
        0 - fromRegex
        1 - fromCSVList
        2 - fromContinent
        3 - toRegex
        4 - toCSVList
        5 - toContinent
        6 - FTAttackModifier
        7 - FTDefenseModifier
        8 - TFAttackModifier
        9 - TFDefenseModifier
        10 - borderType
        11 - borderDirection
      '''

    I did not add the "distance" metric yet, because that is more complicated, but I could do that eventually if someone thinks they will use it.

    I suppose others should way in. berickf's World War II map with the artillery borders from the cities could have used this feature.


  4. #24 / 29
    Standard Member Korrun
    Rank
    Brigadier General
    Rank Posn
    #74
    Join Date
    Nov 12
    Location
    Posts
    842

    Ozyman wrote:

    The grid system would need you to tell it how your grids are organized & named.  So for example adding a border from all artillery territories to all neighboring infantry territories:

    addgridborders; hex;I ([0-9]{2}) ([0-9]{2});A ([0-9]{2}) ([0-9]{2}); neighbor distance=1; +1 attack; one-way; artillery-only

    The important part is the

    I ([0-9]{2}) ([0-9]{2})

    which is a regular expression that matches your Infantry territories.  Let me break it down:

    [0-9]   ==>  match any digit

    {n}     ==> n copies of the previous match

    [0-9]{2} =====>  match 2 digits

     

    When we group stuff in parenthesis I can easily grab it from the territory name.  So you give me that pattern above, and I can iterate over all the infantry territories getting their row/column for each.

    Then I use the same "A [0-9]{} [0-9]{}" pattern to find every artillery territory and it's location on the board.

    Given 2 sets of row/columns I can tell if they border.  For example for a territory at row, column = r,c, I know all of its borders:

     

    if (r is odd)

    borders = (r+1,c-1), (r+1,c), (r-1,c-1), r-1,c)

     

    if r is even

    borders = (r+1,c), (r+1,c+1), (r-1,c), r-1,c+1)

     

    maybe not precisely, but something like that.

     

    This would of course not know about things like the river in your map, but it's not too hard to go in and delete those borders in the editor.

    One other problem is that your columns don't line up, so you'd have to rename your top row of your map.

    I could also make a grid territory creation form.   So you'd give an upper,left coordinate.  A left/right delta, and up/down delta and a pattern for the territory names, and it would make all the territories for you.

    I think gridded maps are a relatively popular type of board and are probably worth supporting better, and there may be other automatic things that could be applied to them.

     

    That's pretty cool. I imagine gridded maps would be even more popular if it were easier to make the borders!

    Also, add (r, c+1) and (r, c-1) to both the above to catch the horizontal borders.


  5. #25 / 29
    Shelley, not Moore Ozyman
    Rank
    Brigadier General
    Rank Posn
    #40
    Join Date
    Nov 09
    Location
    Posts
    3449

    Korrun wrote:

    Looks good!

    I think this:

      '''
      args:
        0 - fromCSVList
        1 - fromRegex
        2 - fromContinent
        3 - toCSVList
        4 - toRegex
        5 - toContinent
        6 - FTAttackModifier
        7 - FTDefenseModifier
        8 - TFAttackModifier
        9 - TFDefenseModifier
        10 - borderType
        11 - borderDirection
      '''

    Should actually be this:

      '''
      args:
        0 - fromRegex
        1 - fromCSVList
        2 - fromContinent
        3 - toRegex
        4 - toCSVList
        5 - toContinent
        6 - FTAttackModifier
        7 - FTDefenseModifier
        8 - TFAttackModifier
        9 - TFDefenseModifier
        10 - borderType
        11 - borderDirection
      '''

    Yeah, I'm pretty sure you are right.  I wish I had someone like you at my real job.


  6. #26 / 29
    Shelley, not Moore Ozyman
    Rank
    Brigadier General
    Rank Posn
    #40
    Join Date
    Nov 09
    Location
    Posts
    3449

    Korrun wrote:

    Also, add (r, c+1) and (r, c-1) to both the above to catch the horizontal borders.

    Geez.  You're pretty good at this.  If you ever want to contribute actual development to WGAME let me know.


  7. #27 / 29
    Shelley, not Moore Ozyman
    Rank
    Brigadier General
    Rank Posn
    #40
    Join Date
    Nov 09
    Location
    Posts
    3449

    Next question - is it better for me to work on adding a GUI for addBorders, or is it better to add more functionality without GUIs first?


  8. #28 / 29
    Major General asm asm is offline now
    Standard Member asm
    Rank
    Major General
    Rank Posn
    #20
    Join Date
    Nov 09
    Location
    Posts
    1686

    Nerds.

    Been gone a while. You all did a good job holding down the fort.

  9. #29 / 29
    Enginerd weathertop
    Rank
    Brigadier General
    Rank Posn
    #64
    Join Date
    Nov 09
    Location
    Posts
    3020

    says the guy who took the time to try to read thru this (i'm only here to 'mark as read').

    I'm a man.
    But I can change,
    if I have to,
    I guess...

You need to log in to reply to this thread   Login | Join
 
Pages:   12   (2 in total)