Colors

Colors

Postby roguan on Tue Sep 07, 2010 3:03 pm

Hey guys,
This is awesome stuff. Really fun to dig into.

I've been looking around a bit and can't seem to find color ranges for hued sandals.
For example, a healer spawns with a robes
Code: Select all
<eq           robe yellow_colors 1>


These colors are defined in defines.q
Code: Select all
YELLOW_COLORS          1701 1747


On UOSA, most people look for black sandals on Weavers:
This is the code from the demo for Weaver shoes (also jewelers, tailors, artists, alchemists, cooks, actors, innkeepers mages)
Code: Select all
<eq           random_shoes neutral_colors 1>

So, for the demo, if weavers have a chance of getting black sandals, so should the other classes above.

But that's odd, because Black Colors are
Code: Select all
BLACK_COLORS           2305 2305

and Neutral are
Code: Select all
NEUTRAL_COLORS         1801 1887

So really, these classes, do not spawn black sandals in the demo.


But for most NPCs with colored sandals: priests, runners, cashuals, mages, healers, scribes, monks, herbalists, evil mages, evil mage bosses)
Code: Select all
<eq           sandals 0 0 1>

The question if color range provided by the
Code: Select all
<eq           random_shoes neutral_colors 1>
differs from the colors defined for the
Code: Select all
<eq           sandals 0 0 1>

