Log in

View Full Version : Wrong Section? Merchant's Items Mislabeled?


Fatboy5706
10-27-2008, 03:25 AM
Well, I play on PEQ, and I went to buy Crushed Black Marble from a merchant and it gave me a steel collar instead, 70pp waste, and then I tried to buy a Flawless Diamond and it gave me a cog... not much pp wasted on the cog. The CBM was only 31pp and it charged me 178pp for the steel collar. I do not care about the pp, but something needs to be fixed. Move this to appropriate section if need be wasn't sure where to make this. Thanks in advance.

Fatboy5706
10-27-2008, 03:36 AM
Might need to be moved to bug section, sorry for the inconvenience.

trevius
10-27-2008, 04:26 AM
NP, I moved it to bugs. Sounds like a possible issue with the Temp merchant code. I know it was changed considerably lately. Sounds like it is worth investigating.

Fatboy5706
10-27-2008, 11:26 AM
You could keep me updated on the situation Trevius (am I allowed to capitalize that?), I know fixing things like this take time I am not rushing the resolution. Just a tidbit here and there would be helpful. Thanks in advance. ;)

So_1337
10-27-2008, 11:48 AM
Cavedude responded over on PEQ if you'd like to follow up there. He's looking for the merchant's name that you were using.

http://www.projecteq.net/phpBB2/viewtopic.php?t=5918

cavedude
10-27-2008, 12:04 PM
Yeah, this one is known and has been around forever. Reordering the items so they are in order by slotid corrects the problem. The items should be in order anyway, so I kinda like this bug. It lets me know when a merchant is out of order instead of going to each individually.

I am noticing a trend here, please post bugs in either PEQ or EQEmu, not both. They are going to be seen by the same people anyway so it just adds confusion.

ChaosSlayer
10-27-2008, 02:21 PM
Yeah, this one is known and has been around forever. Reordering the items so they are in order by slotid corrects the problem. The items should be in order anyway, so I kinda like this bug. It lets me know when a merchant is out of order instead of going to each individually.

I am noticing a trend here, please post bugs in either PEQ or EQEmu, not both. They are going to be seen by the same people anyway so it just adds confusion.

cavedude - could you be a little bit more specific how to "reorder" them?
or even better how to prevent this from happening?

thanks =)

cavedude
10-27-2008, 03:09 PM
The slot column in merchantlist on a given merchant has to be in order, with no gaps. If you have a have items in slots 1, 2, 3, and 5 let's say what happens is if a player sells an item to that merchant it uses the first available slot. In this case 4. The problem arises when the next player sells an item to the merchant. It'll go in slot 5, even though an item already exists there because the server knows 4 is home to a player sold item, via merchantlist_temp.

The code should probe merchantlist before assigning a slot to merchantlist_temp to make sure it isn't already in use. That will correct the issue. However, since the slots should be in order anyway that's a moot point.

trevius
10-27-2008, 05:36 PM
It sounds like you are right that it should be checking the merchantlist again before adding anything to merchantlist_temp. Even though it is probably best to fix every merchant so they are in order, I don't think it would be a bad idea to have it run that check of the merchantlist table again. Mainly I am thinking about servers running custom databases. Making sure all merchant tables are perfect could probably be a bit of a pain and it would be nice if people didn't have to.

Angelox
10-27-2008, 05:52 PM
Agreed, that's a headache for me (renumbering everything), although I did start to do this, but quit, because I didn't see any need for it. I guess there is now.
there's got to be script that can be made to run and renumber them.

It sounds like you are right that it should be checking the merchantlist again before adding anything to merchantlist_temp. Even though it is probably best to fix every merchant so they are in order, I don't think it would be a bad idea to have it run that check of the merchantlist table again. Mainly I am thinking about servers running custom databases. Making sure all merchant tables are perfect could probably be a bit of a pain and it would be nice if people didn't have to.

GeorgeS
10-28-2008, 10:10 AM
Adding this to the merchant editor so gaps are removed is trivial. I'll add this as an option in tonight.


GeorgeS

ChaosSlayer
10-28-2008, 02:23 PM
I still don't understand why we looking into how to "reorder" out of order merchants instead of fixing the source code to prevent the problem from occruing over and over again over time.

cavedude
10-28-2008, 03:15 PM
Because the database is wrong! That's the problem. The slots need to be in order, that's the correct way of doing things. We're just lucky the code doesn't actually use the slot to place the item, otherwise we'd see gaps on the merchants in-game.

The only reason why it is so bad is because items have been removed over time that do not belong. Now that all of the bogus items from vendors have been removed in PEQ, it has increased the gap problem considerably. Once all merchant's slots are in order starting at 1, we will no longer have a problem. The PEQ Editor, and I'm sure any other editor that works with merchantlists will automatically put any new items in order by slot. It is up to the world builder to make sure this happens.

