Transferring AI consciousness into manually controlled player via trigger event
I’m attempting to make a game in which a character travels alongside her faithful wolf companion and the two have very very different abilities in terms of gameplay (and the fact ones an animal and ones a person) is it possible to create essentially an AI with the objective of protecting the currently controlled character to swap consciousness to the other character when a certain input is triggered? I’ve only just begun experimenting with AI and I don’t entirely understand how it works but I have a basic fundamental grasp of the subject.
Your thoughts?
About this post
- Posted
- Archived
- Score
- 2 · 100% up
- Kind
- Text
- ID
- 9shmsu
2 comments
All entities in the game world can respond to a set of inputs that cause certain outputs.
For example, if the user hits the jump key, the player controlled character will jump. Likewise, if an AI controlled rabbit "senses" danger - the rabbit will jump.
In both those cases, the input is different (jump key or sensing danger) but the output is similar. (Player jumps or rabbit jumps).
A player character is really just an AI agent controlled by gamepad/keyboard+mouse input.
If you build your two characters both as "AI", then there is nothing stopping you from taking the inputs that are usually for the player and sending them to the rabbit or vice versa. (When the user hits the jump key, send that information to the rabbit instead).
This game programming pattern describes this concept: http://gameprogrammingpatterns.com/command.html
It might be overkill for your purposes but I'd definitely recommend a read.
Thank you for the insight, I’ve just been trying to wrap my head around how I will make this a reality and this is a step in the right direction 😁