![]() ![]() So the more surplus it has the more it tries to sell, while still retaining a buffer in case things go sour and it starts needing the equipment itself. And if they have a total surplus of 100 equipment, it will put 0.2*100 = 20 equipment up for sale (assuming a ratio of 20 %). They will also pull back anything already up for sale so they can use it themselves. This means that if the AI needs the equipment themselves, they have a total surplus of zero, so they put 0.2*0 = 0 equipment up for sale, i.e. Every market AI update, it calculates its total surplus of every equipment type (surplus on production stockpile + anything on the market stockpile) and makes sure that the ratio is correct. It had some shortcomings so we modified it a little bit, but it’s still the basis of how the AI puts things up for sale. Despite the simple approach it worked pretty well, and since it’s simple it’s also easy to understand and debug. ![]() In one of the first iterations of the market AI, we just made it put a certain ratio (say 20 %) of its surplus equipment up for sale. But manually having to define the numbers for different equipment types and situations and countries also means a lot of work and balancing, so we at least want some good default behavior with a possibility of tweaking it. We could do something simple and say that “if we have a surplus larger than 200, then start selling”, but 200 infantry equipment and 200 strategic bombers are on completely different scales so using absolute numbers is not a good idea. This could depend a lot on what type of equipment it is and what situation our country is in. The problem is that we need to define how much “ a lot” is so we know when to start putting the things up for sale. If we have a lot of surplus equipment, start selling some of it, but not all of it.If we need the equipment ourselves, don’t sell it.We basically want something like the following behavior: And if the surplus disappears and we start lacking equipment again, the AI should take the equipment off the market so it can use it itself instead. However, just because there is a surplus doesn’t mean that it’s a good idea to put all of that surplus up for sale. Just like for a human player, it is only possible for the AI to add equipment to the market if it has a surplus of it. Putting things up for saleBefore anyone can buy equipment from the AI, it obviously needs to put equipment up for sale. The right-most number showing surplus/deficit is an important component of how the AI interacts with the International Market. The familiar logistics tab showing what equipment is available on the production stockpile. This base behavior is then modified by other factors, such as AI strategies. In general, it will try to buy equipment it has a deficit of and will offer to sell equipment it has a surplus of. The basis of the AI’s behavior on the International Market is the surplus/deficit it has of different types of equipment on the production stockpile (you know that list of equipment you see under the logistics tab). It also needs a surplus of equipment to sell, but fortunately the AI already knows how to produce equipment, so that just needs a little bit of tweaking! putting equipment up for sale on the market Gain market access so that we can see what other countries have put up for sale.On a very high level, there are a few things that the AI needs to be able to do in order to utilize the market: So, in this week’s dev diary I’ll focus on showing how the AI interacts with one of our major new features: The International Market My absolute favorite part of game development is working with the AI and trying to make it more fun and interesting and immersive to play with. Large parts of my work consists of feature work, bug fixing, and general game improvements. Hey everyone! I’m Plankie and one of the programmers on Hearts of Iron. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |