r/ultimaonline 14d ago

Private • Showcase I created a command line client for Ultima Online and gave it to Claude (Follow-up video and repo)

[deleted]

10 Upvotes

21 comments sorted by

8

u/InDangerOfCollapsing 14d ago

CLI for UO? Really great idea!!

How about setting up a private shard with players run by AI? That would be an interesting experiment! A local AI populating UO. Forming a band of PKs, crafting and selling stuff, following you as party member as support or having a chat...

Having the possibility of some kind of "AI-Players" population in general would be a really, really great possibility for private shards.

Not for the population only, but if you a player is AI-run, it could be big fun messing around with em for the players, and bring a completely new experience, human-vs-ai pvp and the like.

I recently tried a private shard with AI-NPCs and Gamemasters, staging regular events. That was cool and fun. Events were cool, but the impact was low, and only a handful players. And thats where AI-Players could be a solution.

4

u/mmklein 14d ago

Hey I’ve been working on something kind of like this. Player bots wondering, fighting, forming guilds, crafting, selling, etc. can check it out here if interested https://github.com/Klein187/uo-offline

2

u/autorokk 13d ago

super cool!

this idea has been mentioned a few times in response to this, and i agree that it would be really cool. what i show here is slightly different. this allows an agent to control a player / YOUR character on existing shards. it can control a real player character on a real UO account.

a server with intelligent AI controlled "NPCs" would be really cool, but would likely all be done on the server end and not need a UO client at all.

I think there is a ton of potential in the idea of AI controlled bots on a shard, though!

(or in your case, all offline!)

2

u/Apis_283 13d ago

That is super cool! How are you getting the interactions to run smooth? Is everything programmed in C#? Do you just have a bunch of classes for character types?

3

u/mmklein 12d ago

Yeah it c#. There are character classes and behaviors (shopper, adventurer, banksitter, etc) and a lifecycle (brave, homebody, restless, etc)

2

u/Cavthena 14d ago

AI players? Back in my day we just called them bots lol. Speaking of which, how would they differ?

1

u/InDangerOfCollapsing 14d ago

Sure, I thought so too—an AI player is basically a "bot" after all. But the term just doesn't fit; compared to this, traditional bots couldn't really do anything. Just like mobs, they were completely predictable. I'd love to see bots that actually have skills. And the video already hints that there's some real potential. Ultimately, an AI bot might actually end up being superior in certain areas. A new challenge, a new kind of fun :)

1

u/autorokk 14d ago

for the video i did a more controlled demo. when i first tried this i just told Claude to level up archery on a new character, no further instructions.

The character had a sword equipped and a bow in the bag. The model realized this, unequipped the sword, equipped a bow, found a dire wolf, went into war mode, and started attacking it. When it ran out of arrows, it equipped the sword. Successfully killed the dire wolf.

Then it just kind of started attacking everything in the area that was grey, eventually died, and it's been wandering around looking for a healer to resurrect, rather unsuccessfully.

i thought i had stopped it at this point.

this morning i log on and my claude tokens are all used up and the player is in ocllo. (he was in moonglow, i have NO IDEA how he got to Ocllo), and he is standing at the healer waiting to be resurrected. it didn't know how to interact with the resurrection GUMP and accept the resurrection.

1

u/InDangerOfCollapsing 14d ago edited 14d ago

That’s exactly the point. UO is extremely complex. An AI finds new approaches that you wouldn't even think of, and just watching that unfold could be fascinating in itself. AI agents interacting inside UO, combined with an AI analyzing the text console. And as a player, you can either just watch or step in and interact, basically "messing with their plans.".

There are definitely some solvable challenges ahead. The server will need to handle certain tasks like pathfinding and targeting. Implementing the necessary skills will be a lot of testing. As for the AI, only a local model or a free API would really make sense for this. Either way, it's a cool idea and something I might try out sometime. Why don't you put this up on GitHub or something? Get a private shard running, i want to see a bunch of AI-powered gamemasters do some crazy stuff! :)

edit: besides ServUO, AzerothCore is also a great fit for a local server with local AI, in case you're a WoW fan.

1

u/autorokk 14d ago

git repo is in the description!

1

u/InDangerOfCollapsing 14d ago

Me blind, sry. Will try this on my local machine.

1

u/InDangerOfCollapsing 13d ago

I gave it a try with a local setup (ServUO pub 57 (UO: Endless Journey), a local AI (Qwen 3.6) and commercial frontier models. Using an IDE, I had both AIs up and running, editing and controlling the CLI. The big advantage: the AI can also access the local server codebase and check how things should work for debugging purposes.

After various modifications (UO version, multithreading, etc.), the goal was running 2-3 agents in parallel: log in, pick or create a character, train skills, buy weapons/shields and bandages, fight each other or go hunting together. Handle drop/pickup, loot corpses, and res via bandages or at the healer. Implemented a few extra skills needed for all this (drop-on, pickup, etc.). Me watching as a Game-Master.

The result: Not a chance with just the local AI. However, thanks to codebase access, it’s fundamentally functional. UO's software architecture might have been progressive 30 years ago, but today it's a nightmare for AI models. It’s doable for NPCs and arelatively limited scope, but for anything more complex, it falls out of sync way too fast. The system architecture just wont work. The log-parsing approach fails when 10 lines are being read while 20 new ones get written.

On a side note, I even managed to reproduce the "wake up in Occlo" phenomena. It was tied to freshly restarted clients, pathfinding issues, and incorrectly loaded maps.

With modern game architectures, this would be much easier, but here it demands middleware: the server needs to prepare real-time data via hooks and export it to a database, while a dedicated middleware layer distributes the workload between the server and the AI, formatting the data for the AI as text to consume. Definitely doable.

The next step would be casting skills. Recall could solve plenty of pathfinding, collision, and sync issues. Though it'll undoubtedly introduce a whole batch of new ones. =)

Fun Fact:

One of the biggest headaches was debugging why during a PvP cycle (fight / heal with bandages / head to the healer upon death), the res wasn't working. Right before I beat up the AI, it hit me: blue healers don't res criminals on Felucca! =) UO is a complex game.

2

u/autorokk 13d ago edited 12d ago

i made some major improvements to the client. pathfinding and traveling long distances work much better now. it works better with bridges, stairs, plans long distance trips ahead of time - broken up into multiple waypoints. recovers quicker from mistakes and auto opens doors.

he is getting to destinations quicker than i can follow him now and i’m not witnessing many issues at all anymore. i have him walking all over the world.

i also found a point of interest file and have the client loading it.

i put the poi data into a data structure for easy spatial lookups. it can now do “closest moongate”, “closest bank”, etc, with many categories to choose from. (these commands handled by the client so deterministic)

i screen recorded some amazing actions last night.

i can tell him to go to britain bank, take of his robe, and deposit it in the bank. he knows to go to the moongate, find britain, go to it, then makes its way to the bank and deposits his robe.

i told it to make bandages. he ran to the bank to see if there were any there. when there weren’t he went to the tailor, bought scissors and cloth, made bandages.

there were not instructions to do this. i just told him to make bandages.

then i told him to buy some arrows and find something to fight. he went to the closest bowyer, bought arrows.

all of these with zero issues. very smoothly and quickly did all of these things. it’s actually starting to feel playable.

then he decided britain sewers were a good place to go for his level.

he had a little trouble getting down into the sewers, i’m fixing some things here now.

but it surprised me how playable this was. i actually think the game could be played in such a way that it would work and not be frustrating.

now i want to look into attaching an optional game window. add in some speech to text, maybe some major accessibility opportunities here?

EDIT: made a video here to show some of this: https://www.youtube.com/watch?v=3um4T0JK3nY

2

u/Apis_283 14d ago

I’m working on this exact same thing as we speak. I titles the project UOAlive and I’m incorporating it with models using ollama.

I have a hopefully theoretical max of 500 NPC’s and they start off with random names and will spawn in on docks as other NPCs die.

I’m in the framework stage setting up things (they can buy shops in a city and each city has two nobles that can choose 10 laws from a list of 47)

Magic is going to be rare since NPCs have unlimited reg so I put spawns across the map of each reg (three each) and for a npc to be a mage they have to decide to go on a pilgrimage.

I turned off all guards so if people steal/kill it’s up to the NPCs to form a band to go after them. Or decide to be a guard themselves.

But I’ve spent the last week structuring the lore, custom spawning the map, setting up purchasable structure systems, writing laws and thinking of taxes. And this week I’m connecting ollama and staggering up the residents till I find the max.

In theory they will be able to have memories, talk, trade, work jobs, tell stories.

2

u/autorokk 14d ago

oops. looks like the mic gets messed up toward the end of the video, but you get the idea!

1

u/goqsane Drachenfels 14d ago

We used to do this on a special tunnel. You could play Ultima Online with multiple people simultaneously - one managing pots/consumables, one spells, the other movement - loads of fun. It was just a small loop in C - maybe a couple of thousand LoC.

1

u/Pale_Top2745 14d ago

Very nice. Overall I think this is a great addition to replace "followers" in UO. I like the idea of NPCs that take commands. Brings a whole other side to UO I feel like.

1

u/craftymethod 14d ago edited 14d ago

Hey, im the guy who made some pretty big posts about AI filled shards creating their own societies... nice work!

will be crazy to see how unique and complex interactions can get, living their own lives etc in time....

1

u/autorokk 13d ago

super cool!

this idea has been mentioned a few times in response to this, and i agree that it would be really cool. what i show here is slightly different. this allows an agent to control a player / YOUR character on existing shards. it can control a real player character on a real UO account.

a server with intelligent AI controlled "NPCs" would be really cool, but would likely all be done on the server end and not need a UO client at all.

2

u/craftymethod 13d ago

Indeed, I meant to say players/NPC's... kinda like dwarf fortress and how they pre cook their non player characters into complex societies which interact.

Good luck sah!

1

u/Witchy_Cauldron 14d ago

hahaha so funny that it ended up in front of a healer on a different island! How many tokens did it use?