How do I pick the most beneficial combination of items from a set of items?
Posted
by Chu
on Stack Overflow
See other posts from Stack Overflow
or by Chu
Published on 2010-04-24T12:11:53Z
Indexed on
2010/04/24
12:33 UTC
Read the original article
Hit count: 162
algorithm
|game-development
I'm designing a piece of a game where the AI needs to determine which combination of armor will give the best overall stat bonus to the character. Each character will have about 10 stats, of which only 3-4 are important, and of those important ones, a few will be more important than the others.
Armor will also give a boost to 1 or all stats. For example, a shirt might give +4 to the character's int and +2 stamina while at the same time, a pair of pants may have +7 strength and nothing else.
So let's say that a character has a healthy choice of armor to use (5 pairs of pants, 5 pairs of gloves, etc.) We've designated that Int and Perception are the most important stats for this character. How could I write an algorithm that would determine which combination of armor and items would result in the highest of any given stat (say in this example Int and Perception)?
© Stack Overflow or respective owner