Modifying the AI

This is the zone for the ones who prefer to play against the machine.
Taeves
Posts: 25
Joined: 04 February 2015, 03:52

Modifying the AI

Postby Taeves » 04 February 2015, 04:15

Hi there, I've been working on ways to make the game more challenging. I don't have good internet access so I generally play Chaos Edition against the AI and the AI is pretty stupid.

Google searches for database editing have been fruitless for the most part, so I decided to try the forums and I was surprised by how much good stuff is in here.

One thing that has really bugged me since I tried Legendary Edition and later Chaos Edition was the AI Formations. When you play against a human being, most people will lineup aggressively when they are receiving the ball. The AI will in all situations except one (The Wall formation) put only 3 people on the line when they are receiving, or kicking. I can't change the AI to adapt to what the player has setup when kicking. But I can change how the formations at least to put more people on the line.

The lack of resource or reference files for the database has been hugely frustrating. I have had issues adding in new player types for example. Take out the Human Blitzers, insert a new Human Beserker position with different MA, ST, AG, AV and skills. It will work for 7-8 games but as soon as players start getting 51+ SPP the game will inevitably reach a point where the game "loops". You get stuck at the end of the game in the post-match sequence and it forces you to restart the game or the latest save, forever.

I have had that happen three times in three different scenarios. I also have issues modifying the Strings_Localized table. Everything seems to work fine but later in the campaign the looping scenario occurs. Deleting everything in SavedGameInfo under Match_strSave (TEXT) either gets you through the game but next game loops again with Match_strSave suspiciously empty or it just takes you back to before the game started (as everything in Match_strSave is your current match info).

Has anyone had a similar problem and figured out how to solve it? I really want to be able to modify the races, just to spice things up a bit, but so far all I can do is remove skills altogether like Loner, Really Stupid, etc. Those work fine.

Anyway I got off topic. I tend to ramble. If anyone is still interested you can change the formations by looking at the AI Positions tab in an SQL Editor, your WorldCup.db file. Your key is "The Wall" in AI_Tactics. #5, it's the only formation with more than 3 people on the Line of Scrimmage. Look at AI Positions, under idAi_Tactics for #5. You'll see eleven entries, (2, 12), (5,6) and (4,12), etc. The Wall formation has nine people on the line, 5 on the LoS and 2 on each side. You'll see that there are nine entries with (#, 12). If you look at other formations, you'll see they only have three entries with (#, 12). So we know that's the number to put people on the line.

I've tested it out and it works. I'm modifying Attract_Center at the moment. I'm sorry if this has been mentioned before, I looked through the forum and couldn't see anything related so I hope this is new and helpful to some.

If anyone is interested I'll post my results as I finish my setups.

Taeves
Posts: 25
Joined: 04 February 2015, 03:52

Re: Modifying the AI

Postby Taeves » 05 February 2015, 22:03

I have been working on formations and I've more or less figured out how Character Role Types work. I really wish there was an established reference to look at, or if there is one, if someone could point the way. Nonetheless, I seem to have a working guide.

There are 10 formation choices to choose from when you kick or receive the ball (you can of course make your own custom formations in-game, but they disappear if your game crashes for any reason). The AI of course will ignore your custom formations and use the preset ones. Which is why I'm doing what I'm doing; I'm trying to make the AI more formidable.

Of the 10 formations, each and every one has a column that follows "Character Role Types". I still don't understand how it works (if you look at AI_Character_Role_Types there are only three options: Attack, Melee and Defense) as it has two extra digits, 4 and 5, which do not exist in AI_Character_Role_Types. I thought it might be referencing the extra positionals in AI_Character_Roles but if you look at them it doesn't make sense at all based on my following findings.

Of each formation, they all have the following sets of numbers and always the same amount of each. 3 4 1 2 5 x 4, 4 1 3 2 5 x 2, 2 4 3 1 5 x 2, 5 1 4 2 3 x 3 which adds up to 11 (the number of players on the pitch). I wasn't sure if the sets meant anything, so I started trying different custom formations and writing down what players were in each position.

The results were mixed but there were some constants. 5 1 4 2 3 always seems to have a big guy or higher strength positionals like Chaos Warriors or Black Orc Blockers. 2 4 3 1 5 prioritize throwers, but will throw in a lineman or blitzer if you only have one thrower on a team. The second 5 1 4 2 3 is nearly always the big guy (Ogre, Treeman, etc).

The set of 3 4 1 2 5 is usually Blitzers or Catchers and other such positionals. It's strangely random but generally isn't linemen, unless you don't have enough blitz/catcher types. Teams like Chaos will have a lot of beastmen take up these positions along with 2 4 3 1 5, or split that with a Warrior.

4 1 3 2 5 gets used for teams with a lot of positionals, often used for Runners I think (Assassins, etc). But seeing as how each formation has 2 of this slot it gets taken by whatever is left to be filled.

So I've got a good idea of how to try and setup some tougher formations but unfortunately it will always be off a little bit depending on what team is using it. If I make a formation with Orcs in mind, an Elf team using this formation might find themselves in trouble. That said, I can still always put the Throwers in a good position. But Blitzers/Catchers will have to share a spot off the line.

I've also figured out the grid so it's easy to plot who goes where. It works like this.
0, 12 to 14, 12 and then goes downward as that is the line.
So you'd want a Thrower around 7, 5 for example, if receiving.

I know someone else out there figured all of this out awhile back and created some sort of editor, I saw a link in the general forums, but that link is long dead. Hopefully someone else out there will see this and use it.

Edit: I've also been looking at the Priority column in AI_Positions, and I can't figure it out at all. If I ignore the Character Role Types and just plot where players are using Priority it's a jumbled mess except for the first position which is Throwers. I tried looking at various Human teams and I'd look at the number on the roster where the Ogre is. And I'd look at the priority list and the Ogre is placed randomly or is higher than the list goes (it goes from 1-11), say 13. The second formation also has a repeating 1.

Just when I think it's starting to make sense I find I know nothing at all. I'm just going to stick with the Character Role Types findings and ignore Priority, as I get results with the former, and my formations do work.

BloodSkull
Posts: 153
Joined: 17 May 2012, 19:05

Re: Modifying the AI

Postby BloodSkull » 08 February 2015, 14:25

Taeves wrote:
1. The lack of resource or reference files for the database has been hugely frustrating. I have had issues adding in new player types for example. Take out the Human Blitzers, insert a new Human Beserker position with different MA, ST, AG, AV and skills. It will work for 7-8 games but as soon as players start getting 51+ SPP the game will inevitably reach a point where the game "loops". You get stuck at the end of the game in the post-match sequence and it forces you to restart the game or the latest save, forever.

2. I have had that happen three times in three different scenarios. I also have issues modifying the Strings_Localized table. Everything seems to work fine but later in the campaign the looping scenario occurs. Deleting everything in SavedGameInfo under Match_strSave (TEXT) either gets you through the game but next game loops again with Match_strSave suspiciously empty or it just takes you back to before the game started (as everything in Match_strSave is your current match info).


1. Because of hard coding of constants and hidden boundaries; You CAN NOT add new player positions into Player_Types_Skill_Progress. This will be your number one cause of failures, loops, and general corrupt data because it has failed to find it.

You can add in new Player Types into Player_Types Table, but the problem is the AI will not use the new player types. The game will recognize them being there, and have no problems with you using them. If you are going to be using a new player type you will still need to point to an existing Player_Type_Skill_ Progress even though the AI will not use the type it can still crash the game without one for some retarded reason.

2. For the same reason as #1 You can only replace what has been given to you. Adding more text and everything else will eventually corrupt your game. It seems stupid and basically is, but unfortunately I believe they did this to keep mods at a very limited strangle hold.


Of each formation, they all have the following sets of numbers and always the same amount of each. 3 4 1 2 5 x 4, 4 1 3 2 5 x 2, 2 4 3 1 5 x 2, 5 1 4 2 3 x 3 which adds up to 11 (the number of players on the pitch). I wasn't sure if the sets meant anything, so I started trying different custom formations and writing down what players were in each position.

The results were mixed but there were some constants. 5 1 4 2 3 always seems to have a big guy or higher strength positionals like Chaos Warriors or Black Orc Blockers. 2 4 3 1 5 prioritize throwers, but will throw in a lineman or blitzer if you only have one thrower on a team. The second 5 1 4 2 3 is nearly always the big guy (Ogre, Treeman, etc). ......... Blah blah blah the rest


Ok these are your Player_Base_Types this basically tells the AI how to "Best" get SPP points and choose options that will increase their SPP depending on the percentages given.

1 is Lineman
2 is Quarter back
3 is Catcher
4 is Running Back
5 is Monster

