Light Style© by Fisana

Jump to content


Photo

deep_forest_v0.1 Random Map Generator


  • Please log in to reply
41 replies to this topic

#1 FeXoR

FeXoR

    Centurio

  • Community Members
  • PipPipPipPipPip
  • 938 posts

Posted 29 February 2012 - 08:43 PM

Here's my (poorly implemented) early version of a deep dark forest map.
Well at least at size medium and higher.

Well, I learned much about what I did wrong when I made it x)

Here it is:
EDIT: Dont download this! Plz look though this topic for later versions.

deep_forest_v0.1.rar
deep_forest_v0.1.zip

Siege engines might have trouble getting through

Edited by FeXoR, 13 March 2012 - 01:08 PM.

  • 0

#2 FeXoR

FeXoR

    Centurio

  • Community Members
  • PipPipPipPipPip
  • 938 posts

Posted 29 February 2012 - 09:01 PM

That was TO dark.

Here's a more playable one

deep_forest_v0.2.zip
  • 0

#3 MishFTW

MishFTW

    Primus Pilus

  • Web Development Team
  • 1,920 posts

Posted 29 February 2012 - 10:48 PM

Nice, however, I think this will tax alot of graphics cards (including mine :()
Here is a screenshot.

Attached Thumbnails

  • Screen shot 2012-02-29 at 4.47.05 PM.png

  • 0
Mish [Adarash Mishra]
Wildfire Games Webmaster
Email Me | About Me

#4 Mythos_Ruler

Mythos_Ruler

    Senator

  • WFG Retired
  • 14,965 posts

Posted 01 March 2012 - 01:08 AM

It looks fantastic zoomed out. However, it is nigh unplayable due to graphical lag. There are simply too many trees, I'm afraid. I would mix it up with patches of Oaks, Carobs, and European Beech trees, even some pines. Also, there is a problem with the water plane being too high. Lower the water plane so it doesn't stick above ground. This is a good start though. Keep at it, FeXoR. :)
  • 0

#5 k776

k776

    Centurio

  • WFG Retired
  • 724 posts

Posted 01 March 2012 - 03:50 AM

Awesome map.

Not-so awesome frame rate when playing it. Yikes! We need a way for the game to dynamically scale shadow quality based on the amount of entities.
  • 0

Kieran P [ aka k776 ]


#6 Mythos_Ruler

Mythos_Ruler

    Senator

  • WFG Retired
  • 14,965 posts

Posted 01 March 2012 - 04:19 AM

Awesome map.

Not-so awesome frame rate when playing it. Yikes! We need a way for the game to dynamically scale shadow quality based on the amount of entities.


Not so sure it's the shadow map causing the lag. Likely it is all of the alpha-channeled trees.
  • 0

#7 historic_bruno

historic_bruno

    Primus Pilus

  • WFG Programming Team
  • 2,415 posts

Posted 01 March 2012 - 04:29 AM

Plus there are loads of "out of memory" errors even on a Normal-sized map with 2 players, because there are simply too many entities. Larger maps won't even generate. I'd love a forest map though, someday :( Performance is another problem entirely. There are lots of ways of making this work from a technical perspective.
  • 0
Ben Brian [ aka historic_bruno ]

Wildfire Games Programmer
Contact me: ben [at] wildfiregames [dot] com

#8 Spahbod

Spahbod

    Triplicarius

  • WFG Programming Team
  • 588 posts

Posted 01 March 2012 - 09:38 AM

There is a "trick" that can increase the performance. Add some cliffs in the forest heavy areas and fill the borders with trees. Increase the distance between trees and don't add them to the top of the hills. Players won't be able to see the top of the cliffs and thus do not notice that there isn't any forest.
  • 0
Omid Davoodi [ aka Spahbod ]

Wildfire Games Random Map Designer, Low-level Programmer
Contact me: myops37@yahoo.com


Support Wildfire Games!

#9 FeXoR

FeXoR

    Centurio

  • Community Members
  • PipPipPipPipPip
  • 938 posts

Posted 01 March 2012 - 10:51 AM

THX for the replies!

I would mix it up with patches of Oaks, Carobs, and European Beech trees, even some pines.



I'm on it

Also, there is a problem with the water plane being too high. Lower the water plane so it doesn't stick above ground.



Yes, I noticed, can't build there...
How do I do it?


There is a "trick" that can increase the performance. Add some cliffs in the forest heavy areas(...)


Yep, sounds good to me.

(...)and fill the borders with trees.



If you mean the borders of the cliff I agree if at a reachable position.

If you mean the map border I disagree. They are unreachable and will make gatherers pile up on the map border. That's a real issue IMO. unreachable resources should be marked with a flag like "interactable = false" or so so that no AI player intends to gather those resources.

If the pathfinding routine would have a reply like "yep, I sen you near there, but this destination is unreachable" it would be even better.


Increase the distance between trees(...)



Yes, there's a varable "density" that can be reduced. But I don't know how many tiles distance between trees a unit needs to pass through. And if units can at least walk int the forest a bit, pathfindingroutine will go mad (I'm quite sure about that)

(...)and don't add them to the top of the hills. Players won't be able to see the top of the cliffs and thus do not notice that there isn't any forest.



Yep.


I can't do much today, but tomorrow I will go for it!


  • 0

#10 FeXoR

FeXoR

    Centurio

  • Community Members
  • PipPipPipPipPip
  • 938 posts

Posted 01 March 2012 - 11:35 AM

My .json file:

{
	"settings" : {
		"Name" : "Deep forest v0.3",
		"Script" : "deep_forest_v0.3.js",
		"Description" : "The early snapshot of a deep forest map. Siege weapons may have problems to pass...",
		"BaseTerrain" : ["grass b soft dirt 50", "grass1", "grass1_spring", "grass_field", "grass_moss"],
		"BaseHeight" : 0,
		"seaLevel" : -5,
		"CircularMap" : true,
		"XXXXXX" : "Optionally define other things here, like we would for a scenario"
	}
}

But the roads are still under water...
EDIT5: Using the alpha 8.


EDIT: In library.js I see this:


const SEA_LEVEL = 20.0;

EDIT2: I added:


setWaterHeight(-5);
g_Environment.Water.WaterBody.Height = -5.0;

to the .sj file but still the same.

EDIT3:

log("g_Environment.Water.WaterBody.Height = " + g_Environment.Water.WaterBody.Height);

returns "g_Environment.Water.WaterBody.Height = -5".

EDIT4: But in the function "ExportMap" (used at the end of my script like usual) in "mapgen.js" I read:


g_Environment.Water.WaterBody.Height = SEA_LEVEL - 0.1;

and

log("SEA_LEVEL = " + SEA_LEVEL);

returns "SEA_LEVEL = 20"...

Edited by FeXoR, 01 March 2012 - 12:20 PM.

  • 0

#11 FeXoR

FeXoR

    Centurio

  • Community Members
  • PipPipPipPipPip
  • 938 posts

Posted 02 March 2012 - 05:01 PM

After a rough night I got further...

The story about that night can be found here.


The outcome is this:


Attached File  deep_forest_v0.3.zip   5.81KB   79 downloads

Bugs:
- Resources are not really implemented at all (The resources at start position are more artefacts of the previous version then inclusions of this map)
- Didn't find a way to lower the water level, so I raised all tiles - one by one - by one (Sounds strange but it's correct, I guess).
EDIT: Now I know, THX howlingflute!

Issues:
- Still lags on big maps due to the number of entities.
- Takes a bit long to generate due to some self-written functions (they are not necessarily bad but can be made faster)
- Map code has to be tidied up!
NOTE: I got no 'out of memory' problems but I only made 'normal' sized maps (All maps lag on my labtop when bigger then 'medium')

Poor design/things to add or comment:
- There are too many trees in somehow unused map areas near the map border that only causes laag. Cliffs or Lakes should be added there. (Spahbod's suggestion)
- Map border is not designed at all, cliffs/lakes/terrain should be added (I wanted to ensure no chopable tree or other interactive thing is unreachable for units because it causes lags caused by AI, unit AI and/or pathfinding, gatherers pile up there) [cause, cause, cause x)]
- To many/broad roads. With many players they will nearly fill the area between start positions. Should be somehow scaled with number of players.
- Outer roads should be dragged to the border to enlarge the playable map area. 1 of the 2 roads between 2 given players should follow a 'circumventing' not a 'straight' path.
- Roads are to straight IMO. They are generated with a type of 'directed random walk'. If I raise the possible angle the next step directs too much, they might never reach there destination. On bigger maps they might stop somewhere on the map because steps are caped at 1000. (Further tests needed)
- A general hight map should be added. I would like nice, smooth hills. Raising the terrain in the map center and lowering it at the map border would suggest lakes at the border rather then hills/cliffs, but we will see...
- The forest's floor is to dense.
- The forest floor is to uniform. Some sand/dirt should be added.
- A 'forest border' should be added with bushes and longer grass surrounding the forests.
- The forest hight should be raised in a wider radius. Will be implemented with the 'forest border'.
- Terrain textures has to be chosen more wisely. I like the 'mud_slide_2' texture for road borders and bases (looks like dung ^^) but it occurs to often. Single textures of the same type tend to look squared. Have to finetune textures and perhaps rather place them on small areas then single tiles. Available textures are awesome though, great work!
- Player's start positions should be randomized more, especially the angle. Increase the angle offset will do IMO but an added absolute radius offset scaled with the squared map radius could help too (tuned for 'giant' maps which I can't test though...)


And some screenshots:

deep_forest_v0.3-tiny-2_players1600.jpg deep_forest_v0.3-small-3_players1600.jpg deep_forest_v0.3-medium-4_players1600.jpg

deep_forest_v0.3-normal-5_players1600.jpg deep_forest_v0.3-large-6_players1600.jpg





Edited by FeXoR, 04 March 2012 - 08:14 AM.

  • 0

#12 howlingflute

howlingflute

    Discens

  • Community Members
  • Pip
  • 59 posts

Posted 02 March 2012 - 05:30 PM

Looks like progress. In the future to set the base height of the map it is in the .json file. Just change the "BaseHeight": to a positive value. A height of 0 is the location of where water is, so just making the base height greater than 0 will make the water level below the map.
  • 0

#13 FeXoR

FeXoR

    Centurio

  • Community Members
  • PipPipPipPipPip
  • 938 posts

Posted 02 March 2012 - 05:43 PM

You are right!

I did try that but didn't restart atlas.
The .json file does not seam to be reloaded when re-generating the map.


THX!

Edited by FeXoR, 02 March 2012 - 05:45 PM.

  • 0

#14 MishFTW

MishFTW

    Primus Pilus

  • Web Development Team
  • 1,920 posts

Posted 03 March 2012 - 02:01 AM

Great job (y)
Finally, I can enjoy this without the app crashing!
  • 0
Mish [Adarash Mishra]
Wildfire Games Webmaster
Email Me | About Me

#15 FeXoR

FeXoR

    Centurio

  • Community Members
  • PipPipPipPipPip
  • 938 posts

Posted 04 March 2012 - 09:15 PM

So, here's the next version, quite playable now though many details still missing.

Feedback welcome.

Attached File  deep_forest_v0.4.zip   8.21KB   73 downloads

deep_forest_v0.4-2players-tiny.jpg deep_forest_v0.4-3players-small.jpg deep_forest_v0.4-4players-medium.jpg deep_forest_v0.4-5players-normal.jpg


deep_forest_v0.4-6players-large.jpg deep_forest_v0.4-7players-very_large.jpg deep_forest_v0.4-8players-giant.jpg

Whow, making screen shot of giant maps takes about 15 min... but I had to try x)





  • 0

#16 Mythos_Ruler

Mythos_Ruler

    Senator

  • WFG Retired
  • 14,965 posts

Posted 05 March 2012 - 01:41 AM

Hmmm... it generates a map, but with no forests. Bug or feature? ;)
  • 0

#17 FeXoR

FeXoR

    Centurio

  • Community Members
  • PipPipPipPipPip
  • 938 posts

Posted 05 March 2012 - 07:18 AM

Hmmm... it generates a map, but with no forests. Bug or feature? ;)

Huh??? :eek:
I'll test the download today, didn't check it...
EDIT: Yes, U'r right somehow, it's a feature :LOL:


Adding some screenshots of what happened to you, I think:

On tiny maps:

deep_forest_v0.4-3players-tiny.jpg deep_forest_v0.4-4players-tiny.jpg deep_forest_v0.4-5players-tiny.jpg deep_forest_v0.4-6players-tiny.jpg


If you have more then 3 players on a tiny map, the map will be quite empty.

Similar with small maps and more then 5 players.

In addition to that 'expansion' metal (normally outside the start locations) is very near to each other when you have many players on small maps.

Should scale the path's more with map size and perhaps the base size.

EDIT: Scaled the maximum tree density with the map size for future versions...






Edited by FeXoR, 05 March 2012 - 08:14 AM.

  • 0

#18 Mythos_Ruler

Mythos_Ruler

    Senator

  • WFG Retired
  • 14,965 posts

Posted 05 March 2012 - 08:06 AM

Actually, I am getting this:

Attached Thumbnails

  • no forest.jpg

  • 0

#19 FeXoR

FeXoR

    Centurio

  • Community Members
  • PipPipPipPipPip
  • 938 posts

Posted 05 March 2012 - 08:17 AM

Actually, I am getting this:

This is strange!


I use alpha 8, perhaps that's it...

All functions I used are inside the map, perhaps some rmgen libs changed...

I have no clue, I generated the screenshots of my previous post with the downloaded version and didn't change any files...

EDIT: U'r screenshot shows No hight mapping(hills/lakes/paths), no texture (base, path, woods, lakes) and no entities but the start entities and start resources...

Checking the 2 functions that didn't seam to run at all...



Edited by FeXoR, 05 March 2012 - 08:23 AM.

  • 0

#20 FeXoR

FeXoR

    Centurio

  • Community Members
  • PipPipPipPipPip
  • 938 posts

Posted 05 March 2012 - 08:36 AM

Could you please check your mainlog for warns/errors?

Would help a lot if there are some...

EDIT: Perhaps I use the same function names as used in the new rmgen libs (and so override them?) and other rmgen functions that are using the overwritten ones act strange.

Edited by FeXoR, 05 March 2012 - 11:16 AM.

  • 0