Announcement

Collapse
No announcement yet.

Map Description Language

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Map Description Language

    Folks,

    I've finished up writing a little map description language, which allows me to quickly create geometric shape maps.

    The main purpose is to let me easily add new map types by just dropping a few lines into a text file. However, it also means that you folks could easily create new, geometric maps if you so desire, send them to me, and I can stick them in and decide whether to use them or not.

    Here are the functions available in the language. All things listed in {}s are required variables, while <>s are optional variables. |s list alternative values that can be used. There's examples aplenty at the bottom.

    MAP {name}

    Required at the start of a map description.
    OPTION stardistance high

    Disallows stars from being 2-root-2 or 3 distance (ie, not 2x2 diagonally or 3 in a straight line. Used for maps which are mostly stars, such as "plain" and "donut".
    OPTION centervalue {high|veryhigh},<radius>

    Used to make all stars within the optional radius 6-10 wealth (high) or 11-15 wealth (veryhigh). If radius is not included, 10 is used.
    STAR home x,y
    STAR {name} {x,y,wealth}, <factories,fleet>

    Each map must have 12 home stars, which appear on a grid between 1,1 and 50,50.

    Each map may have additional stars listed, which must include a wealth rating. Optional values on the additional stars include factories, and fleets, which default to 0 and a number based on wealth if not included.

    Home stars are a pain to fill in one-by-one, but you can often grab a group of home stars from an existing map and be pretty close. You'll also note that most maps reflect the home stars along either x line 25, y line 25, or both.
    RECTANGLE {add|subtract} {x1,y1,x2,y2}
    CIRCLE {add|subtract} {x1,y1,radius}
    RING {add|subtract} {x1,y1,innerRad,outerRad}

    All shape additions and subtractions are cumulative, based on their order in the file. In other words, if you add a rectangle, then subtract a circle inside that rectangle, then add a circle inside that circle you'll end up with something like the moat map ... a rectangle with a ring of empty space.

    The two x,y coords on the rectangle define the upper left and bottom right corners.

    For the circle and the ring the x,y coords designate the center.
    I should note that all capitalization is irrelevent and thus can be totally arbitrary.

    I'm very happy to receive any maps mailed to me at shannona@skotos.net.

    To offer good examples, here's what all the existing maps look like. I should note I've changed some of these from how they work in existing games, particularly moat and links (ie, don't use these maps as examples of what you might find in existing games of those types).

    Shannon
    --

    Map Plain
    OPTION StarDistance high
    STAR Home 1,1
    STAR Home 25,1
    STAR Home 50,1
    STAR Home 15,15
    STAR Home 35,15
    STAR Home 1,25
    STAR Home 50,25
    STAR Home 15,35
    STAR Home 35,35
    STAR Home 1,50
    STAR Home 25,50
    STAR Home 50,50
    RECTANGLE Add 1,1,50,50

    Map Donut
    OPTION StarDistance high
    STAR Home 4,4
    STAR Home 25,1
    STAR Home 46,4
    STAR Home 15,15
    STAR Home 35,15
    STAR Home 1,25
    STAR Home 50,25
    STAR Home 15,35
    STAR Home 35,35
    STAR Home 4,46
    STAR Home 25,50
    STAR Home 46,46
    RECTANGLE Add 1,1,50,50
    CIRCLE Subtract 25,25,10

    MAP Wheel
    STAR Home 25,1
    STAR Home 37,4
    STAR Home 47,13
    STAR Home 50,25
    STAR Home 47,37
    STAR Home 37,47
    STAR Home 13,4
    STAR Home 13,47
    STAR Home 4,37
    STAR Home 1,25
    STAR Home 3,13
    STAR Home 25,50
    CIRCLE Add 25,25,25

    MAP Clover
    STAR Home 5,5
    STAR Home 45,5
    STAR Home 5,45
    STAR Home 45,45
    STAR Home 9,20
    STAR Home 20,9
    STAR Home 9,30
    STAR Home 20,42
    STAR Home 30,9
    STAR Home 42,20
    STAR Home 42,30
    STAR Home 30,42
    CIRCLE Add 12,12,11
    CIRCLE Add 38,12,11
    CIRCLE Add 12,38,11
    CIRCLE Add 38,38,11
    CIRCLE Add 25,25,2
    CIRCLE Add 2,25,2
    CIRCLE Add 48,25,2
    CIRCLE Add 25,2,2
    CIRCLE Add 25,48,2

    MAP Ring
    STAR Home 37,4
    STAR Home 50,25
    STAR Home 37,47
    STAR Home 13,47
    STAR Home 1,25
    STAR Home 13,4
    STAR Home 25,13
    STAR Home 36,19
    STAR Home 36,31
    STAR Home 25,37
    STAR Home 14,31
    STAR Home 14,19
    RING Add 25,25,10,25

    MAP Hourglass
    STAR Home 5,2
    STAR Home 46,2
    STAR Home 25,22
    STAR Home 25,28
    STAR Home 5,49
    STAR Home 46,49
    STAR Home 1,25
    STAR Home 50,25
    STAR Home 14,10
    STAR Home 37,10
    STAR Home 14,41
    STAR Home 37,41
    CIRCLE Add 25,1,22
    CIRCLE Add 25,50,22
    CIRCLE Add 1,25,8
    CIRCLE Add 50,25,8

    MAP Links
    OPTION CenterValue veryHigh,4
    STAR Home 5,5
    STAR Home 45,5
    STAR Home 5,45
    STAR Home 45,45
    Star Home 9,20
    STAR Home 20,9
    STAR Home 9,30
    STAR Home 20,42
    STAR Home 30,9
    STAR Home 42,20
    STAR Home 42,30
    STAR Home 30,42
    STAR Abode 25,25,20
    RING Add 15,15,7,14
    RING Add 36,36,7,14
    RING Add 15,36,7,14
    RING Add 36,15,7,14

    MAP Moat
    STAR Home 3,3
    STAR Home 3,47
    STAR Home 47,3
    STAR Home 47,47
    STAR Home 9,16
    STAR Home 16,9
    STAR Home 9,34
    STAR Home 16,42
    STAR Home 34,9
    STAR Home 42,16
    STAR Home 42,34
    STAR Home 34,42
    STAR Abode 25,25,20
    OPTION CenterValue veryHigh,10
    RECTANGLE Add 1,1,50,50
    RING Subtract 25,25,10,18

  • #2
    Stuff

    Just curious, not saying I'd make use of it if it was possible, but how hard is it to import a map from some other game (lets say the map of the inner Sphere from Mechwarrior), and create a new map out of it for people to run a scenario on.

    Comment


    • #3
      Re: Stuff

      Originally posted by Annatar
      Just curious, not saying I'd make use of it if it was possible, but how hard is it to import a map from some other game (lets say the map of the inner Sphere from Mechwarrior), and create a new map out of it for people to run a scenario on.
      What I'm doing is simple geometrics: circles, squares, rings. Hopefully some sine waves soon.

      It sounds like you're talking about a more arbitrary/exacting placements of stars. Those could be created, basically by laying out the STARs one-by-one, with name and wealth. It'd be a lot of work though.

      As for instant conversion: it'd depend on what their file formats were, but, more importantly, if their galaxy size was similar. Definitely there's nothing automatic right now.

      Shannon

      Comment


      • #4
        Could you explain the Option centervalue command again a bit more verbosely? I read it three times and looked at the examples, and cannot make heads or tails of it.

        I get that stars are normally 2-10 income, and there is an option to set some stars to high 6-10, or veryhigh 11-15 ranges.

        What I don't understand are the words "Centervalue" and <radius>.

        Is centervalue an x, y location, or does it refer to income value?

        Should the word centervalue be substitued for an x, y location?

        If not, does the command refer to all stars on the map?

        Is the radius geometric? If so, is it a circle of stars centered on the map?

        Sorry if these seem like dumb questions Just scratching my head over this one... it is a good thing there are brute force methods like listing every blasted star, lol - That, I can understand.



        OPTION centervalue {high|veryhigh},<radius>

        quote:
        --------------------------------------------------------------------------------

        Used to make all stars within the optional radius 6-10 wealth (high) or 11-15 wealth (veryhigh). If radius is not included, 10 is used.

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

        Comment


        • #5
          Originally posted by Quigg
          What I don't understand are the words "Centervalue" and <radius>.
          Centervalue is just the name of the option, which is why it wasn't in {}s or <>s. It can either be set to "high" or "veryhigh". By default all stars within a radius 10 circle of the center get that higher value, but you can set that radius differently.

          For example, the next version of links I run (not the current one) will have a very high radius of 4--everything within 4 of 25,25 will be quite nice. (Go look at game #16, I believe, for how that'll look. It's called "Galactic Pools".)

          Shannon

          Comment


          • #6
            Anyone interested in constructing there own map can now play around with the following, prototype mapmaker (adapted from Richard's original):

            http://hegemony.skotos.net/cgi-bin/mapmaker.cgi

            It'll get nicer at some point, then be linked in to the main site.

            But, in the meantime, if you'd like to play with your own, simple map, go for it. Just enter a few geometric shapes and you're done (per the instructions above). I'd love to see any results, for possible inclusion in the game itself.

            Shannon

            Comment


            • #7
              This one looks like it would be fun to me...

              (Maybe a little tough on the people in the corners)

              MAP X
              STAR Home 3,3
              STAR Home 3,19
              STAR Home 3,31
              STAR Home 3,47
              STAR Home 47,3
              STAR Home 47,19
              STAR Home 47,31
              STAR Home 47,47
              STAR Home 19,3
              STAR Home 31,3
              STAR Home 19,47
              STAR Home 31,47
              CIRCLE Add 0,0,21
              CIRCLE Add 0,50,21
              CIRCLE Add 50,50,21
              CIRCLE Add 50,0,21
              RECTANGLE Add 15,15,35,35

              Comment


              • #8
                Looks great. I'll use it for the next regular and would be happy to make sure you're in it. Just sign up on a waiting list, then send a piece of mail to ce@skotos.net and I'll make sure you're there.

                Soon. I'll probably create the game tomorrow.

                Shannon

                Comment


                • #9
                  That's okay, I'll watch it with interest...

                  I'm already in two games, and that's about my limit before timing too many moves results in catastrophic sleep loss...

                  Comment


                  • #10
                    Greg's map is now the basis of Game 029.

                    I've got some maps from Quigg & Kargh which will be the basis of future games. Thanks for all the contributions and more are always welcome.

                    Shannon

                    Comment


                    • #11
                      Shannon have been working on a spiral galaxy map thanks to a comment you made in another thread. Have it almost worked out but can't close it in with the circle functions (the last couple overwrite parts of the first ones) To finish it I need an arc function, based on a circle, give two endpoints, a radius, and a width. Draws a curve from point A to point B with the given radius, then draws another line parrallel to the first one but <width> distance away. If you are willing to email me the code for the functions you are currently useing I would be happy to do the work to adapt them and save you some time, provided they are written in c, c++ or perl that is, not very good with java or xml.

                      it took me around 40 tries and some editing to get this to run in the map maker you linked for us, couldn't get enough stars on the page.

                      map spiral
                      star home 24,1
                      star home 36,4
                      star home 45,12
                      star home 49,24
                      star home 46,36
                      star home 38,45
                      star home 26,49
                      star home 14,46
                      star home 5,38
                      star home 1,26
                      star home 4,14
                      star home 12,5
                      circle add 25,10,15
                      circle subtract 29,3,15
                      circle add 33,12,15
                      circle subtract 40,8,15
                      circle add 38,17,15
                      circle subtract 46,18,15
                      circle add 40,25,15
                      circle subtract 47,29,15
                      circle add 38,33,15
                      circle subtract 42,40,15
                      circle add 33,38,15
                      circle subtract 32,46,15
                      circle add 25,40,15
                      circle subtract 21,47,15
                      circle add 17,38,15
                      circle subtract 10,42,15
                      circle add 12,33,15
                      circle subtract 4,32,15
                      circle add 10,25,15
                      circle subtract 3,21,15
                      circle add 12,17,15
                      circle subtract 8,10,15
                      circle add 17,12,15
                      circle subtract 14,4,15
                      ring subtract 25,25,25,36
                      circle add 25,25,15
                      The Chonkesh

                      Comment


                      • #12
                        The way it's currently done is that an x and a y coordinate are generated each between 1 and 50. Then, a shape function is consulted to see if that x,y pair fits inside the shape. If so, additional work is done to create a star. If not, a new x and y coordinate are generated (until it either generates 150 stars or decides it won't).

                        Basically each shape just centers around a single routine which returns a boolean answer.

                        This is the circle routine. $x,$y are the random coordinates. $circleX, $circleY, and $circleY are the numbers that get read out of the map file (ie, the center and radius of the map shape).


                        $shapeCheck = (sqrt( ($x-$circleX)**2 + ($y-$circleY)**2 ) <= $circleRad);
                        Similarly, here's the much simpler rectangle. Again, the start and end variables come out of the file:

                        $shapeCheck = ($x >= $startX && $x <= $endX && $y >= $startY && $y <= $endY);
                        And the much more complex sine wave:

                        my $shapeSine = ( $amplitude * sin ( ( 2 * 3.1415929 ) * ( ( $x + $xOffset ) / $gridsize ) * ( $frequency ) ) + $gridsize/2 + $yOffset);

                        $shapeCheck = ( $y <= $shapeSine ) if lc($overOrUnder) eq "over";

                        $shapeCheck = ( $y >= $shapeSine ) if lc($overOrUnder) eq "under";
                        Which is probably mostly gibberish, because a lot of the work was getting it to play nice with the map size. ($gridsize is 50 for all maps; in this case a lot of my adding and subtracting was to center the sine wave at Y=25 with an frequency of one map width.)

                        Anyway, that'll give you some of an idea of what I'd need for a new shape function. If you want to do up an arc, I'd be happy to add it. Just give me the shapeCheck and tell me what variables I should expect in the map format.

                        I'd tried to program an archimedes spiral last week but kept flubbing it somehow. Somewhere between converting from polar coordinates and laying it out on the grid.

                        Shannon

                        Comment


                        • #13
                          I would welcome the addition of being able to put death shields and spy shields on planets. I have a map in mind but it might require such.

                          Jess
                          Jess

                          "You've just been perverted and befouled by the dark side, otherwise known as open-source. Typical, though, for your heart is already stained black with the corruption of your unholy programming." -- StoryCoder Aquilus

                          "Any fool can criticize, condemn, and complain -- and most fools do."
                          Dale Carnegie

                          "You should never underestimate the predictability of stupidity."
                          Snatch

                          Kalle says, "Can I see your thing that you give it with?"
                          Kalle rolls 1D6 to speak English: DC 2. Rolls a 1. *FUMBLE*

                          "The only sensible way to estimate the stability of a Windows server is to power it down and try it out as a step ladder."

                          Comment


                          • #14
                            Yes, I'd be interested in other options because this sounds like fun , making maps and the game really is alot of fun. I'm thinking of making maps that would put folks close together, sorta like teams, put some story behind it and give it a go. Just a little something I guess.

                            Also, if I place all the stars , or most of them myself, the program chooses where to place the players among the stars I place? And the lines

                            Star home => That is a player start right?
                            and...
                            Star {name...etc} => That is just any old star right?

                            Umm , I think that's it for now. Thanks for letting us have a chance at making maps , really cool.

                            "An armed society is a polite society. Manners are good when one may
                            have to back up his acts with his life."

                            Robert A. Heinlein

                            "I would spread the cloths under your feet:
                            But I, being poor, have only my dreams;
                            I have spread my dreams under your feet;
                            Tread softly because you tread on my dreams."

                            Yeats

                            Comment


                            • #15
                              Originally posted by Mordheim

                              Also, if I place all the stars , or most of them myself, the program chooses where to place the players among the stars I place? And the lines
                              The players go on the 12 player stars, but as to who goes where, yeah, the program chooses.

                              Star home => That is a player start right?
                              and...
                              Star {name...etc} => That is just any old star right?
                              Yes.

                              Umm , I think that's it for now. Thanks for letting us have a chance at making maps , really cool.
                              Definitely & I look forward to seeing your maps.

                              Shannon

                              Comment

                              Working...
                              X