[MUD-Dev2] [TECH] Implementing currency without implementing currency

Nick Koranda nkk at eml.cc
Thu Jul 13 11:00:13 CEST 2006


William Leader wrote:
>    So assuming that I have a mechanism for NPC's to know what they 
> will and won't accept as currency. The only remaining question is how 
> to count it. The code does not currently support stackable objects. If 
> a character has two of something, then there are two instances of the 
> object not a big deal since they are just another record in the 
> database. So right now If I wanted a character to have say, 100 gold 
> pieces than that becomes 100 records in the database. It also becomes 
> 100 items in the players inventory to manage. Thats not so good. 
> Currency in this form demands stackable objects. I just don't see away 
> around it. In the past I have avoided stackable items for no other 
> good reason than that I have heard they are the source of most duping 
> bugs. Is there any truth to this or am I just being paranoid?
>

I would imagine you could have multiple currency values such as nickels, 
dimes, quarters so that 5 nickels would be equivalent to 1 quarter and 
so on.  The code could handle auto converting to the least amount of 
coinage.  So you would not have to carry around 100 gold pieces (or 100 
objects) but say 5 platinum (5 objects).  If the exchange wasn't exact 
then you would have 4 plat is 17 gold, but still less then the 100 
objects.  It would get around from having stackable objects.



More information about the mud-dev2-archive mailing list