[ New messages · Members · Forum rules · Search · RSS ]
Forum moderator: Daddio, EbelAngel  
Forum » Cossacks III » GamePlay » Cossacks 3
Cossacks 3
kirjasbeltranDate: Sunday, 26/April/2015, 6:46 PM | Message # 41
Viscount
Group: Users
Messages: 59
Awards: 0
Reputation: 0
Status: Offline
i would love to see cossacks 3 as a more improved version of cossacks 2. possible improvements from cossacks 2 would be the other nations that are not included in cossacks 2 yet featured in the first cossacks be featured in cossacks 3, better to have an unlimited population as opposed to building settlements and townhalls just to increase pop caps; it sort of sucks if your structure inflates and you are unable to build another if your structure is worth 7 digits when the maximum in cossacks 2 is up to 6 digits, and if your townhall inflates, you will cannot build another one; take it from me if i am playing as the british, i can only build up to 3 town halls, whereas if i am playing as the others, not counting spain, poland and rhine, i can build up to 8 town halls. it is also better to be able to build an unlimited number of artillery units instead of building additional artillery foundries so that you can be able to build additional artillery units. i  cannot help but wonder why ships and other water units are excluded in cossacks 2, so they better bring ships back in cossacks 3. in some similar threads, generals with adjutants are also mentioned, so why not include them too.
 
FtoomshDate: Monday, 07/September/2015, 10:20 PM | Message # 42
Count
Group: Modders
Messages: 124
Awards: 0
Reputation: 0
Status: Offline
This is a copy of a post I made on the official C3 forum.

I would like to start a discussion about C1 and C3 AI. I mean of course "artificial intelligence" or the way the game program plays the game against a human opponent. If you have experience in programming RTS game AI in C1 or other games, I would be pleased if you would join this discussion. Also, if you have ideas or suggestions please join in. I am hoping at some stage with C3 to mod it to improve the AI (assuming it needs improvement). However, I would mod C3 to be more like OC Mod first and then I would mod its AI. This is assuming the complexity of all these tasks is not beyond me.

As with all problems, I believe the best approach is to take a divide and conquer approach. That is to say, we should break the problem down into its component sub-problems and seek to solve each separately. At the end, we would put the solutions together which requires more work to make the components fit each other and blend together in one working whole.

Consistent with this "divide and conquer" or modular approach to the overall AI problem, we can see that getting an RTS AI to play well has three sub-problems. I will use the word "solve" because we must essentially solve the mathematical and algorithmic problems. We have to;

1. Solve the economy.
2. Solve conversion of economic resources to military resources.
3. Solve the military problem.

This discussion will start with the first problem. How do we "solve" the economy? Remember at this point we want to solve the economy problem in isolation from all other AI problems. The solution will be a path to a goal. It is clear that the algorithms to solve all the above problems must be goal-seeking algorithms. What is the goal of the RTS economy in and of itself? This goal must be to grow as big as possible as fast as possible. This is the clear overall goal of an RTS economy on its own. We know a bigger economy supports a bigger and better military.

How do we grow the economy as fast as possible? I am talking about raw growth without any refinements. Refinements must come later after the raw growth problem is solved. Clearly, the peasant is the backbone of the economy. Most games start with only peasants and some store of resources. To solve the raw growth problem, we must grow the peasant population as fast as possible.

Growing the peasant population as fast as possible requires solutions to two special kinds of pathing problems. (There is also the issue of full employment, i.e avoiding idle peasants.) Let's look at these pathing problems. The first pathing problem is not what is traditionally considered a pathing problem. It is the "build path". The full build path is not just the order of making buildings and units, it also involves the intervals of gathering between construction. That is to say the build path in a game typically involves a path of;

Construct building A -> Gather enough resources for building B -> Construct building B.... and so on.

The next pathing problem involves the physical paths of the peasants. This refers to more traditional pathing algorithms. The peasants should walk the shortest paths possible each time when
building and gathering. Time saved in path traverse equals more rapid building and gathering and thus more rapid growth.

