Anonymous
11 years agoSneaky algorithm
It seems to me that certain items only appear in GO HQ when either I don't need them, or I haven't got enough room in my storage to buy them. I have thought this for a while but thought I was probabl...
@etamni103 wrote:(but it would be possible without being overly complicated, using a simple weighting algorithm).
The "simple weighting algorithm" would become far less simple when you have to read the user's mind. How do you know the user is looking for a couch, or merely the lumber needed to build one? How do you know the user is looking for a table that he needs, and not a lock or a dozer part because he's more interested in expanding at the moment than building? Or do you just weight everything you think the user could possibly need? I currently have eight sets of building requirements in my city, with between 3 and 6 item requirements each. A "simple weighting algorithm" would have to weight each of those items, as well as the components used to make them, plus dozer parts and storage parts. That's probably close to everything available in HQ, making the weighting meaningless and the algorithm nothing more than a waste of CPU cycles.
I suppose you're right in that it would be possible with a simple weighting algorithm, as long as nowhere in the requirements is it stated that such an algorithm actually also be particularly effective. ๐
In reality, I'm sure nothing is happening. No algorithm, and I'd be willing to bet that the item requirements are equally distributed. It's human nature to try to find patterns where none exist. Earlier I needed three couches to upgrade a building. But I was planning on building them, not buying them. Couches were all over the HQ. So I needed them and there was also plenty of supply. Right now I have absolutely ZERO need for cheese. But I haven't seen a single cheese all morning. Or beef for that matter. Or several other things I'm not looking for. So I don't need them at all, and yet they're still hard to find. There are always a couple of building upgrades that I need to do that require wood, plastic, or metal from the factory. Yet, I can find all of these things easily in HQ because people love to sell the easy stuff. There are plenty of examples where the pattern doesn't hold, but most people aren't paying attention to those times, because they're only noticing when things don't go their way. ๐
Point is, most people can't find what they need right away, and they assume a causal relationship; "I need it and can't find it, therefore it's hard to find because I need it." Those people don't bother to notice that they also can't find things they DON'T need, or that they sometimes CAN find what they DO need. There is no causal relationship, it's a coincidence.
Or maybe there's a rogue dev on the team that just wants to watch the world burn, cleverly obfuscating his cheese-hoarding algorithm so that it passes peer review, giggling to himself in the darkness of his corner cubicle.... ๐mileywink:
@jeffk42 wrote:Or maybe there's a rogue dev on the team that just wants to watch the world burn, cleverly obfuscating his cheese-hoarding algorithm so that it passes peer review, giggling to himself in the darkness of his corner cubicle.... ๐mileywink:
That was worth one XP all by itself! ๐mileyvery-happy:
@jeffk42 wrote:
@etamni103 wrote:(but it would be possible without being overly complicated, using a simple weighting algorithm).
The "simple weighting algorithm" would become far less simple when you have to read the user's mind. How do you know the user is looking for a couch, or merely the lumber needed to build one? How do you know the user is looking for a table that he needs, and not a lock or a dozer part because he's more interested in expanding at the moment than building? Or do you just weight everything you think the user could possibly need? I currently have eight sets of building requirements in my city, with between 3 and 6 item requirements each. A "simple weighting algorithm" would have to weight each of those items, as well as the components used to make them, plus dozer parts and storage parts. That's probably close to everything available in HQ, making the weighting meaningless and the algorithm nothing more than a waste of CPU cycles.
To use a counter-example, would it be possible to make a "simple weighting algorithm" that helps the player find what he/she is looking for? Of course it would be. To keep it simple, let's say that the player has one building needing to be upgraded, and one ship that needs its order fulfilled. The player hasn't built an airport yet. The upgrade needs 8 nails, 3 logs, and 2 meat patties. The ship needs 4 measuring tape, 3 metal, and 2 hamburgers. For each item in the list, the game (or the server) would add +1 to the weight of that item, and +1 to each ingredient in that item. Additionally it would note that the player had not fully expanded the storage or the land, and might add some value to the weight of the expansion items as well. We'd end up with a weighted list that looks something like this:
metal +5
wood +2
plastic +2
seeds +1
textiles +1
animal feed +2
nails +1
measuring tape +1
cooking utensils +1
flour bag +1
cream +1
meat patties +2
bread roll +1
burgers +1
BBQ grill +1
storage cameras +10
storage locks +10
storage bars +10
dozer exhaust +10
dozer gear +10
dozer blade +10
Note that I have not given any weight to the quantity of each item needed. Of course, at this point it doesn't look simple any longer, but the game could calculate this faster than a human blinks. The "simple weighting algorithm" would do it's random calculation of what to show in the Global HQ, giving extra chances to the items shown in the list, based on the "weight" assigned the items. Once it selects the item types to show, it would select randomly from among all the advertised sales of those items that hadn't been sold yet, and place them on the shelf. In order to use the process to weight against the items being shown, it would do the same thing, but intead of weighting in extra chances of an item showing up, it would reduce those chances for the same items. Presto, artificial scarcity!
Having said all that, I still think the scarcity comes from everybody getting ships and planes that want the same items, around the same time. When that happens, people stop selling those items.
[edit 4/12/2015] I've changed my position on this and now believe they are using an algorithm of some kind to weight against what the player needs. Please see my newer posts below.
If you feel that the answer provided here resolves your concern, please feel free to click accept solution as this may help others with similar issues obtain resolution. XP is greatly appreciated but not required.
Yeah they could do that, but you still have to consider that the algorithm would then run for every player, not just you. Considering all of the HQ complaining going on now, imagine how bad it would be when people want something that isn't as highly weighted for them as it is for others. All of a sudden, that resource has become even MORE scarce for them than it was before.
Then you need to consider the processing impact. It may seem simple on its face, but once you have a weighted list, you don't just say "go" and magically get a result. You'll need to decide how to handle it. Of course, I don't know how they've designed HQ. It could be that when you put something up for sale, a sale request is sent to the server, given an id and maintained in a pool (a huge hash? idk) until someone clicks on HQ, at which point the server sends back an id reference to 24 semi-random sales. That may be over-simplifying it. But the overhead to filter those items for every single HQ click would be significant. Rather than just (for example) grabbing 24 hash keys, you need to get the "type" of every item in the pool, determine the needed percentages based on weights so you don't just always get 24 of your highest weighted item, and then actively seek out that many of each type of item. If the only way to get to a sale is by hash key, this becomes an extremely expensive series of operations. And it would have to be executed on every single HQ click! A database would have more overhead, but would allow filtering on type. You'd still probably need to do multiple queries to ensure a properly weighted result. (apologies to the EA devs for what is probably a gross over-simplification for something that certainly required a lot of effort to implement)
At any rate, for the market to be fair everyone needs a fair shot at the same items. In that sense, it's more like a real market. First come first serve. How badly you WANT the item is not a factor if someone else gets there first. ๐
@BasinCity wrote:
The huge lag in bringing up the exchange is likely evidence that there is such an algorithm in use...
Just sayin'...
No, it's not likely at all.
@jeffk42 wrote:
Of course, I don't know how they've designed HQ. It could be that when you put something up for sale, a sale request is sent to the server, given an id and maintained in a pool (a huge hash? idk) until someone clicks on HQ, at which point the server sends back an id reference to 24 semi-random sales. That may be over-simplifying it. But the overhead to filter those items for every single HQ click would be significant. Rather than just (for example) grabbing 24 hash keys, you need to get the "type" of every item in the pool, determine the needed percentages based on weights so you don't just always get 24 of your highest weighted item, and then actively seek out that many of each type of item. If the only way to get to a sale is by hash key, this becomes an extremely expensive series of operations. And it would have to be executed on every single HQ click! A database would have more overhead, but would allow filtering on type. You'd still probably need to do multiple queries to ensure a properly weighted result. (apologies to the EA devs for what is probably a gross over-simplification for something that certainly required a lot of effort to implement)
Looking to another source, I took a peek at EA's careers site to see what skills and experience they might be searching for. Unfortunately, it isn't always possible to tell which jobs go with which games, but I did see a number of positions where experience with several different languages and database platforms was requested, so no help there. Other than violating the Ts&Cs of the game, it might be possible to reverse engineer the client app (or packet-sniff the traffic) and gain insight into how the back end works, but it's not worth the effort for a free game! LOL. I'd rather that they just implement a free-market commodities trading system that either has no caps on prices, or caps them very high (say, 999,999 Simoleons), effectively leaving them uncapped. Daniel would not buy unsold items, but the sale could be cancelled and reposted with a different price. (Discussed ad nauseam elsewhere so I won't explain it again here.)
@etamni103 wrote:
Looking to another source, I took a peek at EA's careers site to see what skills and experience they might be searching for. Unfortunately, it isn't always possible to tell which jobs go with which games, but I did see a number of positions where experience with several different languages and database platforms was requested, so no help there.
Also, in the 15 years I've been a software engineer, I don't know that I've ever once seen a set of job requirements accurately match the "actual" job requirements, lol. :-)