Language: 
To browser these website, it's necessary to store cookies on your computer.
The cookies contain no personal information, they are required for program control.
  the storage of cookies while browsing this website, on Login and Register.

Author Topic:  Shop interface  (Read 6462 times)

0 Members and 0 Guests are viewing this topic.

smacky

« on: 20, November 2009, 01:51:32 »
@grommit: i don't think it should be scripted. I was my first idea too, but there are alot problems as i go in the workflow deeper. Without going in details, the main problem is storing and processing of the items.

it needs a solid server depending C base for sure.

Oh, and i forget to point out: That kind of storing/code will help to make real NPC shops. The old "floor based" stores are fun, but really, not used since like 15 years anywhere outside rogue like games and crossfire.

NPC shops are nothing more as out quest interface, but you just have there and sell and buy interface.

This opens alot game play elements.... Moving traders, trader which offers first a quest then they allow shop access.

And, finally, faction based shops, which offers access only when they are friendly to you.


Here's an unfinished shop interface using the awesome power of SENTInce:



I say 'shop interface'. It literally is an NPC interface, you just invoke the method ib:ShopInterface(true) from your script to get the icons arranged in a grid rather than the standard list.

There are a couple of obvious errors still but it should all be ready to roll by about Sunday. (There is also a sell interface, which is simply the opposite -- player selling to NPC).

Not shown here is an extension to the GUI, a bit in between the main window and the buttons/textfield that only appears in shop interfaces. Here you will see the tile and body text for the currently selected item.

ThePlaneskeeper

« Reply #1 on: 20, November 2009, 14:11:10 »
SWEET shop interface.  Do they have roll-over tool-tips?  That would be the best.

smacky

« Reply #2 on: 20, November 2009, 15:05:03 »
That's a nice idea. I'll do that.

LordGrunt

« Reply #3 on: 20, November 2009, 17:16:37 »
roll-over tool tips require mouse input. It might look better (and more functional) if prices were written below/under item. Any other info, i agree, can go to tooltip.
different background maybe, to see items better.
other than that, great interface  :)

grommit

« Reply #4 on: 20, November 2009, 22:01:14 »
roll-over tool tips require mouse input.
Surely the whole point of a GUI is point-and-click. Otherwise, all you need is:

Code: [Select]
>

:P

smacky

« Reply #5 on: 21, November 2009, 00:49:36 »
Sorry, a madness took me. When I sai the tooltip idea was good, I actually meant not necessary. ;)

It's already handled in a way that is also keyboard-friendly (and mousers don't have annoying tooltips obscuring everything), that extension to the GUI I mentioned. Here's a new pic:


ThePlaneskeeper

« Reply #6 on: 21, November 2009, 05:23:16 »
and here i was all excited.  I still think it is a good idea.

LordGrunt

« Reply #7 on: 21, November 2009, 14:18:48 »
ehmm, thread split?
This looks good, though I dont think stacked items like i see them now will work. On every purchase you should be asked how many you want, this way you can buy 1000 arrows without spending 1h on clicking.
I see background is changed, but what I meant was to get rid of background in favor of solid neutral colour.
What about 'selling' interface?

smacky

« Reply #8 on: 21, November 2009, 15:09:30 »
re thread split: well i don't want to discuss SENTInce per se in this non-public forum -- it has its own thread in daimonin project. But also I don't really want to start a public discussion of this shop interface until it is 'ready' and on dev.

But bearing that in mind I'll split this in this board.

re stacking: yes, it works ;). In this window you choose an item to buy. This opens a new window,  where you type/select the number of items.

Moreover, the numbers you see here are the total stock of the shopkeeper (obviously these would be much higher than 1 in the real game). So we have shops with real stock levels meaning the shops get monthly deliveries or however we choose to do it (I need this for a B6 quest) and in future we can have specific items or materiials affected and regional economies (for example, the Cloud Mtn ogres mine iron which they sell to Sh, at some point human-ogre relations fall apart so much this trade stops, hence no iron is delivered to Sh, hence the shops stocks dry up).

re selling. This specifically handles only player<->NPC buying and selling (player<->player can later be implemented with a similar look and feel, but until the fabled auction houses are implemented, this is moot):



Karamor has no cash ATM and you can sell coins, which is silly, but these are easily fixed.

smacky

« Reply #9 on: 22, November 2009, 19:37:11 »
Here' the latest and an interesting problem:



The problem is that shopkeepers having 'real' stocks is quite difficult in a mp game, particularly wiith a client-side interface like this.

For example, Karamor has a stock of 1000 athames.

Player A waddles up to him and says '/talk buy' to open the above GUI. He then spends a while browsing.