The logical sequence is;

1. Solve what to build next or gather next; then
2. Solve how many peasants to assign to that task; then
3. Solve the shortest path problems for the peasants who perform those tasks.

Each of these problems will be formidable conceptually and algorithmically. My first questions here for experienced people are how does C1 solve (or fail to solve) these problems currently? The
possibilities are;

A. Predefined heuristic scripts. The game follows a set script which says start with a mill, then a Town Centre, then a... and so on. This would sometimes be called a deliberative script. This is as opposed to a reactive script. A deliberative script follows a set sequence. A reactive script modifies its activity by reacting to enemy activity.

B. Heuristic scripts modified by feed-backs. The AI first asks itself what it needs. That is to say it does a stock-take of existing buildings (sticking to the buildings discussion for now). From this stock-take it determines what building is needed next. It would do this by comparing its actual buildings to the ideal natural sequential list while factoring in in some manner what it has lost, if anything, and what resources it has available. This form of script/algorithm has an advantage over A above because it can respond to the destruction of a building and replace it as soon as resources allow. I think C1 AI works in this fashion though it still has a lot of obvious physical path faults and issues that are not fully corrected after damage is done by attacks. I noticed mills burnt down are not replaced in C1 AI so the peasants then walk a long way from fields to a Town Centre or other mill. (This is an example where the problem can be fixed by improving the AI or by changing game design such that field burns away when the mill burns away.)

C. Tree-search algorithms. Does the AI tree-search branching possibilities and pick the best growth path for the next x seconds or minutes? I doubt this is done as the search tree or search "space" of the problem is far too big and complex; far more complex than the search tree for chess for example. I doubt the current AI does this.

D. Genetic algorithms and learning algorithms. I very much doubt current AI uses these. Is it possible to use these in any way? I mean are they suited to solving the resource growth path problem in Cossacks?

That is enough questions for starters. If anyone has any ideas, suggestions and so on that would be good. If anyone knows how the current AI does economic resourcing and growth in C1 and could describe it that would be good. I am just trying to get my bearings on this problem.


Message edited by Ftoomsh - Monday, 07/September/2015, 10:40 PM
 
DaddioDate: Tuesday, 08/September/2015, 6:16 PM | Message # 43
Marquis
Group: Moderators
Messages: 431
Awards: 4
Reputation: 3
Status: Offline
We have not had too much activity here since C3 forum has opened up.

http://i1045.photobucket.com/albums/b455/Billy_Jo_Patrick/cossacks2_art_03_zpsel8tgwad.jpg
 
FtoomshDate: Tuesday, 08/September/2015, 11:18 PM | Message # 44
Count
Group: Modders
Messages: 124
Awards: 0
Reputation: 0
Status: Offline
Quote Daddio ()
We have not had too much activity here since C3 forum has opened up.

Yes, I have posted this topic on the C3 forum too but had no replies yet. I was hoping to get into a conversation with people who have worked on RTS AI in general or in C1 AI in particular. But so far I have no takers. I have some ideas for C3 AI (assuming it will be like C1) but I still want to mod C3 into an OC Mod style game first and then think about the AI.

If I could have a forum conversation here or in the C3 forum with anyone who was done a bit of AI it would be great. The Cossack C1/C3 game model is very interesting for a number of reasons. One of the reasons is that the game model is VERY amenable to the creation of an excellent AI. I could give some theoretical reasons for that now but there is little point if I can't get a conversation going first with anyone with modding and AI interests.


Message edited by Ftoomsh - Tuesday, 08/September/2015, 11:20 PM
 
DaddioDate: Wednesday, 09/September/2015, 2:57 PM | Message # 45
Marquis
Group: Moderators
Messages: 431
Awards: 4
Reputation: 3
Status: Offline
My skills as you know are slight.

But many many people over the years have tried to address the AI issue. Only one has ever been able to make a difference. It was a Russian, and I believe that he copied the AI to some extent from AC. The main problem with AI is that no matter what you make it is always predictable, and thus it becomes easy to beat omc\\nce you understand what it is going to do.


