Results 1 to 15 of 15
  1. #1
    augustas656 is offline Senior Member
    Join Date
    Apr 2014
    Location
    United Kingdom
    Posts
    169
    Rep Power
    1

    Default Java 2D Game: Random Map Biome Generator

    I'm trying to make a Survival Game like Don't Starve, I'm going to make a tile map, and I would like to use Random Generation of different Biomes. Now, these biomes won't be affected by the place in the world, there won't be such a thing as north pole or towards up or down there's colder temperature. Just that biomes don't switch from Snowy directly to Desert, and some biomes are rarer than others. I'd like the game not to have just polygons for biomes, a bit more random like Don't Starve or minecraft. However, my game is going to be two dimensional, there will be caves but I will basically use a different generator for caves as well. I'm not too advanced in gaming making, I started a few days ago, but I had made a different RPG game in the past. Lastly, I'm wondering how I could make semi-structures such as rivers. How can I use java to create a random map biome generator, so I provide a list of biomes, and semi-structures such as rivers, with information of their rarity, how can I use these resources and create like a randomly generated map with biomes, perhaps similarly to Don't Starve does it?

    Regards
    Augustas

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,017
    Rep Power
    10

    Default Re: Java 2D Game: Random Map Biome Generator

    You've asked about a dozen different questions, none of which have just one single answer.

    The best advice I can give you is to start smaller. Can you create a grid of randomly colored squares? Start from there and work your way up instead of starting off trying to emulate huge games.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    augustas656 is offline Senior Member
    Join Date
    Apr 2014
    Location
    United Kingdom
    Posts
    169
    Rep Power
    1

    Default Re: Java 2D Game: Random Map Biome Generator

    Yes I can create a grid of randomly colored squares, what's should I learn to or try to do next?

    Give me a list of things, starting from Grid of Randomly Colored Shapes to Random Game Biomes Generator, and I'll see what I can and cannot do in-between these including the last item, being my goal. A list of things to learn and search for on google to get an idea of what I should learn or try to do in order to reach my goal in creating the Random Biomes Generator.

    Regards
    Last edited by augustas656; 07-16-2014 at 09:48 PM.

  4. #4
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,017
    Rep Power
    10

    Default Re: Java 2D Game: Random Map Biome Generator

    Well, just work your way up from there. Can you create a rule system that dictates where the colors can go, but still make it random? Can you insert blue tiles in a way that resembles a river? Work your way up from there instead of trying to work backwards from your end goal.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    augustas656 is offline Senior Member
    Join Date
    Apr 2014
    Location
    United Kingdom
    Posts
    169
    Rep Power
    1

    Default Re: Java 2D Game: Random Map Biome Generator

    Blue tiles of for a river, well, that's something I do not know how to make. Where can I find how to learn to making this. I just don't know how to apply random generation algorithms to java, I can do it in my head and draw it on paper, but not sure how to apply it to java. That's what I'm trying to find P:

  6. #6
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,017
    Rep Power
    10

    Default Re: Java 2D Game: Random Map Biome Generator

    Well, how do you do it in your head and on paper? Write out rules that somebody else could follow to do it in their head and on their paper.

    When you have those rules written out, that's an algorithm that you can start thinking about converting to code.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  7. #7
    augustas656 is offline Senior Member
    Join Date
    Apr 2014
    Location
    United Kingdom
    Posts
    169
    Rep Power
    1

    Default Re: Java 2D Game: Random Map Biome Generator

    I just got an idea of how I could make it work. I'm not sure wether it's efficient, but it's to do with random placement and then spreading. Generating a random number of different biome tiles, and then with an examplary chance of 90% spreading from each tile. Is it efficient or is there a better one?

    Regards

  8. #8
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,280
    Rep Power
    6

    Default Re: Java 2D Game: Random Map Biome Generator

    Here is an awesome example to draw inspiration from:

    MapGen - Introduction
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  9. #9
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,732
    Blog Entries
    7
    Rep Power
    21

    Default Re: Java 2D Game: Random Map Biome Generator

    Just an extremely silly question: what is a 'biome'? (my google button is down).

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  10. #10
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,017
    Rep Power
    10

    Default Re: Java 2D Game: Random Map Biome Generator

    Quote Originally Posted by augustas656 View Post
    Is it efficient or is there a better one?
    Stop worrying about whether your first algorithm is the most efficient algorithm ever and just try something.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  11. #11
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,185
    Rep Power
    20

    Default Re: Java 2D Game: Random Map Biome Generator

    Quote Originally Posted by JosAH View Post
    Just an extremely silly question: what is a 'biome'? (my google button is down).

    kind regards,

    Jos
    "a large naturally occurring community of flora and fauna occupying a major habitat"

    The Eden Project in Cornwall has several in its domes.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  12. #12
    maca is offline Member
    Join Date
    Jul 2014
    Location
    UK
    Posts
    16
    Rep Power
    0

    Default Re: Java 2D Game: Random Map Biome Generator

    Quote Originally Posted by augustas656 View Post
    I just got an idea of how I could make it work. I'm not sure wether it's efficient, but it's to do with random placement and then spreading. Generating a random number of different biome tiles, and then with an examplary chance of 90% spreading from each tile. Is it efficient or is there a better one?

    Regards
    Think about your class design, communication between your normal program logic and anything like an algorithm should be done via an interface, if you get your interface right then it doesn't matter if your algorithm is efficient or not - you can easily replace the derived algorithm at a later date if necessary with something more efficient (or even with something that has different behaviour if desired).

  13. #13
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,017
    Rep Power
    10

    Default Re: Java 2D Game: Random Map Biome Generator

    Quote Originally Posted by Tolls View Post
    "a large naturally occurring community of flora and fauna occupying a major habitat"

    The Eden Project in Cornwall has several in its domes.
    It's also a place where Pauly Shore and Stephen Baldwin hung out in the 90s!
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  14. #14
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,732
    Blog Entries
    7
    Rep Power
    21

    Default Re: Java 2D Game: Random Map Biome Generator

    Quote Originally Posted by KevinWorkman View Post
    It's also a place where Pauly Shore and Stephen Baldwin hung out in the 90s!
    Duh, I bet all those bio-domes were all a failure because they didn't have a proper bar; a bar where one can eat salted peanuts and drink cold Grolsch beer or read the newspaper or have fun at the bar area or have a proper meal. That's why; so there.

    kindest regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  15. #15
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,280
    Rep Power
    6

    Default Re: Java 2D Game: Random Map Biome Generator

    The first time I read the term "biome" was in Minecraft. In computer games it simply means a sub-area within the larger world with a specific "theme". Jungle biome, winter biome, desert biome, etc. Its a common design choice in open-world survival games.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. random letters generator JAVA
    By lazarat in forum New To Java
    Replies: 2
    Last Post: 10-08-2012, 05:43 PM
  2. Random number generator
    By adjit in forum New To Java
    Replies: 9
    Last Post: 03-05-2012, 05:09 PM
  3. Random Generator
    By Learning Java in forum New To Java
    Replies: 9
    Last Post: 05-31-2010, 09:15 PM
  4. Random Shape generator
    By scheng12 in forum New To Java
    Replies: 1
    Last Post: 03-09-2009, 03:06 AM
  5. Random Generator
    By padutch2 in forum New To Java
    Replies: 1
    Last Post: 12-03-2007, 07:43 PM

Posting Permissions

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