0
\$\begingroup\$

Suppose that I have a game that has fairly simple rules, but may have any number of rules modifiers. For boardgames, the classical example would be Cosmic Encounter, but Slay the Spire or any number of games apply. The base rules are easy, but there are too many modifiers to explicitly write conditionals for them all. So how is this done?

(This could also be for any business logic rules engine, but games are where I seem to encounter this more often).

I would think you might be able to do this by having "state" objects and then passing them through a series of modifier objects, but I'm not sure this is the right way of doing it. What is the technique / style for this? What are some good primers/examples?

(I can program well enough, but with my EE degree have only whatever theory I've picked up on the job....).

\$\endgroup\$
2
  • \$\begingroup\$ We have quite a few existing questions that discuss strategies for adding flexible modifiers to games, with an emphasis on trading card / deckbuilding games. I gathered a list of them in this meta thread. I'd recommend reading through them for some ideas of starting points, then editing your question to detail a specific challenge you've encountered putting these resources into practice, if you find you're still stuck. \$\endgroup\$
    – DMGregory
    Jun 4, 2020 at 15:45
  • \$\begingroup\$ Thank you for the recommendation. I will look at it. \$\endgroup\$ Jun 4, 2020 at 18:24

0

You must log in to answer this question.

Browse other questions tagged .