Is information for the aggregate groups such as sandals (i guess it's aggregate if the sandals are not only brown) available via the Animdata parser?

Beggars has only a chance of having sandals.
Code: Select all
<eq           { sandals 1 0 1 } 0 0 1>
roguan
 
Posts: 17
Joined: Tue Sep 07, 2010 1:57 pm


Re: Colors

Postby Batlin on Wed Sep 08, 2010 8:34 pm

I believe the colors for sandals are black because of what you said and have a hue of 0 send to the client.

I used some breakpoint to track the creation of the sandals (type=5901 or 0x170D):
CreateObject (AX==0x170D).jpg
CreateObject (AX==0x170D).jpg (117.68 KiB) Viewed 193 times


And I used hardware breakpoints to track where the hue variable is accessed in memory:
Hardware Breakpoint.jpg
Hardware Breakpoint.jpg (150.55 KiB) Viewed 193 times


Result: the hue was never written to, so it remained 0 all the time.

Next: I used the LOGFILE option of uodemo+ to track the messages send from the server to the client:
Razor Log.jpg
Razor Log.jpg (25.52 KiB) Viewed 193 times
As you can see on that screenshot, the hue is 00 00, which resembles the memory layout of the sandal server-side. So the client is drawing the sandal with a hue of 0. You can refer to http://www.ruosi.org for the 0x2E packet layout.

Some sandals do spawn with a color, but they are part of the random_shoes definition (5901 & 5903).
<Derrick> RunUO AI is kind of a functional prototype, which i have hacked into something resembling OSI behavior, but only by complitcating everything
Batlin
Site Admin
 
Posts: 306
Joined: Wed Apr 08, 2009 6:35 am


Re: Colors

Postby roguan on Wed Sep 08, 2010 9:06 pm

Wow, thank you. This is really helping me understand the flow of things in the dissassembly.

But, this case whence the hue is never modified, does this then imply that sandals are always black upon creation? Where would "choice" of hue take place, for example the range applied to the random_shoes aggregate?
It's much more difficult to find these things without the function labels in place =/

Thanks!
roguan
 
Posts: 17
Joined: Tue Sep 07, 2010 1:57 pm


Re: Colors

Postby Batlin on Wed Sep 08, 2010 9:53 pm

<eq random_shoes neutral_colors 1>

But, this case whence the hue is never modified, does this then imply that sandals are always black upon creation? Where would "choice" of hue take place, for example the range applied to the random_shoes aggregate?
If the sandals are created by "eq sandals" then yes, they will always be black because the color definition is not there. If the sandals are created by "eq random_shoes" than the hue will be chosen from neutral_colors. I'm not sure what you mean with "where", but it's a function inside the EXE, that parses the parameters, in case of "0 0", then no hue is assumed. In case of (by example) "4551 4559" then the server will do a random between those 2 values I believe.

The templatestable can be edited. I only did in a limited fashion, but you fix the "eq sandals" have them spawn in other hues.

It's much more difficult to find these things without the function labels in place =/
It sure is, I still have a limited understanding of the objects and functions.
<Derrick> RunUO AI is kind of a functional prototype, which i have hacked into something resembling OSI behavior, but only by complitcating everything
Batlin
Site Admin
 
Posts: 306
Joined: Wed Apr 08, 2009 6:35 am


Re: Colors

Postby Derrick on Thu Sep 09, 2010 1:45 pm

Hue zero is always the default unhued graphic; so for sandals, hue zero is brown as that's their natural unhued color.

However it looks like NEUTRAL_COLORS is the key here.

RANDOM_SHOES { 5903 1 5901 1 }
NEUTRAL_COLORS 1801 1887

There is definitely one hue in NEUTRAL_COLORS, 1881 which looks pretty darn black to me when applied to sandals; I suspect this is the source of the black sandals on weavers. This gives a weaver a 1 in 174 chance of spawning sandals in a particular hue, although there may be one or two other hues in the color set that players may have called black.

True Black, usually hue 1 does seem to be used for beggar sandals, although it's some pretty unusual syntax, I'd like to verify this via the Demo if we can spawn a few beggars there it should be pretty revealing.

Thanks much for this thread.
Derrick
Site Admin
 
Posts: 250
Joined: Tue Jun 17, 2008 2:33 pm


Re: Colors

Postby Batlin on Thu Sep 09, 2010 10:52 pm

True Black, usually hue 1 does seem to be used for beggar sandals, although it's some pretty unusual syntax, I'd like to verify this via the Demo if we can spawn a few beggars there it should be pretty revealing.
I've created a script to spawn beggars,they are spawned with regular sandals or without any at all. So I believe the data between { } is more a chance indicator than a reference to the hue.

Normal beggars:
3 beggars, 1 with sandals, hue=0.png
3 beggars, 1 with sandals, hue=0.png (244.31 KiB) Viewed 181 times

Beggars in the inn:
Beggar Fest.png
Beggar Fest.png (243.31 KiB) Viewed 181 times
(I applied hue 1881 to the shirts, and I mixed hue 1881 and hue 1 to the pants and sandals, do you spot the difference?)

A NPC completly black but with hue 1881 sandals:
Black NPC with 1881 hued sandals.png
Black NPC with 1881 hued sandals.png (88.89 KiB) Viewed 181 times
(if one would apply hue 1 to the sandals, well the complete paperdoll would be black, except for the hairs)
<Derrick> RunUO AI is kind of a functional prototype, which i have hacked into something resembling OSI behavior, but only by complitcating everything
Batlin
Site Admin
 
Posts: 306
Joined: Wed Apr 08, 2009 6:35 am


Re: Colors

Postby roguan on Thu Sep 09, 2010 11:33 pm

Well I'll be, would ya look at that....
Image
4/4 female jewelers spawning black shoes or sandals only...
*EDIT* More spawning indicates about an equal amount of default colored shoes, default colored sandals, black shoes, and black sandals.

lol, it seems like someone made a typo... hence black sandals...
neutral_shoes should probably be neutral_colors in the original script
Code: Select all
<eq           random_shoes neutral_shoes 1>



As compared to the weavers...
Code: Select all
<eq           random_shoes netural_colors 1>
roguan
 
Posts: 17
Joined: Tue Sep 07, 2010 1:57 pm


Re: Colors

Postby Derrick on Fri Sep 10, 2010 1:58 pm

Wow, I missed that entirely, I even copied that equipment line into a comment in my own soure code yesterday and didn't notice neutral_shoes. Thanks!

Can you verify that those are coming out as Hue=1?
Derrick
Site Admin
 
Posts: 250
Joined: Tue Jun 17, 2008 2:33 pm


Re: Colors

Postby roguan on Fri Sep 10, 2010 7:08 pm

Confirmed. Female Jewelers are the only NPC's I've seen with this faulty equip code.

Image
Image
Image
roguan
 
Posts: 17
Joined: Tue Sep 07, 2010 1:57 pm


Re: Colors

Postby Kaivan on Sat Sep 11, 2010 2:29 am

Well, I dropped by this thread a couple of days ago and saw the discussion related to black sandals and the like. Among the topics I noticed some information suggesting that the only NPCs that spawned black sandals were Jewelers, and that they spawned these items due to a typo in the template file. To make a long introduction short, this did not jive well with my memory of OSI servers, nor did it match somewhat recent experiences with the demo.

From my recollection, jewelers and weavers were the two sources of black sandals on OSI servers, and in fact, they did not always spawn with these sandals (in fact it was somewhat rare). This notion came from the practice of sandal farming in Papua during early-mid UOR. The process was to pre-cast fire field (which had been disallowed in towns), and to run into Papua and cast it on the target. This exploited a bug in the targeting portion of the scripts that forgot to check to see if you were in town upon targeting the spell (this was not the only bug of its kind, mind you).

For anyone who recalls the configuration of the map, both the weavers and the jewlers shop were very close to the edge of guard zone, allowing a pre-cast spell to be released before the timer expired. However, the jeweler's shop was right next to the bank, which would attract attention and almost certainly get you killed, and your sandals looted. Thus, the weavers shop was the ideal location for an "out of the way" place to get sandals from.

Given that, on OSI servers, I farmed my fair share of black sandals using this method and one of the things that I decided to do while farming these sandals was to keep a set of sandals for myself. A couple of hours ago, I got onto my OSI account that I had re-activated some time ago in order to compare OSI functionality with demo functionality in certain areas and checked the black sandal stash that I had. The black sandals that I had (7 of them) all had a hue of 1. Thus, the sandals that I had farmed, that were quite specifically from the Fellucia Papua weavers on OSI servers, suffered from the same glitch.

Small note: during the time that I farmed on OSI servers for these sandals, weavers and tailors would both spawn either shoes or sandals. But when they spawned shoes, the hues weren't simply limited to the neutral color hues as they were on sandals. Sometimes deep blues and hot pink colors that were available on normal dye tubs would show up when they spawned shoes.

But back on the main topic, I also recalled seeing black sandals spawn on the weavers once on the demo as well. Unfortunately this was over a year ago (back before Batlin had even decompiled the scripts themselves), and I didn't have the forethought to take a screenshot then. So, I decided that I would take the time to mess around and see if I couldn't get one to spawn again on the demo. Luckily it didn't take more than a couple of tries (although this is not indicative of the total difficulty) to get one to spawn. Here are the screenshots:

Weaver spawns the black sandals
blacksandals.PNG
blacksandals.PNG (316.67 KiB) Viewed 168 times


Sandals on the weaver's corpse
blacksandals2.PNG
blacksandals2.PNG (334.51 KiB) Viewed 168 times


Shiny new sandals!
blacksandals3.PNG
blacksandals3.PNG (321.78 KiB) Viewed 168 times


And there you have it. It looks like something else is probably the root cause of this issue in the first place. Some testing on other NPCs should be done to see if any other NPC will spawn such sandals. From my recollection it is only Jewelers and Weavers, and if the demo confirms that, then we'll have ourselves a really awkward bug to track down.

Edit: Upon further testing in the demo it was discovered that only female weavers would ever drop black colored footwear. Further investigation into the templates revealed this amusing bug:

Here is the shoe equipment line from the demo for male Weavers:
<eq random_shoes neutral_colors 1>


Here is the shoe equipment line from the demo for female Weavers (notice the bolded letters):
<eq random_shoes netural_colors 1>


So basically both instances of black footwear come from a mis-spelling in the actual template itself. Given that, we can say that black sandals should spawn approximately 1 in 4 times on Jewelers and Weavers (1 in 2 for male or female, and 1 in 2 for sandals or shoes).
Kaivan
 
Posts: 13
Joined: Thu Apr 23, 2009 1:27 am


Next

Return to UO Demo

Who is online

Users browsing this forum: No registered users and 1 guest