Skip to main content

Extract information and images from the Ultima Online client files

Project description

PyPI version

ultimapy

ultimapy is a python library for rendering images from the Ultima Online client files. The SDK part of the project is almost a direct 1:1 code translation of the C# Ultima SDK (used by UOFiddler, among other things).

It does not support saving back to client files, only reading.

Why?

The C# SDK does not run with mono due to implementations being missing from the underlying libraries. Attempts to get this to run in dotnet core or using mono have never been successful. Rewriting this code in Python allows the code to be used in a linux environment, for the most part out of the box. Since Python has many available popular open source web frameworks, this library allows you to serve up images directly in code used by your web framework of choice.

It also includes some features not seen anywhere else, such as the rendering of player avatars. Items & paperdolls have been done before in PHP, but that code is difficult to read and edit, whereas this library takes a much more flexible and simple approach (the same as which is used in the C# SDK). This lib even fixes a few rendering bugs which are present in the C# SDK.

Features

ultimapy can currently do the following:

  • Render land, statics. This includes rendering of in game items.
  • Render "animations" or single frames of animations. This includes monsters and players, though player construction is done by rendering the mount, body, hair and clothing layers in order.
  • Draw text from the client (eg, ASCIIFont).
  • Extract information about skills - naming, groups, indexes.
  • Rendering paperdolls / individual gumps

Installation

Install ultimapy to your project with:

pip install ultimapy

You must specify your Ultima Online client directory by any of the following methods:

  • environment.ini - add the line ULTIMA_FILES_DIR=/path/to/ultima
  • Django - add into settings.py: ULTIMA_FILES_DIR=/path/to/ultima
  • Specify an environment variable ULTIMA_FILES_DIR with the value /path/to/ultima

Settings

As above, settings can be set through any of the methods that the ULTIMA_FILES_DIR can be set by (environment.ini, Django settings, environment variable).

Currently there are only 2 settings:

  • ULTIMA_FILES_DIR, this is the path to your Ultima Online directory. This has no default and will not read from registry.
  • ULTIMA_MOUNT_IDS, if loaded via environment, should be a valid json list of all possible mount IDs. If set in Django, can simply be set up as a list. This has a default of mounts that are found in the 5.0.8.3 client.

How to use ultimapy

Example of creating an image:

from ultimapy.sdk.art import Art
from ultimapy.sdk.hues import Hues

moongate_item_id = 0x0F6C
art = Art.get_static(moongate_item_id, check_max_id=False)
art.save("art.png")

red = Hues.HUES[32]
red_hued_art = red.apply_to(art, only_grey_pixels=False)
red_hued_art.save("red_art.png")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ultimapy-0.0.25.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ultimapy-0.0.25-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file ultimapy-0.0.25.tar.gz.

File metadata

  • Download URL: ultimapy-0.0.25.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ultimapy-0.0.25.tar.gz
Algorithm Hash digest
SHA256 71a666782a97056dc499d0ceb856986ce255b3f6f35b6506d15149ea379b9e51
MD5 f49844361db4e2060bc655c52ec577b0
BLAKE2b-256 782538995afb2bc1867271235e2265e94d92a4bdfce8bed31afbe3f2e52ac1e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for ultimapy-0.0.25.tar.gz:

Publisher: publish.yml on jackuoll/ultima-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ultimapy-0.0.25-py3-none-any.whl.

File metadata

  • Download URL: ultimapy-0.0.25-py3-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ultimapy-0.0.25-py3-none-any.whl
Algorithm Hash digest
SHA256 527188742ebf5588c27214a687035f442d094cbebd0d88650fa039321c3a2323
MD5 538756a51e31fac1b127d18d764eac3b
BLAKE2b-256 5d8c044d057aa64c835fe63a8ac8c88ebb53978f3799bca8f52e9a8ca203d825

See more details on using hashes here.

Provenance

The following attestation bundles were made for ultimapy-0.0.25-py3-none-any.whl:

Publisher: publish.yml on jackuoll/ultima-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page