Skip to content

User guide: Migration to v0.4.0

Patrick W. Crawford edited this page Nov 26, 2023 · 5 revisions

This page provides an overview of what to expect when migrating from v0.3.4 to v0.4.0 of the plugin.

Example project migration (video)

thumb-design

Migration steps

  1. Download the latest version of the plugin from the releases page.
  2. Open the folder of your current Road Generator plugin in your project
  3. Delete the current plugin folder entirely
  4. Copy over the new folder you just downloaded, final path should be the same as before: /addons/road-generator/
  5. Reload the current project from the Project menu. You will face some warnings of broken dependencies
  6. Click the "Fix dependencies" button. This will auto resolve all but one: RoadNetwork (which was renamed to RoadContainer)
  7. Click on the folder icon to the right of the broken link: "road-generator/road_network.gd" -> "road-generator/nodes/road_container.gd"
  8. Re-enable the plugin from Project > Project Settings > Plugins: Road Generator (if necessary)
  9. Reload the current project again to ensure all new code is loaded (this one is more for good measure).
  10. For each scene that you were using the Road Generator:
    1. Add a new RoadManager node (it can be anywhere in the scene hierarchy)
    2. Move all RoadContainers as children or grandchildren of this manager node.
    3. If you are using prefab roads in separate scenes saved to disk, be sure to set the RoadContainer node as the root node of the saved scene, otherwise configuration warnings will show. When instancing these scenes, you should still place them as children or grandchildren of the RoadManager
    4. (Optional) Delete the old Points and Segments nodes that were previously auto-created and not longer utilized, though there is no harm in leaving them in-place.

Why is this update not backwards compatible?

In preparation for a better long-term user experience, we chose to make backwards breaking changes in this release to prepare for upcoming features. This includes preparation for intersection support (which is still coming soon) and generally better user interactivity with creating roads. We aim to not have further backwards compatibility breaking, but it is possible up until version 1.0.

What are the breaking changes?

Some script names changed, as well as the structure of nodes placed in the scene.

In the old plugin (v0.3.4 and earlier), the following scene structure is constructed after adding a RoadNetwork node (the primary "root" Road node):

  • RoadNetwork
    • Points (a spatial, no script)
      • RoadPointA (user added road_point.gd instance)
      • RoadPointB (user added road_point.gd instance)
    • Segments (a spatial, no script)
      • RoadSegment between A and B; invisible in the editor screen.
        • RoadLane

Then the user would then need to know to add RoadPoints as children of the Points node. The plugin would mechanically add the generated mesh geo under the Segments node. However, we needed to introduce the concept of geometry or details that belong to a Segment between to RoadPoints (such as railings, sidewalks, etc). We decided to pivot to below structure instead, so that every RoadSegment (invisible in editor) very explicitly "belongs" to one RoadPoint (visible in editor) and there's no confusion as to where new nodes should be placed:

  • RoadManager (New node, now meant to be the parent of all "Roads")
    • RoadNetwork -> Renamed as RoadContainer
      • RoadPointA
        • RoadSegment (still hidden, but mesh bounding box visible when selecting RoadPointA)
        • RoadLane
      • RoadPointB

The newly renamed "RoadContainer" is intended to be analogous to one "road". That is, the length of roadway between two intersections. We call it a RoadContainer so that it can also

New icons

The old visible layout:

old nodes

New icons and example hierarchy (as seen in editor, RoadSegments not visible)

new nodes