http://i1045.photobucket.com/albums/b455/Billy_Jo_Patrick/cossacks2_art_03_zpsel8tgwad.jpg
 
FtoomshDate: Thursday, 10/September/2015, 5:49 AM | Message # 46
Count
Group: Modders
Messages: 124
Awards: 0
Reputation: 0
Status: Offline
Quote Daddio ()
The main problem with AI is that no matter what you make it is always predictable, and thus it becomes easy to beat once you understand what it is going to do.

Really sophisticated AIs can overcome this. There are AIs called learning AIs with things like genetic algorithms, neural networks, bayesian network inference engines and so on. They actually learn and develop and come up with new plans. I have to say up front I cannot program anywhere near such complex stuff. At a pinch, I could start beginner work on genetic algorithms but it would take me a long time to learn even them.

At my level, I would aim for a basically sound set of Economy and Military algorithms. Within that hopefully solid framework, I think I could work in some "timing window attacks" and "probability attacks". The engine can be given a set of possible "timing window" attacks which it might make if it assessed conditions were right. It can react to how the enemy plays and this will give it variety in play.

For example, if its human opponent attacks it early on and non-stop, it will be programmed to defend non-stop with technically correct internal lines defense. It will set a program parameter to "defend only". Indeed that will be the initial program setting anyway. After a certain time it will assess (count up) its losses and its opponent's losses. Then it will assess if the opponents losses are greater by a set margin than what the opponent can make up by new production at its base during the traverse time taken by the computer's remaining forces moving to the opponent's base. Thus the computer can calculate it will have more troops at the battle site even when the next battle site is right at the opponent's base. It will also make estimates about possible upgrades on both sides. Based on these assessments it will use simple pseudo "fuzzy logic" to decide if it will attack. For example, it it estimates it will have 10% more troops at the battle site near the opponent's base then there could be a 1 in 10 chance it will make a decision to attack. If it figures it will have 50% more troops then there is a 1 in 2 chance it will decide to attack. These are just examples. Then it can learn by tweaking its own parameters. It will learn and store for example that when I-the-computer attack with 10% more troops I never do decisive damage I will so now set a 1 in 10 attack likelihood only when I estimate I will have 20% more troops at the battle site. When I attack with 100% more troops (double) I always win so reset the "Always attack" level to just 90% more troops and test that.

That's just one example. The computer AI could also be given random chances of trying certain sneak attacks. For example, let it have 50% chance of sending the very first 36 man pike formation (once scouting has found the enemy) down the map side to try a sneak attack whilst reserving everything else for defence for the time being.

These are just a few examples of how assigning attack likelihoods based on numerical assessments and chance generators (varying the chances based on how good the assessments are) can help the AI vary its play. So now its attacks are not blindly scripted but depend on troop estimates, upgrades estimates and a generator which assesses its chances of making a winning attack in a given troop number situation.


Message edited by Ftoomsh - Thursday, 10/September/2015, 5:51 AM
 
kirjasbeltranDate: Thursday, 10/September/2015, 8:37 AM | Message # 47
Viscount
Group: Users
Messages: 59
Awards: 0
Reputation: 0
Status: Offline
How about this.. every single cavalry or infantry unit including mercenaries can organize themselves into formations with or without officers, standad bearers, drummers and all must be present and formations cannot be organized if one isnot present(applies to units that requires such commander units).
 
adrianj30Date: Monday, 03/October/2016, 11:49 PM | Message # 48
Esquire
Group: Users
Messages: 3
Awards: 0
Reputation: 0
Status: Offline
It is very good reminds me of the old days despite being much slower nonetheless it has great sound effects and good graphics it just seems like Cossacks Remastered to 2016 to me but it is a great game very much am enjoying it I won't compare it to the original series yet though.
 
Forum » Cossacks III » GamePlay » Cossacks 3
Search: