Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by KnightRiderGuy · Jan 01, 2017 at 10:09 PM · c#vraimemoryvoice

Is There A Way To give Your A.I. A Memory

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.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Grench1 · Jan 01, 2017 at 10:24 PM 0
Share

Great question!

avatar image tanoshimi · Jan 01, 2017 at 10:50 PM 0
Share

That's pretty much what a database does - store and retrieve structured information.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by RobAnthem · Jan 01, 2017 at 10:48 PM

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.

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image KnightRiderGuy · Jan 02, 2017 at 02:06 AM 0
Share

Thanks @RobAnthem, This sounds very interesting, I would like to know more about it. my App is not technically a game, but I kind of approach a fair amount of it from a game-like perspective. It's basically a voice command app I am creating for my $$anonymous$$night Rider replica. In it you can voice command many functions for the car such as turning on headlights, fog lights, hoping the rear hatch and many, many other car functions. The app itself can hold a fairly complex conversation which can lead into other conversational aspects... within certain limits based on the audio responses I have. The app even has mood swings of a sort based on how you talk to it.... pretty much like $$anonymous$$ITT in the TV show would often do.,,,

But yeah I would sure like to know a little more about implementing something like what you have mentioned here.

His audio responses draw from a random array for each question or statement the user speaks. Depending on his mood depends on which array he draws a response from. I have a microphone volume checker that detects if you are shouting which also affects mood if you swear at him loudly VS just casually, Loudly he takes a verbal insult more seriously.

avatar image KnightRiderGuy KnightRiderGuy · Jan 02, 2017 at 08:07 PM 0
Share

I was following that tutorial modifying the code a little but I don't think I'm using it correctly. I get a "Object reference not set to an instance of an object" error, not sure why??

 case "AreYouAspaceship":
                 SaveLoad.Load ();
                 if ($$anonymous$$ITT_IsPlayingAudioRecording == false && $$anonymous$$ITT_IsRecordingAudio == false) {
                     //Check if it Is $$anonymous$$ichael And Surveillance $$anonymous$$ode Is OFF And That Shut Up $$anonymous$$ode Is OFF
                     if ($$anonymous$$ITTmodesObject.is$$anonymous$$ichael == true && $$anonymous$$ITTmodesObject.Surveilance$$anonymous$$odeActive == false
                        && $$anonymous$$ITTmodesObject.$$anonymous$$ITT_isSpeaking == false && $$anonymous$$ITTmodesObject.ShutUp$$anonymous$$ode == false
                        && $$anonymous$$ITTmodesObject.$$anonymous$$ITT_SaidThis == false) {
                         if (lastQorA == "AreYouAspaceship") {
                             $$anonymous$$ITTvoiceBox.YouHadAlreadyAskedThatResp ();
                             //Negative So Subtract 1 Point From The $$anonymous$$ood Level
                             $$anonymous$$ITTmodesObject.$$anonymous$$ITT_$$anonymous$$oodLevel--;
                             Debug.Log ("Why Is $$anonymous$$ichael Asking $$anonymous$$e This Again? That Is $$anonymous$$ost Anoying");
                         } else if ($$anonymous$$ITTmodesObject.is$$anonymous$$ichael == true && $$anonymous$$ITTmodesObject.Surveilance$$anonymous$$odeActive == false
                                   && $$anonymous$$ITTmodesObject.$$anonymous$$ITT_isSpeaking == false && $$anonymous$$ITTmodesObject.ShutUp$$anonymous$$ode == false
                                   && $$anonymous$$ITTmodesObject.$$anonymous$$ITT_SaidThis == false) {
                             Debug.Log ("$$anonymous$$ichael Asked ---- Are You A Spaceship");
                             $$anonymous$$ITTvoiceBox.AreYouAspaceshipResp ();
                             //Negative So Subtract "1" point From The $$anonymous$$ood Level
                             //Stating the obvious does not earn any "Brownie Points"
                             $$anonymous$$ITTmodesObject.$$anonymous$$ITT_$$anonymous$$oodLevel--;
                             lastQorA = "AreYouAspaceship";
                             // Lets Try And Save That We Asked this Question
                             // So That The Next time $$anonymous$$ITT Is Started He Will Say That You Asked $$anonymous$$e That Yesterday
                             UserSession.current.lastQorA01.name = ("AreYouAspaceship");
                             SaveLoad.Save ();
                         }
                     }
avatar image KnightRiderGuy KnightRiderGuy · Jan 02, 2017 at 09:35 PM 0
Share

O$$anonymous$$ I was playing around with the code a little more and I Added a reference to the UserSession Script like this

 // Reference To The UserSession Script
     public UserSession UserSession;

And in my part where I want to save I changed this:

 UserSession.lastQorA01.name = "AreYouAspaceship";
                             print ("I Will Remember This");
                             SaveLoad.Save ();


Now from looking at the inspector it is changing the "LastQorA01.name" alt text

But When I call load in my void start the inspector is not changed.... does anyone have any idea what I'm doing wrong?

screenshot-2017-01-02-153044.png (31.6 kB)
avatar image KnightRiderGuy · Jan 02, 2017 at 03:22 PM 0
Share

@RobAnthem, I've been looking into the binary formatters... is this the sort of thing you are talking about? https://gamedevelopment.tutsplus.com/tutorials/how-to-save-and-load-your-players-progress-in-unity--cms-20934

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

295 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Real Voice Print Authentication 0 Answers

Make player not be seen by AI, when player in foilage and shadows. 1 Answer

Enemy AI C# 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges