A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: My Tribe island generation, how did they do it?

  1. #1
    Senior Member bluemagica's Avatar
    Join Date
    Jun 2008
    Posts
    766

    My Tribe island generation, how did they do it?

    I just got myself off of the virtual villagers and gave My Tribe a chance. And it looked really amazing as how they generated their islands dynamically based on a seed. It maintained the island structure, object placements and also gave the island an unique name. Any ideas how they did this?
    If you like me, add me to your friends list .

    PS: looking for spriters and graphics artists for a RPG and an Arcade fighting project. If you can help out, please pm me!

    My Arcade My Blog

    Add me on twitter:

  2. #2
    When you know are. Son of Bryce's Avatar
    Join Date
    Aug 2002
    Location
    Los Angeles
    Posts
    838
    How about a link? I have no idea what you're talking about.

  3. #3
    Senior Member Orkahm52's Avatar
    Join Date
    Jan 2006
    Location
    Perth, Australia
    Posts
    335
    I'm not an expert on the matter but I think that it's probably something along the lines of procedural generation.

    I'm sure you could achieve the same sort of basic effect by just randomizing.

    Note: I've never played My Tribe, only seen a few screenshots on google just now.

  4. #4
    Pumpkin Carving 2008 ImprisonedPride's Avatar
    Join Date
    Apr 2006
    Location
    Grand Rapids MI
    Posts
    2,377
    Mr. Grant Skinner has provided us with a seedable Random class here. With that, you could very easily store the seed to a shared object on the users computer.

    As far as how they did it; Orkahm is probably right. I could easily see a very naive algorithm that simply selects a size for the island, splashes some trees in there, surrounds it with a beach, and then goes back and tweaks it a bit to give it that random feel. If you're truly interested, look into MapMage or even Cellular Automaton.
    The 'Boose':
    ASUS Sabertooth P67 TUF
    Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
    8GB G.Skill Ripjaws 1600 DDR3
    ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
    New addition: OCZ Vertex 240GB SATA III SSD
    WEI Score: 7.6

  5. #5
    Senior Member bluemagica's Avatar
    Join Date
    Jun 2008
    Posts
    766
    @ SonOfBryce : http://www.planetozkids.com/ozzoom/g...tribe-game.htm
    Those who don't know of this, should really give this a try from a game-devs point of view.

    @ Orkham52 and IP : Thanks for the links. I know this is done procedurally, and I did a bit of random terrain generation experimentations a long time ago, so i have some idea how they generated the island itself. What I want to learn is mainly the concept and logic behind seed-based generation. gskinner's code looks like what I needed, and I will be dissecting it now. But I wish there was some specific reading material on seed based generations, so that I could understand the logic thoroughly.

    In my tribe, the trees are not just slapped on the terrain, rather their position is exactly the same, but the more interesting thing is the usage of seed to give a unique name. Also though not in context to seeding, there is an interesting concept in the gameplay where the game virtually keeps running after it is closed....so if you see a 5 yr old now, close the game and return tomorrow, you might see him a grown up of 25 years who has already developed skills or done some work like cutting trees, the environment(trees, fish, e.t.c) is also made to show that change. (If anybody is wondering, no, the game is not a ghost which runs without your computer! It just remodels it's data at loading time based on the time difference of your pc.)

    Seeding really looks a very interesting thing. Maybe I can give a unique story to every unique player in a game, or something with even more possibilities...... I would really like to learn about seeding based random data creation.
    If you like me, add me to your friends list .

    PS: looking for spriters and graphics artists for a RPG and an Arcade fighting project. If you can help out, please pm me!

    My Arcade My Blog

    Add me on twitter:

  6. #6
    Pumpkin Carving 2008 ImprisonedPride's Avatar
    Join Date
    Apr 2006
    Location
    Grand Rapids MI
    Posts
    2,377
    The game doesn't virtually keep running after it's closed. When you return to the game it runs X periodic iterations of "gameplay"; be it seconds, minutes, or some other time increment based on the difference between when you left and when you returned. This allows the nature and personalities of your islands' inhabitants to play out the course of their lives. Of course this is most likely vague and only a rough estimate at how I would personally accomplish something like that.

    As far as the logic is concerned, I've always understood seeded random numbers by imagining the static series of pseudo random numbers nearly limitless and the seed as a starting place in that series. If you know the "starting place" you'll always get the same X numbers you need.
    The 'Boose':
    ASUS Sabertooth P67 TUF
    Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
    8GB G.Skill Ripjaws 1600 DDR3
    ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
    New addition: OCZ Vertex 240GB SATA III SSD
    WEI Score: 7.6

  7. #7
    Senior Member bluemagica's Avatar
    Join Date
    Jun 2008
    Posts
    766
    I mentioned "virtually" BECAUSE it isn't really running....you should have read the entire thing I wrote.

    as for the random seeding, PMPRNG seems to be the exact answer!
    If you like me, add me to your friends list .

    PS: looking for spriters and graphics artists for a RPG and an Arcade fighting project. If you can help out, please pm me!

    My Arcade My Blog

    Add me on twitter:

  8. #8
    Pumpkin Carving 2008 ImprisonedPride's Avatar
    Join Date
    Apr 2006
    Location
    Grand Rapids MI
    Posts
    2,377
    Regardless, my explanation stands as valid. YOU should consider taking constructive advice with a grain of salt, mate. My comment is merely an elaboration of "remodeling its data" as you put it.

    Good that you found your solution.
    The 'Boose':
    ASUS Sabertooth P67 TUF
    Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
    8GB G.Skill Ripjaws 1600 DDR3
    ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
    New addition: OCZ Vertex 240GB SATA III SSD
    WEI Score: 7.6

  9. #9
    Senior Member bluemagica's Avatar
    Join Date
    Jun 2008
    Posts
    766
    after playing around a bit with the files at lab.polygonal.de, I finally understand the concepts of seeding and how I can do it either in actionscript/flash or other languages like c#(which I am learning for unity).

    heres two files I made:- Though you can't input a seed, the level generated should be the same everytime you open the link.(I made these two entirely in code using fd, so not much visual jazz).


    1) Maze :- http://megaswf.com/view/dd42328bbb05...b63237d45.html
    The maze will randomly change once you reach the bottom.
    Controls:- arrow keys

    2) Match3 :- http://megaswf.com/view/bfeae502f199...1026ec2fc.html
    The level will change if you manage to remove all jewels. Ps:- shape doesn't matter,checking is done by color (well shape checking means I just have to change one varible in the source.)
    Controls:- Mouse click.
    If you like me, add me to your friends list .

    PS: looking for spriters and graphics artists for a RPG and an Arcade fighting project. If you can help out, please pm me!

    My Arcade My Blog

    Add me on twitter:

  10. #10
    Senior Member
    Join Date
    Jan 2008
    Posts
    150
    I can't find good images of the islands that game generates but there are essentially two ways to do that:
    A: plugging "rooms" together. This is what you can see from games like Diablo to- well, basically that sort of game. Adding in a little something like what you probably did to make that maze you could just plop down a variety of rooms in some area and connect them with tunnels (seen in games like Pokemon Mystery Dungeon,) or you can actually have a variety of edges to the "rooms" and just have it match up edges, or possibly even automatically generate a border around whatever shape it creates.

    Now the potentially more interesting but less frequently well applied option
    B: Perlin Noise. If you've seen photoshop's "render clouds" you've seen Perlin noise but it's not immediately clear how they do that.

    Imagine just generating a bunch of random numbers between -1 and 1. If you draw this out it's static. Static doesn't really look like an interesting perimeter for an island though so you need to do something more sophisticated. With Perlin Noise you generate a few random numbers, like maybe a 5x5 grid. Then you do it again but this time it's a bigger grid, like 10x10. Lay these on top of each other (the pixels in the first one would be twice as big in this example.) Repeat this process with some bigger grids/smaller pixels a few times and you'll get that render clouds look.

    *not exactly. They smooth the boundaries between "pixels" at each level for smoother transitions but you may not need to depending on your purpose.

    Now, clouds also work pretty well as mountains if you make white (1) mean high and black (-1) mean low. Likewise there are a lot of other things you can make these numbers mean. If you don't care about what's under the water everything below 0 would just flatten out to water and instead of mountains you could have things above 1 be how heavy the vegetation was.

    And once you've got random terrain in place there are lots of things you can do with it. Choose a cliff face and dig a cave into it or run some bridges over water to connect islands and place various animals in semi-random places that still make some sense.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center