Mentor Interview: Dave Churchill of Memorial University

David Churchill is an associate professor at Memorial University in Newfoundland, Canada who specializes in artificial intelligence for real-time strategy games. His work on applying AI solutions to Starcraft goes back to his PhD studies in 2011, through to the present day. His course lectures on game development in C++ and AI applications are publicly available on Youtube.

Web page: https://www.cs.mun.ca/~dchurchill/

Professor Dave Churchill caught in the wild (source: his university web page)

The syllabus for COMP4300 says:

This is a course for students interested in learning the fundamentals of game programming and game engine architecture. Topics include an introduction to: vector math for games, rendering, animation, and artificial intelligence, collision detection, game physics, and user- interfaces. Students will be writing fully functional games using the C++ programming language and the SFML graphics library.

I'm especially thrilled to have landed this interview because my project, McRogueFace, is what I would call "a COMP4300 engine". The basic structure of GameEngine, Scene, and input registration all comes from that course. The engine structure is extremely flexible, and would allow you to design different scenes with vastly different properties and input styles: sidescrollers, arcade shooters, strategy games, and turn-based RPGs all harmoniously managed in the same engine. I'm making a roguelike, and I'll continue using COMP4300's methodology as I implement particles and what I hope will be absurdly high numbers of entities. Shaders, memory-aligning entities for performance, and implementing NPC AIs are all topics covered by his Youtube library.

I'm incredibly grateful to the professor for his time for this interview and for his Youtube series' that bring these gamedev topics down to earth for enthusiasts without a single cent in tuition required.

What follows is Professor Churchill's own responses verbatim to my questions (the headings).

How did you get into programming and game development? What games inspired you?

As long as I can remember, I have been interested in video games and computers. When I started university I enrolled in computer science and fell in love with it, and naturally just started to program some of my own games as a side hobby.

Game Development and Game Programming are two completely separate topics, and I would say I'm more of a programmer than a developer, which involves every step of the process such as design, story, etc.

My favourite games over the years have been EverQuest, World of Warcraft, StarCraft, Path of Exile, Final Fantasy, Quake, Tekken, and I think whenever we go to make new things we draw inspiration from the games we have played in the past.

How did you get into Starcraft research? Was your faculty very supportive, or was this area of research met with skepticism?

I initially did computer vision and robotics for my MSc research, and went to the University of Alberta to start my PhD research in the same topic. As part of my course requirements I did an Game AI programming class with Dr. Michael Buro, and fell in love with the topic. Toward the end of the class he asked if anyone was interested in real-time strategy game AI research to come talk to him, and I did. I switched topics to game AI and it was one of the best decisions I have ever made. Never feel like you're locked into one area at any point in your life, there is always a way to change if you want to.

Any fond memories on languages or systems from the past? Anything you were glad to see go out of style, or are there any features or core lessons missing from modern development tools?

I didn't get started with programming until 2001, and my first programming language was Java, so I don't think I have any "old timer" horror stories about having to write code in assembly or anything like that.

One of the biggest changes over the past 20 years is how everyone used to write their own game engines if they wanted to make a game, but now they can use prebuilt engines like Unity, Unreal, Godot, etc. It makes it much easier to make games and have them work on various systems.

I don't know of any features missing from these engines because I haven't used them enough, but I do feel like you should try to know the technology that created them if you want to truly master them.

Do you still play games "just for fun"? Is developing a bot the same kind of fun as playing?

Yes, of course! I am always playing at least 1 or 2 games in my free time. For example I am currently playing the new Path of Exile league.

Do you have any tips on persistence and overcoming problems? Do you code on a schedule? Do solutions come to you in the shower or while dreaming?

For me, overcoming tough problems requires being in a space where I cannot be interrupted for long periods. Even a 2 second distraction can cause you to lose a train of thought and end up losing many minutes of time thinking or problem solving.

I absolutely never code on a schedule - sometimes it's 9-5, other times it's 11pm to 3am. I find that working when I am 'in the mood' makes me most productive. If I am not 'in the mood' I try to do some other chore.

I don't think anything has ever come to me in a dream, but of course potential solutions come at all times of the day. I don't think I've ever run out of the shower in a eureka moment but I've definitely thought of solutions there

How can one decide if they need a custom engine?

Research! Watch a lot of videos on the features that existing engines have. If your game needs something that they don't have, then you may need to make your own, or at least modify the existing one.

I think that if your goal today is to make a game quickly and efficiently, and be able to release it on multiple platforms with the least friction, you'd be kind of crazy to make your own engine. It's more of an academic exercise to teach you the skills required.

Do you prefer rushing towards a minimum viable feature, or do you build to support your entire feature list?

This is entirely dependent on the goal at the time. Do you need something to 'just work' for a quick proof of concept, or are you developing something that you want to release publicly?

All actions should be goal-oriented. You don't need to spend a whole day building a perfect ladder to grab something from a shelf if you can just grab a chair to stand on for a second.

How do you balance between extensibility and simplicity? How can newbies avoid rework of delicate, inflexible code versus overengineering?

I don't think there's any magic formula to be able to balance these two things, it comes with time and experience.

Start by following the basics. If you're writing a piece of code in multiple places that accomplishes the same task, you should probably make it a function. If you have a few functions that are related with some data shared between them, make it a class, etc.

