Are you, in fact, a pregnant lady who lives in the apartment next door to Superdeath's parents? - Commodore

Create an account  

 
Civ 6 Map Scripts

Still sad that Firaxis doesn't just release their map-editor to the world, they clearly have one, or they wouldn't have been able to make all those scenario maps. Maybe they're afraid (and quite rightly so) that some modder will steal the thunder from their next expansions?
Reply

Well duh. Once content is considered a revenue stream it makes no sense to give players control of that for free. At most a subscription model to hte content creating software...look at Office 365.

So a functional map editor? Why give that away? SDK? LOL NAH. At best the map editor is released with an expansion for another $30, hell probably only released the map editor a year before Civ 7 is gold.
Current games (All): RtR: PB80 Civ 6: PBEM23

Ended games (Selection): BTS games: PB1, PB3, PBEM2, PBEM4, PBEM5B, PBEM50. RB mod games: PB5, PB15, PB27, PB37, PB42, PB46, PB71. FFH games: PBEMVII, PBEMXII. Civ 6:  PBEM22 Games ded lurked: PB18
Reply

Lots of software tools are created for internal company use but with lots of bugs and rough edges that aren't worth cleaning up. Firaxis may have a map editor but that doesn't mean it's suitable for public release.
Reply

I've been experimenting further but I've run into a snag. I'm not sure if I'm just mis-understanding Lua or if I have a more fundamental mis-understanding of how variables work. Referencing the following snippet of code:

   

Nothing in the above code as far as I can tell should make any change to the plotTypes array, yet the code as written DOES turn many of the land tiles into water. I'm thinking I must have some fundamental mis-understanding of how variables work because line 296 which I have highlighted should be changing values in the plotTypesTemp array, NOT plotTypes. If I comment out this line only, then the plotTypes array remains un-changed. Lines 288 and 306 were commented out for troubleshooting so that I was not manipulating the plotTypes array in any way within this section of code.

The plotTypes array coming into line 286 contains an ellipse of land tiles surrounded by all water tiles. I want to preserve the original plotTypes while looping through all the current plotTypes lines 289-305 (this way no changes I make on the current pass affect the outcome of adjacent tiles on this pass). In order to preserve this array I make an identical temporary copy of this array in line 286 upon which to operate. I don't understand why line 296 is changing the plotTypes array (unless I am mis-understanding how my variable declaration works on line 286).

As another alternative I could define an empty array, append the i values to that array on line 296, and then on line 306 insert a loop through all indexes found and at that time change the plotTypes[i]. I just don't understand why the above doesn't work.
Reply

In Lua, table variables are passed by reference.

Quote:There are eight basic types in Lua: nil, boolean, number, string, function, userdata, thread, and table. ....

Tables, functions, threads, and (full) userdata values are objects: variables do not actually contain these values, only references to them. Assignment, parameter passing, and function returns always manipulate references to such values; these operations do not imply any kind of copy.

There do appear to be various possible workarounds to achieve what you are looking for though.
Reply

(October 19th, 2017, 07:29)BRickAstley Wrote: In Lua, table variables are passed by reference.

Ah, that explains it. Rather than trying one of the suggestions to create a temporary copy of the table, it will be easier just to make a list of the i values which meet all the tests and then update plotTypes at the end. In fact, now that I'm thinking on this track I remember seeing this approach done in one of the functions in the TerrainGenerator.lua file. Not on my civ computer now though so won't be able to test until tonight.
Reply

Here's a doughnut with cross-like hole in the middle ... screenshots from two different maps rolled:
   

   
The doughnut can be made with island in the middle:
   
Reply

Some improvements on the doughnut (I went back and spoiler tagged the photos from the previous post). There are a few more screenshots from different rolls inside the spoilers below. All of these were rolled with the same settings.

   

   

   

   

   
Reply

Using same methodology as the doughnut script above, here is an improved snaky continent. Now rather using a template as in the initial post, the coastline is entirely shaped by repeatedly eroding and then adding to the coast. This gives much more randomized coastline but with tweaking some of the variables still keeps roughly the same up/down pattern with natural looking islands. All the following maps were generated using the same settings:

   

   

   

   

   
Reply

Cornflakes, I just want to reiterate love these map scripts. I think there would be great for MP games, making positioning roughly balanced while not uniform.

What's the Continents divide looking like?
Reply



Forum Jump: