SIfixes and Numbered NPCs

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

SIfixes and Numbered NPCs

Post by Knight Captain »

Thanks to the report of duplicate Ernestos in Moonshade I ended up creating fixes that:

1) Added Ernesto as a 'real' numbered NPC rather than a spawned monster (NPC -1), and gave him a realistic schedule. He now eats at the inn, and loiters west of the blacksmith.
2) Added code that prevents spawning him to prevent further duplicates.

Then I took a look at The Silver Seed NPCs, each of which is also a spawned monster.

3) Added Isstanar, Elissa, Surok, Tsandar, Shal, Yurel, and Draxinar as numbered NPCs, and gave each schedules so they sleep. The keep inhabitants also will now sit with Isstanar for a bit, but do not eat.
4) Wrote new Usecode to strip Elissa, Shal, and Draxinar of their spell shapes when they die.
5) Added code to the Rabbit function that kicks off the game start, and prevent Karnax from triggering the creation of the SI NPCs as spawned monsters.
6) Changed three of Yurel's path eggs to Quality 15 so his existing barks can finally be seen.
7) Added a name to Isstanar's shape so he's now "automaton" rather than completely blank. Due to the way Exult does shape names, this means the entire list has to be included in the patch, it appears.
8) Fix Draxinar's shape so he's taller than the table and most things around him. He was 4,4,3 before, now he's 4,4,5 similar to the BG's red dragons.

TODO

9) Create an egg that causes Draxinar to approach the Avatar when he first enters Draxinar's area.

I'm hoping this large patch will be accepted into SIfixes, but would like to know if anyone would be willing to help me test this first?
agentorangeguy
Posts: 565
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by agentorangeguy »

awesome!
-------------------------------------------------------------------------------------
Ultima 6 Mod for Exult site: http://www.ultima6.realmofultima.com/
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Dominus »

I just can't find the time ;(
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

It's almost done, including the Draxinar approach egg, but I don't know which mod files I need to include since many of the monster fixes are binary-only.

This also includes fixing in in-hand offsets for the Goblins at Fawn Tower.
galneon
Posts: 23
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by galneon »

It's great to see you putting in all this time to polish things further.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

Though I didn't change Iolo's cell path egg values, I'm now seeing him do a vertical pace as opposed to the normal path. Did the Patrol code get improved recently?
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

I need to do some schedule work on the Silver Seed NPCs. They don't do Desk Work well without items, and somehow I need to redo Tsandar's schedule.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Dominus »

is their schedule work in the original as boring? If not it might be worth looking at how it differs and push for a schedule code change.
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

They have no schedules in the original. So they never leave their day jobs. Must get great overtime pay. So I gave them full schedules.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Dominus »

Sorry, should pay attention. You might need to add desk items to their desks then.
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Dominus »

Or don't use the desk schedule but something different ;)
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

My pull request has been submitted.

I also added these fixes:
9) Created an egg that causes Draxinar to approach the Avatar when he first enters Draxinar's area.
10) Added the correct in-hand offsets for the Goblins at Fawn Tower, which use the shape that doesn't have them. Their weapons now appear.
11) Fixed the teleporter out of the gridiron football field, going to the intended location outside of Pothos' house/island: 2265,1919.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

I've pulled back my own pull request to improve it a bit.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

Pulling this back was the right thing to do. While my Ernesto conversation code was manually converted from the original code, I didn't convert the Flags over to the si_flags.uc list. So I've had to do a bit of research, but here's some additional flags:

PICKED_UP_BROWN_BOTTLE = 0x45, // Set when you pick up the brown bottle
KNOWS_GOBLINS_HIDEOUT = 0xC0, // Set only by Krayg the Provisioner
FOUND_BROWN_BOTTLE = 0xC8, // Set when you see the brown bottle by the monolith
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

As part of improving these changes, I had everything done until I started writing the change log entry. I realized it's way too many changes at once, so I'm going to resubmit much of these as small pull requests.