I would also say that if you're making your first game or two - start by making it work, and then come back and refactor it to be 'nicer' if you want later. Is the goal to make a game, or make a great architecture?

What's your organization system like? Trello, post-it notes, "// TODO" all over the code files, etc...

My overall life organization system is a combination of google calendar and the unread emails in my gmail inbox. I sort my email by 'unread on top' and whenever I have something I need to do I write myself an email. When I finish it, I mark it as read.

For smaller tasks I have a notepad open on my desktop that sits in the corner with some TODO notes on it. My weakest personal skill by far is organization.

What games are looking especially hard and/or interesting to solve these days?

I still think that Starcraft is very interesting, as well as MOBA games like DOTA2.

Cooperative games will probably become more popular over time as an AI field of research as well I believe.

When is it fair for bots/NPCs to "cheat" (by not following the same game logic, using more information, etc)?

Again, everything is goal oriented. What is the goal of your AI system? If 'cheating' allows you to accomplish this goal, then cheat all you like.

For example if your goal is to make a 'good enough' AI system for your retail RTS game, why not let it see where the players units are? Why does it matter?

Do whatever you can to accomplish the game design goals.

Do you have any opinions on the "right" or "best" interface(s) for bots?

DLL injection, keyboard/mouse simulation, actual APIs? I think a lot of games obstruct anything that might become an interface for cheating, so how can we buck that trend and encourage coding, automation, and software development against game-like simulation environments? [-Ed.]

Most if not all games these days have terms of service that don't allow any direct interaction between 3rd party code and their game clients. So any use of those technologies may get you banned from the game.

If you're not concerned with that, then again I think there is a choice depending on your goals. If you want the fastest possible interaction between code and game, then dll injection. If you want the most modular and flexible system, then some sort of socket or message passing system.

Having an actual API released by the game developer is always the best solution, but unfortunately they are rarely available.

What makes a game interesting for you to solve with AI, versus interesting to play as a human? Is there overlap, or are the categories distinct?

For me something is 'interesting' if it cannot easily be solved via brute-force. For example all of the possible games of tic-tac-toe can be enumerated in under a millisecond. This makes it uninteresting to work on - the game must have a large enough number of states/actions that it cannot be trivially solved.

For interest vs human I think that the game must not rely too much on precision or dexterity in order for humans to stand a chance. For example, it is trivial for almost any programmer to write a fighting game AI that could beat the world's best players. Just block every attack and then counter attack with perfect precision. In order to make those sorts of games interesting, additional constraints must be placed on the AI, such as imperfect timing, or APM limits.

Are expert bots foiled by unorthodox strategy? Is this a phenomena of machine learning systems, or are heuristic-based bots susceptible as well?

AlphaGo Zero made the news again in February by losing to novice play techniques. Since expert play was massively over-represented in its training set, it was unprepared for low-level play. Does this play out in real time games as well? [-Ed.]

One of the issues with machine learning / reinforcement learning is that in order to learn about something, you must have encountered something similar. So yes, this is a real problem that we have seen happen in AI systems of all kinds.

It doesn't always happen, and there is no magic way to decide if/when it will happen, but it definitely does happen and is just a downside of machine learning systems in general.

Heuristic search based bots do not typically have this issue, since they exhaustively search all possible actions up to a certain limit. It is possible that if your heuristics are bad, then it can happen, but it generally is not as much of an issue.

On ChatGPT

Do you have a blurb about ChatGPT that you've repeated 100 times in the past few months which you can copy/paste here, so that nobody will say I should have asked for your opinion about it? (Alternatively: are you tired of ChatGPT hype, and do you think this hype wave will help or hinder your field going forward?) [-Ed.]

ChatGPT is very good as a language transformation device. Rewording things, transforming things, generating many ideas for a brainstorming session, etc.

ChatGPT is very good when you forget the syntax for something when programming simple examples and functions, it can save a lot of time googling or API searching.

ChatGPT is horrible as a knowledge / calculation device. For example, it very recently told me that sin(0) was 1. That was when I stopped trusting it for knowledge.

What recent developments in your field are the most exciting, in your opinion? If you were starting a PhD in 2023, what would you want to focus on?

I can't speak for others, but I personally find it exciting to work on Game AI which can be used as a tool for game designers / developers to make games. For example, picture creating a level and having an AI system find all the places you can jump out of bounds, or tell you if the level is solvable, or how difficult it may be. These types of tools could dramatically increase the speed of development, and help indie studies especially.

What makes a project stand out in a portfolio for a grad student? IF you were accepting PhD students, what sorts of problems would you appreciate seeing the candidates work on?

This is a hard question, because there are many outstanding portfolios of students that I cannot accept, because they are simply not in my area of research. I would say that whatever you end up doing, if you contact a potential supervisor, make sure to look up their publications and explain how your research fits in with their field.

You could be the best in the world at deep learning for language translation, but I would not be able to accept you as a student.

What are some industry applications that real time game solving AIs are being applied to?

As I stated before, I think the field of using AI as a development tool / QA method is in its infancy, but is just now starting to be adopted by the industry.

Also, many of the algorithms that we use in real-time strategy games can be used in other areas with similar properties, such as robotics. For example, the same algorithm that tells your NPC where to go in a game could also be used to tell a robot how to navigate.

links

social