Tag Info

Hot answers tagged

6

First think of what you would do as a player (and/or ask others what they would do) and then try to program one or more of those strategies. There are probably several situations where a simple rule won't be a good idea to follow. This is actually a good thing, because otherwise your game would be fairly pointless to play as a human. Having an AI that can ...


3

There is really nice article at Rogue Basin on Dijkstra Maps about the problem you are encountering. This kind of "exploit" can be easily overused, cornering range units, while they are try to flee, they really stuck and can't move away. The article describes making "negative" Dijkstra maps. You create normal Dijkstra map, multiply result by value -1.2, and ...


2

One simple way of doing it could be to make a few alternate versions of the script and have different AI profiles for the enemies (just give them a random one when created). This way you could have one type that goes straight ahead like you have now, but also others that try to get the player by curving right or left. Maybe even one that makes some random ...


2

You wouldn't have to hardcode the best answers. You'd make chromosomes out of genes that indicate what to compare and how to compare them. Comparison DNAs: < > == != Modifying DNAs: + - * / Value DNAs: player.position.x, 9, 3.18, etc Condition Extension DNAs: && || If you make a bunch of genes out of some combination of the above DNAs you can ...


2

Make a list of things a character would do at certain hours and be sure to have multiple activities at every time. Say at 08:00 they eat breakfast or shower and at 09:00 they commute to work or work from home. Now you keep also note how long a NPC would take to finish the task. You keep track of the last time the player was able to see the NPC. If the player ...


1

This task can be surprisingly difficult in general; it is a variant of the Art gallery problem, and just like that problem, it is made dramatically harder with even slight complexities in the geometry. But if you're willing to accept a flawed, "good enough" solution, here's one: leave a "vision trail", and assess whether there is only one exit that is not ...


1

A design pattern I've enjoyed using has two types of things: task management and task execution. Task management asks the question "What should I be doing right now?" And task execution asks, "How do I complete the current task?" Task Managers The job of the task manager is to constantly look at the AI's internal state (read-only) to determine whether new ...


1

The best way I can think of to do this is to have an empty object with a TaskController script. Assuming the NPCs have their own scripts, and you can call a function in their script to have them handle a task, your logic would flow like: Player clicks on light switch Light switch script calls CreateTask(TaskName, Index) on your TaskController empty's ...


1

Artificial Intelligence is a very fuzzy idea without clear boundaries. The Oxford English Dictionary just defines it as: the theory and development of computer systems able to perform tasks that normally require human intelligence, such as visual perception, speech recognition, decision-making, and translation between languages. The definition of ...



Only top voted, non community-wiki answers of a minimum length are eligible