Of course I'd like to see the code check a slot to make sure it isn't in use first before assigning it, but fixing that and then ignoring the gaps in the database is just plain lazy. If something is going to be done, it needs to be done right.

So_1337
10-28-2008, 04:05 PM
I suppose I misunderstood (and maybe ChaosSlayer did as well), as I thought you meant that these gaps could occur even if a vendor's base set of goods was perfect, just in the way that people would buy and sell items off of them.

Example: A merchant has ten items (that are correctly ordered in the database). Player A sells the merchant five items. Player B buys one of player A's items, sells six more. We now have 20 items, with one of them out of order because of the way the code works.

That may be the reason for confusion. I get it now. Thanks for explaining that it's only a database issue, and not a problem with merchants keeping items sold to them.

ChaosSlayer
10-28-2008, 04:19 PM
Because the database is wrong! That's the problem. The slots need to be in order, that's the correct way of doing things. We're just lucky the code doesn't actually use the slot to place the item, otherwise we'd see gaps on the merchants in-game.

The only reason why it is so bad is because items have been removed over time that do not belong. Now that all of the bogus items from vendors have been removed in PEQ, it has increased the gap problem considerably. Once all merchant's slots are in order starting at 1, we will no longer have a problem. The PEQ Editor, and I'm sure any other editor that works with merchantlists will automatically put any new items in order by slot. It is up to the world builder to make sure this happens.

Of course I'd like to see the code check a slot to make sure it isn't in use first before assigning it, but fixing that and then ignoring the gaps in the database is just plain lazy. If something is going to be done, it needs to be done right.


ok i guess i don't fully comprehend the entire mechnics of the system that why its somewhat confusing to me.

so merchant has item list
some items he has on his list are NOT supose to be there
those items were removed
removal created GAPS in the list

question - isn't server restart supose to reorder the list automaticly? I guess not.

In any way, from what i see the problem that merchant list in Db is been adress by some sort of internal id - (table row id#?)

and when items gets removed, the number secuence gets screwed up, right?

in this case i have stupid question: the way i understand the server boot up logic:

-server starts
-server load items and vendor info in memory
-server BUILDS vendor list based on data in DB - from my understanding- every time server starts vendor list is build from the scratch!!! this means gaps can ONLY occur if in real in ram vendor list gets altered.

In other words I don't understand how could there any sort of problem at all with thsi appraoch :cool:

cavedude
10-28-2008, 04:56 PM
Slot in merchantlist doesn't get changed by the server at all. Once you assign it, only you can change it. I think the confusion comes because perhaps you are thinking slot is an id. While it could be viewed that way, its real purpose is to allow the world builder to determine what slot he or she wants a particular item to show up in in-game on the merchant's list. This would allow somebody to say, put the more expensive items at the top of the list if they so wished.

In-game items will fill in to cover gaps in the slots, so there are no gaps visually. However, the slot column will still remain the same. If we have items with slot 1, 2, 3, 5, 21. The items would use slots 1-5 in-game, but the slot values in the database would remain 1, 2, 3, 5, 21. If the server did change that column, we wouldn't have a problem with slots overlapping, but we would also lose control over item placement on merchants. We want to tell the server which slots to place items in, not the other way around.

ChaosSlayer
10-28-2008, 06:11 PM
i am not sure why is it important to have item on vendor listed in SPECIFIC order in GAME - after all you not in the mall where they try to push all the jewelry at first floor and for shoes you have have to go to 3rd floor.

I realy doubt that in game vendors can posibly seduce players into buying their junk this way =)

after all -in game you have on vendor sort by name and by price

eitherway from what I see - any time you want to make some TINY change to a item list- you instantly break it - imho thats poor coding/design

So_1337
10-28-2008, 06:34 PM
That is a point; items are sorted alphabetically anyway, from what I've seen. Even if you manually ordered items, is there some method for having them show up the way you put them?

trevius
10-28-2008, 06:35 PM
As Cavedude already said, the option to be able to order the merchant list does have possible uses. Perhaps you want to have a vendor that sells free starter items and a bunch of other items as well. It would be best to have the starter items sort to the top to make starting out just 1 step easier. I can see definite use for this and now that I know that, I might just adjust my starter merchant's table lol.

But, I also agree that it is bad coding not to have it check the merchantlist again before adding more to the merchantlist_temp. It is probably a fairly simple change. Yeah, having the Database accurate is the right way to do it and I think it is important for a database like PEQ which shoots for accuracy and is used by a large number of people. But, for custom servers running custom DBs and merchants, I don't see the need to be quite as anal about it. It is a fairly minor issue to not have them in the proper order, but the bug that results is not as minor. So, if the bug can be fixed, I don't see why not.

