/r/gameai
Topics relating to the development and use of game AI. Note that this is often not real artificial intelligence but rather what has been referred to for decades as "AI" in games. Usually, that is variations on some form of artificial behavior.
And take that bucket off your head!
A subreddit for those interested in the development and research of artificial intelligence for games. For broader scope, check out /r/gamedev and /r/artificial.
Recommended Resources:
/r/gameai
Hi guys, I will develop a video game with Unreal Engine as my graduation project, and it has to use some deep learning or machine learning to be qualified as a graduation project. I've done some research, and I'm thinking about two topics. The first one is a npc that follows player with using deep learning, and the second one is emotion based decision-making for npc with deep learning similar to the Black & White game. The second one looks simpler than the first one to me because I can't figure out how to autonomously move a npc towards the player because the player's location and direction can be changed continuously, so how can the neural network learn to follow the player correctly around the level? What do you think about these ideas, and do you have any advice?
I want to develop a system similar to "The Director" from Left4Dead or AI Storyteller from Rimworld. The system's goal is to procedurally generate events depending on context and player actions. The main goal is to make these events meaningful and to generate a narrative via the system.
My first idea was to use Utility AI with buckets of events. But maybe you can recommend some other approaches? I would appreciate any related experience or materials.
I'm working on a hobby 3D first-person game where you play as the robotic care-taker on a train escaping from some nameless horror: Oregon Trail vs. Alien Isolation. At each station, you pick up NPC passengers and try to give them the tools to survive, like food, shelter and water, but you don't directly command them on how to use them. In this sense, it felt like The Sims would be a good model for the AI, and I went down a rabbit hole on Utility AI approaches, from The Sims' motives-based system to Dave Mark's really cool talks on IAUS.
I'm going to start with the more approachable Sims system, and I think I understand how the curves that weight the NPC's motives weight the offer of each behavior offered by a smart object. The place I'm circling on is how detailed to make behaviors.
For example, I have a loaf of bread sitting on the bed of the train car. It offers +10 to "fullness" (opposite of hungry) motive. Based on what I've read about the Sims, it seems like the behavior might be as coarse as "eat". However, in a 3D game, to work out a convincing eat behavior, I've found myself making each behavior as a state machine of actions, where each action is similar to an input a player might make. The state machine to eat the bread looks like:
Move To -> Stop (when in reaching distance) -> Drop Held (if already holding an item) -> Pick Up -> Eat -> Done
However, this means every time I make a behavior, I'll have to code up a small state machine to implement it. That probably isn't the end of the world, and behaviors will be reusable on different objects.
As an alternative after reading through some posts here, I saw a suggestion that the behaviors could be as atomic as those actions, so the bread object might offer the following behaviors:
All 3 of these behaviors would offer the same +10, so that a hungry NPC moves towards the bread and picks it up, even those those two behaviors don't directly result in the motive being adjusted. Also, impossible behaviors, like picking up the target bread would be rejected if out of range, and eating something that isn't held would be rejected. In this way, the behaviors could self assemble into the more complex sequence I manually coded above. Additionally, if both an "Eat Standing" and an "Eat Sitting" behavior become enabled once the player has picked up the target food, the NPC could choose between those two options without me needing to make two state machines that have lots of duplicated checks.
The place where I start to get unhappy with that approach is the actions are no longer atomic player-like actions. You can't Pick Up without dropping whatever you're holding, and I'm not sure how to reason the NPC into picking that kind of intermediate action purely through behavior weighting. I could make the Pick Up behavior always drop what is currently held first as a practical approach.
So, my question is, is the Behavior-as-a-state-machine approach in the first example a good approach, or is it more maintainable to try to keep Behaviors as small as possible and incentivize them to self-assemble.
note: i gonna do all games, but from the 1st to the 4th...
You still have time to submit your work to the 14th International Conference on Artificial Intelligence in Music, Sound, Art and Design (EvoMUSART).
If you work with Artificial Intelligence techniques applied to visual art, music, sound synthesis, architecture, video, poetry, design or other creative tasks, don't miss the opportunity to submit your work to EvoMUSART.
EvoMUSART 2022 will be held in Trieste, Italy, between 23 and 25 April 2025.
For more information, visit the conference webpage:
www.evostar.org/2025/evomusart/
I wanna create a simple card game , a mix of uno and solitaire, i need a computer to play against the player, so i wanna know where can i learn this?
Hi, I'm the founder of TimeWizardStudios. We create well-written, stylized adult games.
Instead of posting separate ads for each role, I’ve combined everything here to keep it short and sweet.
You can find out more about our game here:
We’re expanding our team – looking to hire artists, writers, and programmers.
Our game Another Chance has been in development for over 4 years, with monthly updates. The current team consists of two writers, two artists, one programmer, and one social media manager.
Each update adds a quest (go here, pick up the item, talk to this character, etc.), ending with a sex scene. The story is dialogue-heavy, with branching routes for characters and different outcomes based on player choice.
Here is a quick trailer:
Here’s a sample of our in-game writing:
^^(please ^^don't ^^apply ^^for ^^the ^^writing ^^role ^^unless ^^you ^^can ^^write ^^at ^^least ^^to ^^this ^^level ^^of ^^quality, ^^sorry ^^but ^^it ^^will ^^save ^^both ^^of ^^us ^^time)
Writers:
We have a lead writer, so we are looking for someone who can add new quests and expand the storyline, continuing with the in-game writing.
This task is actually pretty hard to find a suitable writer for, because our current lead writer is talented (in my opinion), and a big portion of our game's success is that we have a strong script and well-written story.
To join our team, you would have to be able to copy and mimic the current writer's style and prose, plus be able to match all the character voices.
For the writing our budget is $800 - $1,000 per quest. Usually a writer would submit around one quest per month, but we have no strict deadlines.
We are also thinking about branching out and making new games, but any writer (or artist) I hire, I would want to test their skill through our current workload, before working on new projects.
Artists:
Here’s our sprite sheet to show our art style. If you can replicate this, I’ll send you a more detailed style guide.
https://i.imgur.com/e4Bu8cN.jpeg
This link would also be good to review as a writer, as it will show you all our characters and help you imagine them when you write. We have lots of writing documents that outline the whole plot, story, plus we have resources like sprite sheets that show every character with matching emotion/expression.
Honestly, playing the game would grant you the biggest chance at success at any of these roles, as you can see exactly what we are building, how it works and functions, and how all the pieces of art, writing, and programming come together in the final product. Please ask me for a link to the latest release and I will send it to you.
Programmers:
And lastly for programmers, there are a couple projects I am working on.
I am looking for someone with knowledge of PixiJS and Typescript, as we are building an online visual novel engine.
I am also looking for someone highly experienced in AI and LLMs as there are a couple of SaaS tools I want to build, and one I am already working on right now (a really cool social media management tool).
This is a tech stack that we use for one of our projects:
https://i.imgur.com/59jnovp.png
And lowest on the priority list would be someone experienced in Unity.
I really believe that AI is the future, and I have lots of cool ideas that I want to build integrating it. Virtual assistants, virtual employees, since I run a game dev studio there are a lot of tasks that AI can really help me with, and I am looking for a talented programmer who can help me put all the pieces together.
I know the programming and art sections were much shorter, but these roles are also important to me, so if you read everything and you feel like there could be a spot for you on the team, please reach out.
I’m always on the lookout for talented, hardworking, and intelligent people to join the team.
Contact:
I actually created a server to help facilitate and manage all this. It's called Rolodex Online
It will be a place where writers, artists, programmers, and all kinds of creatives can join and leave their portfolios. I plan to keep this server neat and organized, to grow it and turn it into a useful tool where people can find collaborators and form projects or relationships.
When I tried to do recruiting in the past, sometimes I would get too many messages and get stuck. So sadly, lot of people went unresponded.
With this server, we will track and organize everyone's portfolio, and make sure applicants receive timely responses.
If you've contacted me in the past and I never replied, I apologize, most likely I did not do it on purpose. I am trying to fix my bad habits, I lost a lot of really talented people I could have worked with, and that is one of the reasons I am creating this server. I believe it can grow into a big community where creatives can connect and collaborate.
To apply:
Please join the server and leave a message in the relevant category with your portfolio. We can then discuss rates and I’ll share more resources.
Hey folks! 👋
Are you working on research in Artificial Intelligence for creative purposes like visual art, music generation, sound synthesis, architecture, poetry, video, or design? EvoMUSART 2025 offers a great opportunity to present your work!
📍 Location: Trieste, Italy📅 Date: 23-25 April 2025🗓️ Paper Submission Deadline: 1 November 2024
More info: https://www.evostar.org/2025/evomusart
#ai #airesearch #creativetoots #art #design #cfp #music #generative #callforpapers #italy
Hello world! I wonder if you could help me out with my PhD research. I am generating a pipeline for LLMs to re-theme a dungeon crawler with card-based combat, then using SD to create all the spritesheets and images. I would appreciate if you could take some time to fill in this survey:
https://forms.gle/8b7bVG3ZCbDPFMmn7
It's a "fun"️ quiz in which you guess which settings the AI generated images and text fit best! Participation is optional and it's completely anonymous. The survey takes between 10 and 15 min to complete.
Thank you in advance for your consideration, whether you choose to participate or not 🙂🎮
Hi guys. I'm trying to figure out how to use Utility AI. I gathered all the information on the Internet that I could reach and read all the articles and videos. I made a pet project in unity with my implementation of utility AI. And if there are no problems with the implementation of the entire system. and with the price of the action, everything is clear, it is equivalent to the usefulness of the action expressed as a percentage. Then everything is difficult with aggregation. And I found that the most difficult question is agrigation scores from consideration. and it is very sad, but it is this part that the least information is devoted to. I think if it could be covered in more detail, then the utility AI approach would be much more popular. I have seen several approaches, one of which is multiplying all considerations and using a modifier:
public float EvaluateAiAction()
{
float score = 1f;
foreach(var consederation in _consederations)
{
float consederationScore = consederation.Evaluate()
if (consederationScore = 0) => return consederationScore;
score *= consederationScore;
}
float actionScore = csore + ((1- score) * (1-(1/_consederations.Count)) * csore);
return actionScore;
}
Other options have individual processing of values using min, max, average, sum, product. Which seems more correct to me. But I would like to know the basic principles by which aggregation takes place. how to understand how to combine values and, most importantly, how it relates to how consideration is combined in another action. I know that there are both the founders of this approach and other experienced developers here. I would really like to clarify how agrigation should work.
I will give an example from my pet project so that there is a little context for the discussion. There are aiActions, Considerations, three curves and Tasks for behaviour that should be used to aggregate Considerations.
Tasks for behaviour:
Actions:
Consideration:
Curves:
In each Consideration class, I have a metod Evaluate , which usually applies curve to the incoming values anp performs something similar to this:
public float Evaluate(int value, int maxValue)
{
_score = _curve.Evaluate(Mathf.Clamp01(value / maxValue));
return _score;
}
(perhaps later need to do only one type of class and just passing the curve inside)
In each AiAction class, I have a metod EvaluateAiAction that gets a scores of Considerations and has to agrigate them. An example for "DrinkHealingPotion":
public float EvaluateAiAction()
{
var visibleHealingPotions = _aiBrain.GetNumberOfVisible(VisibleTypeE.HEALING_POTION);
var targetEnemy = _aiBrain.GetNumberOfVisible(VisibleTypeE.TARGET_ENEMY);
var nearestEnemy = _aiBrain.GetNumberOfVisible(VisibleTypeE.NEAREST_ENEMY);
var distanceToHealingPotion = _aiBrain.GetDistanceOfNearest(VisibleTypeE.HEALING_POTION);
var nearestHealingPotionDistance = _allConsiderationsDict[ConsiderationTypeE.DISTANCE].Evaluate(distanceToHealingPotion _stats.Speed);
var healingPotionStock = _allConsiderationsDict[ConsiderationTypeE.COUNT].Evaluate(_heroInventory.HealingPotions, 5);
var healingPotionPoiCount = _allConsiderationsDict[ConsiderationTypeE.COUNT].Evaluate(visibleHealingPotions, 5);
var heroHealth = _allConsiderationsDict[ConsiderationTypeE.HEALTH].Evaluate(_stats.Health, _stats.MaxHealth);
var NearestEnemyHealth = _allConsiderationsDict[ConsiderationTypeE.HEALTH].Evaluate(nearestEnemy.Stats.Health, nearestEnemy.Stats.MaxHealth);
` var TargetEnemyHealth = _allConsiderationsDict[ConsiderationTypeE.HEALTH].Evaluate(targetEnemy.Health, targetEnemy.MaxHealth);
float score = ????????????????; // the main question concerns this place
return score;
}
(perhaps later you will need to do caching from the outside, but now the main thing is to understand the principle of the aggregation approach)
image of curves https://i.imgur.com/ueR0sic.jpeg
Hello everyone! I’m currently conducting research throughout my second-year master’s program in design on the implementation—or rather, the ways in which video games are adapting to advances in AI by integrating them into gameplay. This includes the emergence of new NPCs with integrated LLMs, as envisioned by Ubisoft, as well as other visual, narrative, or gameplay initiatives. I’m open to any discussions, references, or connections with people in the industry to enrich my analysis, state of the art, and potential avenues of exploration. Thank you all !
I recently bough the book AI for Games by Ian Millington. I've liked it so far and have been trying to implement each behavior in godot 4.2. However for some reason the separation steering isn't working as expected. Instead of moving away from each other. Characters move towards each other. At first I though maybe the decay coefficient needs to be negative (and that does seem to fix the issue) however he clearly states:
The k constant can be set to any positive value
And later on when describing attraction.
Using the inverse square law, we can set a negative value for the constant of decay and get an attractive force.
So it seems like that value should be positive to separate and negative to attract. Yet I'm getting the opposite behavior.
This is my code:
separation component code:
class_name SeperationComponent
extends Node
@export var MAX_ACCELERATION :float
@export var THRESHOLD :float
@export var DECAY_COEFFICIENT :float
@export var character :CharacterBody2D
var targets :Array[Node]
func get_seperation() -> SteeringOutput:
var result := SteeringOutput.ZERO()
for target :CharacterBody2D in targets:
if target == character: continue
var direction :Vector2 = target.global_position - character.global_position
var distance :float = direction.length()
if distance < THRESHOLD:
var strength :float = min(DECAY_COEFFICIENT / (distance * distance), MAX_ACCELERATION)
direction = direction.normalized()
result.linear += strength * direction
return result
character code:
extends CharacterBody2D
@onready var seperation_component :SeperationComponent = $SeperationComponent
func _ready() -> void:
seperation_component.targets = get_tree().get_nodes_in_group("target")
func _physics_process(delta :float) -> void:
var result := seperation_component.get_seperation()
if result.is_zero():
velocity = Vector2.ZERO
else:
velocity += result.linear
rotation += result.angular * delta
_clip_speed()
move_and_slide()
func _clip_speed() -> void:
if velocity.length() > 50:
velocity = velocity.normalized() * 50
And pseudo code from the book:
class Separation:
character: Kinematic
maxAcceleration: float
# A list of potential targets.
targets: Kinematic[]
# The threshold to take action.
threshold: float
# The constant coefficient of decay for the inverse square law.
decayCoefficient: float
function getSteering() -> SteeringOutput:
result = new SteeringOutput()
# Loop through each target.
for target in targets:
# Check if the target is close.
direction = target.position - character.position
distance = direction.length()
if distance < threshold:
# Calculate the strength of repulsion
# (here using the inverse square law).
strength = min(
decayCoefficient / (distance * distance),
maxAcceleration)
# Add the acceleration.
direction.normalize()
result.linear += strength * direction
return result
I'm using the Separation behavior independently. So the Scene starts with a couple of characters that are too close together. And the behavior moves the characters away from each other (or closer in my case).
Not sure what I'm doing wrong. Any help would be appreciated.
I want to talk to game devs for a short mini-doc, focusing on the videogame/VO actor strikes currently going on.
Questions will be surrounding the agreements Sag-Aftra are trying to negotiate and what people think the realistic outcome will be, going forward.
I need a “pro AI” take from a game dev, someone who can balance the argument for the film. People are keen to know how the tech will improve the gaming industry and enrich the player experience.
It’ll go out on my YouTube channel, which is a subscriber base currently made up mostly of gaming enthusiasts.
Previous work here: https://youtu.be/vHBjjRZV7No?si=1VnpOlY2vMYFwoOV
I am Luke Dale (actor/filmmaker). I play Hans Capon in Kingdom Come: Deliverance, a major historical RPG launching next year.
My audience will be very interested to hear from you, so don’t hesitate to get in touch.
This game contains six AI NPC as characters with image output, with a little kitty for you to interact with, auto response and three chapters in total, from choosing the lisan al gaib (chat based), defeat and take the throne (Select Adventure) to pass the golden age (card swipe form, Yes / No as in Reigns)
Game Intro:
Link to the Game
So I'm trying to implement utility AI using all the resources I can find on IAUS, and I've hit a snag while linking actions to behaviors.
Suppose I have an AI mech that can be loaded out with different weapons, components etc. Some actions are added to the mech when it's designed, such as BasicMeleeAttack -> Punch or ClosingMeleeAttack -> ShoulderCharge. However, maybe I also want to add another attack that uses ClosingMeleeAttack as its behavior, such as DashKick.
Or maybe the mech picks up an axe which also uses BasicMeleeAttack to the mech's equipment. If I want the mech to be able to either punch or swing the axe, I have to change punch's behavior to BasicUnarmedMeleeAttack, or have some way of choosing which action to perform for a given behavior + target.
The first solution I thought of was to choose a behavior and target, then pick from the available actions either randomly or via a priority assigned when designing the action (swinging axe is priority .8 while unarmed punch is .2). Not a fan of this.
The second solution is to evaluate each behavior, target, and action together. This unfortunately introduces coupling between the behavior (what to do), and the action (execution code). But this allows more context when evaluating behaviors, as maybe Punch doesn't have the range to hit the enemy whereas the axe does.
Finally, I could increase the granularity of behaviors to increase the number of actions available without introducing a one to many relationship. For instance, ClosingMeleeAttack -> ShoulderCharge and FlairClosingMeleeAttack -> DashKick.
My instinct is to go with solution 2, since it offers the most flexibility in situations where I want a character to have interesting actions available without forbidding the "default" action.
I'd appreciate hearing from anyone who has tackled this problem themselves!
Hi, my name is Uchan, and I'm the lead developer of 1001 Nights, a storytelling game driven by large language models (LLMs, like GPT-4. We used GLM for free demo)
1001 Nights is an RPG driven by language AI based on Persian folklore. The protagonist Shahrazad has the unique ability to transform language into reality. Your mission is to craft a compelling tale for the King, leading him to mention weapons, which then materialize into real blades in your hands to revenge on him
1001 Nights is a pre-GPT game, initially developed in 2020 before AI became widespread (driven by GPT-2, the precursor to ChatGPT). Due to the limitations of AI before 2023, this game was originally an art and academic project rather than an indie game. Over the past years, I published academic papers on the game system and received a nomination for the Berlin A.MAZE indie game awards.
We have provided a full AI content disclosure on our itch.io page, and most of our AI workflow has been disclosed and published in our papers (they are basically like dev logs in a special format). If you have any questions or feedback about the AI workflow, please leave us a message! We rarely see indie games with a detailed disclosure statement like ours, so we're not entirely sure how best to approach it. We would greatly appreciate any suggestions you might have.
1001 Nights' free demo is now available. We also have a Steam page, but the demo is currently only on itch.io. This game is still in progress, and we'd love to hear your feedback.
Links:
Hi,
Various simulation games require carrying resources from various sources to a single destination, for example resources needed for crafting need to be delivered to a workshop from wherever these resources are currently lying around.
So imagine you have a single destination, and it needs N resources of some type. These resources are available in various sources on the map, and each source has a different amount of said resource, that ciykd be more or less than N. There are also various characters around the map in different positions that can be assigned the task of carrying resources towards the destination.
I'm looking for an algorithm that doesn't have to be optimal but needs to make sense to the player (so they don't say "the AI sucks") where one (or more) of the characters are assigned a route to collect resources from various nodes so that their total amount is N, and then deliver them to the destination. Any ideas?
Efficiency is a concern of course.
I had a thought last night and maybe this isn’t the place for this post but I wanted to get the idea out.
What if there was an AI tool for video game players that helped you set your personal ideal sensitivity settings for individual games based on your movement patterns and performance?
So, an AI “watches” you play a few rounds of a game (probably something competitive) and analyzes that you almost always over correct vertically but not horizontally in your aiming movements. The program uses this information to run some numbers and spits out a suggestion for what sensitivity best fits your current skill level. Ideally it would be integrated into the game itself and would be able to make those changes in the game setting automatically.
I’m guessing this could then be expanded to help the players reach higher sense levels too with some kind of training regimen through continued gameplay analysis.
Is this something that would be doable in AI’s current form?
Greetings. I am currently working on developing an AI for a strategy RPG game. The core gameplay loop is that the AI will either be tasked with capturing a castle or defending it from being taken by the player.
What I have designed so far is that I am using a scoring system to determine the best position , action and targets. The formula I use is
Position x Action x Consideration.
Position starts at 1.0 and increases/decreases depending if moving there is beneficial or not (terrain bonus) It also change depending on how close this unit is to the castle or to the enemy.
Action is what's the action is worth. Either damage an enemy, heal an ally, apply buffs to allies or apply debuffs to enemies.
Consideration also starts at 1.0 and changes depending on certain circumstances. For example, healing/attacking an army general adds a bonus of 0.5 than a regular unit, adding further 0.02 per level so it prioritize high-level units. Additional points are added depending if the Action is suited for Attack, Support, Debuffer, or Healer or if attacking this unit will kill it.
My questions are
Am I using the right formula for determining the points for an action? How do I determine how much an action is worth? What metrics can I use to justify attacking an enemy unit over using a support skill or healing an ally especially for unit that can have multiple roles?
Currently, I am basing it on damage done (maximizing damage). A saved test I have has an AI deciding to eliminate a normal unit over an army general. Both are already near death. Since this unit deals more damage on the normal unit, it always kill the normal one unless I tweak the consideration to higher than 0.5.
Hi all,
I notice that the recent posts here involve very specific items. But where does one START when looking into Game AI?
I'm an ex-software developer but I've never done any AI beyond Boids. I'd like to get started, but I don't know where to look first.
Another issue I have is figuring out how to incorporate it into the game loop, but that's mostly because I don't understand the game loop either :|
Whether you're in the animation field or academic research, get ready for the launch of the M-Body project! Supported by NSERC-CRSNG federal funding, this project brings together a multidisciplinary team from four leading applied research centers across Canada : SIRT Centre, Centre de développement et de recherche en intelligence numérique - CDRIN, MRC Studio Durham College and Laboratoire en innovation ouverte (LLio). Our goal is to provide a collaborative, open-source toolkit and software systems for cutting-edge generative character animation, complete with a high-quality, human motion dataset. #AIgenerative #animationtech #dataset #opensource
Follow us: m-body.ai / Open-source data and tools, for generative animation
Hey Everyone, I have been reading AI for Games by Ian Millington and I was wondering if anyone knows if there are some solutions available somewhere. I cant seem to find any. Thanks!
Also, if anyone has any other books or resources for game AI, id love to hear them. Or even your thoughts on this book if you have read it :)
Sadly, I have little programming experience, but I'd like to learn in order to work on an ongoing project. At the moment I have a couple of resources lined up, like the C# course at CodeAcademy, as well as this resource on learning gamedev: https://github.com/notpresident35/awesome-learn-gamedev . I'd prefer free resources if possible. Thank you to anyone who stops by to read or even comment.
Hey guys!
I'm doing a quick, anonymous survey about AI and games for a little project of mine: https://forms.gle/mocR2Aenewwdqgdb6
Thanks in advance to you, good folks, that are going to give us some of your time and opinions!