* Added Async APIs for the various Process*FromList terrain functions. Please note that we are currently defaulting the number of worker threads to one, because splitting the work over multiple threads causes contention when locking various mutexes, resulting in slower overall wall time for async requests split over multiple threads vs one where all the work is done on a single thread. The latter is still preferable over a regular synchronous call because it is just as quick and prevents the main thread from blocking. This should be changed once the mutex contention issues have been addressed, so that async calls automatically split the work between available job manager worker threads, unless the ProcessAsyncParams specify a different desired number of jobs. Signed-off-by: bosnichd <bosnichd@amazon.com> * Fix Linux builds by adding missing #include Signed-off-by: bosnichd <bosnichd@amazon.com> * Added a test for cancellation of terrain async requests, and fix it so that it works. Note that the benchmarks show this implementation to be slightly slower than the previous one, which I presume is because we're now calling a 'perSurfacePointFunction' in the inner loop; this can probably be addressed, but will result in a lot of code duplication, and I think efforts will be better spent on removing the mutex contention to enable running multiple terrain async jobs at the same time. Signed-off-by: bosnichd <bosnichd@amazon.com> * Added Async versions for all Process*Region terrain API functions, along with benchmarks. Signed-off-by: bosnichd <bosnichd@amazon.com> * Fix the newly added terrain async request benchmarks to actually use the async APIs. Signed-off-by: bosnichd <bosnichd@amazon.com> * Revert to the original version which just calls the synchronous API from the job function, along with some other updates in response to review feedback. Signed-off-by: bosnichd <bosnichd@amazon.com> * Change the TerrainWorldDebugger to use the async API, along with the following changes: - TerrainJobContext no longer uses a JobCancelGroup so we can guarantee the completion callbacks of associated jobs will be invoked even if it is cancelled. - As a result of the above change, the ProcessAsyncCompleteCallback function signature again accepts the associated TerrainJobContext as a param. - The TerrainProcessAsyncCancellation test has been resurrected and simplified by using binary semaphores instead of condition variables. - All the async related TerrainSystemBenchmark functions have been simplified by using binary semaphores instead of condition variables. - Global cancellation of all terrain jobs on deactivation of the TerrainSystem has been reintroduced, but in a different way than before. - Other miscellaneous changes/fixes made while testing and based on earlier PR feedback. Signed-off-by: bosnichd <bosnichd@amazon.com> * Updates based on review feedback: - Go back to using a vector instead of an array (fixed the original problem by adding custom copy/assignment constructors/operators to the WireframeSector struct). - When calling WireframeSector::Reset, block until any associated in flight has completed. - Added the concept of a minimum number of positions per terrain job. Signed-off-by: bosnichd <bosnichd@amazon.com> * Use semaphore instead of binary_semaphore in a bunch of places to account for the race condition where a completion callback fires before we started waiting for it. Signed-off-by: bosnichd <bosnichd@amazon.com>
O3DE (Open 3D Engine)
O3DE (Open 3D Engine) is an open-source, real-time, multi-platform 3D engine that enables developers and content creators to build AAA games, cinema-quality 3D worlds, and high-fidelity simulations without any fees or commercial obligations.
Contribute
For information about contributing to Open 3D Engine, visit https://o3de.org/docs/contributing/.
Download and Install
This repository uses Git LFS for storing large binary files.
Verify you have Git LFS installed by running the following command to print the version number.
git lfs --version
If Git LFS is not installed, download and run the installer from: https://git-lfs.github.com/.
Install Git LFS hooks
git lfs install
Clone the repository
git clone https://github.com/o3de/o3de.git
Building the Engine
Build requirements and redistributables
For the latest details and system requirements, refer to System Requirements in the documentation.
Windows
- Visual Studio 2019 16.9.2 minimum (All editions supported, including Community): https://visualstudio.microsoft.com/downloads/
- Check System Requirements for other supported versions.
- Install the following workloads:
- Game Development with C++
- MSVC v142 - VS 2019 C++ x64/x86
- C++ 2019 redistributable update
- CMake 3.20.5 minimum: https://cmake.org/download/#latest (Release Candidate versions are not supported)
Optional
- Wwise audio SDK
- For the latest version requirements and setup instructions, refer to the Wwise Audio Engine Gem reference in the documentation.
Quick start engine setup
To set up a project-centric source engine, complete the following steps. For other build options, refer to Setting up O3DE from GitHub in the documentation.
-
Create a writable folder to cache downloadable third-party packages. You can also use this to store other redistributable SDKs.
-
Install the following redistributables:
- Visual Studio and VC++ redistributable can be installed to any location.
- CMake can be installed to any location, as long as it's available in the system path.
-
Configure the engine source into a solution using this command line, replacing
<your build path>,<your source path>, and<3rdParty package path>with the paths you've created:cmake -B <your build path> -S <your source path> -G "Visual Studio 16" -DLY_3RDPARTY_PATH=<3rdParty package path>Example:
cmake -B C:\o3de\build\windows -S C:\o3de -G "Visual Studio 16" -DLY_3RDPARTY_PATH=C:\o3de-packagesNote: Do not use trailing slashes for the <3rdParty package path>.
-
Alternatively, you can do this through the CMake GUI:
- Start
cmake-gui.exe. - Select the local path of the repo under "Where is the source code".
- Select a path where to build binaries under "Where to build the binaries".
- Click Add Entry and add a cache entry for the <3rdParty package path> folder you created, using the following values:
- Name: LY_3RDPARTY_PATH
- Type: STRING
- Value:
<3rdParty package path>
- Click Configure.
- Wait for the key values to populate. Update or add any additional fields that are needed for your project.
- Click Generate.
- Start
-
Register the engine with this command:
scripts\o3de.bat register --this-engine -
The configuration of the solution is complete. You are now ready to create a project and build the engine.
For more details on the steps above, refer to Setting up O3DE from GitHub in the documentation.
Setting up new projects and building the engine
-
From the O3DE repo folder, set up a new project using the
o3de create-projectcommand.scripts\o3de.bat create-project --project-path <your new project path> -
Configure a solution for your project.
cmake -B <your project build path> -S <your new project source path> -G "Visual Studio 16"Example:
cmake -B C:\my-project\build\windows -S C:\my-project -G "Visual Studio 16"Note: Do not use trailing slashes for the <3rdParty cache path>.
-
Build the project, Asset Processor, and Editor to binaries by running this command inside your project:
cmake --build <your project build path> --target <New Project Name>.GameLauncher Editor --config profile -- /mNote: Your project name used in the build target is the same as the directory name of your project.
This will compile after some time and binaries will be available in the project build path you've specified, under bin/profile.
For a complete tutorial on project configuration, see Creating Projects Using the Command Line Interface in the documentation.
License
For terms please see the LICENSE*.TXT files at the root of this distribution.