Really, I could care less about if my merchants are in order or not. I also don't plan to ever completely update my server to PEQ again just because I don't have much need to since my focus is custom content. But that doesn't mean that I want some merchants to be broken if I ever enabled temp merchant lists. This isn't really an issue either way to me, personally. I am just playing devil's advocate about why it might be good to fix the bug :P

ChaosSlayer
10-28-2008, 06:40 PM
That is a point; items are sorted alphabetically anyway, from what I've seen. Even if you manually ordered items, is there some method for having them show up the way you put them?

Better question: can anyone imagien situtaion when player opens merchant inventory and says:

"OMG OMG OMG!! A Rusty Bastard Sword!!! only 2 gold!! OMG I will buy it rigth now!"
<click>
and then (after purchase) player looks down the list and says: "OMG they had Rusty dagger for only 3 silver! If I only knew I would have never spent 2 gold on rusty sword! OMG I now have to go and camp large rats for 2 hours to get back all that money!"

I am honestly can't posibly imagine anything like that :grin:


Back from my days on LIVE I did ocasinaly found nice items on vendors - but all of them were player sold

cavedude
10-28-2008, 06:41 PM
eitherway from what I see - any time you want to make some TINY change to a item list- you instantly break it - imho thats poor coding/design

No, you don't. Most editors should put new items in order at the end of the list. If you remove an item, you should re-order the slot list. The same goes for anything. Why do you think the PEQ DB used to have spawn IDs that were 8 digits in length? Because nobody seemed to care enough to keep the table organized when they added new entries or removed obsolete ones. It isn't perfect now, but just under 59,000 is a hell of a lot better than a max ID of 28,000,000. What it comes down to isn't a functionality thing, but an organizational thing. It just so happens that in this case, choosing to be disorganized will cause an issue with the functionality.

ChaosSlayer
10-28-2008, 06:46 PM
As Cavedude already said, the option to be able to order the merchant list does have possible uses. Perhaps you want to have a vendor that sells free starter items and a bunch of other items as well. It would be best to have the starter items sort to the top to make starting out just 1 step easier. I can see definite use for this and now that I know that, I might just adjust my starter merchant's table lol.


I do have soemthing like that on my server too. But I use a stand alone npc vendor who sells free (0 copper priced) items for beginers. But I don't put those items in same pile as normal items (with price)


Really, I could care less about if my merchants are in order or not.


well as a potential player (aren't we all?) I would be rather upset when I am trying to buy a Blue Diamond (for example) which normaly not sold by vendors (LIVE-like/peq DB) (hence player sold) and keep geting something else instead which is rather expensive, and keep loosing money

ChaosSlayer
10-28-2008, 06:48 PM
No, you don't. Most editors should put new items in order at the end of the list. If you remove an item, you should re-order the slot list. The same goes for anything. Why do you think the PEQ DB used to have spawn IDs that were 8 digits in length? Because nobody seemed to care enough to keep the table organized when they added new entries or removed obsolete ones. It isn't perfect now, but just under 59,000 is a hell of a lot better than a max ID of 28,000,000. What it comes down to isn't a functionality thing, but an organizational thing. It just so happens that in this case, choosing to be disorganized will cause an issue with the functionality.

well I only use Georges Merchant Editor - so I hope it does the reordering thing =)

Angelox
10-28-2008, 08:47 PM
Cavedude:
Is my 2 week old PEQ merchant list current, or should I get a new one? I have an idea, and am going to try it out.

cavedude
10-28-2008, 11:00 PM
2 weeks old is outdated, but to tell the truth so is the current CVS dump. I'm just trying to get a few more things in, and I'll update CVS either tonight or tomorrow.

GeorgeS
10-29-2008, 10:07 AM
The merchant editor automatically reorders the list so it's contiguous by slot number when making a new merchant or editing the list. I also added some code to reorder the entire merchantlist as an option, but I would only do it on occasion since the execute time is about 20minutes to parse and analyze and repair the entire table.

I should mention the merchant stand alone program is now depreciated, but now included in the npc&loot editor
Running the tool to reorder sometimes makes the window say not responding due to the time it takes to finish, but just wait till its done.
GeorgeS

cavedude
10-29-2008, 01:37 PM
Making me use Windows. Bah! Thank you very much, George! You've just saved me a boatload of time.

Angelox
10-29-2008, 02:20 PM
Wow, that was fast!
You know all of GeorgeS programs run well with Wine, I just haven't had time to figure out how to tell it where the database is, so I get that error.

cavedude
10-29-2008, 03:09 PM
I thought they were C# based?