Jump to content
Sign In to follow this  
Andy80586

Modding to enhance terrain importation

29 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 
I have done some experimenting with the parameters in the Terrain Simulator (which can be reached using Ilive Reader Exemplar Analyzer at simcity_1.dat\other\terrain simulator). The parameters I have tested with this include SeaLevel, ImageImportScaleFactor, and the ones related to initial erosion, but more needs to be done with the erosion ones. There is a chance that there is something hardcoded blocking me from modding the erosion as I have not been having any luck in doing so. Despite the erosion, what I managed to create by importing terrains IMO looked pretty cool and worthy of being posted here, so I have two screenshots below:
 
/idealbb/files/granby55
 
/idealbb/files/granby8
 
The first image has the ImageImportScaleFactor set to 5.56 (the setting closer to what it looks like realistically) and the second image has this parameter set to 8. As you can see, it has a direct correlation (that can also be determined mathematically) with the height of the terrain. I chose to use Gramby, Colorado as an example because of how the mountains contrast with the water. In addition to these, there are two other screenshots that have been made by taking advantage of this mod (one of them by joerg): they are located in a similar thread in the Experiments section that will be kept active for the foreseeable future as long as the people over there have continued questions regarding the now false limitation on terrain heights achieved using grayscale maps. The specific math regarding how to determine sea level and the correct import factor can also be found at the thread located in the experiments section (I will reply to this message posting the exact URL for it but it shouldn't be all that hard to find).
 
I also think that there should be a modification made to the MEX to allow for people to post the .dat plugins containing the correct parameters for their particular region if or when map makers begin taking advantage of this. I have actually known about how this worked since the beginning of the year (do a search for Catalina in the Map Making thread, the .dat file for a long-ago deleted region is in the .zip file) but thought someone would act on it until I saw someone's thread talking about how limited the grayscale importation was.
 
This thread therefore serves the purpose of stating that the limitations on grayscale terrains no longer exist as far as height is concerned, even though more testing needs to be done on the erosion parameters. I am also thinking that the math involved here could be incorporated into some type of program or plugin for a well-established user-friendly program (Datgen for example) that examines the grayscale file and determines what the sea level and scale factor should be implemented based on information typed in by the user.
 
-Andy80586

Share this post


Link to post
Share on other sites
Posted:
Last Online: A long, long time ago... 
 
My fault. I started that topic. Will this mod allow surface water to be defined above 'sea level', and for sea level to remain where it is? And rivers to run downhill?

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    Sea level can be defined at any level you want. All you need to do is figure out what scale factor you want to use (the difference between your highest and lowest points in meters divided by the number of shades of gray in your image), and then determine what grayscale level you want water at. If everything below 30 should be underwater, then multiply your scale factor by 30 or 31 to get your sea level. The sea level for the regions on this thread were 175 for the 5.56 scale factor and 256 for the 8 scale factor (I wanted everything below 32 underwater). This also eliminates the need to select water areas and make them extra dark with a photo editor... the only thing I used a photo editor for was counting the number of colors in the image and determining the range of them.
     
    I made an attempt at factoring in the Colorado River in my images, but it becomes less and less accurate as it flows downstream. This is one thing that actually could be improved with a photo editor, but I wanted to get this posted here, which meant that I had to get a new region made up quickly and import it into SC4 to get a screenshot.
     
    If anyone here wants to experiment further with this, there are some things in which I am unsure of how they work. Erosion is one of them, and I think it is hardcoded, but I would like to see this confirmed.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    woops..wrong thread. Firebird tabs can be confusing. I'll type up the response for this now.>>>>>

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    So let me get this straight...its possible to increase the height/gradient of mountains in the importation process?

    If so, I've been wanting that for a long, long, time (I was told it was impossible). I have some maps on the MEX -and some that I haven't even bothered to upload- that could really benefit from such a mod.

    Would you be willing to make it? I've played around with the Ilive reader, and I'm not that great with it. But I have a lot of suggestions for a terrain importation mod.

    The values they shipped with the game are all about keeping things realistic. A fantasy terrain mod (or set, like the watercolour mods) could *really* spice up the game. Especially if other things like beachcolour, and snowcapps were set as default.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    For all those interested thanks to this mod ive got 2 things i may be working on now. First is a accurate grand canyon region and second is a seattle/tacoma area with accurate heights.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    Well i just found out a few more things. I just realized the game does an edge reconcile when importing. Also i rendered a grand canyon. It turned out pretty cool really although there are a few things i didnt much like about the render. The heights were amazing. Opening up a city the canyon could hold a wtc in it with room to spare on the top. I tried to get as close to the real scale as possible. I need to render again with auto reconcile off though and one less itteration of the erosion tool also without the dester texture.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    I changed the erosion iterations from 4 to 1 when I made the Granby region, but it seemed to have little effect. I have not tried 0 yet, so that might make a difference, as well as varying the two kinds of erosion (wind and hydraulic).
     
    The problem with this mod is that it is different from other mods in that it requires each person to calculate their individual parameter values based on how I explained it on my last post here and package it into a separate .dat file. The .dat file would end up being different for everybody since the differences in height would vary greatly. In some cases, they might even require a value smaller than 3 (the default scale factor) if the land is flat enough. 
     
    Also, when you are done making the mod for your region, you import it, and you like the final result, the mod must be deleted from the Plugins folder. If the mod is still there and you try to import a region with different parameters, you will realize your error real quickly as your region would resemble Mars' landscape more than it would Earth's.
     
    In other words, map makers need to compute the required values for each parameter and make the .dat files themselves until a program comes along that automatically does this for them, and even then it would require knowing the maximum and minimum elevations as well as where sea level should be located. My programming ability goes about as far as sticking the quadratic formula in a TI-82, so we need someone like DarkMatter or Ilive to make the program.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    Once we get the erosion issues sorted out, or at least when we know whether or not they can be sorted out, I am considering making a tutorial and perhaps posting it on the Omnibus or in the map making forum with the possibility that a moderator might pin it at the top. What do you guys think?

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    Date: 5/5/2004 6:41:21 PM
    Author:

    For all those interested thanks to this mod ive got 2 things i may be working on now. First is a accurate grand canyon region and second is a seattle/tacoma area with accurate heights.
    quote>

    Joerg,
    Have you been able to do the Seattle/Tacoma region? I might have to go back and redo all my ten maps I did on the MEX. If you or Andy are still working on it, maybe a program can be made so all we have to do is put the numbers in automatically.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    Ive acctually not delved into a Seattle Tacomma Region just yet but i can say that i have had a number of very very  successful imports with this new system.
     
    In my personal opinion though this is not something we should give the end user the abiltiy to play with unless a very well thaugth otu program is created for this purpose.
     
    Also andy what do you mean by delete the mod after you import? If you do that then the waterlevel changes in the region you just imported and therefor you are left with a few big problem. I understand that you cant import another region with the same dat but you can really delete dat either.
     
    Also Andy if your still around have you noticed a wierd problem with sealevel? I know in my regions sealevel is about 60-80 meters off of what the scale factor and rgb values indicate it should be.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    No magic program is needed. By modifying Trolca's method, I was able to create maps easily, with excellent mountain scale.



    Here's a rundown:

    In microdem, go display parameter->elevation. Then right click->specify. Make a note of the second number. Input that into the following formula:

    NumberOne == 0-[(NumberTwo*(255-SeaLevel))*(SeaLevel)]

    Right Click->specify, put in NumberOne, leave the second number alone and you're off. If we have one standard terrain-import mod, like the snowcap mod, there is no need for a special. program.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    I said to delete the mod in case the user wanted to import more terrains because each terrain would require a different scale factor and/or sea level. I think I posted the sea level issue on the other thread but forgot to post it here when I found out about this. The problem I could see happening with the sea levels is that every time you switch to a different region, the sea level would be different than what it should be. What would be required is making multiple mods and loading them into plugins every time you wanted to play a particular region, which might get annoying after a while if the player switches in and out of a region quite often.

    I was letting my mind go off into some hypothetical situation where a player might be playing five different regions at once and having to switch mods every time they want to change the region. What Maxis could do is create some type of auto-loader or something in the next expansion (if/when they make it) that could automatically load the mods upon changing the region.

    Sorry for any confusion this might have caused.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Date:6/15/2004 1:33:46 PM
    Author:flamesrock

    No magic program is needed. By modifying Trolca's method, I was able to create maps easily, with excellent mountain scale.

    I think you mean Toroca or my memory is getting really bad.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    Date: 6/29/2004 7:01:26 PM
    Author:


    Date:6/15/2004 1:33:46 PM
    Author:flamesrock

    No magic program is needed. By modifying Trolca's method, I was able to create maps easily, with excellent mountain scale.


    I think you mean Toroca or my memory is getting really bad.

    quote>


    Yes it is Toroca's Method. Haha its funny after a year and a half ya'd think people would get you guys figured out. Anyway, if Andy or Joerg is interested, I took an excel sheet that lets you input the a few numbers and comes out with the scale factor. If you want it let me know. I dont think it would be too big of deal with having to quit simcity to input another dat for another region. As long as it doesnt screw it up by corrupting it, people should have a good idea about it. I think I will have to download the newest reader to make dats and redo my regions. Oh, maybe Ilive or DM can make a stand alone program that will make this dat for us. Would be a heck of a lot easier...

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Ok, after thinking for a while and looking in the files I think I figured out a scale factor that will apply to all maps. Reason being is the set height it 2500m. I dont know if we can go higher but I think it would look a little weird since the highest point is 4342m in the US. The other problem was figuring out a scale using DEM so the maps would all be accurate to this one scale factor. So the min and max Z scale factor I figured out to be very close with any map, Though the two maps I checked were coastal maps. With different heights in the mountains on each, they came very close. So here are all the numbers I have gathered. Sea level is set to 20. This gives us a range of 235 greyscale pixels. Thus gives us a scale factor of 10.638. Now the ranges for the min and max Z scale used in the DEM program are as follows; Z min (-325) and Z max (3250). These need to be tested to see how they do with land without water to see how close in pixels we come to the height. After seeing Spider man 2 I can work on this. If anyone else wants to please try. If you do, please post the finished ingame pic of the region to get an idea of how it looks.

    Overall, I think that scale of 10 that Joerg is very close to where we need to be without stretching the land too much. Joerg or Andy, if you get a chance check this out. I think this would be easier with one dat for the whole thing than a dat for every region.

    Edit: Ok, I used the same Z scale settings on a mountain terrain and the pixels came out just like they should. So, after my date with my wife tonight and some sleep, tomorrow I think I will make a mod for the scale factor and show two regions, one ocean and one mountain terrain. Should be interesting... If anyone else wants to do this, go for it. A map revolution has begun....37.gif

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Glad I caught this thread. Been messing around with some of this stuff and I'm having a bunch of fun. Really helpes with one of my big gripes with sc4 now if only we could do surface lakes/rivers/streams. :)

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    Hello everyone.  After much testing all day and many, many region generations I think I figured out a scale factor and other stuff to give us accurate maps up to 2500 meters.  Here are the before pics and after.
     
    This was the Pismo Beach region made without any mods importing.
    /idealbb/files/Pismo
     
    Here is the same region with the mod made and other changes.
    /idealbb/files/Test1_thumb1.jpg
     
     
    Here is what changed.  In the first pic, the sea level starts around 86 and the highest mountain was at 255.  In the second pic, the water is at 3 and the highest mountain is around 90.  You can tell by the snow mod as that I have not changed.  Hmm, a way to make full use of the maps??? :)
     
    Ok here is what I changed.  In the DEM program, I changed the water level to 2 for RGB.  Make sure you change it in both places required.  Now, set the min Z scale at -60 and the max at 3250.  Ok when all thats done, check it in a paint program. 
    When you check it, the water should be at 2 and the shoreline should read at 5. 
    The modifications I made in the game itself was the sea level at 50 and the scale factor at 10.6.  I can not attach the one I made so if anyone wants to try, send me a pm. 
     
    I think this should open the door to a whole new world of map making and only with using one mod instead of many.  Please use with caution until all numbers can be checked and report what you find.  One testing that needs to be looked at is the erosion.  Andy was right, it really makes it look screwy.  Enjoy all.  44.gif

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    I ran a test on the two erosion exemplars last night with both lowered to 1 and I didnt see a difference as Andy said with his. But one thing I noticed was every two pixels on the very low side of the greyscale, like 6 or 7, the ground would rise considerably but level off on the next two pixels. I only noticed this with the lower ones under 15 I believe. Looking back at my map i do have some 6 and 7 in the flat areas down at the bottom. I think this will always be a visible issue due to the higher scale factor we have for the game. I am going to try to put both to 0 tonight and see what happens. If nothing, then I think this mod is ready to be released. 44.gif

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    Date:7/3/2004 11:36:29 PM
    Author:Skippydam73

    Andy was right, it really makes it look screwy.  Enjoy all.  44.gif

    quote>

     

    someone mention me? how does it look like me?

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    Date: 7/6/2004 11:10:55 AM
    Author:

    Date:7/3/2004 11:36:29 PM
    Author:Skippydam73


    Andy was right, it really makes it look screwy. Enjoy all. 44.gif

    quote>


    someone mention me? how does it look like me?

    quote>

    Screwballl,
    Cant you see the great resemblance in the terrain???? Haha

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    Date: 7/6/2004 11:23:56 AM
    Author:

    I really want to try this........
    quote>

    Dolfan, pm me your email addy and I will send the mod to you. Take a look above because the pixel shade is very important. The best thing to do is create a new map all over again. Thats what I would have to do. If you have any questions let me know..

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Well I see no one else really has tested anything. Before I started working this very long two weeks straight at work I was able to adjust the sea level with no problem. The only problem I did run into was lowering the land when starting a brand new region in the game. No matter all the numbers I played with I could not get the land to lower. The only way I could do that is by rendering a map. If anyone has been able to lower the land without rendering or clicking the lower god mod button, I would like to know. If anything else, I may abandon that effort and make a map for rendering. Any thoughts anyone?

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online: A long, long time ago... 
     

    Is this problem with map importation just a restriction on the upper limit, so if you have high mountains it scales everything down? If this is true then I assume that a fairly flat region (no more than about 90m above sea-level) would be to scale (if i got my greyscale image correct). Is this correct or am I misunderstanding the problem?

    It would also be useful to have lakes above sea level but it sounds as if this is not possible in SC4. (Hopefully they might include it in v5.)

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    This zip file is intended for use with my new map on the MEX. Anyone interested in learning how this process works can download the map and unzip the attached file to the SimCity 4\Plugins directory. The .dat file itself is just a copy of the Terrain Properties with the exemplar for the scale factor adjusted to 9.783.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    I hate to bring back such an old thread, but I thought I might share this to make things easier on anyone who has or might in the future create your own import.dat file...

    SeaLevel = 60350(meters)^-0.991
    SeaLevel = 247.5(ImageImportScaleFactor)^-0.991



    They're the same formula, just one uses meters and one uses ImageImportScaleFactor.

    Just so you know, the total meters in height between 0 grey and 255 grey divided by 256 is the ImageImportScaleFactor. I plan on doing some testing with other 'exemplars' (is that what they're called?) 29.gif

    Share this post


    Link to post
    Share on other sites

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account

    Sign In to follow this  

    • Recently Browsing   0 members

      No registered users viewing this page.

    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections