Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: World Generator  (Read 3906 times)

HavingPhun

  • Bay Watcher
    • View Profile
World Generator
« on: May 18, 2017, 01:34:44 pm »

About 2 years ago I started this little project to create a world generator, and I've worked on it on and off since then.  I used C++ along with SFML for graphics, and TGUI for UI. TGUI is a UI library built for use with SFML. I haven't been working on it much and it doesn't seem like I will be any time soon. So, even though it's ripe with bugs and issues, I decided to post it for all to see.

Some notes:
-There are many small bugs and problems.
-I recommend not running it in full screen in case it crashes.
-Delete the settings file if you encounter issues.
-If you delete the "MapExports" folder, it won't regenerate.
-If you generate a custom world, I've got no clue what half the settings do. Many of them I added in just to play around with and then forgot about.
-For the moment I can't do any patches, have rebuild the libraries for my new system.

Controls (Once a map is generated):
Q/E to switch overlay type
Tab to Toggle UI visibility
Mouse wheel to zoom (only on tile map)
R to generate a new map.

Eventually I'm going to start fresh and make another one of these. Though this time I'll likely use OpenGL for graphics and QT for UI rather than using SFML and TGUI. Things I would like to change next time are the way I handled mountains, rainfall, and rivers, along with many smaller things.

Let me know your thoughts on it and if you can't get it working.
« Last Edit: January 13, 2019, 02:57:30 pm by HavingPhun »
Logged

knedl

  • Bay Watcher
    • View Profile
Re: World Generator
« Reply #1 on: May 18, 2017, 02:10:49 pm »

Looks neat! Great job  8)
Logged

HavingPhun

  • Bay Watcher
    • View Profile
Re: World Generator
« Reply #2 on: May 21, 2017, 11:53:47 pm »

Looks neat! Great job  8)
Thanks, were you able to get it running by any chance? Some people weren't able to run it previously and I wasn't sure if that problem was still present.
Logged

AoshimaMichio

  • Bay Watcher
  • Space Accountant
    • View Profile
Re: World Generator
« Reply #3 on: May 29, 2017, 03:50:15 am »

Neat. Any changes to make such version that can take a small (just few pixels) seed image which says "roughly here be ocean, here or so be mountains, rest be land of some kind" and generate large amount of details from that?
Logged
I told you to test with colors! But nooo, you just had to go clone mega-Satan or whatever.
Old sigs.
Games.

HavingPhun

  • Bay Watcher
    • View Profile
Re: World Generator
« Reply #4 on: May 30, 2017, 08:05:30 pm »

Neat. Any changes to make such version that can take a small (just few pixels) seed image which says "roughly here be ocean, here or so be mountains, rest be land of some kind" and generate large amount of details from that?
Interesting. I can make that work. I might work on it this weekend and I'll see about adding that in. I'm hoping that having this thread online will give me some steam to keep going with this project. If anyone has more suggestions then fire away.
Logged

LordArchibald

  • Bay Watcher
  • Indie Game Developer
    • View Profile
    • IndieGameDev
Re: World Generator
« Reply #5 on: June 09, 2017, 12:00:44 pm »

Interesting. Do you plan to release it as a library or is it for your own use?
Logged
Legends of Amberland: The Forgotten Crown - classic RPG (topic)
Stellar Monarch - 4X, no micromanagement, turn based (topic)
Homepage: http://www.silverlemurgames.com/
Twitter: https://twitter.com/SilverLemur

snow dwarf

  • Bay Watcher
  • Is always cold
    • View Profile
Re: World Generator
« Reply #6 on: June 10, 2017, 06:14:04 am »

PTW will use it and will let you know once I download and run it.
Logged
Here at Bay12 we excel at Theoretical Biology. Need to know the value of Merbone? Check. Need to know the density of a thrown Fluffy Wambler? Check. Need to know how a walking Mushroom can theoretically talk? Check.

HavingPhun

  • Bay Watcher
    • View Profile
Re: World Generator
« Reply #7 on: June 12, 2017, 02:58:46 pm »

Interesting. Do you plan to release it as a library or is it for your own use?

Initially I wanted to use it for a game, but I ended up liking the project so much that I haven't progressed into a game yet. I have had thoughts of releasing the source and making it into a library but had some doubts about it. Mainly if it would actually be used and if my code is too atrocious for others to improve upon. It's still a possibility though, I have more time now being out of college for the summer.

PTW will use it and will let you know once I download and run it.

Thanks, I want to iron out as many bugs as I can.


