Skip to content

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?

2 points2 comments
Open on Reddit
About this post
Posted
Archived
Score
2 · 100% up
Kind
Text
ID
9shmsu

Author

1
posts
1
comments
0
media
View profile

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.

2 points

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 😁

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.