Sign in to follow this  
Followers 0
FeXoR

deep_forest_v0.1 Random Map Generator

42 posts in this topic

Hui, I didn't read that before but 'deep forest' looks very similar to 'Ardennes Forest' in the 'MAPS AND BIOME GUIDE'.

Should really have read that x)

Didn't play AoK.

Didn't meant to steel someones ideas or offense anybody by naming my map 'deep forest' and not ' Ardennes Forest' (which is already taken btw) or anything else.

Edited by FeXoR

Share this post


Link to post
Share on other sites

Hui, I didn't read that before but 'deep forest' looks very similar to 'Ardennes Forest' in the 'MAPS AND BIOME GUIDE'.

Should really have read that x)

Didn't play AoK.

Didn't meant to steel someones ideas or offense anybody by naming my map 'deep forest' and not ' Ardennes Forest' (which is already taken btw) or anything else.

I think your map matches the description of 'Ardennes Forest' in the guide much more than mine. :)

It is well done!

Share this post


Link to post
Share on other sites

THX, I will get to work on it again tomorrow. EDIT: Monday :blush: Edit: Well, soon :lookaround:

Guess I will more or less finalize it then.

Edited by FeXoR

Share this post


Link to post
Share on other sites

The map is not working any more due to changes in the rmgen libraries.

I'm working on it...

Share this post


Link to post
Share on other sites

Here is a total rewrite.

Not finished but 1/4 of the lines of the previous version ;)

It may happen (though it only happened to me once) that a path runs out of the map and causes an error.

deep_forest2012-3-20.zip

I'm still not happy with the terrain textures. Any suggestions welcome.

If you play with many players on a small map everything will be covered with paths. But 3 players on a tiny map is ok so it's not that bad.

On large or greater maps the woods is still thin to avoid out of memory errors.

Ideas and criticism welcome.

Edit: Start position and starting resource placement not randomized yet.

Deer, sheep and chicken to be added.

Edited by FeXoR

Share this post


Link to post
Share on other sites

Here's a version with randomized stuff, some templates changed to temperate and lots of animals to hunt.

I don't like wolfs so I didn't add them yet. I will when they don't destroy buildings or an acoustic alarm with event position is added.

NOTE: This is for the SVN version and will not work properly in alpha 9!

deep_forest2012-3-21.zip

Edited by FeXoR

Share this post


Link to post
Share on other sites

Here's the next version.

Get the rmgen script 'library.js' from the SVN repository for Alpha 9 (actual version in the download).

Here the overview

post-14196-0-13788500-1332509219_thumb.j post-14196-0-42118600-1332509231_thumb.j post-14196-0-34964200-1332509243_thumb.j

or take a closer look

post-14196-0-15896800-1332511945_thumb.j post-14196-0-24017500-1332511970_thumb.j post-14196-0-89592700-1332511987_thumb.j

post-14196-0-91580900-1332512015_thumb.j post-14196-0-85110400-1332512037_thumb.j post-14196-0-00661800-1332512048_thumb.j

And here's the download: deep_forest2012-3-23.zip 

Share this post


Link to post
Share on other sites

To keep compatible with the svn version deep_forest2012-4-6.zip

EDIT: A new version was added to the svn, thx quantumstate!

Edited by FeXoR

Share this post


Link to post
Share on other sites

Here's a new version fixing the out of memory errors on large+ maps with only a few players:

deep_forest2012-7-4.zip

Here's a table of the entities per map depending on map size and the number of players:


size width tiles entities with: average tree density
8 players 1 player 8 players 1 player
tiny 128 16384 430 1827 ~0,026 ~0,112
small 192 36864 1365 5519 ~0,037 ~0,150
medium 256 65536 4862 8604 ~0,074 ~0,131
normal 320 102400 7010 9029 ~0,068 ~0,088
large 384 147456 8295 9439 ~0,056 ~0,064
very l. 448 200704 9213 9777 ~0,046 ~0,049
giant 512 262144 9916 9866 ~0,038 ~0,038