So, if you want the Linemen to be on the Line of scrimmage regardless of the Race you will need to have 1 in the first position of iList_IdAI_Character_Roles list. Then just will it with what ever crap you want on the front line. The Biggest problem with this is across many teams you will have Player Types if the same Player Role.

IE.
Chaos Beastman and Minotaur are both setup as Running Back AI Types
DE Linemen and Assassin Lineman Types
DE Blitzer and Witcher Running Back

.... there are more I'll just stop here. I'm still trying to figure out how the AI chooses the players in the 4 field. If the position is determined by Player_id first, roster position or by best possible skills.

Edit: I've also been looking at the Priority column in AI_Positions, and I can't figure it out at all. If I ignore the Character Role Types and just plot where players are using Priority it's a jumbled mess except for the first position which is Throwers. I tried looking at various Human teams and I'd look at the number on the roster where the Ogre is. And I'd look at the priority list and the Ogre is placed randomly or is higher than the list goes (it goes from 1-11), say 13. The second formation also has a repeating 1.


Character Role Types are specifically there for the AI to act a certain way..... If you ignore this you will get garbage reactions from the AI position. 11-14 on the Role list I believe have not been implemented properly so you can feel free to ignore them. You will need to figure out in your own positions these 11 players need to be in your formations.... You can have more than one type of Character role, but the problem lies if you have one Catcher and 2 Catcher guards on the field the one farthest away from the catcher is more likely to make retarded risky roles to protect the catcher on the other side of the field.

As stated above you can only replace things that are provided to you, so adding more things will just be ignored or cause bugs and crashes.

User avatar
Darkson
Posts: 2702
Joined: 17 September 2008, 20:43
Location: Somewhere on the same planet as you.
Contact:

Re: Modifying the AI

Postby Darkson » 08 February 2015, 14:36

GW were (are?) anti-modding, so Cyanide had to make it difficult and limited.
Galak 3:16 says "There is a point in time that a player really should read the rulebook."
Home of the ARBBL
TalkFantasyFootball admin - PM me if you need help.

Darkson wrote:Nope, I was talking about a 0TTD on a Blitz! using TTM.

BloodSkull
Posts: 153
Joined: 17 May 2012, 19:05

Re: Modifying the AI

Postby BloodSkull » 08 February 2015, 14:40

Darkson wrote:GW were (are?) anti-modding, so Cyanide had to make it difficult and limited.


Good to know. Looking at how they did a lot of things it's really not surprising they can't make proper patches and had to rebuild from scratch.

Taeves
Posts: 25
Joined: 04 February 2015, 03:52

Re: Modifying the AI

Postby Taeves » 08 February 2015, 18:29

That's a lot of good information, thanks for the reply!

I wasn't too sure about the positions and adding players, I've only tried it a couple of times with negative results (but not until later in a campaign). I was going to look into that but now there's no point.

In regard to formations and Player_Base_Types; you may be onto something there. You don't need to bother with id_Ai_Character_roles however. You can force the AI to use 4 Black Orc Blockers by replacing a couple of the Linemen entries in AI_Positions. As I was changing every formation I noticed that they are different, some of the default formations only have 1 Thrower for example.

I've now finished all of the formations and they work fine, but now I'm trying to determine what the best formations would be for a variety of teams that work for both offense and defense (since the AI chooses randomly and only has this list to pick from). I have seen that the AI does less dodges to make blocks when they have more players on the LoS, which surprised me, since the AI tends to do stupid dodge/blitzes all the time when they could just block instead.

You mentioned Linemen are 1? If I put a Lineman on the LoS, I have two entries of 4, 1, 3, 2, 5 and put them on 4-10, 12. I haven't had an issue yet using that method; what is frustrating is the Big Guy being the second set of 5, 4, 1, 2, 3 about 90% of the time. I can't get it to 100%.

I'm almost afraid to use trial and error with Player_Base_Types to see if it works as you say, as I have a fairly good understanding of how to place who where at the moment. Well, maybe less understanding and just more of luck in being successful. :)

Have you had any luck changing anything else in the game to make the AI more challenging?

BloodSkull
Posts: 153
Joined: 17 May 2012, 19:05

Re: Modifying the AI

Postby BloodSkull » 08 February 2015, 19:53

Taeves wrote:You mentioned Linemen are 1? If I put a Lineman on the LoS, I have two entries of 4, 1, 3, 2, 5 and put them on 4-10, 12. I haven't had an issue yet using that method; what is frustrating is the Big Guy being the second set of 5, 4, 1, 2, 3 about 90% of the time. I can't get it to 100%.



