This Grand Life 2

This Grand Life 2

Nincs elegendő értékelés
Creating Cities And Maps For This Grand Life 2
Készítő: PokingWaterGames
This is a guide from the developer on how to create maps in This Grand Life 2.
   
Díjazás
Kedvenc
Kedvenc
Törlés
Video Walkthrough And Overview
This video should be used with the instructions in this guide https://youtu.be/e2kuJCukJZ0
Here is the city created from this guide:
https://steamproxy.net/sharedfiles/filedetails/?id=3164478801
Downloading The Raw Data
  • Find a city on https://www.openstreetmap.org/

    Maperitive
    • Download, install and open http://maperitive.net/
    • Clean up the interface by clicking on the top bar Map -> Untick Show Grid + Untick Show Map Scale
    • We are going to download the map data in chunks, since the whole map is likely too big to download at once.
    • Move the view to include the top left quarter of the city. Once happy with selection, run Map -> Download OSM Data. This will download all the data in your current view.
    • Optional: Once data is downloaded you can save the .osm data for future use, just change the file name for each data chunk. In the command prompt at the bottom, run:
      save-source file="sources/RandomChosenNameQuarter.osm"
    • Repeat Download OSM Data for the remaining chunks of the city (top right quarter, bottom left and right quarters)
    • Once all the data is downloaded, under Map Sources in bottom right corner uncheck Web map so only the downloaded .osm data is showing in the view window.

    Drawing Rules
    • Maperitive uses a set of rules to work out how to draw a map. Replace Maperitive/Rules/Default.mrules with the custom file from https://pokingwatergames.com/sdm_downloads/this-grand-life-2-maperitive-default-mrules/ The current view should update automatically when you replace the rules, although you might have to make a random useless edit to the file to trigger the update.
    • Zoom out the current view to show the entire region you want to use as a map, plus a buffer. The buffer will be used to create the outer black & white zone.
    • Next we want to export this area to Maperitive/output/output.png. In the command prompt at the bottom, run:
      export-bitmap zoom=14.5

Creating Image Files
  • Using Paint.net (or Photoshop, etc)
  • To get the middle playable area of the map, we want to copy out an image with dimensions that are some multiple of 400x312 pixels, which will create an 8x8 tile map.
  • Standard sizes you can use for simplicity - 5600x4992 pixels (112x128 tiles), 6000x4680 (120x120), 6400x4368 (128x112), 6800x4056 (136x104), 7200x3744 (144x96)
  • Copy the area and save it as a .png file in This Grand Life 2\modsLocal\[CITY]\art\maps, replacing [CITY] with whatever you want to call the mod
  • Now on a separate layer, fill in the area you just copied with black. Then fill in a 4000x2000px area diagonally to the top left and bottom right of the image, like so:
  • We are going to use this black boxed layer to help copy out the border images. I'm going to use a 5600x4992 playable area as an example. To get the top border image, we want an image 4000 + 5600 + 4000px = 13600px width and 2000 + 1px = 2001px height. The extra 1px is so there is a slight overlap between the playable area and border image
  • Copy this area of the map into a new image. Then Adjustments -> Black & White. Then Adjustments -> Hue/Saturation -> Change Lightness to -5
  • Save this border image into the art/maps folder
  • Repeat selecting/copying/editing/saving for the bottom (13600x2001), left (4001x8992) and right (4001x8992) borders of the map. Remember if you used different playable area size these dimensions will be slightly different.
  • Update v0.49.00 - Shrink the border images by 50% (so 13600x2001 becomes 6800x1000), the game will re-inflate them by 2x to get back to original size
  • Finally, create a thumbnail by shrinking the playable area image to 10% its original size. Your art/maps folder should end up looking something like this:

Generating / Editing City Data
For this section I recommend reading the Creating Mods guide first to understand how the modding system works, since we will be adding the city as a mod.

It's best to watch the video for this section since it's easier to show than tell. Here is a summary:
  • Create the mod folder in modsLocal/[CITY_MOD_NAME]/data/cities
  • In the [CITY_MOD_NAME] folder, add a modName.txt, modDesc.txt and modType.txt and fill in details. For modType.txt use the line modTypeCities. This ensures the city is loaded properly.
  • If using a custom currency, in the [CITY_MOD_NAME]/data folder add currencyBase.txt
  • Copy an existing city's xml and edit the data up to <autoMap>
  • Start the game, enable dev mode, open the editing window and do the automapping steps
  • Remember the data from automapping is saved to the base game data/cities folder. You need to move it into your modsLocal/[CITY_MOD_NAME]/data/cities folder to make sure it's uploaded to the Steam workshop later.
  • Once automapped, continue editing the xml data until done
  • Now you can follow the Creating Mods guide to upload it to Steam Workshop
(Optional) Download Local Street Names
Go to https://overpass-turbo.eu/ and run the below command with your city of interest in view to get a list of all local roads:

[out:csv ("name")][timeout:2500];
(
way["highway"]["name"]({{bbox}});
);
for (t["name"])
{
make street name=_.val;
out;
}

Create a text file in the data\cities folder (e.g CalgaryRoadNames.txt) and copy/paste the road names into this file.

There is going to be some rubbish in the downloaded data. To help clean this up, start the game and go into the debug menu file editing tools -> Clean Road Names. Make a backup of your raw data in case you need to tweak the filtering file (namesRoadTypes.txt) to get what you want



Once you have cleaned up the file, move it into your modsLocal/[CITY_MOD_NAME]/data/cities folder and remember to change the city XML's roadNames to use the new file
Additional Notes
  • I recommend only adding the images and data mentioned in this guide to the city mod. For anything unique about the city (e.g changing Eat Burger Meal to Eat Poutine Meal) you should create a separate modTypeCountry mod, upload that to the Workshop and add it as a dependency for the city in its xml under <modsCities>. Otherwise when people activate your city mod, they might get the Eat Poutine Meal in every city they play!
6 megjegyzés
PokingWaterGames  [készítő] 2024. szept. 23., 0:43 
@Mizfit you can 100% just "print off your map, resize it, save to correct name an format" and skip the first two sections. You could even draw your own made up map in MSPaint.

As long as you get the RGB colours right so the transport networks, spawn densities and forbidden areas are generated correctly. You could even use custom colours if you wanted as long as you set up the automapping part of the xml correctly.

Sorry if this guide was more complicated than you were expecting. It would be much more simple if map features didn't affect gameplay but I think the extra steps are worth it to get the most out of the natural features of each map.
Mizfit 2024. szept. 23., 0:16 
ALL of that to add an interactive picture to a game. My god, why can't it be print off your map, resize it, save to correct name an format. No wonder this game has crap locations. This is the first game I've seen that requires more than 3 steps to basically alter an Image.
PokingWaterGames  [készítő] 2024. jún. 26., 0:08 
Thanks, guide updated and the click through bug will be fixed in next update
Zebulan 2024. jún. 25., 20:51 
The guide is missing the step for copying the street names from the site and saving them to the data folder, to be loaded in-game.

When you're setting roads as X/O/R/H, it looks like it clicks through the button too and manipulates the map. For instance, if you have R selected then go to click O, it puts an R behind the O button on the map.
PokingWaterGames  [készítő] 2024. jún. 20., 14:08 
Let me know if anything is terribly inaccurate :steamhappy:
shogged 2024. jún. 20., 7:52 
calgary is my city! =D