Author Topic: Editing Cities - can one delete a city or merge two of them?  (Read 132 times)

Zarkow

  • Newbie
  • *
  • Posts: 37
    • View Profile
While one can edit, merge and even delete countries and regions, this doesn't seem possible with cities?

I have a usecase where too many cities, due to zoomed out style of the game, would be better if they where joined together (i.e. map simplified), the population totaled up and the no longer needed cities deleted.

While I can manually edit a city this still leaves the old one, and a merge would perform both a sum and a delete in one go. Location of the merged city could be whatever location the bigger of the two cities was located at.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6981
    • View Profile
Re: Editing Cities - can one delete a city or merge two of them?
« Reply #1 on: March 28, 2021, 06:08:35 PM »
Unfortunatelly this seems too specific. I see that this representation could be even dynamic, based on the zoom level. For instance, the asset could simplify the number of cities as you zoom out.

Currently you could do as advised in the other thread, override the DrawCities() method with your own implementation and call it when camera distance changes significantly.

Zarkow

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Editing Cities - can one delete a city or merge two of them?
« Reply #2 on: March 28, 2021, 06:59:08 PM »
Thank you for your reply - while you idea is great as a visual representation, I was actually looking to simplify the map and the contents, to use it as the actual basis of interaction -- so only larger cities in the nations shown, to avoid the clutter that is today, but also to join together (merge) cities close together, to give a proper representation of population that can be impacted.

Hence the question how one can delete a city from the map editor, as I cannot find that right now. Or even merge smaller ones into a larger one, to delete it and join all population sums.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6981
    • View Profile
Re: Editing Cities - can one delete a city or merge two of them?
« Reply #3 on: March 29, 2021, 11:51:06 AM »
Yes, you can use the Map Editor to select a city and modify it. You can update its properties and move it around the map. And of course, delete it.
Here's a demo: https://youtu.be/6yl0ElQtJMM

Make sure you work in the SceneView and that Gizmos button is enabled.

Zarkow

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Editing Cities - can one delete a city or merge two of them?
« Reply #4 on: March 29, 2021, 12:53:12 PM »
I see - I will look into that, thanks!

Zarkow

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Editing Cities - can one delete a city or merge two of them?
« Reply #5 on: May 04, 2021, 05:48:54 PM »
I have a base set of map-data now, after a lot of cleanup. Did the city-merging using code, and it works fine, but cost a but of time on startup.

For future reference, as I know I can adjust map-data at run-time (running the game, not only during editor mode), is there an API to save the current, in memory, data to disk of one sown location? What about loading data at will, from an arbitrary location?

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6981
    • View Profile
Re: Editing Cities - can one delete a city or merge two of them?
« Reply #6 on: May 05, 2021, 09:28:45 AM »
I've added some useful methods to latest beta which allows you to get / set current countries, provinces, cities and mount points geodata and attributes.
The returned data is a packed string with all the info so you can safely store this data in any database or folder (make sure it uses UTF-8 encoding).