Edited by FeXoR

Share this post


Link to post
Share on other sites

Works smoothly with Alpha 10. And not as laggy anymore.

Share this post


Link to post
Share on other sites

Small "concern": the trees are not centered correctly, it would appear there is a strip around the bottom left "side" of the map where there are no trees

(the image comes from the AI terrain detection I'm working on, you can see the white strip in the bottom left)

post-9128-0-80877600-1351849786.png

Share this post


Link to post
Share on other sites

Small "concern": the trees are not centered correctly, it would appear there is a strip around the bottom left "side" of the map where there are no trees

(the image comes from the AI terrain detection I'm working on, you can see the white strip in the bottom left)

post-9128-0-80877600-1351849786.png

Nice! I think I know why: I leave a border free of trees to avoid trees are unreachable. I plant all trees in coordinates with integer x/y values. I check the distance to the border with (x*x + y*y)**(1/2). I noticed that a map has NOT getMapSize() tiles but getMapSize() + 1.

So all the trees would have to be placed (currentX - 0.5, currentY - 0.5).

I will check this...

Share this post


Link to post
Share on other sites

The reason is that the trees are placed on the center of the tile (so tile coordinate + 0.5 in x and y direction).

Fixed the corresponding check and added a comment.

Now it should be alright.

Here are the files including the SVN .diff (only one line in the .js changed): http://fexor.dyndns....rest/2012-11-4/

And a screenshot that seams to indicate it works: http://fexor.dyndns....st2012-11-4.jpg

deep_forest2012-11-4.jpg

Edited by FeXoR

Share this post


Link to post
Share on other sites

Did we ever get that system implemented that no longer placed resources at the map edge? because the AI still seem to crowd around a tree that doesn't exist (or can't be seen).

Share this post


Link to post
Share on other sites

More of an AI issue than a RM placement issue. With my latest stuffs for Aegis Bot, I believe I could fix that problem.

FeXoR: I'll check and commit when i'm over with my water commit.

Share this post


Link to post
Share on other sites

More of an AI issue than a RM placement issue. With my latest stuffs for Aegis Bot, I believe I could fix that problem.

FeXoR: I'll check and commit when i'm over with my water commit.

Thx.

Glad someone from the AI side said it first ^^. I was about to say the same thing. Still I can (even if only until AIs manage it) write a function that removes all entities outside the playable map area (though this would include all actors as well). That function could be added to any problematic map (but is not called by lats say exportMap(), so optional).

The functions would overlap in their need with removing trees when walls are placed anyway.

Will AIs be able to avoid trying to chop trees surrounded by other trees or inside a building, too?

EDIT: Should be this code (not tested yet, may have the shift like in deep_forest.js):


function removeAllObjectsOutsideMap()
{
var mapRadius = g_Map.size / 2;
// Remove terrain objects
for (var x = 0; x < g_map.terrainObjects.length; x++)
{
for (var y = 0; y < g_map.terrainObjects[x].length; y++)
{
if (isCircularMap())
{
var actualRadius = Math.pow((x - mapRadius) * (x - mapRadius) + (y - mapRadius) * (y - mapRadius), 1/2);
if (actualRadius > g_Map.size)
g_map.terrainObjects[x][y] = [];
}
else if (x > g_Map.size + 1 || y > g_Map.size + 1)
g_map.terrainObjects[x][y] = [];
}
}
// Remove all other objects
for (var i = 0; i < g_map.objects.length; i++)
{
var x = g_map.objects[i].position.x;
var y = g_map.objects[i].position.y;
if (isCircularMap())
{
var actualRadius = Math.pow((x - mapRadius) * (x - mapRadius) + (y - mapRadius) * (y - mapRadius), 1/2);
if (actualRadius > g_Map.size)
g_map.objects.splice(i, i);
}
else if (x > g_Map.size + 1 || y > g_Map.size + 1)
g_map.objects.splice(i, i);
}
}

Edited by FeXoR

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0