Topic: Difficulty levels
DragonAtma![]() Topic Opener |
Posted at: 2016-02-19, 06:54
So in another thread, I recommended that we add difficulty levels. At GunChleoc's request, I'm adding a new thread to discuss them.
![]() ![]() |
einstein13![]() |
Posted at: 2016-02-19, 11:30
I think that for AI starting wares should not change. Current AI sometimes has problem with lack of resource (in some maps, especially where is limitation of terrain). For human players - we should consider minimum number of wares. The line considering this idea can be realised by:
where: difficulty_factor = {0.5, 0.67, 1, 1.5, 2, 3} for each difficulty type, stadnard_number_of_wares - number of wares currently implemented, minimum_number_of_wares - definit minimum of wares that should be considered. Why I am thinking about it? Because on some maps, some positions has no gold at all. Or hardly any gold. Building up two ports in a very short time is the major aim for the player. Lack of gold can be very harmful then. Considering Empire, the tribe needs 4 gold bars to build 2 ports. And that is standard number of initial gold. Other example is with Altanteans clothes. They need clothes to produce clothes. Initial number of wares is very limited too. einstein13 ![]() ![]() |
king_of_nowhere![]() |
Posted at: 2016-02-19, 13:18
there was a thread about the topic. THere had been several threads, in fact, but I cannot find them; either they are older than I assume, or they started about a different argument and so I cannot see them by the title. Anyway, the proposal to change working speed of the Ai to make difficulty levels is nothing new. I already was a strong proponent for it (I could go all hipster and say I wanted to have difficulty levels before it became mainstream :). The problem is that the programmers have limited time, and they didn't consider this enough of a priority. There has been an attempt to introduce difficulty levels by limiting the amount of certain buildings, in particular the smelting works and training sites. It has been introduced a few months back. I don't remember the specific numbers, but I think at very easy level the AI is limited to making one smelting works and no training camp/dungeon, and it can't make more than 2 at easy level. This approach, I lamented, is very limited. First, you can't make difficulty levels harder than normal. But most important, the limitation is too rigid to adapt. In early game, the ai is the same as always; the limitation only means it cannot progress to late game. Then, the limitation on buildings does not take into account how much space is available; in a small map, the ai would never be able to make more than one smelting works anyway, so playing at easy or normal level is the same, but in a large map it would be possible to make a dozen smelting works, and the ai is thoroughly castrated by the small limitation. Almost everyone agrees that the best way to make difficulty levels is to change the working time, but it apparently would require more coding (it seems a little thing to me, instead of "35 seconds" you write "35 * X seconds", where X is a parameter determined by the level, and you're done, but I'm not an expert of programming, and the code must be made in a way that this would not be easily implemented). So it hasn't been done yet. It is something on the "to do" list, but we should keep it for build 20. By the way, I think the changes in the production time should be in the ai, not the human, so that managing one's tribe would be the same at all difficulty levels. And I agree with einstein, I would avoid giving less starting resources, as is some cases they are all needed; giving more is ok, though. Alternatively, the difficulty level could be set independently for every player. ![]() ![]() |
GunChleoc![]() |
Posted at: 2016-02-19, 14:12
Giving human or AI players more or less starting resources is pretty easy - we only need to add more scripts to the starting conditions, e.g. eg we could have Headquarters (easy), Headquarters (normal), Headquarters (challenging) etc. Busy indexing nil values ![]() ![]() |
PkK |
Posted at: 2016-02-19, 21:27
I use these starting conditions for tougher AI players: http://colecovision.eu/stuff/widelands-patches/ Instead of a one-time bonus they repeatedly give wares. Philipp ![]() ![]() |
GunChleoc![]() |
Posted at: 2016-02-20, 09:00
Thanks! I have put them into a new branch so that we can play with them. Busy indexing nil values ![]() ![]() |
king_of_nowhere![]() |
Posted at: 2016-02-20, 11:20
giving a fixed amount of resources every x time is better than static limits, but it also is a limited approach. First, it again has the problem of not differentiating between large and small maps; in a small map those wares are a lot, in a large map they are negligible compared to thoose that are available normally. And second, it is too undependent on the game situation; it does not matter how bad the ai situation is, it will always get those resources. while increasing the working speed will give a boost to the ai that is always related to how well the ai is actually faring, giving a ffixed bonus will make less important to expand, or destroy stuff. But I agree that, until someone codes for cchanging the working speed, this would be better than nothing. At least we can introduce levels that are harder than normal that way. ![]() ![]() |
GunChleoc![]() |
Posted at: 2016-02-20, 11:45
Edited: 2016-02-20, 11:46
Busy indexing nil values ![]() ![]() |
king_of_nowhere![]() |
Posted at: 2016-02-20, 13:00
is there a way to calculate the amount of buildable land? the algorithm for territorial lord already does count the walkable land. the best thing would be to count available buildspaces, but that's too complicated probably. So, calibrating the algorithm to the amount of walkable land divided by the number of players should work fine. the only limitation is for maps that include a lot of desert, but nothing is perfect, and it's already a large improvement over a bonus that scales only with map size - which by itself is an improvement over a bonus that doesn't scale at all. Since we're here, I may also propose to scale the bonus with time, up to a certain amount. That's because the same amount of resources is more important in early game than in late game. Ideally, the resources gifted shall increase with the increasing of controlled terrain, up to a certain fixed amount once all the economy has been built. Say, a good equation could be X' = X * (t^2 / (10000 * L +t^2), where X' is the amount of resources given, X is the amount of resources that we want to give at time = infinity, and L is the area of walkable land divided by the amount of players. t is in milliseconds. So with that equation if every player has an area equal to 1000 (for comparison, the whole map of crossing the horizon has a walkable area around 10000) then after three hours the ai will get half the resources it will eventually get, and after six hours it will roughly stabilize (80% of infinity amount). At t = infinity, 10000 * L + t^2 is roughly equal to t^2, so X' = X. We could even make the bonus the ai get dependant on the amount of land it controls, if we want conquering the ai to have a meaningful impact on how much resources the ai will lose. I propose this needless complication now because it will be much easier to code if it is coded in from the start. ![]() ![]() |
GunChleoc![]() |
Posted at: 2016-02-20, 13:31
I found this in
So, if we feed this with a small building, we should be able to get all unoccupied buildable fields. Busy indexing nil values ![]() ![]() |