Tired of hitting balls on the same range every day? Switch things up by building your own custom practice ranges for OpenGolfSim.
Getting Started
- First create a new blank Unity 6000.2 HDRP project.
- Install our SDK by dragging the OGS Course SDK files into your new project. (The latest SDK files can be found on our Discord)
Building Your Course in Unity
Add terrains or meshes to build your practice range environment. We recommend a terrain with a size of 600m x 600m for ranges, which is a little over 600 square yards.
Guides and Tools
There’s a ton of guides, tutorials, and tools out there to help you create terrains and environments in Unity. To get you started, we’ve curated a few helpful resources for learning how to build terrains in Unity.
-
Unity 6.2: Sculpt the terrain with a brush
For simple scenes, you can use the built-in Unity terrain brushes to manually raise and lower the terrain.
-
Try using our new experimental tool to find and create height maps from real-world lidar data.
-
For creating biomes and planting mass trees/vegetation in Unity. This version of Gaia is compatible with OpenGolfSim’s version of Unity (6000.2), and makes quickly planting lots trees or painting terrain quick and easy.
-
R.A.M 3 - River Auto Material 3
Another useful Unity asset for carving and shaping terrain and generating rivers and lakes.
Add Start & Aim Positions
- Create an empty game object named
StartPoint
and position it in the scene where you want your player to hit from. - Create an empty game object named
AimPoint
and position it in the scene where you want your player to aim initially.
Create Course Build
To export your new range as a playable course for OpenGolfSim, you’ll need to export your Unity scene as an asset bundle.
Create New AssetBundle
- In Unity, locate and select your scene in your Assets folder.
- At the bottom of the Inspector you should see an
AssetBundle
section. Click the dropdown and add create a new asset bundle. - Enter the name of your course all lowercase, and without spaces. (e.g.
spacerange
)
Export Checklist
To prep your scene for export to a playable course bundle, you’ll need to make sure to check a few things:
-
Make sure any cameras in your scene are disabled or removed.
-
Remove any runtime-based scripts / dependencies.
Note: One limitation of Unity asset bundles is that scripts are not exported with the scene. So avoid using or adding any scripts that are used at runtime.
Course Export Tool
- Make sure to set a bundle version in your Unity project’s settings.
- Select Edit > Project Settings > Player
- Enter a Product Name and Version for your course.
- Build your course file using our OpenGolfSim Tools
- Select Tools > OpenGolfSim > Build Course
-
Click
Select Output Folder
to set the build location of your course. -
Enter a description for your course.
- Click the Export button.
Once the export has completed, you should see a few files have been created. One with your asset bundle name, and a file named course.json
. This file contains some metadata about your course package.
Example course.json:
{
"name": "Space Range",
"course": "spacerange",
"version": "1.0.1",
"description": "A simple driving range set in space.",
"gameMode": 0
}
Course Poster
You can place a 1280x720 JPEG file in your course folder named poster.jpg
to represent your course in the library.
Course posters look best when they are an actual rendering of your course level, not a photograph of the course. It also shouldn’t contain any text or logos.
Loading and Testing Your Course
-
Make sure OpenGolfSim Desktop is not currently running. (Right click the logo in the status bar and select
Quit OpenGolfSim
) -
Create a new folder for your course within the OGS Courses directory.
%USERPROFILE%/AppData/Roaming/opengolfsim-desktop/ogs_courses/spacerange
-
Copy/move both your exported asset bundle file and
course.json
file into that folder. You should end up with a folder structure like:spacerange/spacerange
spacerange/course.json
spacerange/poster.jpg
-
Fire up OpenGolfSim and you should see your new course listed in your course library.
Having trouble? Come chat with us on our Discord.