This tutorial will guide you through expanding the map created in Making a Basic Map with new road meshes and a road network on top of them to allow for traffic and AI car navigation.
This tutorial will also cover making a custom HUD map Mesh that's made from the aforementioned road meshes.
You will need a PC copy of The Simpsons: Hit & Run as well as the following tools to accomplish the steps in this tutorial:
- Lucas' Simpsons Hit & Run Mod Launcher
- Lucas' Simpsons Hit & Run Model Builder
- SketchUp Make 2017
- Knowledge of how to use SketchUp in general will help as these tutorials will assume you're already at least a bit familiar with the software.
- A Text Editor, we recommend Notepad++ or Visual Studio Code.
- The map created in Making a Basic Map
Part 1: The SketchUp File
Step 1: Expanding the map
In the previous tutorial, you created a small square. This doesn't really have any space for your Road network so the first thing you'll want to do is expand the map a bit.
First focus the
Zone001 group. Then you should add some 12 meter wide rectangles to each side of the map and some 12x12 squares to each corner. It would also be good to make some Materials and color them differently so they can be told apart.
After you make them, group the new shapes and name the group
Road [Intersect] [Road]. The new
[Road] group tag on the end is how you tell the tool to include this mesh on the HUD map as roads.
When you're done, your outliner should look like this:
Step 2: Making the roads
Roads are very easy to create as they are just 1 or more connected lines with a special group name. Start by drawing 4 separate lines connecting the midpoints of each corner of the map.
Then select each line individually and group it. Once you have 4 groups tag them each with the following names:
Road001 [SimpleRoadPairRight]   
Road002 [SimpleRoadPairRight]   
Road003 [SimpleRoadPairRight]   
Road004 [SimpleRoadPairRight]   
In this case you use the
[SimpleRoadPairRight] group tag to tell the tool that you want this line to be made into 2 parallel roads going the opposite direction of one another. The
Right part means cars will drive on the right side of the road though there is an equivalent
[SimpleRoadPairLeft] tag. The 3 tags following that tag are as follows:
- Amount of traffic cars: The amount of traffic cars that can be on one side of the road at any given time. Use 0 to make it so there's no traffic.
- Lanes: The amount of lanes on the road. In this case, you want each side to just have 1 lane.
- Width: The width of the road. This is divided in half for each side of the road.
Step 3: Making the intersections
Intersections are also simple as they are just grouped circles. Draw 1 in each corner that fully covers the end of each road.
Make sure to delete the face in each one, leaving just the edges of the circles!
Now select each circle individually and group it. Name each one with some group tags as follows:
Intersection002 [Intersection] [Stop]
Intersection004 [Intersection] [Stop]
[Intersection] group tag tells the tool that these circles should become Intersections. This example also adds the
[Stop] group tag to the 2nd and 4th one which changes it so traffic will stop at these intersections instead of immediately continuing when they reach them.
Step 4: Making the Terra group
After you make the intersection groups, group all of them and the road groups from the previous step together and name the group
Terra as these must go into the map's Terra file. This should leave your outliner looking like this:
Part 2: Configuring the Model Builder
Step 1: Including Base HUD Map rules
The first thing you will want to add to your rules is a line to include the base HUD Map rules next to the Zone rules.
<Include Path="$(ModelBuilderPath)\Rules\HUDMap.xml"/> <!-- New Inclusion --> <Include Path="$(ModelBuilderPath)\Rules\Zone.xml"/>
Step 2: Adding a HUD Map file and Mesh
Now that you have the rules, you'll want to add a new
OutputPure3DFile next to your other ones for the HUD Map as well as a
<!-- Make sure to change the level number in the file and mesh names to match the level you're building the map for --> <OutputPure3DFile Name="HUDMap" Path="$(OutputPath)\frontend\scrooby\resource\pure3d\l1hudmap.p3d"/> <Mesh Name="HUDMap"> <OutputPure3DFile Name="HUDMap" ChunkName="l1hudmapShape"/> </Mesh>
Step 3: Updating the ModelOutputInstructions
Next scroll down to your
Zone and add a line to execute the new rules and one to set the
<ModelOutputInstructions Name="Zone"> <ExecuteInstructions Name="BaseHUDMap"/> <!-- New Instruction --> <ExecuteInstructions Name="BaseZone"/> <SetParameter Name="OutputHUDMapMesh" Value="HUDMap"/> <!-- New Instruction --> <SetParameter Name="VertexColours" Value="World"/> <SetParameter Name="FallbackMaterial" Value="Null"/> </ModelOutputInstructions>
Step 4: Build and check it out ingame
There's no new rules to add for the roads so you're actually already done!
Now it's time to run
Build.bat to see if it works ingame.
If you've done everything right, the map should successfully build and look something like this:
That's it for this tutorial. You're now ready to move on to the next one.