Jump to content

Forest Nothing - Random Map


Recommended Posts

This is my first attempt at making a map for 0 A.D. To start simple I tried to replicate a simple but classic mod map in Age of Empires II, Forest Nothing:

Here is a screenshot:

map.thumb.jpg.388b378b44326a5bf4d04758f0f04e17.jpg

Files:

forest_nothing.json

forest_nothing.js

This is a work in progress, there's still some problems with the map:

  • Only works for Tiny, Small and Medium maps, more than that map generation crashes (out of memory);
  • Even Tiny takes ages to generate the map, I guess there is some better way of saying "just put trees everywhere" which I don't know about;
  • There is a little space on the edges of the map where people can walk, you were not supposed to be able to reach your enemies without cutting lots of wood;
  • Beginning of game is extremely slow: the AI sends units to cut trees, but the massive number of them makes pathfinding extremely slow (I guess);
  • AI does surprisingly well, but will need some tweaks. Since it doesn't "know" that it needs to make some space their choices are not optimal. They start to have space to build after more than 1 hour. Also, their units often get stuck among the trees;
  • Market prices lower limit should be raised a bit, because this map is all about buying stuff. You only have wood;
  • If players send many units to cut wood at once it lags the game a lot because they will all do a lot of pathfinding to find the nearest tree (since you cannot put 20 units cutting in the same tree).

Still, the map is playable. It took me around 2 hours to reach the AI in the tiny map, haha. Will be fun with other human players. There's something cosy about being in a village completely surrounded by trees and protected from your enemies.

  • Like 2
Link to comment
Share on other sites

29 minutes ago, coworotel said:

I guess there is some better way of saying "just put trees everywhere" which I don't know about

I suppose you can paint your pForest on the whole map using a createArea call.

createArea( new MapBoundsPlacer(), new TerrainPainter(pForest), avoidClasses(clPlayer, 0));

or you can just loop over the whole map and place a tree on each tile using placeEntityPassable().

Both these methods would probably be faster than using createForest()/createStragglerTrees() with insane parameters.

Edited by Guest
Link to comment
Share on other sites

The TerrainPainter choses a random array element each tile, so you can change the ratio of trees to free space by adding or removing items.

The nomad call should be prior to the createArea call, so players dont end up in trees. (The grass and dirt patches calls are ineffective because the terrain call overwrites it.)

  • Like 1
Link to comment
Share on other sites

  • 4 years later...

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