For now, I've just opened a pull request for this edit:
https://github.com/exult/exult/pull/15/files
This tiny request only makes a single map edit. It fixes the blank destination of teleporter egg out of the gridiron football field, which now goes to the intended location outside of Pothos' house/island: 2265,1919. This was an annoying issue as a player, since the only way out without cheating was to die of hunger.

Remaining items to be cleaned up and submitted:

1) Re-add Ernesto as a real NPC with a schedule, and prevent duplicates.
- Map edit to add NPC, set his schedule, give him appropriate gear.
- Usecode for his conversation (with fixes).
- Usecode to not spawn him via egg.

2) Add the correct in-hand offsets for the Goblins at Fawn Tower, which use the shape that doesn't have them. Their weapons will appear after this is done. This would fix https://sourceforge.net/p/exult/bugs/1948/

3) Silver Seed NPC changes, since these mostly re-use the Usecode attached to their shapes. This was the largest part of the large request.

4) Possibly add some other minor shape edits, such as fixing the Ice Dragon's attack to use a blue flame rather than a telekinesis shape.
Paulon

Re: SIfixes and Numbered NPCs

Post by Paulon »

The ritual blooding device is faster than hunger for getting out of there. Still a pain though. Your fix is a good thing.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

Topo's schedule includes a lunch break, but he just stands at the cask, so I'll include a change for this too.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

It also appears Julia can end up sleeping in the other bed in Hawk's room if there's a ranger already in the bed she uses in the barracks. Why doesn't she use the bed upstairs?

Technically, it's further away, but why not set that too?
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

And the chairs south of the Rangers' mess hall table are too close to table for them to sit there.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

In the original, Petra uses plate frame 4, but Exult only uses plate frame 0.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

I opened a bug for the Waiter schedule.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

Ernesto as a standard NPC has been submitted for approval.

Much of this was map editing, since the NPCs are built into that.

Ernesto
Added Ernesto as NPC233 and disabled his spawn eggs so he's now a standard NPC like Julia, etc.
Gave Ernesto realistic adult-level stats, since the spawned ones used the semi-random ones the other Rangers get and those are mageling-weak.
Gave Ernesto a Magic Bow and Lucky Arrows to make him stand out from the other Rangers. Julia has a Magic Sword so it makes sense.
Gave Ernesto a schedule based on the egg-spawn times, but filled in the middle of the day so he's visible in Moonshade. This will make it easier to get his honest opinion of Julia.
Converted and improved Ernesto's entire conversation tree, which fixes:
Ernesto not checking for items before commenting.
Ernesto not changing his response about the shield based on your tattoo.
Ernesto not correctly checking for the Banes being released, now correctly comments on Shamino the MageLord.
Removed the nocturnal egg that creates a sleeping Ranger from 2179,1844 so he does not compete for the bed Ernesto sleeps in.

Julia
Julia was also competing for a bed with the nocturnally spawned sleeping Rangers, often making her teleport to the nearest open bed in the Blue Boar Inn, in Hawk's room. Fixed this by changing Julia's schedule to sleep in the unused bed in the Ranger's tower at 2148,1814,6. I suspect this was intended but not implemented by the original team.
Gave Julia a key to the tower (same as in the desk) and a backpack to hold it in, and leather leggings to match Ernesto.

Topo
Topo had a broken lunch schedule, which would have him stuck in the location of the cask rather than going to the inn to eat as intended. His schedule has been changed so he goes to the inn at noon.

Map Edits
Rangers' Sleeping - Removed the nocturnal egg that creates a sleeping Ranger from 2179,1844 so he does not compete for the bed Ernesto sleeps in. (listed above)
Blue Boar Inn - Moved one chain in the to line up with the table so the plate Petra serves appears on the table.
Rangers' Mess Hall - The chairs have been rearranged so they can sit south of the table as an egg intended.
The existing mislayered plates and food have been changed, and smaller plates put in their place. The eat-at-inn activity does not seem to consume already-placed food, nor does it create a plate if there is not one there already. To be as close to canon as possible that food was moved to the other non-dining tables in the same room.
Added new but canonical blue wine glasses.
Shamino's Castle - A cobweb that overlays a nightstand at 1810,1012,1 has been moved south to make the nightstand accessible without needing to find the one pixel that wasn't covered.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

