Highly Performant & Scalable Ultima Online Server Emulator https://www.modernuo.com
Find a file
Kamron Batman 65532ea887
feat: Adds optimized dynamic/static layout gumps (#1652)
# New Gump API
We are pleased to release a new API that is faster, allocates nearly zero memory, and still feels very similar to the original API. The API is broken into 3 types of gumps, dynamic, static with placeholders, and static without placeholders. 

### Dynamic Gumps
These gumps will inherit `DynamicGump` and are meant for gumps that have a dynamic layout. This includes specifying dynamic arguments to HtmlLocalized entries.

## Static Gumps 
Static gumps are those where the function to the build the layout is called only once and cached forever. They can optionally have placeholders. These placeholders allow the developer to specify the string values later, dynamically in a `BuildStrings` method on the gump. If a gump does not have any placeholders, the string entries will also be cached forever.

## Benchmarks
To make sure we were going in the right direction and not wasting time, we took copious benchmarks. Here are the final benchmarks for a really simple gump. 

Note:
* The majority of creating a gump is compressing the layout and the strings. Compressing each section takes ~6,000ns (12us total).

```cs
| Method                         | Mean         | Error        | StdDev       | Median       | Ratio | RatioSD | Gen0   | Allocated | Alloc Ratio |
|------------------------------- |-------------:|-------------:|-------------:|-------------:|------:|--------:|-------:|----------:|------------:|
| OldGump                        | 13,308.29 ns | 1,059.695 ns | 1,883.608 ns | 14,330.72 ns | 1.000 |    0.00 | 0.1526 |    2400 B |        1.00 |
| DynamicLayoutGump              | 13,357.86 ns |   129.144 ns |   226.185 ns | 13,323.60 ns | 1.029 |    0.17 |      - |      48 B |        0.02 |
| StaticLayoutDynamicStringsGump |  6,653.10 ns |    81.815 ns |   143.292 ns |  6,617.45 ns | 0.514 |    0.09 |      - |      40 B |        0.02 |
| StaticLayoutGump               |     86.33 ns |     0.760 ns |     1.350 ns |     86.07 ns | 0.007 |    0.00 | 0.0020 |      32 B |        0.01 |
```

# Non-Breaking Changes
* All gump components in the core have been moved to `Gumps/Legacy`.
* All legacy gumps will still inherit `Gump`, which now inherits `BaseGump`

# Special Thanks

Thank you to @stefanomerotta for considerable contributions/benchmarking/testing to make this effort a reality! We collectively went through over 10 iterations, but it is finally ready.
2024-04-25 22:40:30 -07:00
.config fix: Adds missing migration files. (#1642) 2023-12-20 13:02:01 -08:00
.github fix: Adds command help, webpage, and fixes issues with other commands (#1669) 2024-02-10 00:19:19 -08:00
Distribution/Data fix: Fix unguarded/termur regions in regions.json (#1723) 2024-04-07 13:30:35 -07:00
docs chore: Adds [AddonGen to commands page on modernuo.com (#1713) 2024-03-28 16:52:00 -07:00
Projects feat: Adds optimized dynamic/static layout gumps (#1652) 2024-04-25 22:40:30 -07:00
.editorconfig Adds ModernUO docs skeleton (#243) 2020-09-13 15:21:28 -07:00
.gitattributes fix: Adds migration checks to CICD, updates dependencies, adds Fedora 37, alpine 3.17 support (#1309) 2022-12-22 12:12:47 -08:00
.gitignore fix: Adds command help, webpage, and fixes issues with other commands (#1669) 2024-02-10 00:19:19 -08:00
azure-pipelines.yml fix: Fixes migration check (#1626) 2023-12-02 12:50:42 -08:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2020-05-05 08:51:39 -07:00
CONTRIBUTING.md chore: Updates discord links (#394) 2021-01-07 01:04:05 -08:00
Directory.Build.props chore(deps): Bump Serilog.Sinks.Console from 5.0.0 to 5.0.1 (#1632) 2023-12-08 16:02:37 -08:00
FAQ.md docs: Updates FAQ for time zone issues. (#1368) 2023-03-10 00:18:36 -08:00
global.json feat: Updates to .NET 8. (#1542) 2023-11-14 17:08:09 -08:00
LICENSE Fixes more line ending issues (#267) 2020-09-27 13:54:56 -07:00
mkdocs.yml docs: Updates serialization docs (#1327) 2023-02-02 19:37:18 -08:00
ModernUO.sln fix: Replaces FindItem(s)ByType(s) implementation with BFS strategy (#1454) 2023-08-18 22:05:28 -07:00
publish.cmd fix: Removes echo in publish that is not needed (#1477) 2023-08-29 07:53:10 -07:00
publish.sh feat: Adds .NET 7 & Arm64 support (#1229) 2022-11-06 09:59:11 -08:00
README.md chore: Update README.md (#1661) 2024-01-20 14:24:44 -08:00
rider-settings.zip Cleanup/Housekeeping (#242) 2020-09-12 15:31:21 -07:00
Rules.ruleset Cleanup & Fixes for .NET 5 (#309) 2020-11-15 10:03:50 -08:00
RUNUO_TO_MODERNUO.md fix: Update RUNUO_TO_MODERNUO.md (#1613) 2023-11-24 23:49:43 -08:00
SPONSORS.md Adds Chia to sponsors page 2023-02-24 19:16:27 -08:00
stylecop.json Updates formatting rules (#199) 2020-08-25 18:00:51 -07:00
THIRD-PARTY-NOTICES chore: Updates 3rd party notices (#1042) 2022-06-01 09:42:11 -07:00
version.json feat: Adds optimized dynamic/static layout gumps (#1652) 2024-04-25 22:40:30 -07:00

ModernUO Discord Subreddit subscribers Twitter Follow

Ultima Online Server Emulator for the modern era!

GitHub license GitHub stars GitHub issues
GitHub build Azure Pipelines build

Requirements

Supported Operating Systems

Windows 10/11/2019/2022 MacOS 11+ Debian 11+ Ubuntu 20+ LTS
Alpine 3.18+ Fedora 37+ RedHat 7/8 CentOS 7/8/9 openSUSE 15+ SUSE Enterprise 12 SP2+ Linux Mint 17+ Arch

Required Frameworks

All Operating Systems

.NET

Windows

VC++ Redistributable 17

Development

git .NET

Supported IDEs

Jetbrains Rider 2023.2+spaceVSCodespaceVisual Studio 2022 v17.7+

Getting Started

  • Install prerequisite requirements
  • Clone this repository (or download the latest):
    • git clone https://github.com/modernuo/ModernUO.git
  • Open ModernUO.sln to start developing

Building/Publishing

  • Run ./publish.cmd [release|debug (default: release)] [os] [arch (default: x64)]
    • os - Supported operating systems
      • win - Windows 10/11/2019/2022
      • osx - MacOS 11/12/13 (Big Sur, Monterey, Ventura)
      • linux - Linux
    • arch
      • x64 - Intel 64-bit
      • arm64 - ARM 64-bit (Windows Arm64 not supported)

Linux Prerequisites

Fedora, CentOS, RHEL, etc

dnf upgrade --refresh -y
# CentOS does not come with EPEL enabled
dnf install -y epel-release epel-next-release
dnf install -y findutils libicu zlib-devel zstd libargon2-devel tzdata

Ubuntu, Debian, etc

apt-get update -y
apt-get install -y libicu-dev libz-dev zstd libargon2-dev tzdata

Running the Server

  • Follow the publish instructions
  • Run ModernUO.exe or dotnet ModernUO.dll from the Distribution directory on the

Troubleshooting / FAQ

Want to sponsor?

Thank you for supporting us! You can find out how by visiting the sponsors page.

Collaborators

Kamron Batman Mark1145

Thanks

  • RunUO Team & Community
  • Voxpire, the ServUO Team & Community
  • Karasho, Jaedan and the ClassicUO Community



Development Tools & Plugins provided with ♥ by
JetBrains Material Theme