Okay, I think I understand what you are asking. 4,1, 3,2,5 is in the order of what the preferred player Base types should be chosen by the AI. A Chaos Warrior for all intents and purposes are considered to act as "Linemen" because that is what the programmers have identified them as, and have the basis of collecting the spp points through blocking and should and would chose to block more often.


If you have 9 people on the LOS and they all have 5,1,4,3,2 sets. The AI will chose the best player possible to fulfill this parameter in the order that the positions are placed in the AI_Positions table plus other behind the scenes that happens in the executable. If the fist position is 8,12 Then the monster if you had one would be in the middle of the board. If you wanted the AI to pick Ork Lineman on the line besides Black Ork Blockers(BOB). You would need to to set the positions to 1,5,4,3,2. The reason is BOBs are classified as Monsters(5) and would take higher priority to taking LOS over Line Orks(1) in the original example. By Changing the 1,5 the AI would pick LineOrks over BOBs...... then you will ask about the Troll if they have one on the team. Well, Trolls are Identified as Monsters also. The difficulty I have is to how similar Base Types are chosen for what position. I have yet to determine if it is based on Stats, Skills, Player Type ID, the position that they are bought on the roster, and/or if it is a combination of these elements.

The 5,1,4,3,2 is just a priority of what Base Type you want in that position if you run short. As in case of the ordering If you have no BOBs and/or Trolls, then LineOrk will take it's place. If no LineOrc than the Blitzers and so on down the line.

What exactly is your Frustration of the BIG GUY? Because Minotaurs are Classified as "Runners" (4) as said before. A Beast Of Nurgle and Ogres are considered a "Lineman" (1), All Trolls and Human Ogre are "Monsters"(5). Depending on what team you are talking about there are going to be significant differences if you do not know what the Player_Base_Type (s) are in your formations. If you want All Big Guys front and Center then they all need to be 5s and your positioning will work for all Big Guys. This is why modding is frustrating and nobody really tries anymore because to make a decent AI involves a lot of functions and abilities that we have little to no access to. In other words alternating the vanilla can still drastically hurt teams, but this is the AI which would make you think how can it be any worse because the AI truly sucks anyway, but you would be surprised.


I've now finished all of the formations and they work fine, but now I'm trying to determine what the best formations would be for a variety of teams that work for both offense and defense (since the AI chooses randomly and only has this list to pick from). I have seen that the AI does less dodges to make blocks when they have more players on the LoS, which surprised me, since the AI tends to do stupid dodge/blitzes all the time when they could just block instead.


A lot of the stupidity comes from The Data/Match/AI.xml file and the Combination of the Skills_Listing AI_iWeight , and yes if you want to make the teams more challenging you need to figure this out. Even if you do figure it out it will still fail miserably because a lot of the AI tactics are hard coded, so stupidity will still be abound. Not trying to discourage you, I am just saying from my own experience that's just how it is. CoolViolent the lower it is the less likely it will block and the inverse. RunPass Higher the number the more likely the AI will run the ball. See if AI has more people on the LOS than the opponent through several calculations the AI will chose to block over dodging if it has the clear advantage. If there is no clear advantage and the violence is low the player will dodge. A second Factor to this is the id_Ai_Character_roles Seeing I can only make observations and am not able to see the code. I can only give you possible ideas of what is going on and not what is actually happening, but there does seem to be a correlation between the AI_Role and decision thought that is just my preception.

BloodSkull
Posts: 153
Joined: 17 May 2012, 19:05

Re: Modifying the AI

Postby BloodSkull » 08 February 2015, 19:53

Taeves wrote:You mentioned Linemen are 1? If I put a Lineman on the LoS, I have two entries of 4, 1, 3, 2, 5 and put them on 4-10, 12. I haven't had an issue yet using that method; what is frustrating is the Big Guy being the second set of 5, 4, 1, 2, 3 about 90% of the time. I can't get it to 100%.



Okay, I think I understand what you are asking. 4,1, 3,2,5 is in the order of what the preferred player Base types should be chosen by the AI. A Chaos Warrior for all intents and purposes are considered to act as "Linemen" because that is what the programmers have identified them as, and have the basis of collecting the spp points through blocking and should and would chose to block more often.