I meant to have updated you all sooner. I have done some work on the UI so that hopefully scales better with resolutions and I am also moving the customization menu right into world gen itself. Another thing I've done is split up some huge files for easier editing. I'll be going through all of the generation variables and seeing which work and which can be removed.

I switched over to visual studio and updated all of my libraries. Side effect of that is that I had to redo the entire UI, thus some of the changes. Eventually I might switch to QT and redo it once again.
Logged

LordArchibald

  • Bay Watcher
  • Indie Game Developer
    • View Profile
    • IndieGameDev
Re: World Generator
« Reply #8 on: June 30, 2017, 03:32:44 am »

Interesting. Do you plan to release it as a library or is it for your own use?
Initially I wanted to use it for a game, but I ended up liking the project so much that I haven't progressed into a game yet. I have had thoughts of releasing the source and making it into a library but had some doubts about it. Mainly if it would actually be used and if my code is too atrocious for others to improve upon. It's still a possibility though, I have more time now being out of college for the summer.
There is no need for others to even check your code.
For example, if you make a stable (exteremely important!) library where you can set dimensions of the world and some parameters and it output the outcome to a .txt file (like 0123456789 is height of terrain) AND to memory if someone desires (in such case the user needs to provide a pointer to a 2D table with allocated space) it might be of high use to some people (like in game jams). Then other people can improve the generator without touching your code (they would just start with the terrain your generator produced and only place cities and rivers for example using their own separate code).

I visualize it like that:
WorldGeneratorLibrary.setSeed(rand());
WorldGeneratorLibrary.setDimensions(400,400);
WorldGeneratorLibrary.setParameter(WORLDGENERATORLIBRARY_ENABLE_RIVIERS,1);
WorldGeneratorLibrary.setParameter(WORLDGENERATORLIBRARY_RIVIERS_FREQUENCY,35);
WorldGeneratorLibrary.generateToFile(WORLDGENERATORLIBRARY_HIGHTMAP,"filename");
WorldGeneratorLibrary.generateToFile(WORLDGENERATORLIBRARY_TEMPERATUREMAP,"filename");
WorldGeneratorLibrary.generateToMemory(WORLDGENERATORLIBRARY_HIGHTMAP,pointer);

Extremely handy I would say :)
Logged
Legends of Amberland: The Forgotten Crown - classic RPG (topic)
Stellar Monarch - 4X, no micromanagement, turn based (topic)
Homepage: http://www.silverlemurgames.com/
Twitter: https://twitter.com/SilverLemur

snow dwarf

  • Bay Watcher
  • Is always cold
    • View Profile
Re: World Generator
« Reply #9 on: July 04, 2017, 05:33:31 am »

Wow, this works really well (finally tested it out) and haven't found any bugs yet.
Logged
Here at Bay12 we excel at Theoretical Biology. Need to know the value of Merbone? Check. Need to know the density of a thrown Fluffy Wambler? Check. Need to know how a walking Mushroom can theoretically talk? Check.

hun

  • Bay Watcher
    • View Profile
Re: World Generator
« Reply #10 on: July 13, 2017, 07:34:06 pm »

Good work! I'm wondering, if you have any further plans for development.

It works fine, but fps is very low on my machine in tile biome map mode, especially if I zoom out...

Would be great to add ability to see additional information in tile mode, like to see what is humidity/height/temperature of that particular tile, and brief description of the biome. Just to feel the world better. For example, for some settings I got this strangely colored biome:
Spoiler (click to show/hide)
Not sure if it is bug or not.

AoshimaMichio

  • Bay Watcher
  • Space Accountant
    • View Profile
Re: World Generator
« Reply #11 on: July 13, 2017, 11:48:57 pm »

Good work! I'm wondering, if you have any further plans for development.

It works fine, but fps is very low on my machine in tile biome map mode, especially if I zoom out...

Would be great to add ability to see additional information in tile mode, like to see what is humidity/height/temperature of that particular tile, and brief description of the biome. Just to feel the world better. For example, for some settings I got this strangely colored biome:
Spoiler (click to show/hide)
Not sure if it is bug or not.

Mountains? Looks like DF mountains.
Logged
I told you to test with colors! But nooo, you just had to go clone mega-Satan or whatever.
Old sigs.
Games.

hun

  • Bay Watcher
    • View Profile
Re: World Generator
« Reply #12 on: July 14, 2017, 04:17:19 am »

Mountains? Looks like DF mountains.

Nah, I'm talking about that cyan thing near the mountains.