Troubleshooting Chain Tactics Local Development
Last updated
Last updated
This section addresses common issues when developing with Chain Tactics, complementing the "Common Challenges" outlined in Headless Client. Problems like sqlite build errors, indexing mismatches, or insufficient funds can arise, and the solutions below provide practical guidance .
Cannot build sqlite
Resolution: Make sure to install the correct version of npm to prevent any issues during installation.
ArgumentOutOfRangeException, The application is showing the wrong data from an array/list
Resolution: Blockchain systems use 1-based indexing for their data structures, which differs from most game development environments like Unity and Unreal Engine that use 0-based indexing. This distinction is important to consider when integrating blockchain data into game logic, as it can result in indexing mismatches if not handled properly.
How to know the last error?
Resolution: Make use of the method GetLastError() in the class CTServerContext.
Insufficient funds
Resolution: Actions requiring frequent updates (e.g., player movement, health regeneration, or cooldown timers) can become costly and slow on-chain. Adopt a hybrid model; frequent updates managed off-chain, critical updates on-chain.
Why is it taking too long to receive updates from the backend?
Resolution: Applying traditional real-time mechanics directly on-chain can result in delays due to transaction confirmation times. Consider adding mechanics designed to tolerate delays.
Why are some of the methods still running after I stop the editor?
Resolution: In C# native, tasks stop when the application exits. In Unity, tasks may continue running even after the editor stops. Implement CancellationToken to manage async lifecycle.
Why is my code not called? Why is it not running properly?
Resolution: Calling Unity-related APIs in an async background will cause errors or undefined behaviors. Consider using UnityMainThreadDispatcher or SynchronizationContext to switch back to the main thread if you want to handle Unity APIs.
Error PlayerAlreadyInMatch when trying to find a new match
Resolution: The player is already in a match. Consider calling Leave() first.
Debugging:
Use GetLastError() in CTServerContext.
Check Errors.sol on Bitbucket for error codes.
Reference Links:
Refer to this link for other possible issues:.