Skip to content

Latest commit

 

History

History
71 lines (51 loc) · 5.27 KB

File metadata and controls

71 lines (51 loc) · 5.27 KB
type manual

Running Steps

  1. IDE installation

    Use Rider 2024.3 (update it to the latest version). Install the following:

    • On Windows, install the latest .NET 8 through Visual Studio. On macOS, use Homebrew to install .NET 8 and PowerShell 7. Note that this is not the Windows built-in PowerShell.
    • Visual Studio is not supported. Beginners who run into all kinds of issues with VS should not ask me about them; I do not use VS either. After you are familiar with the project, you can switch to VS on your own.
  2. This branch must use Unity 2022.3.62. Beginners should become familiar with this version before switching to any other version.

  3. Keep a global proxy/VPN enabled throughout the entire process. Otherwise, Unity packages and NuGet packages may fail to download, causing errors such as MemoryPack-related errors.

  4. Make sure to clone a fresh project. Clone a fresh project. Clone a fresh project. This is important enough to repeat three times.

  5. Run pwsh ./Scripts/Initialize-Project.ps1 in the project root to complete initialization.

  6. Start Unity Hub, click Open, select the directory where the ET folder is located, and open the project.

  7. After the project opens, click the Unity menu -> Edit -> Preferences -> External Tools. In the External Script Editor dropdown, select Rider. For Generate .csproj files for, check the first two options.

  8. Click the Unity menu Assets -> Open C# Project. Because the Rider plugin has been modified, this will automatically open ET.sln.

  9. After a fresh clone, Unity may show some errors when opening the project. First make sure IL2CPP is installed.

  10. Compile the entire ET.sln. Make sure the proxy/VPN is enabled, otherwise NuGet packages may fail to download and the build may fail. If errors still cannot be resolved after enabling the proxy/VPN, you can try opening ET.sln with VS and compiling it once, then return to Rider and compile it again.

  11. In Unity, double-click the Packages/ET.StateSync/Scenes/Init scene, then click Play to run it.

  12. To start the server independently, right-click Unity Hub and run it as administrator, then start Unity. Starting without administrator privileges will not work because the server needs to start an HTTP service, which normal permissions cannot open.

    Stop Unity Play mode, then open the Unity menu -> ET -> Loader -> Server Tools -> Start Server (Single Process). This starts the server independently. In GlobalConfig, change CodeMode to Client, then click Unity Play and log in. If you still cannot connect and get error 10037, check the ET/Logs directory for error logs. If you want to start the server with Rider, Rider must also be started with administrator privileges.

    Make sure to use the netsh http delete urlacl command to delete all URL ACLs that you added yourself. Search Google for the exact usage.

    On the client side, open cn.etetet.loader/Resources/GlobalConfig and change CodeMode to Client.

  13. Note that the working directory for running the server independently is no longer the Bin directory. It is the parent directory of Bin, which is the Unity directory, for example: dotnet.exe Bin/ET.App.dll --Console=1. When Rider starts the server, the default working directory is Bin; you need to modify the working directory yourself and remove Bin.

  14. If you run into problems, ask AI to solve them.

Packaging Process

  1. Click HybridCLR -> Installer, then click Install and wait for installation to complete.

  2. Use the Unity menu ET -> Excel -> ExcelExport to export Excel.

  3. Use the Unity menu ET -> WOW -> ExportScriptableObject to export skill, buff, and AI configs.

  4. Press F6 in Unity to compile. Note that you must not compile Model Hotfix with the IDE, because IDE compilation references UnityEditor and will cause problems.

  5. Click HybridCLR -> Generate -> All.

  6. Click ET -> HybridCLR -> CopyAotDlls. This copies the DLLs that need supplemental metadata to the Assets/Bundles/AotDlls directory.

  7. Open the YooAsset -> AssetBundle Builder window and follow these steps:

    1. BuildPipeline: ScriptableBuildPipeline

    2. BuildMode: IncrementalBuild

    3. CopyBuildinFileOption: ClearAndCopyAll

    4. Click Click Build

  8. In ET.YooAssets/Resources/YooConfig, set EPlayMode to HostPlayMode. Then open File -> Build Profiles -> Build, and select Release as the output directory.

Also: Study the YooAsset package management library yourself. See the YooAsset official website.

Hot Reload

  1. To try this feature, open Unity menu -> Edit -> Preferences -> General, and set Script Changes While Playing to Recompile After Finished Playing.
  2. After the project is running, modify and compile the code, then click Unity menu -> ET -> Reload, or press the F7 shortcut.

Notes

Common causes of errors:

  1. Chinese characters in the directory path.
  2. Rider or VS is not updated to the latest version.
  3. Rider or VS does not have the required components installed.
  4. .NET 8 is not installed.
  5. Not all server projects have been compiled.
  6. The Unity version is incompatible.
  7. Windows 7 users did not apply special settings.
  8. If packaging reports a missing StreamingAsset, create a StreamingAsset folder under ET/Unity/Assets yourself.