Fantasy

resorcerer

Chieftain
Joined
Apr 3, 2013
Messages
85
Made some changes to this script that I wrote about a year ago, so I'm posting it here again. It's kind of a swiss army knife of a map script, in that it has many (too many?) options. But the idea is a map that does not attempt realism in any way. (But, er, it does have an option to turn on a basic latitude-based climate. See the second and fourth image below.) Snow next to desert, etc. Terrain is organized into regions, and those regions are sometimes seperated by mountain ranges. Can generate both a wrapping map (Scope: World or Realistic World) and a non-wrapping map (Scope: Realm or Realistic Realm).

download civ5mod

download lua

steam workshop

github repo


default settings


Scope: Realistic World


Scope: Realm
Ocean Size: Lots of Land
Continent Size: Pangaea
Coast Width: Very Wide
World Age: 2 Billion Years
Mountain Clumpiness: Epic Clumps
Rainfall: Wet


Scope: Realistic Realm
Ocean Size: Mostly Land
Continent Size: Pangaea
Coast Width: Wide
World Age: 3 Billion Years


Ocean Size: Earthsea
Continent Size: Tiny
Island Amount: Lots
Temperature: Hot

Spoiler :

Rainfall: Random
Temperature: Random


Rainfall: Random
Temperature: Random


default settings
 
with the latest update i made use of Map.Rand, with the hope that multiplayer would work properly. if someone plays a multiplayer game on this map, let me know how it went?
 
Does anyone know if there's a way to set WrapX when GetMapInitData doesn't get called? In WorldBuilder, it never does. Which means that even the scripts that come with the game generate coasts (for example) as if the land wrapped to the other side of the map. I've gotten around this by using all my own functions for finding adjacent tiles, but it would be nice, for simplicity's sake, to be able to use the native functions, and to be able to test in WorldBuilder instead of the game.
 
Can I include this map script in my upcoming fantasy mod? I used a modified version of Perfect World 3 before, but this one is better for my purposes, with support of "flat" maps with cold climate in the north and warm in the south (or vice versa), and many other useful settings. The only thing I'm going to change are the default values of some of the options. Of course, full credit will be given to you.

(I'm sorry, but I don't know the answer to your question.)

Edit: One problem I noticed is that the realistic realm setting, even with hot climate, often produces maps where there are lots of tundra - is there a way to avoid it? (A bit of tundra is OK, but not half of the map.)
 
Does anyone know if there's a way to set WrapX when GetMapInitData doesn't get called?
Not without a DLL mod :(

Edit: And I'm not even sure that would help as a) WorldBuilder is not part of the DLL we can mod and b) I suspect that even if it was, the ability to set WrapX from Lua would occur too late to stop WB doing what it does anyway
 
PawelS, go for it. As for preventing giant swaths of Tundra in Realistic Realm maps, look in the precalcFantasyLatitude() function.
 
I haven't tested it, but here's a replacement precalcFantasyLatitude function
Code:
local function precalcFantasyLatitude()
	local boundLow, boundHigh = -10, 90
	if temperature == 1 then
		boundLow, boundHigh = 10, 90
	elseif temperature == 3 then
		boundLow, boundHigh = -15, 65
	end
	local boundDiff = boundHigh - boundLow
	local minimumDiff = 40
	realmStartLatitude = mRandom(boundLow, boundHigh - minimumDiff)
	local endLatitude = mRandom(realmStartLatitude + minimumDiff, boundHigh)
	local hemisphere = Map.Rand(2, "is the realm in the south or north hemisphere")
	if hemisphere == 0 then
		local oldEndLat = endLatitude+0
		endLatitude = -realmStartLatitude
		realmStartLatitude = -oldEndLat
	end
	realmMultLatitude = (endLatitude - realmStartLatitude) / iH
	EchoDebug(realmStartLatitude, endLatitude, realmMultLatitude)
end
 
PawelS, go for it. As for preventing giant swaths of Tundra in Realistic Realm maps, look in the precalcFantasyLatitude() function.

Thanks for the hint, despite what I wrote earlier I'm going to make a few more changes in the script if you don't have anything against it, for example making the realm maps larger, and increasing the number of atolls and oases. Your code is much more clearly written than PerfectWorld, so it's easy to make changes to achieve the effects I desire.

It will be called "Fantasy CoA edition" or something like that. (CoA is my mod)
 
I'm working on a rewrite that has strict control over the number of oceans (i.e., how many regions seperated by Astronomy research). it makes use of voronoi, which means the landforms scale consistently (the old fantasy algorithm tended to have different shapes for different map sizes, because it drew landforms one hex at a time).

fantasticalwip-2.jpg

https://github.com/zoggop/Civ5FantasticalMapScript
 
Does anyone know how to get Plot:SetRouteType(iRouteID) to work? (In other words, how to place roads on a map in a map script.) I'm assuming that iRouteID is just RouteType (which is 0 for roads), but maybe I'm wrong. I've tried using the function in all the usual map script functions, GeneratePlotTypes(), GenerateTerrain(), AddFeatures(), AddRivers(), AddLakes(), to no avail.
 
I have a feeling that that particular function may not be included into MapGenerator.lua nor any of it's subordinates. That would make it entirely unavailable (and you should get an error in the log claiming undeclared blah blah or something along those lines if this is the case).

Edit: If this is the case, there may be a way to include the required file(s) to expose it during Map Generation though.
 
I don't get any errors, which is strange because you're right, I know MapGenerator.lua doesn't contain it. The only files that use it are in WorldView.lua, in UI.

In other news, the rewrite is pretty much ready for release:
fantastical-dev-2014-9-4.jpg
 
I actually find that I much prefer the map generation using this than your map script. It has more options and it's easier to tweak to the types of maps I like. However, I keep getting insane numbers of barbarians spawn. It's like playing "raging barbarians" on steroids except I didn't select it. Is this by design or some crazy bug?
 
That's funny. I guess it's good this script hasn't gone to waste. Neither script does anything to barbarians. My only guess is that you're getting more landmass than the vanilla scripts, and therefore more opportunities for barbarians?
 
Top Bottom