Advertisement

automation in RTS games

Started by November 10, 2006 09:51 AM
15 comments, last by Edtharan 18 years, 3 months ago
I think much of this is a design issue as well as an implimentation issue.

I'm going to talk about the designing of RTSes, and let your ideas come up.

Most of the RTSes around now are just tweaks and slight improvements on the originals. The idea of harvest, build, research and attack underpins almost all modern RTS and at their core the gameplay hasn't changed. This isn't a bad thing, but we, the RTS players, have grown bored. We want more.

In this situation we don't want to try and apply AI to a gamestyle where it doesn't work. if the AI is better than a human, then you may as well use the AI all the time, thus less work for the player(s) and less challenge and enjoyment. If the AI is worse, why have it at all. As players learn how to play it could be useful, but we want to look at why an expert player would want to use it.

For this we'd have to look at the core design of the RTS, which parts of it ass to the game and which parts detract. We like the idea of builing a resource network, but hate having to micromanage it on a long term basis. We like building up a base, until it gets to a certain size and/or point in the game then it's just a hassle, and it's worse when you have multiple bases. Building armies, charging into battle and killing the enemy are great, but constantly having to refill your army all the time, and make sure the right units attack the correct defenders, and having your support units work as proper support units, all in the face of a large battle become difficult, especially as the scale gets larger.

I think a good step is to analyse what works and what doesn't work in an RTS. Taking those things that work and improve apon them, while taking those that don't work and stripping them down so they do work, automating them or removing them completely. Much of the time when designing an RTS we look at what makes the game more/less fun or challenging, but never from a point of view of automation. There are many ideas that could be included into an RTS that would improve the game, but are too hard for the players to manage. If we automated these then we could add them to the game, automate them, then give the player control over how the automation works.

I'll throw several ideas out and show how this could be done.

---
The AI could make a "hot map" which would show where areas around the base need to be defended, as new units are made they would go to the areas considered underdefended, the player could access and draw on the hotmap pointing out areas that they would like defended as well, and the AI would update accordingly.

Income wouldn't be spent on a per unit basis, but rather a guideline for which of each sort of unit should be created, the AI would manage building the units in the correct spending ratios, mixing them up nicely according to the players wishes, but allowing the player if distracted by a battle to keep building. If the player temporarily wished to control it directly they could. The AI could be set to only start spending on units after the bank has so much in it.

In battle units would pick cover, run from dangerous units, and go after units they are strong against. The units would pick targets for maximum effectiveness, perhaps this would have to be set up by the player, especially considering each player plays differently, but each unit would do it's best, rather than blindly fighting whatever is closest/most convenient.

Base building could be similar to army building, designate builds to be built and where, then the AI would spend a portion of the income on building them in the spots you have chosen. Research could be extended the same way.
---

I know most of these ideas apply to current day RTS, but the fully automated RTS would look very different. I'd like to see a 90% automated RTS where the players choices mattered on a scale bigger than "shaving time from build queues", where unit placements, attack patterns and defense designs have a massive impact on the game, shifting the game from micromanagement to macromanagement. I like the idea of majesty, not controlling your units, but for this to be done your units would have to be SMART. I think now we finally have the computing power to have this be so.

Now I'm looking forward to making my own RTS. ;)
I've just been playing the Age of Empires 3 trial version (AoE has been pretty much the only RTS I've played) and thought of a few ideas.

1. Have a building like a Labor Market or employment office where idle villagers go when they don't have work. The building then reassigns them to harvest resources depending on the priorities you give it.

2. Businesses. Kind of like a Labor Market in that it automatically commands idle villagers. However, each business is assigned a specific resource to gather, a certain number of villagers it can use (or a ratio of the total villager count) and a budget of resources you give it to work. It then uses the villagers and resources you assign to harvest that resource, research technologies to improve production, and if needed build buildings to create the resource.


Another thing that I would like to see is a setup where large groups of resource gatherers to be automatically either given an escort (perhaps 1 combat unit per 5 gatherers) to protect them. Or at least have gatherers have some sort of plan in the event of an attack (call for help, head to a shelter, fight back as a group or something... I hate it when the enemy sends a soldier over to kill my gatherers and nobody seems to care that their fellows are getting killed).
Advertisement
Quote:
Hmm... Alot of the problem seems to be that players don't trust the higher level AI. This seems to be because the AI might not work well with the player's way of thinking, or the designer didn't think of the situation that the player is trying to use the AI in, or for any number of reason's, the AI is "jsut a little bit off". Obviously, the player needs to be able to control the AI as much as possible. The solution, from m programmer's perspective, is obvious.

