Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Looking for an Alamaze Map
#29
Smile 
(03-21-2013, 08:54 PM)unclemike Wrote: Second priority should be given to the randomized hex map which can make each game different from each other. It's not difficult to do this coding-wise and it would make the game more enjoyable.

Lord Diamon Wrote:I don't know how easy it is to code a random map. Do you have any coding experience? If so, let Rick know! The hex format would be more like Fall of Rome than Forgotten Realms. Of course, Rick designed both games..

Ah...its easy to write that code. The attached java file took me like 15 mins to do. Its rather crude but it does generate a random map of any size. And you can always manually fine tune the map afterwards and assign terrain as you like (if you want a larger forest area or such).

After running the code a few more times, seems that Java's random number generator doesn't work that well with limited ranges. So to have more water areas show up (water was last in the list for Java to select), I would make the following change:

From:
int terrainType = rand.nextInt(5)+1;

To:
int terrainType = Math.round( rand.nextInt(60)/10);
terrainType++;

It provides the same range but allows Java runtime virutual machine to give a better spread of terrain types. Doh !


Attached Files
.zip   Map.zip (Size: 1.38 KB / Downloads: 7)
Reply


Messages In This Thread
Looking for an Alamaze Map - by Kalrex - 03-10-2013, 05:42 PM
RE: Looking for an Alamaze Map - by Ry Vor - 03-10-2013, 07:14 PM
RE: Looking for an Alamaze Map - by Lord Diamond - 03-10-2013, 10:05 PM
RE: Looking for an Alamaze Map - by Ry Vor - 03-10-2013, 11:22 PM
RE: Looking for an Alamaze Map - by unclemike - 03-21-2013, 09:21 AM
RE: Looking for an Alamaze Map - by Kalrex - 03-11-2013, 02:17 AM
RE: Looking for an Alamaze Map - by Ry Vor - 03-11-2013, 10:22 AM
RE: Looking for an Alamaze Map - by Lord Diamond - 03-11-2013, 10:50 AM
RE: Looking for an Alamaze Map - by Lucky Tiger - 03-11-2013, 11:30 AM
RE: Looking for an Alamaze Map - by Ry Vor - 03-21-2013, 03:53 PM
RE: Looking for an Alamaze Map - by unclemike - 03-21-2013, 08:54 PM
RE: Looking for an Alamaze Map - by Lord Diamond - 03-21-2013, 09:13 PM
RE: Looking for an Alamaze Map - by unclemike - 03-22-2013, 11:21 AM
RE: Looking for an Alamaze Map - by Sancus - 03-21-2013, 09:15 PM
RE: Looking for an Alamaze Map - by Ry Vor - 03-21-2013, 09:42 PM
RE: Looking for an Alamaze Map - by Lord Diamond - 03-21-2013, 09:47 PM
RE: Looking for an Alamaze Map - by Kalrex - 03-11-2013, 12:20 PM
RE: Looking for an Alamaze Map - by Lucky Tiger - 03-11-2013, 12:29 PM
RE: Looking for an Alamaze Map - by Wulfgar - 03-11-2013, 02:52 PM
RE: Looking for an Alamaze Map - by Flashman - 03-11-2013, 09:29 PM
RE: Looking for an Alamaze Map - by Ry Vor - 03-11-2013, 11:52 PM
RE: Looking for an Alamaze Map - by Kalrex - 03-12-2013, 05:06 AM
RE: Looking for an Alamaze Map - by Lucky Tiger - 03-21-2013, 04:15 PM
RE: Looking for an Alamaze Map - by Lord Diamond - 03-21-2013, 04:18 PM
RE: Looking for an Alamaze Map - by Lucky Tiger - 03-21-2013, 04:24 PM
RE: Looking for an Alamaze Map - by Ry Vor - 03-21-2013, 04:59 PM
RE: Looking for an Alamaze Map - by Lord Diamond - 03-21-2013, 05:36 PM
RE: Looking for an Alamaze Map - by Lord Diamond - 03-21-2013, 10:11 PM
RE: Looking for an Alamaze Map - by wfrankenhoff - 03-22-2013, 12:51 AM
RE: Looking for an Alamaze Map - by Lord Diamond - 03-22-2013, 12:42 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)