Allegro.cc - Online Community

Allegro.cc Forums » The Depot » [Questing Game] World Generator

This thread is locked; no one can reply to it. rss feed Print
 1   2 
[Questing Game] World Generator
Onewing
Member #6,152
August 2005
avatar

A little over a week ago, I mentioned I was working on a little project and I was starting with the world generation. I've kind of hit a milestone with it and I decided to release a demo program for people to see and possibly get some feedback before I dig deeper into what actually happens in these worlds.

Some screenshots:
{"name":"screen1.PNG","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/f\/1f6e67c2977c4ecc0f288b1a3bb345d7.png","w":645,"h":512,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/f\/1f6e67c2977c4ecc0f288b1a3bb345d7"}screen1.PNG
{"name":"screen2.PNG","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/c\/5c820f09c26d1e2987b95de316b44d03.png","w":645,"h":512,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/c\/5c820f09c26d1e2987b95de316b44d03"}screen2.PNG
{"name":"screen3.PNG","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/2\/82003803857db3ea5c8dbe49edf1e856.png","w":645,"h":512,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/2\/82003803857db3ea5c8dbe49edf1e856"}screen3.PNG

Nothing fantastic, I'm even using two-year old code from lost Cosmos project. I changed the color palette and added some things like forests and rivers and there ya go.

The circles and lines see in the graphs above are the "locations" and "paths" one can take (once the actual game is ready) to travel between places. While having your parties travel from one node to the next, they will fight battles (possibly develop relationships, get a sickness, get an injury, etc.).

Red paths mean that in the game, it will require finishing a quest to unlock. Green paths require a subquest be finished (but most of the time, it just saves travel time). Blue paths are shortcuts, requiring something like extra money or having a Paladin (or any other job) in the party.

Here's a link to check it out in its infancy:
Oldest version: Currently codenamed: MyQuest
Newest Version: 0.0.6

Key commands
Arrow keys: move around the world
Plus/minus (not on pad): Zoom in/out
M key: hide nodes and lines
S key: Open settlement population window

Geographic Locations Generated
Deep-sea trenches
Ocean
Wave crests near land
Beaches
Deserts
Grasslands
Tundra
Safari
Highlands
Permafrost
Mountains: Reddish for hotter areas, Gray-purply for cold
Snow

You can open the config file to change the amount of nodes generated at the bottom of the config file.

------------
Solo-Games.org | My Tech Blog: The Digital Helm

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Onewing
Member #6,152
August 2005
avatar

Quote:

I like that there are so many diverse climates. What kind of parameters did you use to generate the terrain? Humidity, altitude, temperature?

The basic process for creating the map (italicized words are the paremeters, usually integer):

1) Start with a flat ground
2) Create mountains: Pick a random location and raise that location by a randomized height. Next, odds of jumping to a different location entirely are based on islands. If not a new location, only move randomly up to island_jump far.
3) Create holes: Same process as mountains, only sinking instead of rising (creates lakes, trenches, etc.)
4) Calculate temperature. First, choose a temperature range, which determines how quickly things get cold from the equator. Then, Create an ozone mask: a bitmap which is littered with ellipses that represent holes or thickness in the ozone. The sun is placed randomly horizontally and in the middle vertically. The temperature for each pixel is then calculated with a formula using the distance of the sun from the planet, the thickness of the ozone on the mask and where the pixel is int the x,y,z (z being height). Humidity is not considered. In cosmos, wind and air pressure were calculated at this point.
5) Render. Create forest spawn locations and ranges and create rivers, allowing them to run down the maps (bit of recursion here, with a small chance to create another river as were flowing down). Each pixels color is then based on height, temperature and whether or not we're a river or forest.

The next steps are in creating the node graph.

[Edit]
Technically, I could turn the sun on (it's currently off). However, the new color palette isn't quite set up right at the moment, so some pixels go out of bounds where its night time.

------------
Solo-Games.org | My Tech Blog: The Digital Helm

ngiacomelli
Member #5,114
October 2004

I remember you showing off the first version of this! The change in colour palette (and the further developments) are a big improvement. Regarding the actual game, it kind of sounds like a souped up version of The Oregon Trail, which I used to play for hours when I was younger.

The only real suggestion I'd make is that the landscapes would probably look better (especially as you intend to allow zooming) with antialiasing.

Keep up the good work!

Onewing
Member #6,152
August 2005
avatar

Quote:

The only real suggestion I'd make is that the landscapes would probably look better (especially as you intend to allow zooming) with antialiasing.

Thanks. If I manage to get further into the game play to satisfy my hunger, I'll definitely do attempt some touch-ups on the graphics.

I'm tinkering with generating the location names. I probably won't release another version until I have fog of war and have the player moving from node to node rather than just glancing at the whole graph. Some screenies:

http://www.allegro.cc/files/attachment/597615
http://www.allegro.cc/files/attachment/597616
{"name":"597617","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/a\/9\/a9af43613cdf5eddf1de914b21cd9a13.png","w":640,"h":510,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/a\/9\/a9af43613cdf5eddf1de914b21cd9a13"}597617
http://www.allegro.cc/files/attachment/597618

8-);D

------------
Solo-Games.org | My Tech Blog: The Digital Helm

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Onewing
Member #6,152
August 2005
avatar

Quote:

Could use a little fine tuning after the initial generation, but they're good.

Yeah, I'll probably be tweaking them for a while.

I'm going to go ahead and release a the next pre-alpha verison (it is a WIP afterall), because I figure I won't have much time to work on it until next weekend (if even then). This version gives a somewhat more hands-on feel to what the gameplay is evolving into. At the moment, it is a barren world filled with locations, but no life, other than you. Eventually, there will be townsfolk, members to recruit and battles to wage. All you can do now, is go from location to location and imagine the missing pieces.

Screenshots:
http://www.allegro.cc/files/attachment/597648
http://www.allegro.cc/files/attachment/597649

The paths to really mind at this point are the red ones. These are locked paths that would require a quest to be completed. The makeshift quest for now is simply travel to another, reachable node. Once the quest is completed, it'll turn green.

The number under the location's name is the "rank" or the difficulty of that area. Imagine each rank increase is several times harder. Last, but not least, the black node surrounded by purple is the calculated final stage of the game. There could be harder stages, but this one is the one to beat the current generated game.

Myquest V0.0.2

------------
Solo-Games.org | My Tech Blog: The Digital Helm

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

ngiacomelli
Member #5,114
October 2004

This one really interests me! The location names are pretty funny and I'm in love with the detail of the world generator. Will other inhabitants have an impact on the world at all? For instance, will a town be able to develop a settlement, attack neighbouring towns, deplete resources in an area, etc.

Audric
Member #907
January 2001

I have one graphical suggestion:
Right now, you display directly the pixels with a lightness that matches their "height" (for mountains, particularly)
The display might be enhanced by applying a kind of emboss filter
that takes into account the level of the surrounding pixels instead.
It could simulate a light that comes from top-right, for example, which is not necessarily realistic, but can be a convincing illusion of a cast shadow.

Onewing
Member #6,152
August 2005
avatar

Well, since I haven't had electricity in a week (argh!), I haven't had a chance to do anything with the project. So, I guess I'll just unveil some of the design work to keep the thread alive a little longer.

Quote:

It works fine for me, and I made it to the last stage, Bella Vista.

Nice, that's a town about forty minutes from my house. ;D Currently, there's some degree of measuring the "epicness" of word choice-age, but mainly around dungeon names. As I go, I intend to sort it better to have better outcomes, probably when I upgrade from raw data to using sqlite.

Quote:

Will other inhabitants have an impact on the world at all? For instance, will a town be able to develop a settlement, attack neighbouring towns, deplete resources in an area, etc.

I hope to have as many impacts as possible via AI. That being said, to specifically respond to the examples you listed, I don't currently plan to allow development of settlement during the game (not in the design papers at least). In some situations, "control" of settlements may change alignment (or change into ruins if it were destroyed). Probably won't have depletion of resources.

Character jobs
Overall, the entire idea of the game is to focus around implicit content, simply massaging the player's imagination. This way, I can avoid the things that I'm not as good at, like graphics or music/sfx. Thus, I need a lot for the content generation for different outcomes.

There are three scores the player invests in to build each character: Melee, Mind and Mystique. These act like rock-paper-scissors to some degree (like mind has an advantage over melee, but a high level melee could still beat a low level mind). Melee jobs are like warriors, farmers, knights, etc. Mind are like engineers, librarians and mages. Mystique are like dancers, ninjas and jokers. And, of course, there are jobs for mixed combinations of the three M's.

Next, each character has an alignment: light, neutral and dark. Adjusting these numbers provides the player with unique characters. I have written out a huge table of all the "classifications" based on the numbers. For each M, you can have the stat from 0 to 100. For each 10 (0-9, 10-19, 20-29, etc.) you have one classification per alignment. Thus, you'd have ten classifications for Melee Neutral, if you didn't invest any points on the other M's. Ten more for light and ten more for dark. So each M has 30 different classifications. Naturally, a mixture should also have 30 classifications. That's 120 different titles a character can have. From bouncers to gardners to pirates to prostitutes, the player should have pretty colorful parties.

Furthermore, each job has ten degrees. Like the Nurse job could have the "Candy Striper" degree followed by the "LPN" degree and so on and so forth. Each degree comes with one ability, like "needle prick" or "medicate." Every ability filters to one of five things: healing, buff, attack, debuff, nuke (for lack of better words at the moment). So, while the player is seeing all kinds of different things, ultimately, behind the scenes, everything filters down to the three M stats (plus armor and weapons stats, something I'll get into later), alignment and the five abilities to keep the code relatively straightforward.

Story Arcs
To give a better idea of the point of the game, at the beginning, when the player is setting up what type of game they are going to play, they will choose an overall story arc. This arc is the reason the player's parties are adventuring. Perhaps it could be "to defeat the big bad boss," "prevent the apocalypse," "stop the ever-expanding empire," or "stop the guy from awakening the monster."

During gameplay, the bad AI can advance towards their goal if you don't prevent them. The monster can be awakened! You can lose. And, one story arc can go into another: if the monster is awakened, perhaps now the goal is to defeat the big bad boss. Also, there will probably be the negative goals, like "destroy the planet" and such.

That's design goal anyway. I imagine you can see the complexity of pulling that off...

------------
Solo-Games.org | My Tech Blog: The Digital Helm

OICW
Member #4,069
November 2003
avatar

So basically it will be an RPG but without all the cliche stuff we see on every other corner. Something like Heroes of Might and Magic, but w/o strategy elements - you walk through the world, accomplish quests, see world live it's own life, meet other parties etc. Am I right?

[My website][CppReference][Pixelate][Allegators worldwide][Who's online]
"Final Fantasy XIV, I feel that anything I could say will be repeating myself, so I'm just gonna express my feelings with a strangled noise from the back of my throat. Graaarghhhh..." - Yahtzee
"Uhm... this is a.cc. Did you honestly think this thread WOULDN'T be derailed and ruined?" - BAF
"You can discuss it, you can dislike it, you can disagree with it, but that's all what you can do with it"

Onewing
Member #6,152
August 2005
avatar

Quote:

Am I right?

Essentially yes. I'm hoping to go so far as have a complete simulation mode. Think of The Sims, where if you don't tell the Sim to do something, it'll do what it wants, but you can always override and tell it to do something else. It's almost like a step or two up from Progress Quest, having a bit of actual interaction with the user. Balancing it to get exactly the right amount of interaction I'm expecting to take a while.

Version 0.0.3
Unfortunately, the only time I got to work on the game last week was on Saturday. Here's the items from the version log:

Additions
  * Naming Landmasses
  * Defining Landmass type
  * Defining Regions
  * Settlement population ranges
  * Setting population in nodes
  * New Settlement types
  * New Region Names
  * Determing Node Type

I also worked on a few bugs and got a little caught up with this problem.
http://www.allegro.cc/files/attachment/597738
http://www.allegro.cc/files/attachment/597739

And the executable: MyQuest 0.0.3

Lastly, in case I didn't mention it, the world is based on a flat bitmap image. The reason I'm doing this is I want to also be able to put any image as the world. It could be a picture of me. Afterall, the map is just eye candy, the node graph is where all the game revolves around. I could hand draw my own maps. Or, I could use a Final Fantasy map.

:D

------------
Solo-Games.org | My Tech Blog: The Digital Helm

Schyfis
Member #9,752
May 2008
avatar

I didn't know Mississippi was a continent. :P

________________________________________________________________________________________________________
[freedwill.us]
[unTied Games]

Audric
Member #907
January 2001

Out of curiosity, in-game, how do you explain the travel routes that cross oceans, as they don't always start and end near the coast ? Flying transport lines?
I'm asking because it looks a bit strange when you are at some "harbour" near the shore, and to cross to the other side, you need to first go inland to a mountain, then "jump" in a long route that passes not far from the harbour you were in.

Onewing
Member #6,152
August 2005
avatar

Quote:

I didn't know Mississippi was a continent.

Ah, but did you know that Mississippi is a county in Arkansas? The list of possible names for region or landmass come from the counties of US states. I've added up to California thus far.

Quote:

Out of curiosity, in-game, how do you explain the travel routes that cross oceans, as they don't always start and end near the coast ? Flying transport lines?

I can't really explain as much as I can defend. You don't really travel in straight lines through forests or mountains either. Essentially, a line between two nodes is just stating there is a path between these two places. Maybe they get on a boat once they get to sea, etc.

However, just like in adding polygons to make a model more realistic, adding more to the amount of nodes to the world increases its overall believability.

And, I am going to have fast transport lines connected between settlements. These will be some kind of system where you can get around a bit faster, but don't fight any battles to gain any xp. They'll be good for timed quests.

Version 0.0.4
http://www.allegro.cc/files/attachment/597801
http://www.allegro.cc/files/attachment/597802
I've found a surprising amount of time to add to the game this week. The game now selects a calendar system for your world (currently based off of four calendars). I've created an icon (placeholder graphic: smiley face) to represent a single party's current location. When selecting to move between locations, the camera will follow the party cursor.

The party wakes up at 5:00am and packs up camp, eats some breakfast and heads out for at 6:00am. At 7:00pm, they stop, setup camp, find food, eat, converse and go to sleep around 9 or 10pm. However, the only thing you'll see at the current time is either "TRAVELING" or "SLEEPING".

Traveling across mountains is the slowest form of travel. Sea is the fastest (and they'll move while sleeping). To help increase the accuracy, I've created a middle point node on each edge. It's like that I'll end up creating several "milestone" nodes on each path until I feel it is an acceptable accuracy.

You can press 's' to see a list of all settlements and their population. Node information has been moved to the current HUD at the bottom of the screen. The file is a bit bigger because I added sqlite statically to my program:

MyQuest Version 0.0.4

------------
Solo-Games.org | My Tech Blog: The Digital Helm

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

It's coming along nicely. The player locater covers the name of the current town though. It might be nice to describe the available types of travel between one node to the next :

hiking
horseback
train
sea going vessel
balloon (dirigible / hot air balloon)
plane
etc...

Onewing
Member #6,152
August 2005
avatar

Quote:

It's coming along nicely.

Thanks. :)

Quote:

The player locater covers the name of the current town though.

Noted! I'll try to change that for the next version.

Quote:

It might be nice to describe the available types of travel between one node to the next :

Right now, everything is "Walking Briskly" except for sea travel. I googled walking briskly and found it took about 16-17 minutes to walk a mile. I then decided players could walk around the fantasy world in 10 days, making the world 900 miles in width. World sizes of 2500 (normal) and 5000 miles will be included later on. This makes the normal fantasy world about a tenth of the size of Earth (25000 along the equator).

Woah, sorry, went off on a tangent there. Ultimately, there will be more options when moving from one node to another. Like, walk (fight enemies along the way) or run (hurry past monsters to destination). But yes, I do hope to have other means of travel as well that can drastically change the characters sim-like stats (for example, comfort goes up if you take a first-class airship).

Version 0.0.5

Version 0.0.5  
Addition  100+ Weather Conditions
    Temperatures Shown
    Slight Timer Change to return CPU Power
    Seasons
Modifications  Yellow Debug lines removed
    Reset ticks after generation

MyQuest: Version 0.0.51

The current weather drops and rises like a sin wave based on the time of day (midnight being the lowest of the wave, noon being the highest). Easy to implement and believable enough imo. The current condition is based on cloud, wind and temperature intensity (and type, for special cases (no snowing in desert)). Depending on the season, these intensities change in different ways during the day. The full list of weather conditions can be found here, some items moved.

I still need to add cold/warm fronts and freezing/heat waves for further drastic weather changes. I'd also like to have hazards (tornados, hurricanes, etc.) occur depending on certain situations, which will actually kill the population in the game. And maybe some easter eggs, like "Raining cats and dogs." :)

As you can tell, I've been building quite a stage, but overall activity is pretty dormant. I'm hoping to start adding the actors soon, which I hope brings the game to life. Unfortunately, I'm getting ahead of myself and I'm watching as the bugs creep up. I'll probably have to work on the stability before too long.

[edit]
Slight upload error, one file wasn't completely up-to-date.

------------
Solo-Games.org | My Tech Blog: The Digital Helm

Kikaru
Member #7,616
August 2006
avatar

This game is starting to look pretty awesome. How are you thinking of doing dungeons?

Ran444
Member #9,701
April 2008

This looks quite cool. I hope that the full version will contain full SI-standards support?

SiegeLord
Member #7,827
October 2006
avatar

What's up with the diamondy shape of the mountains? If you notice they seem to be square pyramid shaped, instead of more conical shape of real mountains. I'd imagine you would improve the visual output of your generator greatly if you improved your height generation algorithm.

And yeah, it'd be nice if you had means to introduce your own units into the system, so you are not stuck with the imperial system. I know it's your game and all, but if most of the world can't understand the units you are using, then what's the point of outputting them in the first place?

Also, one place I've been to had a temperature of 141 deg F (60.5 deg Celsius). Quite toasty :P

EDIT: Thought about adding visible day night cycles?

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Darizel
Member #10,585
January 2009
avatar

Very impressive & I like the whole idea of creating unique planets. Only recommendation would be to fix up the zoom mode (less pixelated ;)(

----------
struthersgames.com - fun games for free download ;)
I am not an idiot.*
*in my opinion.

decepto
Member #7,102
April 2006
avatar

Cool idea.

What method are using to create random land masses? If you are looking for some interesting methods, check out Perlin Noise and Brownian Bridges.

--------------------------------------------------
Boom!

Onewing
Member #6,152
August 2005
avatar

Quote:

How are you thinking of doing dungeons?

My hope is to have submaps that are exactly like the world graphs. However, in dungeons, time is slower, meaning instead of taking days to travel between nodes, it could just take hours. I might have different graph structures too, like more orthogonal. However, I think these nodes will have to be "entered" like the player has to "enter" them. In otherwords, if you go to a dungeon on the main world map, if you don't "enter" it, you're technically just passing by.

Quote:

I hope that the full version will contain full SI-standards support?

Yeah, shouldn't be too hard to implement. I'm doing it this way for now so I can recognize obvious errors.

Quote:

What's up with the diamondy shape of the mountains?

I once implemented a "light" system that really brought out the pyramid-like hills/mountains. Currently, it's a relatively low priority thing to fix, since it doesn't effect gameplay at all (purely aesthetic).

Quote:

Also, one place I've been to had a temperature of 141 deg F (60.5 deg Celsius).

Yeah, temperatures need a bit of work. They're a bit too extreme as is. The average temperature is pretty realistic though.

Quote:

Thought about adding visible day night cycles?

The code from the old Cosmos engine is still in there for day/night cycles (commented out), however I'm not currently planning on using it. It places the sun somewhere moving along the horizontal. This would mean I would have to introduce timezones and on a map this small, you'd pass a timezone or two every time you moved from one node to the next. I kind of feel that would be over engineering and only be good for the techie players.

I am thinking of having a sun or moon icon hovering over the party icon. I might turn that into a weather icon and have a particle effect representing rain, snow, etc.

Quote:

Only recommendation would be to fix up the zoom mode (less pixelated

Okay, upped the resolution and blurred to make it look less pixelally (with little hit to the generation phase thankfully).

Quote:

What method are using to create random land masses? If you are looking for some interesting methods, check out Perlin Noise and Brownian Bridges.

I was recommended the Perlin Noise method when I was working on Cosmos. The current method I'm using is the Onewing method, something I made up completely, so it probably isn't the most efficient algorithm. The two main variables that create it are how often a new island is created (pic random x,y) and how far to jump from last x,y.

Version 0.0.6
{"name":"597934","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/8\/5804c7bc61c2017c2c97eb4f6d9dd07d.png","w":645,"h":510,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/8\/5804c7bc61c2017c2c97eb4f6d9dd07d"}597934
{"name":"597935","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/a\/1\/a1fc9039ed7e532809614a0acdd1a684.png","w":645,"h":510,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/a\/1\/a1fc9039ed7e532809614a0acdd1a684"}597935
{"name":"597936","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/5\/b5bf228da4e10a7359a227a63b9ca2cf.png","w":645,"h":510,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/5\/b5bf228da4e10a7359a227a63b9ca2cf"}597936

1Version 0.0.6
2Addition Tracking Weather Temperatures
3 Node Icons
4 Quest Window
5 Scroll bar for information windows
6 Focus control for multiple information windows
7 Star and Skull for Beginning and End node
8
9Modifications Higher Resolution image and blurring (lessens pixelation)
10 Slight Graphical Change to information windows
11 Quests upgraded from structs to classes
12 Locations entered into sqlite database instead of words.dat
13 Directory structure modification: adding data and images folders
14 Node name lowered so temporary party icon doesn't block
15 Node display

Keys:
w - see previous low/high temperatures for current node
q - see all the quests recorded
s - see list of all the settlements and their population
h - Hack, see the entire node graph
m - see behind Fog of War (and node graph)

MyQuest 0.0.6

------------
Solo-Games.org | My Tech Blog: The Digital Helm

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

I'm not too fond of the blurring effect on close zooms. I guess I figured that you would eventually replace the pixel colors with tiles. Something else - the latest version takes up nearly 100% cpu on one core, even when nothing is happening and there is no mouse movement. Looks like you're still making good progress though.

 1   2 


Go to: