Jump to content

deep_forest_v0.1 Random Map Generator


FeXoR
 Share

Recommended Posts

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
Link to comment
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!

Link to comment
Share on other sites

  • 2 weeks later...

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
Link to comment
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
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

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
Link to comment
Share on other sites

  • 4 weeks later...
  • 3 months later...

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...

Link to comment
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
Link to comment
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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...