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

    I am working on a web interface to the python scripts that I wrote to allow other map makers to more easily do complicated things with their maps.  You just need to export the XML for your map from wargear, then use my web page to generate new XML and import the new file.

    I have the first version done and wanted to make it available and get suggestions for where to go next.  Check it out here:  http://prestopnik.com/wargear/MapEditor

    This initial release has only one function: hordify.  But it is a very powerful hordify feature and I plan on adding more functionality.

    Hordify takes 4 parameters:

    hordesBonus - The value of the hordes continents (default: 0).  You need to change this value to 1 to get any hordes continents.

    hordesContinentSuffix - A string to add to the end of the territory name that the continents are based upon. (default: empty string "")

    baseRegex - A way to define which territories are used as the base for new continents. 

    neighborRegex - A way to define which territories are used as the members for the new continents.

    Regexs can be a bit intimidating if you are not familiar with them, but they make this very powerful.  For example assume I have a world map, where I want hordes in only the ocean territories.  I just name all the ocean territories so that they have 'Ocean' in their name.  Then I set the baseRegex to 'Ocean'.  This ensures that all the ocean territories give a hordes bonus if all neighboring territories are also controlled.  But what if I don't want to require control of neighboring land territories for the bonus to be earned.  If I only want players to have to control ocean territories for the hordes bonus, I can also set the neighborRegex to 'Ocean'.  The defaults for these regexes (".*") just mean that they match every territory name.  If you google regex you will find tons of information about how to do more powerful matches.


    Here is a more concrete example.  I created a simple map:
    hordify Test - http://www.wargear.net/boards/designer/3615

    Then I ran hordify with the default regexes:
    all - http://www.wargear.net/boards/designer/3620

    Here is a scenario where baseRegex was 'Territory' and neighborRegex was the default:
    T - http://www.wargear.net/boards/designer/3621

    Here is a scenario where baseRegex and neighborRegex were 'Territory':
    T2 - http://www.wargear.net/boards/designer/3622



    Possible Future Work:

    Most of this I already have python code for, so I just need to generate the web interface & hook it up, but some of it I would need to write more code for:

    • Distant Fog - place view borders from all territories to nearby territories.  See Distant Fog scenario of Simple World for an example.
    • BorderToAll - Add border from specified territory to every territory on the map.  Border type will be configurable.  (useful for watch towers that have big vision, or transports with big fortify connections).
    • Stastics - Generate statistics for your map.  For example:  Distribution of continent sizes, Centrality measurements (http://en.wikipedia.org/wiki/Centrality)
    • GridGenerator - creates a grid (rectangular or hex) of territories (user supplies upper left corner & grid spacing) with or without connecting borders
    • Add a factory option to the hordes -hordes bonuses are auto placed for you on the base territory.
    • AddCollectorContinents - takes  individualBonus and pairBonus.  (would be better to have this take a collectionBonus & collectionSize, so that it worked for a more general case, instead of only for pair-wise collections.)
    • SetAllSoleContinentTerritoriesToNeutral(self,neutralBase=3):  (Find all continents that only have one member, and set that member to neutral. Unit count is equal to the total continent bonus + neutralBase)


    Please let me know if you think you would use this, and what future work you think would be most useful to you.

    Edited Thu 26th Apr 00:13 [history]

  2. #2 / 19
    Premium Member Yertle
    Rank
    Major General
    Rank Posn
    #21
    Join Date
    Nov 09
    Location
    Posts
    3997

    In the simple form, it Hordifies by border information I assume?

    *yawn* *stretch* time to wake up..

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

    Yes that is correct.  In fact in all forms it is based upon border information, the regexs just allow you to narrow the set of territories, not broaden them.


  4. #4 / 19
    Brigadier General M57 M57 is offline now
    Standard Member M57
    Rank
    Brigadier General
    Rank Posn
    #73
    Join Date
    Apr 10
    Location
    Posts
    5083

    Anarchify!

    It should be possible to play WG boards in real-time ..without the wait, regardless of how many are playing.
    https://sites.google.com/site/m57sengine/home

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

    M57 wrote:

    Anarchify!

    I'll put it on the list.  Might take a bit longer, because I have to write some code for it, but shouldn't be too hard.

     

    Right now, my plan is:

    cleanup/revamp the UI

    Distant Fog

    ??? (maybe Anarchify)


  6. #6 / 19
    Brigadier General M57 M57 is offline now
    Standard Member M57
    Rank
    Brigadier General
    Rank Posn
    #73
    Join Date
    Apr 10
    Location
    Posts
    5083

    I'm only half kidding.. and right now I don't have any maps that I would want to anarchify.. but it is certainly the kind of function that would be perfect for the program.

    It should be possible to play WG boards in real-time ..without the wait, regardless of how many are playing.
    https://sites.google.com/site/m57sengine/home

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

    Update

    User Interface Update

    I have updated the user interface, making it much more powerful and cleaner.  (Please check it out: http://prestopnik.com/wargear/MapEditor/ ) Before it was only possible do a single hordify on your map.  Now you create a queue of commands to execute, which allows you to execute multiple hordify commands at once.  As more options become available there will be some that could be order dependent and this provides a solution to that issue.

    You can also edit your queue directly, instead of using the GUI to edit it.  This would allow you to remove commands in the queue, fix errors entered, copy&paste similar commands, or even avoid the GUI altogether (experienced users only).  This is probably a bit fragile, so be cautious.

    New Commands

    Delete All Continents - Does just what it sounds like.

     

    Examples

    Here are some example command queues.  You could enter these as text, but you don't have to.  You can use the GUI forms to generate them  for you.

    This one deletes your current continents and creates hordes over the entire map for you:

    deleteAllContinents
    hordify 1,,.*,.*

     

    This is what I would run to create the Hordify in my Pangaea and Panthalassa map, where there is hordes in the oceans and only other ocean territories are needed to get the bonus

    deleteAllContinents

    hordify 1,,Ocean,Ocean

     

    This is a more complicated example for a map that Edward Nygma is working on called 'Hills and Dales'.  The territories are on 1 of 4 vertical levels and have a (n) in their name (where n is the level).  To create hordes so that you only have to have bordering territories on the same level, we queue four hordes commands, one for each level.  This example is especially complicated, because the parenthesis is a special character and has to be escaped (i.e. preceded by a '\').  These are the special characters:

    . ^ $ * + ? { } [ ] \ | ( )

    More on regex here: http://docs.python.org/library/re.html#regular-expression-syntax

    deleteAllContinents
    hordify 1,,\(1\),\(1\)
    hordify 1,,\(2\),\(2\)
    hordify 1,,\(3\),\(3\)
    hordify 1,,\(4\),\(4\)

     

    Please ask me if you have any problems/questions with creating regexs or anything else.

    Edited Fri 25th May 23:48 [history]

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

    Update

    New Commands

    Add Collectors - This allows you to add 'collector' continents.  This means that every pair of territories is a continent.  You get a non-linear increase in continent bonuses.  For example, 1 territory might be worth 1 unit, 2 worth 3, 3 worth 6, ... 5 worth 15, 8 worth 36, ...  The rate at which continent values increase depends on how you setup your collector continents, but can be slower or faster. 

    This spreadsheet has some example values and you can edit it to try out other values:

    https://docs.google.com/spreadsheet/ccc?key=0AjtIsJkyopekdGFsRFI2QWhpbGxFeG9jejN1V05FTGc

     

    There are two ways to define which territories are included in your set of collector territories.  The simplest method is to just list the territories you want, but you can also define the set of territories with a regex to match territory names.

    Example

    I created the continents on this scenario by using the 'Add Collectors' functionality twice:

    http://www.wargear.net/boards/designer/3793

     

    This form was filled out using the list the territories method:

     

    This form uses a regex to include all territories that have 'Territory' in their name:

     

     

    After filling out those two forms, you can review your commands before execution:

     

     

    The resulting xml file was uploaded to this scenario:

    http://www.wargear.net/boards/designer/3793


  9. #9 / 19
    Premium Member Kjeld
    Rank
    Major General
    Rank Posn
    #15
    Join Date
    Nov 09
    Location
    Posts
    1339

    Would it be possible to program border modifiers as well? Say I have a bunch of territories all with a keyword in the name that designates terrain type. It would be great to use this advanced designer to, for instance, make it such that any border attacking to a 'Mountain' designated territory has a -1 dice modifier.


  10. #10 / 19
    Standard Member ratsy
    Rank
    Brigadier General
    Rank Posn
    #65
    Join Date
    Jul 10
    Location
    Posts
    1274

    Kjeld wrote:

    Would it be possible to program border modifiers as well? Say I have a bunch of territories all with a keyword in the name that designates terrain type. It would be great to use this advanced designer to, for instance, make it such that any border attacking to a 'Mountain' designated territory has a -1 dice modifier.

    YES! Do that! 

    "I shall pass this but once, any good I can do, or kindness I can show; let me do it now. Let me not difer nor neglect it, for I shall not pass this way again." -Stephen Grellet

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

    Sure that is easyish.  I am trying to get my LEGO map finished up in time for the contest, but as soon as I get that done I will add this feature.  Probably take me 2-3 weeks until it's ready.


  12. #12 / 19
    Premium Member Kjeld
    Rank
    Major General
    Rank Posn
    #15
    Join Date
    Nov 09
    Location
    Posts
    1339

    Question:

    Say I have a number of territory designators marked as [W], [J], [M], etc. Each territory has one such designator at the end of its name, e.g. a territory could be called "White Mountains [M]" where the [M] denotes that this is a mountain-type terrain. I want to run a hordes command that uses a bunch of these, but not all of them (e.g. includes forests and jungles, but not oceans). I thought that this would work to let the regex know that I wanted wilderness OR jungle OR double wilderness, etc.

    hordify 1,,\[W\]|\[WW\]|\[J\]|\[FD\]|\[BL\]|\[SL\]|\[DD\],\[W\]|\[WW\]|\[J\]|\[FD\]|\[BL\]|\[SL\]|\[DD\]

    However, it comes up with an error message, so clearly my syntax must be wrong. How do I make this work?


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

    That looks right to me.  It could be I broke something.  Can you email me your xml file & your image files so I can test on them directly.  Shouldn't be too hard to figure out then.    I'll PM you my email address.


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

    I forgot to even ask what the debug string was.  That might help. 

    You can also try turning on the 'debug?' checkbox at the bottom of the forum.  The debug output comes back instead of your xml file.  You'll probably have to 'view source' on the resulting page to see anything, but if you want you could send that to me.


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

    Ok I think I fixed this.  Please try again and let me know if it works.  One thing to watch for, instead of commas in your command, you should now have spaces.  Their is some weird caching of the popup form, that was causing problems, so if you get the cached version and still see commas, just edit the command directly.  i.e. instead of this:

    hordify 1,,\[W\]|\[WW\]|\[J\]|\[FD\]|\[BL\]|\[SL\]|\[DD\],\[W\]|\[WW\]|\[J\]|\[FD\]|\[BL\]|\[SL\]|\[DD\]

    you want:

    hordify 1  \[W\]|\[WW\]|\[J\]|\[FD\]|\[BL\]|\[SL\]|\[DD\] \[W\]|\[WW\]|\[J\]|\[FD\]|\[BL\]|\[SL\]|\[DD\]

    That should do it.

     

    Detailed explanation & warning:

    When I added the collector continent form, I wanted to support a comma separated list of territory names.  Having commas used in two different ways caused confusion, so I switched to using spaces to separate the arguments to the collector continent function, but forgot to change the hordify function.

    Right now I think spaces might break the regex stuff, so if you want a space in your regex, talk to me first and I will get it to work.

     

    ------------------------


    I'm also thinking that trying to follow this increasingly complicated thread to understand how the map editor works is going to just get harder and harder, so I am going to work on moving the documentation to a wiki page.  If anyone can suggest a good free online wiki, let me know.  Otherwise I might just put it on my own personal wiki.

    EDIT:  Thinking of using wikia.com right now.  Anyone have experience with them?\

    Edited Tue 28th Aug 00:24 [history]

  16. #16 / 19
    Premium Member Kjeld
    Rank
    Major General
    Rank Posn
    #15
    Join Date
    Nov 09
    Location
    Posts
    1339

    Yes, that works perfectly now. Thanks!

    Also, is it possible to auto-create factories-on-self for specified territory regexes? That would be cool.


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

    I can probably make some auto-factory stuff.  I'd probably want to make it as general as possible, so let me think about it some.

    BTW - I'm working on nice border modifier form.  Here's the prototype:

    http://prestopnik.com/wargear/MapEditor/BorderModifierInputForm.html

    Still need to fix the 'help' popups and hook up the backend, but what do you think of that so far? 


  18. #18 / 19
    Premium Member Kjeld
    Rank
    Major General
    Rank Posn
    #15
    Join Date
    Nov 09
    Location
    Posts
    1339

    Hmm, that's an interesting way of going about it that I hadn't considered. You've started by naming the border as a feature of the board with 4 separate variables, a to-from attack and defense and a from-two attack and defense modifier. I was thinking of the modifiers not as tied to particular borders but as tied to particular territories with 2 variables, attack modifier and defense modifier. Your way is more nuanced, but also somewhat more difficult to use as it requires manipulation of additional variables, compounding the complexity of the gameplay mechanics. It's pretty cool, but I can't tell if it will raise problems for the way I was thinking about the game mechanics, because I can't avoid setting the to-from defense modifier and the from-to attack modifier (which in my way of looking at it are variables attached to the other territory, not the territory of interest) as I set the two variables attached to the territory of interest, the to-from attack modifier and the from-to defense modifier to translate them into your system. I'll have to think about this some more in the morning to wrap my head around whether the difference actually is significant and will hamper utilization of this new tool.


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

    Yeah, I'm not sure about that interface.  I did it like that because it mimics the way borders are setup in wargear.  For example, if you open one of your map XML file you'll see borders that look something like this:

    <border boardid="2232" borderid="6155966" direction="Two-way" fromid="39" ftattackmod="0" ftdefendmod="0" tfattackmod="0" tfdefendmod="0" toid="42" type="Default"/>

     

    Honestly, it is a bit confusing, but I think you can do anything you want with it.

    > I can't avoid setting the to-from defense modifier and the from-to attack modifier

    Well, I'll probably do something like let you set those to '-' which would mean don't touch them, and leave them as they are.  That should allow you to set things up however you want.

     

    If you give me a specific example of what you would want to do (a use case), that might help us to figure out how you would do it with this setup, and how an alternative setup might be better.


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