Announcement

Collapse
No announcement yet.

Map Generator Model

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Map Generator Model

    Hi all,

    At Marks' suggestion, I've volunteered to pick up on the map generator model. Since I've been unable to reach Gregor to get his version, I've worked up a fairly simple model of my own. My background is in cartography and natural resources, so I'll try to use that to our benefit where possible. Following is a brief outline of what the model will do. I'm still working on the (pseudo)code for the working model; since I program in "ESRI Avenue" (also object oriented) and not Java (yet) it is not a "true" code, but it shouldn't be too tough to translate it later into something that will actually run. Please note that this is still really rough, but I wanted to get something posted to get some comments before I get too involved in hashing out the details.

    The basic idea is to simulate plate tectonics as closely as we can without taking up a huge amount of processing time (simple, eh?).

    This model starts off by creating a supercontinent, then fault lines are arbitrarily defined by splitting the supercontinent up into x plates. 25% of these plates (we can tinker with the ratio as needed) are labeled as "sea" plates, while the rest are labled as "land plates". The purpose of the sea plates is to create seaside mountain ranges (eg Chile) when the sea plates ram into the land plates

    Next, the plates are moved around a bit, forming mountain ranges where they collide. A primitive climate model is used to determine the positions of deserts and vegetation distributions. Finally rivers, resources, and initial starting positions for the civs are selected based on certain criteria for locations (FE you wouldn't stick a tribe on a mountain top - usually!)

    I know that a lot of people liked the idea of setting the sea level later to create undersea trenches, etc. That would require a Digital Elevation Model (DEM) or something similar to it for that type of model to work. I have quite a bit of experience using DEM's for hydrological analysis in the real world, and so haven't ruled out developing a model like that as well...I just put it off for the sake of time now, since it would be considerably more complicated. Any suggestions, gripes, etc are welcome! I'll link the actual "code" on my own site when I get it written up. Have at it!

    I. Build Land Mass
    A. Create Supercontinent
    i. Select centroid
    ii. Randomly build cells around centroid
    B. Create Faults
    i. Select landmass centroids
    ii. Build landmasses about centroids
    iii. Randomly designate sea plates (4:1 ratio of land plates to sea plates)
    C. Move Landmasses
    i. Select random direction move each landmass
    ii. Move landmasses
    iii. Change terrain as landmasses collide
    D. Finalize Landmass positions
    i. After n iterations, end movement
    ii. Remove sea plates (they’re underwater anyway)
    II. Climate Zones
    A. 4 primary jet streams
    i. Divide the map into 8 lateral bands (at equator, and halfway between the poles)
    ii. Assign E-W and W-E alternately to each band
    B. Delineate climate zones
    i. Assign polar/boreal regions (bands 1,8)
    ii. Assign temperate regions (bands 2,3 and 6,7)
    iii. Assign tropical regions (bands 4,5)
    III. Vegetation, Rivers, Resources, Tribes
    A. Distribute vegetation
    i. From “starting” edge (depends on wind direction) move pointer across map
    ii. Assign vegetation according to terrain at pointer and according to 2 squares upwind)
    iii. Move pointer to next square
    iv. Iterate until band is vegetated
    v. Move to next band and repeat
    vi. “Average” out terrain at climate bounaries to avoid extreme transitions
    B. Place rivers and lakes
    i. Randomly place lakes and seas (within climate limits)
    ii. Randomly select headwaters (50% of lakes will have a HW)
    iii. Trace rivers from HW to sea according to terrain
    C. Distribute resources
    i. Randomly assign resource x,y coords
    ii. Allocate resource at random coords according to terrain and veg at location
    D. Distribute starting tribes?
    i. Randomly assign tribe locations based on min distance from other tribes and veg/terrain limits



    ------------------
    Paul
    Paul

  • #2
    My apologies for the crappy formatting of the outline above...the spacing got all screwed up
    Paul

    Comment


    • #3
      Paul:

      Your model looks great so far to me. I have only one question, and one comment at this point. My question is, I don't see how you get eight lateral bands out of something (a band, or a line) at the equator, and to more halfway between the poles. Can you clarify that for me?

      In terms of placement of civs, we may not necessarily want to distribute them evenly. I think this can be left up to the player. We were planning on having a cost system for various start-up options such as cultural attributes, initial size of civ, proximity to others civs, etc. So civ placement might or might not be determined by the player (in general terms) and might have a point cost associated with it. The actual costs used would depend on play-balance determining the values of the various options.

      Mark
      Project Lead for The Clash of Civilizations
      A Unique civ-like game that will feature low micromanagement, great AI, and a Detailed Government model including internal power struggles. Demo 8 available Now! (go to D8 thread at top of forum).
      Check it out at the Clash Web Site and Forum right here at Apolyton!

      Comment


      • #4
        Hi Paul,

        you model looks very good.

        Only got couple of comments,

        a) Are mountains only created when landmasses collide?

        b) Wouldn't it be better to place rivers first and then decided placement of tribes?

        Keli

        PS: I'm at work, thus the new profile, couldn't remember my password :-)
        [This message has been edited by Keli (edited August 18, 1999).]

        Comment


        • #5
          Mark: Sorry about the confusion...I had originally planned on having 4 later bands to simulate the circular motion of the weather patterns and transvergence zones. I later decided that 8 zones better represents the pattern than 4, since we're trying to simulate circular phenomena that occurs on a sphere on a flat map! phew! So the the short answer after a long response is that there will be 8 zones, fairly equally distributed (4 on each side of the equator).

          I really like the idea for distributing starting civs on a point basis, since it allows for the handicapping of expert players.

          Keli: Thanks for the input! I had actually thought about volcanoes, the other major contributor to mountain ranges, when I was brainstorming but I forgot to include that into the model. I definitely will, since they do affect major portions of fault areas. Since we're identifying fault areas, this gives us the potential for including natural disasters in the sim (eg earthquakes and volcanoes in addition to weather related disasters based on the climate model). Disaster-prone areas could be identified at the start and given a value based on the likelihood of each disaster ocurring. Disasters could then be randomly triggered based on the potentials calculated at the start. Any thoughts on this, anyone?

          To answer your second question, Keli, I think the model already determines river courses prior to civ site selection - the poor formatting of the outline (no identations) just makes it a little less intuitive. In any case, the rivers should definitely be carved out first. Probably even before vegetation selection, since you CAN have rivers running through the desert with lush vegetation in the immediate valley (eg the Nile).
          Paul

          Comment


          • #6
            Paul:

            I don't think handling the plate-induced natural disasters will be too tough. Esp when we know plate boundaries (and maybe intra-plate stresses?) However, I'd be happy to skip the specifics for now since I think its an easy add-on later.

            What do you think about climate change through the game? Now That would be cool.

            Great stuff,

            Mark
            Project Lead for The Clash of Civilizations
            A Unique civ-like game that will feature low micromanagement, great AI, and a Detailed Government model including internal power struggles. Demo 8 available Now! (go to D8 thread at top of forum).
            Check it out at the Clash Web Site and Forum right here at Apolyton!

            Comment


            • #7
              Mark: Still working on the model, but "real life" has slowed me down a bit (job interview and work deadline coming up next week). Quick question, though...

              I have a conceptual model in progress (eg if cell A collides with cell B, then that cell becomes "mountain"). Is that what I should be producing now? Or should I be identifying objects, etc. It's a little tough for me to get really detailed in the exact process, since I'm not totally familiar with J++ and the requests that you can send to the different objects (and as a result, I obviously don't know which objects are returned).

              Bottom line: How detailed should I be in modeling the processes? Any idea who is going to actually code them? I could give it a whirl, but I won't be able to invest the time in learning J++ until November (I defend my M.S. in October ) Or is it ?

              Thanks!

              Paul
              Paul

              Comment


              • #8
                Hi, Paul:

                I'm not sure what Mark is going to say, but I can go this far, I think --

                In the 'Space' class (dumb name, but it's early!) there will be a 'Map' class/object. In that 'Map' class there will be a 'generateMap()' method. This method likely will instantiate another class (MapBuilder?), where your model will be coded. Any parameters can be sent to it, of any kind, and anything can be returned -- even another object. Most likely 'generateMap()' will return a 'Location[][]' object. That's a 2-dimensional array of 'Location' objects (we will write those, too, of course). This 'Location[][]' object array will be the functioning worldmap. Locations will be accessed by index #, relating to grid coordinates. I.E. 'worldmap[2][3]' will be the 'Location' object that contains all the vars for map location 2, 3.

                I hope this helps. I don't know who will do the coding. I'm pretty busy.

                Comment


                • #9
                  Hi Paul:

                  My take is that you should formalize the mathematical and conceptual nature of the model, and when that is fairly far along we can worry about handling it in code. Given the slow pace of things so far, I would guess that we can wait until November if you're interested in coding it yourself. There are huge number of things we can do before the map generation will be needed. If you need help sticking the model into a class structure, I'd be glad to help you out when the time comes.
                  Project Lead for The Clash of Civilizations
                  A Unique civ-like game that will feature low micromanagement, great AI, and a Detailed Government model including internal power struggles. Demo 8 available Now! (go to D8 thread at top of forum).
                  Check it out at the Clash Web Site and Forum right here at Apolyton!

                  Comment


                  • #10
                    Paul:

                    The outline of your model sounds great.

                    I'm looking for a limited (in size) corner of the project to work on, so if you have a somewhat detailed algorithm that you think will work, then I can try to implement it in Java.

                    Martin

                    Comment


                    • #11
                      MCA: Thanks for the offer. I just found out that I'll be starting a new job in late October/ early November and I need to defend my M.S. before then, so I obviously won't have the time to do the coding myself before then (especially since I only know Avenue and not Java!). I AM working on the model, however, and next week I'll send you what I have to date and we can take it from there. I look forward to working with you!
                      Paul

                      Comment


                      • #12
                        Mark (and anyone else interested in this...)

                        Just a quick update on the progress with the Map Gen Module: MCA and I have begun collaborating on the coding of the model. I've worked out a pretty detailed conceptual model that should be reasonably easy to implement (MCA can verify if I'm correct in this assumption!)

                        You can add the following features to the original proposal above:
                        1. Volcanos produced near faults
                        2. Deep sea volcanos to produce some islands
                        3. Atolls/island chains
                        4. Erosion effects during map development (FE wearing down of older mountain ranges).

                        I have some pretty solid ideas on how to implement these features, so we'll see If we can do everything in the outline, I think that we'll have the most geographically/geologically accurate maps in any sim out there. MCA and I'll keep everyone updated as we make progress to ensure the inflow of fresh ideas that can only enhance the model.

                        Paul
                        Paul

                        Comment


                        • #13
                          I forgot to ask my questions:

                          What is the size of the map matrix (x,y)?
                          What land area does each cell represent?
                          Has anyone come up with final definitions for terrain/vegetation types?

                          On these last two, several proposals have been bounced around throughout various threads, but I haven't found anything listing the final say on what we'll use.

                          If terrain/veg types are not defined yet, what number are we limited to? FE in Colonization, forest is broken down into several types (conifer, mixed, deciduous, etc). Forgive me if I didn't get the Colonization types right - it's been ages since I played that game (got boring REALLY quickly - too much micromanagement!)

                          Should we start a thread listing the "final" parameters for "global" variables? FE cell area, # terrain types, # units, etc. It might make things easier once we start docking modules. Then again I'm not a programmer, so what do I know!
                          Paul

                          Comment


                          • #14
                            Hi Paul,

                            I like the new features .

                            > What is the size of the map matrix (x,y)?
                            I'm going with 320 by 200 cylindrical right at the moment...
                            Suggestions welcome.

                            > What land area does each cell represent?
                            Approximately 100 kilometers on a side.
                            The current graphics plan is to have them be "diamonds" with the corners pointing in the compass directions. Like in Civ2...

                            > Has anyone come up with final definitions for terrain/vegetation types?
                            No, don't have anything final on this one. I guess just pick the ones you like from the discussions.

                            > If terrain/veg types are not defined yet, what number are we limited to? FE in Colonization, forest is broken down into several types (conifer, mixed, deciduous, etc). Forgive me if I didn't get the Colonization types right - it's been ages since I played that game (got boring REALLY quickly - too much micromanagement!)

                            I think we can cope with several kinds of forest / jungle etc. if you think your model can reasonably calculate them. If it turns out to be a fundamental problem we could just redefine them all back to forest.

                            > Should we start a thread listing the "final" parameters for "global" variables? FE cell area, # terrain types, # units, etc. It might make things easier once we start docking modules. Then again I'm not a programmer, so what do I know!

                            Well... we Should, but I'm not up to it at the moment. if you would like to take a shot at the terrain types here I'd appreciate it. The military model is far from being reasonably complete, so I think starting to talk about specific units would be premature. These are all going to be read in from an initialization file anyway, so they really don't have to be finalized until fairly late in the project. Obviously, the stuff with graphics will have to be worked out well before then. My best guess is we should just work out the specifics of each model when that model is at the right stage, in the sprirt of OO programming .

                            On the topic of wearing down of mountain ranges, I may have missed it, but are you going to start with pre-existing mountain ranges on your mega-content? So we can have really old mountain ranges, as well as relatively new ones?

                            BTW, any chance of getting reasonable mineral deposit locations with your model? I know I'm really stretching, but hey, I've got to try!

                            Sounds great, I can't wait to see it.

                            [This message has been edited by Mark_Everson (edited September 06, 1999).]
                            Project Lead for The Clash of Civilizations
                            A Unique civ-like game that will feature low micromanagement, great AI, and a Detailed Government model including internal power struggles. Demo 8 available Now! (go to D8 thread at top of forum).
                            Check it out at the Clash Web Site and Forum right here at Apolyton!

                            Comment


                            • #15
                              We now have pretty pictures of the map generator in action! What you'll see in the snapshot are some of the the very first, bug-filled elevation maps that have been generated, along with plate tectonic maps (Step I in the model).

                              There are still some issues that need to be addressed: how and how much we're going to move the plates, some mountain raising and erosion parameters that need to be found, and (perhaps most importantly) some "interesting effects" that I can't quite explain yet, before we move on to climate zones and vegetation.

                              Note that the implementation so far uses square map cells, because it is a no-brainer to display them

                              Source code, of the early prototypical variety, is available.

                              Martin

                              Comment

                              Working...
                              X