This would make a central lake using the bayou water terrain(of course any other terrain could be substituted):
int smalllakeID=rmCreateArea("small lake");
rmSetAreaLocation(smalllakeID, 0.5, 0.5);
rmSetAreaWaterType(smalllakeID, "bayou");
rmSetAreaSize(smalllakeID, rmAreaTilesToFraction(1000), rmAreaTilesToFraction(1500));
rmSetAreaMinBlobs(smalllakeID, 3);
rmSetAreaMaxBlobs(smalllakeID, 8);
rmSetAreaMinBlobDistance(smalllakeID, 24.0);
rmSetAreaMaxBlobDistance(smalllakeID, 36.0);
rmSetAreaCoherence(smalllakeID, rmRandFloat(0.2,0.3));
rmAddAreaToClass(smalllakeID, lakeClass);
rmAddAreaConstraint(smalllakeID, playerConstraint);
rmAddAreaConstraint(smalllakeID, avoidTradeRoute);
rmAddAreaConstraint(smalllakeID, avoidSocket);
rmSetAreaWarnFailure(smalllakeID, false);
rmBuildArea(smalllakeID);
This would add 6 other pretty small ponds per player that avoid the central lake and each other:
for (i=0;
{
int smallPondID=rmCreateArea("small pond"+i);
rmSetAreaSize(smallPondID, rmAreaTilesToFraction(180), rmAreaTilesToFraction(240));
rmSetAreaWaterType(smallPondID, "bayou");
rmSetAreaMinBlobs(smallPondID, 2);
rmSetAreaMaxBlobs(smallPondID, 4);
rmSetAreaMinBlobDistance(smallPondID, 6.0);
rmSetAreaMaxBlobDistance(smallPondID, 12.0);
rmAddAreaToClass(smallPondID, lakeClass);
rmAddAreaConstraint(smallPondID, avoidLakes);
rmAddAreaConstraint(smallPondID, avoidNativesShort);
rmAddAreaConstraint(smallPondID, playerConstraint);
rmAddAreaConstraint(smallPondID, avoidTradeRoute);
rmAddAreaConstraint(smallPondID, avoidSocket);
rmAddAreaConstraint(smallPondID, avoidAll);
rmSetAreaCoherence(smallPondID, rmRandFloat(0.2,0.6));
rmSetAreaWarnFailure(smallPondID, false);
rmBuildArea(smallPondID);
}Note you would need constraint statements defining each of the area constraints used, like these:
int playerConstraint=rmCreateClassDistanceConstraint("stay away from players", classPlayer, 45.0);
int avoidLakes=rmCreateClassDistanceConstraint("stuff vs.lakes", rmClassID("lake"), 12.0);
int avoidAll=rmCreateTypeDistanceConstraint("avoid all", "all", 6.0);
int avoidTradeRoute = rmCreateTradeRouteDistanceConstraint("trade route", 8.0);
int avoidSocket=rmCreateClassDistanceConstraint("avoid sockets", rmClassID("socketClass"), 12.0);
int avoidNativesShort=rmCreateClassDistanceConstraint("stuff avoids natives shorter", rmClassID("natives"), 15.0);
And you would need these definitions of the lakeClass, sockets, natives and players:
int lakeClass=rmDefineClass("lake");
rmDefineClass("socketClass");
int classPlayer=rmDefineClass("player");
rmDefineClass("natives");
All of the above definitions would have to come before the lakes can be made, and the class definitions should come before the constraint statements.
These could be adjusted in size, coherence, number of blobs etc to give different appearances. Any questions on this?
[This message has been edited by RF_Gandalf (edited 04-27-2006 @ 10:17 AM).]