If you have 9 people on the LOS and they all have 5,1,4,3,2 sets. The AI will chose the best player possible to fulfill this parameter in the order that the positions are placed in the AI_Positions table plus other behind the scenes that happens in the executable. If the fist position is 8,12 Then the monster if you had one would be in the middle of the board. If you wanted the AI to pick Ork Lineman on the line besides Black Ork Blockers(BOB). You would need to to set the positions to 1,5,4,3,2. The reason is BOBs are classified as Monsters(5) and would take higher priority to taking LOS over Line Orks(1) in the original example. By Changing the 1,5 the AI would pick LineOrks over BOBs...... then you will ask about the Troll if they have one on the team. Well, Trolls are Identified as Monsters also. The difficulty I have is to how similar Base Types are chosen for what position. I have yet to determine if it is based on Stats, Skills, Player Type ID, the position that they are bought on the roster, and/or if it is a combination of these elements.

The 5,1,4,3,2 is just a priority of what Base Type you want in that position if you run short. As in case of the ordering If you have no BOBs and/or Trolls, then LineOrk will take it's place. If no LineOrc than the Blitzers and so on down the line.

What exactly is your Frustration of the BIG GUY? Because Minotaurs are Classified as "Runners" (4) as said before. A Beast Of Nurgle and Ogres are considered a "Lineman" (1), All Trolls and Human Ogre are "Monsters"(5). Depending on what team you are talking about there are going to be significant differences if you do not know what the Player_Base_Type (s) are in your formations. If you want All Big Guys front and Center then they all need to be 5s and your positioning will work for all Big Guys. This is why modding is frustrating and nobody really tries anymore because to make a decent AI involves a lot of functions and abilities that we have little to no access to. In other words alternating the vanilla can still drastically hurt teams, but this is the AI which would make you think how can it be any worse because the AI truly sucks anyway, but you would be surprised.


I've now finished all of the formations and they work fine, but now I'm trying to determine what the best formations would be for a variety of teams that work for both offense and defense (since the AI chooses randomly and only has this list to pick from). I have seen that the AI does less dodges to make blocks when they have more players on the LoS, which surprised me, since the AI tends to do stupid dodge/blitzes all the time when they could just block instead.


A lot of the stupidity comes from The Data/Match/AI.xml file and the Combination of the Skills_Listing AI_iWeight , and yes if you want to make the teams more challenging you need to figure this out. Even if you do figure it out it will still fail miserably because a lot of the AI tactics are hard coded, so stupidity will still be abound. Not trying to discourage you, I am just saying from my own experience that's just how it is. CoolViolent the lower it is the less likely it will block and the inverse. RunPass Higher the number the more likely the AI will run the ball. See if AI has more people on the LOS than the opponent through several calculations the AI will chose to block over dodging if it has the clear advantage. If there is no clear advantage and the violence is low the player will dodge. A second Factor to this is the id_Ai_Character_roles Seeing I can only make observations and am not able to see the code. I can only give you possible ideas of what is going on and not what is actually happening, but there does seem to be a correlation between the AI_Role and decision thought that is just my perception.

Taeves
Posts: 25
Joined: 04 February 2015, 03:52

Re: Modifying the AI

Postby Taeves » 08 February 2015, 19:56

Here are a couple of examples of what I've done and how I've got the positions to work for individual teams. It's not perfect, but there are no longer Minotaurs or Mummies in the backfield trying to play ball carrier.

Image

Image

Taeves
Posts: 25
Joined: 04 February 2015, 03:52

Re: Modifying the AI

Postby Taeves » 08 February 2015, 20:02

I didn't even see that you had posted. :)

My frustration with not being able to figure out where the big guy will go 100% of the time is frustrating as I can't get proper placement for him. It is pointless however, as teams with two big guys (like my picture of the Mummies above) will always mess up placement. The best you can do is put them on the LoS so the code doesn't place them in the backfield like it used to.

5, 1, 4, 2, 3 x 5 is essential for teams with 4 Warriors/Black Orc Blockers + a Big Guy to ensure they're all on the field. Often the AI sits them and puts out Linemen instead. I can prevent that from happening, so games will be tougher with strong opponents.

It's not much progress but it is some. It's a shame about the rest though. I have gotten pretty good at editing the graphics as well (but that's common knowledge by this point) and I have created some interesting pitches. :) I guess that's all that is left to do, and it's somewhat pointless with Blood Bowl 2 not too far away. It looks like they've opened up the AI to us in that at least.

Thanks for the responses!


Return to “You vs AI”

Who is online

Users browsing this forum: No registered users and 1 guest