根据供应和需求调整价格的简单公式要求

发布于 2024-11-02 12:42:28 字数 587 浏览 0 评论 0原文

我正在设计一款带有商人 NPC 的角色扮演/泥浆游戏,我希望它们的价格能够根据供应和需求动态调整。要求。

我已经弄清楚的是:

  • 我不需要一个复杂的“现实”系统,而只是一个基于一些统计数据的简单乘数
  • 我希望该算法能够抵抗滥用和玩家群体规模较小,因此乘数应该应该不是动态生成的,而是与其他商家数据一起存储并每几天更新一次
  • 因此所需的统计数据量应该很低 - 会有很多 NPC,每个 NPC 都有自己的物品列表、价格和统计数据 - 所以它可以随着游戏世界的发展而迅速扩大规模。

问题是:哪种类型的公式对于这种乘数来说是“最佳”?

免责声明:

  • 这可能看起来与供应需求建模,但我不需要库,只需要一些关于如何自己做的技巧。
  • 我知道可能已经有一个模拟这个问题的经济学模型,但我从未学过经济学,所以我什至不知道我应该寻找什么。
  • 不,这不是作业,但它听起来很像,所以我添加了标签:P

I'm designing a rpg/mud game with merchant NPCs and I want their prices to adjust dynamically based on supply & demand.

What I have already figured out:

  • I don't need a complex, "realistic" system but just a simple multiplier based on some statistical data
  • I want the algorithm to be resistant to abuse and low size of player population, so the multiplier propably should not be dynamically generated, but rather stored with other merchant data and updated once per a few days
  • And thus the required statistical data should be low in volume - there will be many NPCs, each with its own item list, prices and statistics - so it can rapidly grow in size with development of game world.

The problem is: What type of formula would be the "best" for this kind of multiplier?

Disclaimers:

  • This may seem related to Supply Demand Modeling but I dont' need a library, just some tips on how to do it myself.
  • I am aware there may already be an economics model simulating this problem, but I never studied economics so I don't even know what I should look for.
  • No, this is not a homework, but it propably sounds like one so I'm adding the tag :P

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不喜欢何必死缠烂打 2024-11-09 12:42:28

我是一名学过经济学的游戏开发者,所以我可以给你经济学家的双手答案。

一方面,经济学的公式非常简单。只需在谷歌上查找或浏览任何经济学书籍的第一章即可。您可以使用这个公式,但由于经济学是关于个人行为的,因此它忽略了人类决策的复杂性,只是将其称为最大化(在此处输入最大化的内容)。这意味着,为了使用非常简单的公式,您必须实现非常复杂的人工智能,除非玩家将成为唯一的生产者/消费者。除非您正在构建模拟,否则这不是一个好方法。

另一方面,你真的很关心乐趣。因此,没有任何接近真实的公式是完美的。使用线性分布,使其成为直线函数,您可以使用的变量是斜率和 Y。使用曲线函数,您可以添加一个指数来使用。将它们放入数据文件中并玩它们,直到变得有趣为止。相信我,如果你感到有趣,那么很少有人会注意到这是不对的。

首先假设该物品的基本成本。这应该不是异常的供应或需求。确定合理的库存。该库存不必是一家商店的可用数量,而是一般可用的数量。接下来确定任何人愿意为其中唯一一项支付的最高金额。再说一遍,这只是为了让它变得有趣。在 x 轴上取可用值,在 Y 轴上取成本并计算斜率。

剑的使用范围相当广泛,所以可以说在任何给定时间你都可以用 5 金币获得 10 把剑。现在假设如果只有 1,没有人会支付超过 20。您有两个点 10, 5 和 1, 20。当线穿过 y=0 时,商人将不再购买剑。

线性“曲线”在经济学中很常见。大多数曲线(例如著名的拉弗曲线)在绘制时实际上几乎是平坦的。

I'm a game developer who has studied economics, so I can give you the economists two hands answer.

On the one hand you have economics where the formula is remarkably simple. Just look it up on google or browse chapter 1 of any econ book. You could use this formula, but since economics is about personal behavior, it ignores the complexities of human decision making and just calls it maximizing(enter whatever is being maximized here). This means that in order to use a really simple formula you must implement really complex AI unless the players are going to be the only producer/consumer. Unless you are building a simulation, this is not a good way to go.

On the other hand, you really care about fun. So no formula anywhere close real is perfectly fine. Use a linear distribution so it becomes a line function and your variables to play with are slope and Y. Use a curve function and you add an exponential to play with. Put these in a data file and play with them till it's fun. Trust me if you get fun then very few people will notice it's not right.

Start by assuming a base cost for the item. This should be no unusual supply or demand. Determine a reasonable inventory. This inventory does not need to be the amount available at one shop, but available in general. Next determine the max anyone would pay for the only one of these. Again this is just to make it fun. take available on the x axis and cost on the Y and compute the slope.

A sword is pretty widely available so lets say that at any given time you can get 10 at 5 gold. Now lets say that nobody would ever pay more than 20 if there is only 1. You have two point 10, 5 and 1, 20. when the line crosses y=0, merchants will no longer buy a sword.

Linear "curves" are pretty common in economics. most curves like the famous Laffer Curve when plotted are really almost flat.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文