Sandbox-style games and non-linear gameplay are becoming increasingly common. This is a panel on those areas.
Bruce Blumberg, Frederick de Caster (Total War Campaign AI programmer), Ulf Johansen (Developer at IO Interactive in Denmark, who worked on HItman: Blood Money).
Very fun discussion – some great information on making things more robust and other things.
Q. How long do you spend on these problems?
Bruce: You spend a lot of time on the common sensical stuff, on what doesn’t work and makes characters look stupid. Like the previous talk on Bad Company.
Q. What about kids playing the game and not pushing the animals outside their contort zone perhaps?
Q. How much can you plan ahead in the campaign AI?
Frederick: Not much long term planning since one battle lost or one declaration of war can change thing. Only major long term one is invasions – with a time limit with the goal of something like 20 turns. Is it going to work or not going to work? Very hard to make that decision.
Also player perception of when war is declared is something that is an issue since the AI might think something entirely different to the player so they don’t expect it.
Q. Do you often find problems you didn’t anticipate Ulf?
Ulf: Yes, yes. In Hitman the premise is you have all these specific situations for the player and unlimited ways the player can break these situations. Just need to keep iterating and really brute force changing things, but thinking in terms of complexity and finding simple solutions to problems.
Q. What is the campaign management system?
Frederick: Belief/desire/intention for the campaign AI, with analysers to ask about the world with the data available. Desires is a really large tree. Certain goals like defending regions. Invasion goals. Research technology goals. Goals are intentions for what to do on the map. Most of the time goes into tweaking the analysis and decision making.
Q. How long do goals stay around?
Frederick: Long-term goals might be the entire game, but short ones might be a millisecond. Not much usable information if logged however.
Q. How do you deal with planning Ulf?
Ulf: Finite state machine on Blood Money. changing to a behaviour tree based approach to do priorities and behaviour oceslattion. Do have more goal planning.
Q. Bruce, can you share any insights on the decision making the animals do? How does it fit into the player?
Bruce: Interesting talking about oceslations. AI originally is about planning, but Bruce Brookes says AI is reactive. Now going back a bit to planning. Important to know when to be reactive. Original PHD was on reactive systems and was a pain in the butt. In terms of World of Zoo the underlying system is a Finite State Machine, looking a lot like a decision tree which knows what to react to and what not to react to. Coming up with a global priority system across states is a really bad idea, but in a certain context you know what to react to and what not to react to.
Q. From a code perspective it seems relatively solvable. Is it a lot of going back to designers?
Frederick: Spent a lot of time with designers just on design. First thing is to teach is keep it simple and do not make it abstract which they like to do since it is hard to implement with numbers and decision making. It’s a huge problem still when the design changes and the AI needs updating but you don’t get told.
Q. In Hitman, do you teach designers to maximise the AI?
Ulf: I don’t know whether we teach the designers but we have a lot of discussions with the designers about these things. I don’t want to say. There are several layers where complexity is coming from and one of the layers is the communication layer. Before you see it in game you are not sure where it is going to go and to figure it out you need to sit down and sort it out.
Q. Using Havok did that help in World of Zoo?
Bruce: Having everyone working on the same computer/terminal really worked well.
Q. On QA, do you have great QA?
Frederick: You have some really good people who find really odd things to test the AI. Internal QA work quite closely, and publisher QA submit a bug or message them but don’t like it when they are told they need to reproduce it since they don’t always know how they go there.
Ulf: Had quite a few QA people just working on the new engine as it is built, especially regression testing on tools and the game itself. When features are not completely done, the problem is everyone has an opinion and so can get heated so need to note down what feedback is required.
Bruce: We tell them Don’t Test This It Is Not Working Yet. There is a time for QA which really makes sense – beginning is frustrating. Had a great QA Angel of Death where he came over it would be a long night. To develop a robust system is really needed.
Q. AI specific QA?
Frederick: Each team towards the end of the product you can get someone to test things now. This allows specific testing where something doesn’t just break for every related system or team.
Q. Can sometimes get QA doing too much – on testers being overeager?
Ulf: Can go both ways – if told do not produce to many bugs and things might be missed. Hard to tell if they are doing the right stuff or not.
Frederick: What is important is quality is not testing or QA. Everyone in the company needs to play the game for a while each week, but not your own part. Time scheduled for half a day a week. Time to fix such issues is called overtime 🙂
Bruce: Started about 3 moths before code complete where there are strike teams, and play a run of the game in the morning to find bugs. Brings the QA people up to speed and it is worked on during the day, also got producers involved so know what they think are bugs.
Q. Sounds like scrum and agile and other bad words. Do you use less waterfall style of development?
Ulf: We use some variant of scrum as well. How it ended up working was a small group of people focusing on each level, scrum without calling it scrum.
Frederick: Not everything is agile but every team has a board with post its for what is being worked on currently, and what will be worked on soon. Helps alleviate the issue of having designers work on one area the programmers cannot work on, but needs design for another area.
Q. What about directors and cheating?
Frederick: Working on campaign AI manager for 90% of the time. Implemented a simpler version in Empire: Total War in a patch. Also try and cheat as much as possible to make it look good. Reuses the old goal based system rather then make a new system because it is faster.
Ulf: We want to make the game fair so we’ve spent many nights trying to sort fairness, and cheating is recommended.
Bruce: Teaching students that intelligence in nature is all about cheating. Sometimes the idea is you need to be pure but the brain is just a big bag of heuristics and random things that just work.
Q. Frederick, on Total War, is the AI defined from the beginning or the difficulty level implement so easier earlier?
Frederick: Number shuffling mainly for difficulty like unit strength. Easy difficulty means some behaviours are turned off though. Hard enough to get it to do something right in the first place.
Q. What do you think about automatic testing games?
Frederick: Have more then QA testing, like AI playing themselves and looking at what happens there. Look at what happens. Everyone needs to run the auto runs before going home!
Q. What about balancing?
Frederick: Not used as much for that but for finding bugs and broken things; mainly if something doesn’t work at all.
Ulf: Main unit testing is to let the game run for 30 seconds and if so it is passed.
Q. Are you, as AI programmers, the first person people to come to when a glitch is noticed?
Frederick: Not especially, everyone usually gets problems passed to them so it is an equal problem.
Q. How do you feed back the goals are failed?
Frederick: Very little, but want to do. Need to say what the strategy is and will make an example game to show that (from the talk yesterday on the player knowing what the AI strategy was).
Q. What about modding as a source of improvements?
Frederick: People do get assigned to go over forums. Some at the company are from the modding community and still look at mods and get ideas from that as well sometimes. Yes, essentially.
Q. Do you have any tools or functionality to help the debugging process like creating certain states?
Ulf: For Hitman 5 we have the AI flight recorder, might do a masterclass on it, and what it is doing is all the things the AI does saved in a file. The AI coder can see what is going on up to the point something weird happens.
Bruce: Didn’t use this because it wasn’t available but the latest version of Havok has a recorder for the behaviour graph in a tool, and allow to play it back and identify problems.
Alex: Saving the players inputs can reproduce any bugs if the engine is saved and the player actions are replayed.
Q. Traditional AI is a source of inspiration but will they ever accept cheating?
Bruce: No. Longer answer; because it is from maths, they want an honest analytical answer. Probably should learn from chaos theory that the world doesn’t work that way.
Q. How did you decide the goals and desires and how did you deal with concurrent goals?
Frederick: It is a continuing problem and will likely have no conclusive answer. Especially with goals going on but it is a goal which conflicts with the current situation. Sometimes you have actions where you want them to always activate but putting it as a high priority isn’t a good idea; better to put in code to reserve units (since generally actions involve moving units). Dynamic prioritisation is not feasible for any real game project – partly yes, but primarily no.
Q. What about testing animations in the game?
Ulf: Depends on what “looks right” means. Aesthetic evaluation shouldn’t be for testers, but backwards feet or whatever need reporting. As before mentioned need to make sure QA know what to report.
Q. Does anyone have a special animation testing tool?
Alex: Tests to check animations are nicely continuous but sometimes you want it to snap. The problems like a backwards head are much easier to spot.