diff --git a/Viagg-io/Assets/BehaviourTrees/3.2-Grotto.bt.txt b/Viagg-io/Assets/BehaviourTrees/3.2-Grotto.bt.txt index a7f8e86..d38d591 100644 --- a/Viagg-io/Assets/BehaviourTrees/3.2-Grotto.bt.txt +++ b/Viagg-io/Assets/BehaviourTrees/3.2-Grotto.bt.txt @@ -14,11 +14,13 @@ Composite(Sequence) { //RunTree("32_Grotto_Story_B_Grotto_Intro") - RunTree("32_Grotto_Kueche_Intro") + //RunTree("32_Grotto_Kueche_Intro") //RunTree("32_Grotto_Kueche_Zwiebeln_schneiden") - //RunTree("32_Grotto_Kueche_alles_gefunden") + RunTree("32_Grotto_Kueche_alles_gefunden") + //RunTree("32_Grotto_Kueche_Interesse_Kochen") //RunTree("32_Grotto_Kueche_Kochen_Anzahl") //RunTree("32_Grotto_Kueche_Zusammen_Kochen") + RunTree("32_Grotto_Kueche_Parmigiano") //RunTree("32_Grotto_Im_Grotto_Essen_Intro") } } @@ -630,8 +632,7 @@ Tree("32_Grotto_Kueche_Zwiebeln_schneiden") { BTC.CompareBool("RisottoIsSnapped", false) // Objekt geht zurueck - BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Risotto", -6.824, 1.335, -18.8996) - + BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Risotto", -7.920319, 0.9762855, -16.10492) BTC.Run("AudioSource.AUDIO.Kueche5Zwiebelnsch") } } @@ -658,7 +659,7 @@ Tree("32_Grotto_Kueche_Zwiebeln_schneiden") { BTC.CompareBool("SalzIsSnapped", false) // Objekt geht zurueck - BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Salz", -6.607, 1.321, -18.8996) + BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Salz", -7.94902, 0.9696183, -16.31448) BTC.Run("AudioSource.AUDIO.Kueche5Zwiebelnsch") } @@ -686,7 +687,7 @@ Tree("32_Grotto_Kueche_Zwiebeln_schneiden") { BTC.CompareBool("PfefferIsSnapped", false) // Objekt geht zurueck - BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Pfeffer", -6.686, 1.321, -18.8996) + BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Pfeffer", -7.923509, 0.976778, -16.23407) BTC.Run("AudioSource.AUDIO.Kueche5Zwiebelnsch") } @@ -714,7 +715,7 @@ Tree("32_Grotto_Kueche_Zwiebeln_schneiden") { BTC.CompareBool("WeissweinIsSnapped", false) // Objekt geht zurueck - BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Weisswein", -6.58, 1.451, -19.0233) + BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Weisswein", -8.098644, 0.9762855, -16.33541) BTC.Run("AudioSource.AUDIO.Kueche5Zwiebelnsch") } @@ -742,7 +743,7 @@ Tree("32_Grotto_Kueche_Zwiebeln_schneiden") { BTC.CompareBool("BouillonIsSnapped", false) // Objekt geht zurueck - BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Bouillon", -6.947, 1.402, -18.995) + BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Bouillon", -8.082785, 0.9762855, -15.99537) BTC.Run("AudioSource.AUDIO.Kueche5Zwiebelnsch") } @@ -770,7 +771,7 @@ Tree("32_Grotto_Kueche_Zwiebeln_schneiden") { BTC.CompareBool("OlivenoelIsSnapped", false) // Objekt geht zurueck - BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Olivenoel", -6.752, 1.449, -19.024) + BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Olivenoel", -8.0905, 0.9762856, -16.20448) BTC.Run("AudioSource.AUDIO.Kueche5Zwiebelnsch") } @@ -807,8 +808,8 @@ Tree("32_Grotto_Kueche_alles_gefunden") { BTC.Run("AudioSource.AUDIO.Kueche2allesgefund") // Herd anstellen - ToDo: Handling in Story? - BTC.Run("NamedGrabEvent.STATIC.Herdschalter") - BTC.Run("StudioEventEmitter.STATIC.HerdplatteAnstelle") + //BTC.Run("NamedGrabEvent.STATIC.Herdschalter") + //BTC.Run("StudioEventEmitter.STATIC.HerdplatteAnstelle") // Zwiebeln in Topf geben BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Zwiebeln") @@ -924,28 +925,43 @@ Tree("32_Grotto_Kueche_Interesse_Kochen") { // --- Kueche - Interesse Kochen --- Composite(Sequence) { BTC.Run("AudioSource.AUDIO.Kueche1InteresseKo") - // ToDo: Freie Antwort als Speech Input - BTC.Set("TextMeshPro.GO.Option1Button", "text", "Lasagne") - BTC.Show("GO.GO.Option1Button") - BTC.SetBool("32_Grotto_Kueche_Interesse_Kochen_Button_Clicked", false) + // Frage beantworten + BTC.AddPossbileSpeechIntent("Kueche.Interesse_Kochen.2") + BTC.StartSpeechIntentRecognition() Composite(Race) { + // -- Race 1: User sagt etwas Composite(Sequence) { - // Lieblingsessen nennen - BTC.Run("NamedEventTrigger.GO.Option1Button") - BTC.SetBool("32_Grotto_Kueche_Interesse_Kochen_Button_Clicked") - BTC.Hide("GO.GO.Option1Button") - RunTree("32_Grotto_Kueche_Kochen_Anzahl") + BTC.UserStartedSpeechInput() + + Composite(Selector) { + // -- Selector 1: Intent erkannt + Composite(Sequence) { + BTC.SpeechIntentRecognized() + + // Intent erkannt + BTC.ClearPossbileSpeechIntents() + RunTree("32_Grotto_Kueche_Kochen_Anzahl") + } + + // -- Selector 2: Intent nicht erkannt + Composite(Sequence) { + BTC.ClearPossbileSpeechIntents() + RunTree("32_Grotto_Kueche_Kochen_Anzahl") + } + } } + + // -- Race 2: User sagt nichts Composite(Sequence) { - // keine Antwort BTC.Wait(5) - BTC.CompareBool("32_Grotto_Kueche_Interesse_Kochen_Button_Clicked", false) - BTC.AbortEventListener("NamedEventTrigger.GO.Option1Button") - BTC.Hide("GO.GO.Option1Button") + BTC.CompareUserSpeechInputStarted(false) + BTC.AbortSpeechEventListener() + BTC.StopSpeechIntentRecognition() + BTC.ClearPossbileSpeechIntents() RunTree("32_Grotto_Kueche_Zusammen_Kochen") } - } + } } } @@ -1108,26 +1124,50 @@ Tree("32_Grotto_Kueche_Selbststaendig_Kochen") { Tree("32_Grotto_Kueche_Parmigiano") { // --- Kueche - Parmigiano --- Composite(Sequence) { - BTC.SynthesizeText("Schau, ich habe dir den Parmigiano hingestellt. Du kannst ihn nun in den Topf geben.") + BTC.SynthesizeText("Ho preparato il parmigiano, puoi aggiungerlo al risotto, per piacere?") BTC.SpeechOutputEnded() // Parmigiano in Topf geben - BTC.Run("NamedGrabEvent.INTERACTABLES.Parmigiano") BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Parmigiano") BTC.Run("Collider.INTERACTABLES.Topf") - BTC.SynthesizeText("Bist du fertig?") + BTC.SynthesizeText("Hai finito?") BTC.SpeechOutputEnded() // Antwort User - // ToDo: Sprache fehlt - BTC.Set("TextMeshPro.GO.Option1Button", "text", "Ja") - BTC.Show("GO.GO.Option1Button") + BTC.AddPossbileSpeechIntent("Kueche.Zusammen_Kochen.6") + BTC.StartSpeechIntentRecognition() + Composite(Race) { - BTC.Run("NamedEventTrigger.GO.Option1Button") - BTC.Wait(5) + // -- Race 1: User sagt etwas + Composite(Sequence) { + BTC.UserStartedSpeechInput() + + Composite(Selector) { + // -- Selector 1: Intent erkannt + Composite(Sequence) { + BTC.SpeechIntentRecognized() + + // Intent erkannt + BTC.ClearPossbileSpeechIntents() + } + + // -- Selector 2: Intent nicht erkannt + Composite(Sequence) { + BTC.ClearPossbileSpeechIntents() + } + } + } + + // -- Race 2: User sagt nichts + Composite(Sequence) { + BTC.Wait(5) + BTC.CompareUserSpeechInputStarted(false) + BTC.AbortSpeechEventListener() + BTC.StopSpeechIntentRecognition() + BTC.ClearPossbileSpeechIntents() + } } - BTC.Hide("GO.GO.Option1Button") BTC.SynthesizeText("Bitte stelle den Risotto hier hin.") BTC.SpeechOutputEnded() diff --git a/Viagg-io/Assets/Scenes/Test-Scene-Grotto.unity b/Viagg-io/Assets/Scenes/Test-Scene-Grotto.unity index f80ec7f..1254c07 100644 --- a/Viagg-io/Assets/Scenes/Test-Scene-Grotto.unity +++ b/Viagg-io/Assets/Scenes/Test-Scene-Grotto.unity @@ -419,7 +419,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &13795130 Transform: m_ObjectHideFlags: 0 @@ -6075,7 +6075,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &126278271 Transform: m_ObjectHideFlags: 0 @@ -12523,7 +12523,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &223435096 Transform: m_ObjectHideFlags: 0 @@ -19212,7 +19212,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 3766f95ede233404dbe8045cd127dfff, type: 3} m_Name: m_EditorClassIdentifier: - intentJson: {fileID: 4900000, guid: 73a9f252c3e0a43b5aefed4bb6a46444, type: 3} + intentJson: {fileID: 4900000, guid: 5c4e3b2efb54540939c37b17ea287a2a, type: 3} --- !u!4 &555528299 stripped Transform: m_CorrespondingSourceObject: {fileID: 6658410826799080655, guid: 6ba9a93db7d65904f944ef6555b4d6c3, type: 3} @@ -20708,7 +20708,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &820302748 Transform: m_ObjectHideFlags: 0 @@ -20717,13 +20717,13 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 820302747} serializedVersion: 2 - m_LocalRotation: {x: 0.46282345, y: -0.5347155, z: -0.5344676, w: -0.4628371} + m_LocalRotation: {x: 0.46289697, y: -0.53453386, z: -0.53453386, w: -0.46289697} m_LocalPosition: {x: 0.3736568, y: -0.08052042, z: 1.1230551} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1820738454} - m_LocalEulerAnglesHint: {x: -89.972, y: 0, z: -261.784} + m_LocalEulerAnglesHint: {x: -90, y: 0, z: -261.784} --- !u!114 &820302749 MonoBehaviour: m_ObjectHideFlags: 0 @@ -73697,7 +73697,7 @@ MonoBehaviour: overrideLogStringDisplay: 0 overrideDebugInternalActive: 0 overrideDebugChangesActive: 0 - instanceID: 814288 + instanceID: 4605480 __behaviourTreeGenerator: {fileID: 0} taskScripts: - {fileID: 4900000, guid: 7100bc138828c402baf6fdd9c426735b, type: 3} @@ -80432,7 +80432,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &1847637242 Transform: m_ObjectHideFlags: 0 @@ -87550,7 +87550,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &2107127220 Transform: m_ObjectHideFlags: 0 @@ -139289,6 +139289,26 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 1871104320} m_Modifications: + - target: {fileID: 444135948009779634, guid: 36b2c5457f6324542af5d451870fabef, type: 3} + propertyPath: m_LocalRotation.w + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 444135948009779634, guid: 36b2c5457f6324542af5d451870fabef, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 444135948009779634, guid: 36b2c5457f6324542af5d451870fabef, type: 3} + propertyPath: m_LocalRotation.y + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 444135948009779634, guid: 36b2c5457f6324542af5d451870fabef, type: 3} + propertyPath: m_LocalRotation.z + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 444135948009779634, guid: 36b2c5457f6324542af5d451870fabef, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -90 + objectReference: {fileID: 0} - target: {fileID: 3659677904987806106, guid: 36b2c5457f6324542af5d451870fabef, type: 3} propertyPath: m_LocalPosition.x value: -8.082785 @@ -139303,23 +139323,23 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3659677904987806106, guid: 36b2c5457f6324542af5d451870fabef, type: 3} propertyPath: m_LocalRotation.w - value: 0.25896916 + value: 0.1831201 objectReference: {fileID: 0} - target: {fileID: 3659677904987806106, guid: 36b2c5457f6324542af5d451870fabef, type: 3} propertyPath: m_LocalRotation.x - value: -0 + value: -0.1831201 objectReference: {fileID: 0} - target: {fileID: 3659677904987806106, guid: 36b2c5457f6324542af5d451870fabef, type: 3} propertyPath: m_LocalRotation.y - value: -0.96588564 + value: -0.68298393 objectReference: {fileID: 0} - target: {fileID: 3659677904987806106, guid: 36b2c5457f6324542af5d451870fabef, type: 3} propertyPath: m_LocalRotation.z - value: -0 + value: -0.68298393 objectReference: {fileID: 0} - target: {fileID: 3659677904987806106, guid: 36b2c5457f6324542af5d451870fabef, type: 3} propertyPath: m_LocalEulerAnglesHint.x - value: 0 + value: -90 objectReference: {fileID: 0} - target: {fileID: 3659677904987806106, guid: 36b2c5457f6324542af5d451870fabef, type: 3} propertyPath: m_LocalEulerAnglesHint.y @@ -142273,6 +142293,18 @@ PrefabInstance: propertyPath: m_Name value: GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Pfeffer objectReference: {fileID: 0} + - target: {fileID: 5814795268391464098, guid: ea26568f2fac8404cb1c223bb1c68cb9, type: 3} + propertyPath: m_LocalRotation.w + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 5814795268391464098, guid: ea26568f2fac8404cb1c223bb1c68cb9, type: 3} + propertyPath: m_LocalRotation.x + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 5814795268391464098, guid: ea26568f2fac8404cb1c223bb1c68cb9, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 90 + objectReference: {fileID: 0} - target: {fileID: 8692800592989772387, guid: ea26568f2fac8404cb1c223bb1c68cb9, type: 3} propertyPath: m_LocalPosition.x value: -7.9235086 @@ -142287,23 +142319,23 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8692800592989772387, guid: ea26568f2fac8404cb1c223bb1c68cb9, type: 3} propertyPath: m_LocalRotation.w - value: 0.9401021 + value: 0.6647517 objectReference: {fileID: 0} - target: {fileID: 8692800592989772387, guid: ea26568f2fac8404cb1c223bb1c68cb9, type: 3} propertyPath: m_LocalRotation.x - value: -0 + value: -0.6647517 objectReference: {fileID: 0} - target: {fileID: 8692800592989772387, guid: ea26568f2fac8404cb1c223bb1c68cb9, type: 3} propertyPath: m_LocalRotation.y - value: 0.3408931 + value: 0.24105018 objectReference: {fileID: 0} - target: {fileID: 8692800592989772387, guid: ea26568f2fac8404cb1c223bb1c68cb9, type: 3} propertyPath: m_LocalRotation.z - value: -0 + value: 0.24105018 objectReference: {fileID: 0} - target: {fileID: 8692800592989772387, guid: ea26568f2fac8404cb1c223bb1c68cb9, type: 3} propertyPath: m_LocalEulerAnglesHint.x - value: 0 + value: -90 objectReference: {fileID: 0} - target: {fileID: 8692800592989772387, guid: ea26568f2fac8404cb1c223bb1c68cb9, type: 3} propertyPath: m_LocalEulerAnglesHint.y @@ -143372,6 +143404,18 @@ PrefabInstance: propertyPath: m_Name value: GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Salz objectReference: {fileID: 0} + - target: {fileID: 3298024285878248071, guid: 653ab80a80abe8546be4e687c9b9185b, type: 3} + propertyPath: m_LocalRotation.w + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 3298024285878248071, guid: 653ab80a80abe8546be4e687c9b9185b, type: 3} + propertyPath: m_LocalRotation.x + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 3298024285878248071, guid: 653ab80a80abe8546be4e687c9b9185b, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 90 + objectReference: {fileID: 0} - target: {fileID: 3356775796168329382, guid: 653ab80a80abe8546be4e687c9b9185b, type: 3} propertyPath: m_LocalPosition.x value: -7.94902 @@ -143386,23 +143430,23 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3356775796168329382, guid: 653ab80a80abe8546be4e687c9b9185b, type: 3} propertyPath: m_LocalRotation.w - value: 0.7088509 + value: 0.50123334 objectReference: {fileID: 0} - target: {fileID: 3356775796168329382, guid: 653ab80a80abe8546be4e687c9b9185b, type: 3} propertyPath: m_LocalRotation.x - value: -0 + value: -0.50123334 objectReference: {fileID: 0} - target: {fileID: 3356775796168329382, guid: 653ab80a80abe8546be4e687c9b9185b, type: 3} propertyPath: m_LocalRotation.y - value: 0.7053584 + value: 0.49876365 objectReference: {fileID: 0} - target: {fileID: 3356775796168329382, guid: 653ab80a80abe8546be4e687c9b9185b, type: 3} propertyPath: m_LocalRotation.z - value: -0 + value: 0.49876365 objectReference: {fileID: 0} - target: {fileID: 3356775796168329382, guid: 653ab80a80abe8546be4e687c9b9185b, type: 3} propertyPath: m_LocalEulerAnglesHint.x - value: 0 + value: -90 objectReference: {fileID: 0} - target: {fileID: 3356775796168329382, guid: 653ab80a80abe8546be4e687c9b9185b, type: 3} propertyPath: m_LocalEulerAnglesHint.y diff --git a/Viagg-io/Assets/Scripts/Speech/LoadSpeechData.cs b/Viagg-io/Assets/Scripts/Speech/LoadSpeechData.cs index 1d7cf3c..8ccda8e 100644 --- a/Viagg-io/Assets/Scripts/Speech/LoadSpeechData.cs +++ b/Viagg-io/Assets/Scripts/Speech/LoadSpeechData.cs @@ -22,12 +22,12 @@ public class LoadSpeechData : MonoBehaviour foreach (IntentData _obj in _intentList.intents) { - Debug.Log($"IntentID: {_obj.intentID}, Sentences Count: {_obj.intentSentences.Count}"); + //Debug.Log($"IntentID: {_obj.intentID}, Sentences Count: {_obj.intentSentences.Count}"); string _combinedSentences = string.Join(", ", _obj.intentSentences); _dicIntents.Add(_obj.intentID, _combinedSentences); - Debug.Log($"Added {_combinedSentences} to {_obj.intentID}"); + //Debug.Log($"Added {_combinedSentences} to {_obj.intentID}"); } SpeechData.intents = _dicIntents; diff --git a/Viagg-io/Assets/Scripts/Speech/viaggioSpeechIntents_it.json b/Viagg-io/Assets/Scripts/Speech/viaggioSpeechIntents_it.json index f2f0980..fce31c1 100644 --- a/Viagg-io/Assets/Scripts/Speech/viaggioSpeechIntents_it.json +++ b/Viagg-io/Assets/Scripts/Speech/viaggioSpeechIntents_it.json @@ -173,12 +173,7 @@ "intentID": "Kueche.Interesse_Kochen.2", "intentSentences": [ "Mi piace fare la pizza.", - "Mi piace fare torte o biscotti al forno." - ] - }, - { - "intentID": "Kueche.Interesse_Kochen.4", - "intentSentences": [ + "Mi piace fare torte o biscotti al forno.", "Mi piace fare la pasta.", "Cucino con la mamma." ] @@ -199,6 +194,12 @@ "No, non cucino mai." ] }, + { + "intentID": "Kueche.Zusammen_Kochen.6", + "intentSentences": [ + "S\u00ec." + ] + }, { "intentID": "Kueche.Outro.4", "intentSentences": [