I also added si_faces.uc which lists all of the face shapes, which were not previously enumerated, and edited the make.bat script to help new editors with compiling their own edits.

Remaining Changes:

1) Move the other Eggs to the new Eggs folder, and break out shapes like the Bolt fix that are in other files.

2) Change the five Goblin NPCs at Fawn Tower to use the shape that has the correct in-hand off-sets, so their weapons will appear. This would fix https://sourceforge.net/p/exult/bugs/1948/

3) Add each major Silver Seed NPC, since I've already got most of the code done for this. It's the schedule part that's harder, and I want to create Barks for when they sit together. I'm also going to submit their Usecode as single files so they can be improved later, perhaps to address flawed conversation code.

4) Possible add some new shapes, such as fixing the Ice Dragon's attack to use a blue flame rather than a telekinesis shape that appears invisible on the snow.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

Thanks to my nifty UCXT->Usecode C sed swap I've got more code waiting for the next round already. :D
Dale
Posts: 176
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Dale »

I want to like all the work you are doing forever. When I get used to being a father and know how to manage my free time again, I am going to be harassing you for help on the mini-mod I was making. You seem to have your game down pretty well already! Impressed.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

Thank you. I hope to write some documentation on the process so others can join in.
Dale
Posts: 176
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Dale »

Yeah that was always my plan as well, but I didn't learn enough to make it worthwhile. Big kudos again!
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

I've been adding a ton of externs to the main si_externals.uc file, reordered the si_flags list, identified some new flags, and generally reordered SIfixes to ease future improvements.

I've also restarted adding the Silver Seed NPCs as NPCs 305-311 to match the face shapes for them. Yurel's barks will now work with eggs 3, 5, 7, and 11 all set to Quality 15.

The Usecode for most of the Silver Seed NPCs are so bad I may as well re-write them all. For example, Tsandar's lines are missing most but not all of the closing double quotes.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

Wow, I checked out about 300 flags today. There's so many orphaned flags that are checked and never set, or set and never checked. They're all getting listed in si_flags.uc as well.

I'm not sure how Draxinar's conversation loops the riddles endlessly.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

Up to 346 (0x15A). Found one flag that only exists in the Fawn Guard's shape usecode that seems to be unset if you are allowed into the city. Maybe it was leftover from some cut plot where you are expelled from Fawn after a guilty verdict?
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

493 flags of about 740 SI non-SS flags.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

534
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

792 is the last original flag, and in typical SI fashion, it's an orphan that is only set and never checked. I've also identified even more si_externals.

It was Delin in Fawn that directed Batlin to Andral for blackrock:
"Batlin... ah, I remember he came here asking about some sort of rock sculpture or something. Black rock..."
"I told him I am a simple merchant. I do not carry such luxuries. I directed him to Monitor. There is a sculptor there."
So perhaps that is where the orphaned flag 0xB was to be set that allows asking Andral about Fawn? His reply isn't specific to Delin however. Delin's conversation code is a bit incomplete, though.

Julia's conversation line about the missing wine that "I still do not know what to make of that odd map we found in its place." is in the Beta but not in the release.
She will return it: "It is no land that I know. Thou art welcome to it if thou dost wish it. I have no use for it."

There are two flags empty within the group of former-companions-with-belongings flags, but it is not clear who the NPCs were, or if they were ever decided upon by the designers.

Flag 0x29 is unused, just after all the copy protection questions. Could this have been intended for the lambskin glovermaker letters-in-name question? It could be possible to add this back but the entire function that randomly selects the question would need to be rewritten.

There might be a vision connected to the cat shape, but if or what it is I do not know.

Event A might be similar to Event Scripted, but called by the run_path command.

The overall order of the flags actually makes sense because they are done by geographic region, which is:

