I’ve working with Voice recognition and response. I Have a fairly complex A.I. going on that cross references what the user said with real world data from either the system information and information being fed in through the serial port from an Arduino.
I’m using player prefs to store some fairly basic things like settings and such…
But I’m wondering if it’s possible through some fancy C# scripting to give my working A.I. a bit of a memory… like to remember things that were said or asked of it several questions ago??
not really sure how to go about that or if it’s even possible really.
Sure, simply create a list of bools that correspond to your questions, I HIGHLY suggest not using player prefs for such a thing though, serialization and database creation is pretty simple, and in most cases all you need is a simple binary formatter.
Personally I would create an entire “history” for the player, that contains his choices, and if your AI has random choices you can create an array of bools to correspond to the choices.
If you did like a 4 Dimensional array then you could store 4 options per conversationwithout having to create a custom data structure, but in my opinion if your dialog is going to be a huge part of the game, I would find a way to create a stored history. Perhaps a dictionary per conversation that looks something like
Dictionary<dialog, bool>
or to store player responses based on a specific possible responses you could always denote the hierarchy to an indexed integer and it may look more like
Dictionary<string, int>
and the int would be the choice that was made, where the string was the actual dialog spoken.
EDIT: As a side note, you could easily incorporate the “history” into your gameplay and evolving storyline.