chore: Add linux support and containerize the project - #5
Conversation
…r linux, add template for perpetuum.ini, add Makefile for some helper commands, update server to take DistributedTransactions as argument to be able to disable it for linux
…date server image to include GDI+
|
Regarding using DistributedTransactions, we use a single database and the connection string doesn't change. Therefore, using DistributedTransactions is not necessary. I'm not very knowledgeable about the intricacies of database operation, but after reading the documentation, I found out that:
Therefore, you can remove: TransactionManager.ImplicitDistributedTransactions = true; in PerpetuumBootstrapper.cs With these changes, I was able to launch the server on Linux. And there are no errors when working with the database. I hope this information will at least be useful. |
…ipt and fix migration when using a directory
This PR disables it but I have left a default value (true) to keep the same behavior to keep compatibility for the Windows build. If removing the |
…creen issue on client when trying to enter a zone. Now the client seems to work (feature validation is in progress). Disabled EnlistTransaction to ensure DistributedTransactions are disabled
|
At this point, the PR is almost ready for review. The client is able to connect and perform all actions tested (chat, enter/leave chat, buy from market, unpack item, activate bot, undock/dock, move, assignments, looting, combat, tutorial, rift) What is left todo?
|
… the EnlistTransaction configurable with the DistributedTransactions state
|
At this point, the documentation has been added and the DistributedTransactions config is now correctly applied in the codebase. |
…d of SKSurface, update usage of canvas.DrawText to fix Y position by taking into account the font size since the origin is on top left instead of bottom left.
…mpose architecture, fix FakeDb missing {, update submodules for asset and db
|
All unit and integration tests pass now. Added Live_36 to the migration with the Raw_SQL for now until the patch is complete. |
| The test profile is excluded from the default `up`/`down` stack. Note that tier 3 failures about | ||
| documented objects being absent from the database (e.g. `usp_RecalculateInsurancePrices`) are real schema | ||
| drift findings, not environment errors — the test suite reports what | ||
| `docs/db_structure/` claims against what the live `perpetuumsa` contains. |
There was a problem hiding this comment.
I successfully completed the "make test integration". However, I had to convert two files (17_consolidate_statistics.sql and 37_Market_decoupling_4.sql in Live_36) from UTF-16 LE to UTF-8.
Also, live_patch_35.sql doesn't contain data from the Raw_SQL files (15_... through 19_...).
I plan to make corrections to the OPDB in the near future.
There was a problem hiding this comment.
The UTF-16 LE fix has been done in this PR: OpenPerpetuum/OPDB#389.
I'll also check for the SQL file.
…nto linux+containerize
…R for this CI action This reverts commit 87cd9d8.
- Add SHA-256 change detection and compressed DB backup restoration - Automate chronological execution for Pre_Alpha_* and Live_* patches - Add clean-cache Makefile target and README Mermaid migration diagram
…tling - Add SimdMath with AVX-512 / AVX2 / Vector128 distance calculation fallbacks - Add HeightfieldMetadata 16x16 chunk bounding grid for raycast optimization - Add CompactPassabilityMask 1-bit per tile bitmask - Throttle empty zone update loop to 1 Hz when no players are present - Enable DOTNET_GCDynamicAdaptationMode for dynamic GC heap sizing - Add unit test coverage for SIMD math and terrain structures
…promotion on Linux - Introduce DbConnectionManager to track and reuse open connections per ambient Transaction - Update DbQuery.ExecuteHelper to avoid multiple connection checkouts in the same scope - Fix System.PlatformNotSupportedException thrown on Linux during player logout and transactions - Add unit tests verifying connection reuse, cleanup on commit, and cleanup on abort
|
I've reworked the migration to load files automatically without having to add new patch in the migration.sh file with a cache mechanism to accelerate migration (development QoL). I also had some instances of Distributed transaction happening due to Enlist some times which was causing errors, to fix this issue, I refactored the DbConnectionManager to avoid multiple connections in the same scope to reuse them. When distributed transactions is enabled, the behavior is unchanged. This refactor will allow in theory better scaling with many players/npcs. I also added SIMD acceleration, did some optimization on the loaded assets by caching the essential content. I also added idle optimization to slow down tick when no player is on an island from from 20hz to 1hz while keeping precision on events on the island. Overall saving (40-60% reduction) 1.5-2.5GB on RAM and (60-90% reduction) 0.6-0.9 CPU core. One notable change is that a zone metadata can now fit in L2 cache (from 36MB to 512KB per zone). |

Context
Setting up development environment for OpenPerpetuum requires Windows, clone of 3 repositories (OPResource, OPDB, PerpetuumServer2), Steam with the official PerpetuumServer installed to get access to database seed + some data files (customDictionnary, map layers, plantrules). Developing on linux is not possible without modifications. We also need to setup the database with migration script, setup the OPResource as a file server, then you can start the PerpetuumServer2 to connect a game client.
The goal of this PR is to reduce that friction to get started more quickly and support multiple development platform by using containers to be compatible on windows, mac, linux. Note: for windows, using linux containers would be a requirement to keep the initial implementation simple.
When porting the application to linux, one issue came up with the database DistributedTransactions. It turns out the .NET on linux does not support it. For now, it has been disabled but I'll try to find a solution or an alternative.
Description
asset) and OPDB (asdb)System.DrawingintoSkiaSharpHow to test
Some technical information
mssql-dataopenperpetuum-dataImprovements