Scripting

In Dark Reign, you could actually script the computer player AI. You could do this to tweak the AI for a particular level you designed in the level designer.

I know of people who designed AIs to follow certain tactics (rush, dig in, explore, etc). And several behaviours could be coded for the 1 AI script.

It was limited, but it did give an interesting way in which a player could dynamically change an AI behaviour.

The scripting system centred around prescribing certain "Strategic Values" to the various entities and objectives in the game. If you wanted an AI to produce lots of a certain type of unit you would give it a high Strategic Value. This could also be done with certain areas of the map and even unexplored regions of the map. The AI would then attempt to achieve that goal.

Say for instance that you wanted to build a certain unit, but it requires the existence of a specific building (it could be a foot soldier needing a barracks). If the AI encountered this, then it would cue a barracks to be built and then once it is built it would start producing the Foot Soldiers.

You could also set up "Funds" that the AI could access. This would break up the resources gathered into allotments. Each allotment could be set for a certain aspect (such as base building, unit production, repair, etc). One of these (a default) was a "Slush Fund" that could be used by any task.

So if we gave the player this kind of control over the AI, by giving them a bunch of sliders that influenced these values, then the player could set these as a high level control over the AI.

So early on, they might move the "Explore" slider up high and the AI will explore the map. When resource fields are discovered, the AI will attempt to build a resource network to them (which could be dependant on the level the "Resource Gather" slider value.

This would also apply to the spending of resources. The player could create "Funds" and indicate what percentage of the resources gathered would be distributed to it (between all current funds) and which Tasks could use it (base building, unit production, etc). The player should also be able to lock/unlock the fund (allow the AI to use the allocated to it), Create/Destroy funds (and resource allocated to a fund that is destroyed should be reallocated as if those resource were just gathered), Merge Funds, Enable/Disable funds (this would stop resources being distributed to the disabled fund, but still allow a task to take resources out of the fund), etc.

You could even still allow the player to have control over the individual units, but have a flag on them that either give the player control, or lets the AI handle them (so once a player is finished with the units they can give control directly back to the AI). You could even have an Idle control level where the units could default back to the AI after a certain time they have been Idle.
Quote:
Original post by NIm
Obviously, the player needs to be able to control the AI as much as possible. The solution, from m programmer's perspective, is obvious.

Scripting

But not all of the players are good at scripting. Only people with some programming experience are going to be able to appreciate that part of a game.


I would still go with scripting. The thing about scripting is that it is close, but not as hard as a programming language. The problem is that, before you get the benefits of that part of the game, you need to learn how to actually script things. I believe that, if you make an drag and drop scripting language, it will work for you. Here's how it works in my head:
The player has a command box with all the regular orders (move, attack, etc). but there is also a AI button, to choose the AI the unit will have. Inside it, you will have several different AIs to choose from, stuff like: "attack nearest enemy", "stay still if it is melee, charge if it is ranged", "cast polymorph if it's a dragon". Most of these AIs come from the guys that made the game, but you can also make your own, if you think you need them. Apart from that, townhalls, armies and the like could also have AI icons, that would work like mini-generals for you.

But if you want to make your own AIs, then you have the ultra-cool AI editor, that will work pretty much like the game-maker scripting part. If you don't know it, it's basically a cript were you drag'n drop the (if), then drag the condition for (if) to be true, etc. Doesen't sounds like much, and would be hard to make, but I believe it would make scripting considerably less frigthening.

Of course, day-dreaming about it is easy, getting dirty and programing the thing is a whole completely diferent thing. The thing is that, if you want to make such thing, I see no easier way. Plus, the player wouldn't HAVE to know how to script per see, he would just have to download the scripts from the internet. But when you expose the scripting for the players, you will have considerably less problems with people complaining about your AI - after all, if they are upset, they can make their own.
Quote:
But if you want to make your own AIs, then you have the ultra-cool AI editor, that will work pretty much like the game-maker scripting part.

Have a look at the open source game Roboships (http://roboships.sourceforge.net/). It has a drag and drop scripting system.

This topic is closed to new replies.

Advertisement