Temp Flags
Belongings
Copy Protection
Monitor (with the Fishnet flags included)
Banes
Moonshade
Fawn
Mad Mage Isle
Sleeping Bull (with Bard Songs and the Mint Ambush)
Furnace
Gorlab Swamp / Dream Realm
Temples
Mountains of Freedom
Skullcrusher
Spinebreaker
White Dragon
Beatrix
Gwani
Monk Isle
Isle of Crypts
Teleport Storm Items
Sunrise Isle?
Northern Forest
Thoxa and Karnax Battle
Unknown 0x2C4-0x2CC
Temple of Emotion
Party Dynamics (sleeping and stealing)
Great Earth Serpent Speeches
Silver Seed
And that one last orphaned flag.

Between that logical order and the Beta's flagname list using the $ variable before each flag name, it appears that the Origin built process used an autonumber system. So flags that were unused but still enumerated in their list used up a spot. Since the Monitor flaglist was not culled as the game changed during development, we have 43 unused flags in that section of flags.

It also explains why the Beta's flag numbers are so far from the release's flag numbers. The Temp, Belongings, and Copy Protection flags were not done then or included later in the compilation list.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

NPC functions 0x801-0x87B are also in alphabetical order:

Alyssand
Argus
Automatons
Boydon
Bucia
Cantra
Caretakers in Freedom
Cellia
Clone Iolo
Man in Fire (Did he have a name that started with C?)
Columna
Delin
Delphynia
Devra
Draxinar
Ducio
Dupre
Elissa
Ensorcio
Something unused Func082F
Filbercio
Flicken
Gustacio
Gwenno
Harnna
Hawk
Hound of Doskar
Iolo
Jendon
Julia
Krayg
Lucilla
Luther
Marsten
Melino
Monks
Mortegro
Petra
Pomdirgun
Pothos
Rabindrinath
Rocco
Selina
Shamino
Skinless Yelinda
Spektor
Standarr
Stefano
Surok
Topo
Torrissio
Tsandar
Wilfred
Zhelkas (incredibly convoluted functions breakouts)
Zulith

So the Origin code base wasn't quite as disorderly as it may have seemed.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

In addition to the blatant spelling and missing quotes, "Sithnos" is used as the name of the last hierophant, not "Ssithnos".
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

Found another thing while poking around. The small island to the west of the ice raft has an egg that spawns fish on land (the ice).
agentorangeguy
Posts: 565
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by agentorangeguy »

that is awesome, keep up the good work! When I start playing SI again , i'll gladly test things out for you
-------------------------------------------------------------------------------------
Ultima 6 Mod for Exult site: http://www.ultima6.realmofultima.com/
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

Another small bug, the well under Delin's shop cannot be used because it is against the western wall, blocking the Avatar from the crank.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

I've gone down the rabbit hole a bit on this, but I've found a way to list the names of each egg in Exult Studio by creating a little custom Usecode C for each:
// Replaces the each color orb with a burnt-out one.
void eggSSOrbPedestals object#(0x765) ()
{eggSSOrbPedestals.original();}
Then when looking at the same eggs in ES, the name shows as eggSSOrbPedestals.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

I think my next merge request for SIfixes will be my last for a while, as I'm starting my new mod very soon.
Joseph
Posts: 7
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Joseph »

Thanks KC for your efforts! Can I ask if it's playable yet? I mean in the sense that it's a bit polished? Or should I stick to regular SI if I intend another playthrough?
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

I'd highly recommend the latest release of SIfixes, which is on the Downloads page. Not all of the latest work has made it into place yet, but what's there now is well worth the installation.

I wish we included it in the default installation.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: SIfixes and Numbered NPCs

Post by Knight Captain »

The egg thing didn't work as expected after all. :(
Vasculio294

Re: SIfixes and Numbered NPCs

Post by Vasculio294 »

Love how you manage to make Ernesto into a REAL NPC. I was wondering if you could do the same for the Witches? Rieya, Drusilla and Solaria
Locked