Meanwhile, Player B prances in and also does '/talk buy'.

For both players the GUI says 1000 athames for sale, which at the time is correct.

Now A has decided to buy athames. He buys 500. So Karamor has 500 left. B's GUI still says 1000 though. So when B tries to buy 800 of them, Karamor says he doesn't have that many any more.

In itself this seems OKish, but B tries again. he reopens the GUI, which now says Karamor has a stock of 500. So B tries to buy 500.

But C has shot in and bought 200. So again B's attempt fails.

And perhaps this sequence of events continues with D, E, F, and G...

While on the one hand this is maybe not unreasonable (it is a MP   environment), OTOH it is bound to lead to confusion and frustration.

The poblem is the GUI represents, on the client, a snapshot of the state on the server at a particular moment. As soon as it is opened, it is out of date. There is no sensible, efficient way to keep the GUI updated.

With limitless stocks, as we have ATM, this problem does not manifest itself.

Another benefit of limitless stocks is that it should then be possible to cache particular interface strings client-side. So the server would not need to continually remake and resend the string every time a particular player reopened the shop. He'd have a local string cached.
« Last Edit: 22, November 2009, 19:38:50 by smacky »

tehill

« Reply #10 on: 22, November 2009, 20:48:49 »
Elsewhere, where they have vendors with a few limited quantity, timed restock items if you click on item a check is made with the server to get a valid current count. If someone else got it while you were browsing or dozing you see the count updated and if zero you will get a message "Sorry, out of stock".

EDIT: Actually if the limited quantity item has a quantity of 4 and another player gets one it does update the display just like a change to the map does , just takes a couple of seconds with lag. Also the timed respawn of the item updates also. So their code is a bit more complicated than ours.
« Last Edit: 22, November 2009, 23:48:36 by tehill »

smacky

« Reply #11 on: 22, November 2009, 21:26:48 »
Yup, that's what happens here. It seems the only way, although less than perfect.

ThePlaneskeeper

« Reply #12 on: 22, November 2009, 23:01:33 »
Another solution would be to NOT check if the item was still in stock (infinite stock, but removed from shop window when one sells- for future players).  Meaning technically several could be bought provided they were requested at the same time.  As soon as one is sold, no more would come up in GUI for future players.  This might be an easier solution.  It is multiplayer, and people will buy stuff under each other, but that only serves to piss people off if someone with 10 mith comes and buys out a shop.  An infinite supply would make it unreasonable to put some nice magic one-time-buy items in a shop.

Anich

« Reply #13 on: 23, November 2009, 01:55:57 »
Quote
Another solution would be to NOT check if the item was still in stock (infinite stock, but removed from shop window when one sells- for future players).  Meaning technically several could be bought provided they were requested at the same time.  As soon as one is sold, no more would come up in GUI for future players.
Possible exploit could be though the item does not show up in GUI, player's may still purchase it if they remember the cmd.

To extend TPK's idea, (which I think this also relates to story) is that as there are many different cultures, there are many different shops that may operate differently. We can have shops that only sell limited amounts to certain players. There can also be shops that only sell to selected rich players (this can be done by players who own luxurious apartments) like Gurkha’s His Majesty’s Reserve for example. Just saying that the shop interface can vary with different shops.

Quote
that only serves to piss people off if someone with 10 mith comes and buys out a shop.
Initially this would be the case. With some balancing strategy this can be avoided. For example by having multiple shops, ranging from different sizes, items, targeted levels, classes, etc. It can work. Any further in that and I go off-topic.
« Last Edit: 23, November 2009, 02:02:43 by ANICH »
Some of you may remember me in-game as Stcrisis.

smacky

« Reply #14 on: 23, November 2009, 14:36:18 »
I think I'll try not displaying nrof in this main window. So here you just see, eg, that he has athames for sale and the price per item.

You then say, yes I'd like to buy athames. It then opens a new window showing only an athame icon with nrof, and you select quantity.

Ie, only show nrof at the last possible minute. This won't absolutely prevent the problem in all situations, but it should minimise the chances.

Tags:
 

Related Topics

  Subject / Started by Replies Last post
8 Replies
1787 Views
Last post 19, December 2005, 04:18:10
by Lothien
46 Replies
8465 Views
Last post 30, July 2007, 03:06:07
by Raab
5 Replies
2228 Views
Last post 22, May 2008, 23:14:05
by smacky
1 Replies
848 Views
Last post 28, July 2008, 00:22:38
by longir
User Interface

Started by Dauric « 1 2 » Suggestions

28 Replies
10519 Views
Last post 21, June 2009, 16:33:29
by michtoen