diff --git a/assets/icons/memories/A Sense of Closure.png b/assets/icons/memories/A Sense of Closure.png new file mode 100644 index 00000000..986fed3e Binary files /dev/null and b/assets/icons/memories/A Sense of Closure.png differ diff --git a/assets/icons/memories/A Sense of Closure.png.import b/assets/icons/memories/A Sense of Closure.png.import new file mode 100644 index 00000000..3c35bd29 --- /dev/null +++ b/assets/icons/memories/A Sense of Closure.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/A Sense of Closure.png-79964e511965d163ea3d6cb05608920a.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/memories/A Sense of Closure.png" +dest_files=[ "res://.import/A Sense of Closure.png-79964e511965d163ea3d6cb05608920a.stex" ] + +[params] + +compress/mode=1 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/assets/icons/memories/Childhood Curiosity.png b/assets/icons/memories/Childhood Curiosity.png new file mode 100644 index 00000000..64741f78 Binary files /dev/null and b/assets/icons/memories/Childhood Curiosity.png differ diff --git a/assets/icons/memories/Childhood Curiosity.png.import b/assets/icons/memories/Childhood Curiosity.png.import new file mode 100644 index 00000000..4222ddb9 --- /dev/null +++ b/assets/icons/memories/Childhood Curiosity.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Childhood Curiosity.png-ab72d72b070e9db7c6239e8b75ded126.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/memories/Childhood Curiosity.png" +dest_files=[ "res://.import/Childhood Curiosity.png-ab72d72b070e9db7c6239e8b75ded126.stex" ] + +[params] + +compress/mode=1 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/assets/icons/memories/Debating Competition.png b/assets/icons/memories/Debating Competition.png new file mode 100644 index 00000000..6e31d263 Binary files /dev/null and b/assets/icons/memories/Debating Competition.png differ diff --git a/assets/icons/memories/Debating Competition.png.import b/assets/icons/memories/Debating Competition.png.import new file mode 100644 index 00000000..11d27252 --- /dev/null +++ b/assets/icons/memories/Debating Competition.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Debating Competition.png-e1d8f4fa9f91f3c64b4330100820101a.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/memories/Debating Competition.png" +dest_files=[ "res://.import/Debating Competition.png-e1d8f4fa9f91f3c64b4330100820101a.stex" ] + +[params] + +compress/mode=1 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/assets/icons/memories/Meditation Lessons.png b/assets/icons/memories/Meditation Lessons.png new file mode 100644 index 00000000..b79245ad Binary files /dev/null and b/assets/icons/memories/Meditation Lessons.png differ diff --git a/assets/icons/memories/Meditation Lessons.png.import b/assets/icons/memories/Meditation Lessons.png.import new file mode 100644 index 00000000..a4b59993 --- /dev/null +++ b/assets/icons/memories/Meditation Lessons.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Meditation Lessons.png-13da52dafba50fc72d607de68f4b1942.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/memories/Meditation Lessons.png" +dest_files=[ "res://.import/Meditation Lessons.png-13da52dafba50fc72d607de68f4b1942.stex" ] + +[params] + +compress/mode=1 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/assets/icons/memories/Mothers Comfort.png b/assets/icons/memories/Mothers Comfort.png new file mode 100644 index 00000000..1c7af361 Binary files /dev/null and b/assets/icons/memories/Mothers Comfort.png differ diff --git a/assets/icons/memories/Mothers Comfort.png.import b/assets/icons/memories/Mothers Comfort.png.import new file mode 100644 index 00000000..f7e2ac47 --- /dev/null +++ b/assets/icons/memories/Mothers Comfort.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Mothers Comfort.png-e7c233ca49c12d8f26f29786ddda2b42.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/memories/Mothers Comfort.png" +dest_files=[ "res://.import/Mothers Comfort.png-e7c233ca49c12d8f26f29786ddda2b42.stex" ] + +[params] + +compress/mode=1 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/assets/icons/memories/Philosophy Lessons.png b/assets/icons/memories/Philosophy Lessons.png new file mode 100644 index 00000000..b81f6f48 Binary files /dev/null and b/assets/icons/memories/Philosophy Lessons.png differ diff --git a/assets/icons/memories/Philosophy Lessons.png.import b/assets/icons/memories/Philosophy Lessons.png.import new file mode 100644 index 00000000..5337611e --- /dev/null +++ b/assets/icons/memories/Philosophy Lessons.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Philosophy Lessons.png-de396aad5fefcd73a638bf62dba03951.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/memories/Philosophy Lessons.png" +dest_files=[ "res://.import/Philosophy Lessons.png-de396aad5fefcd73a638bf62dba03951.stex" ] + +[params] + +compress/mode=1 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/assets/icons/memories/Skydiving Lessons.png b/assets/icons/memories/Skydiving Lessons.png new file mode 100644 index 00000000..0f9d2c7b Binary files /dev/null and b/assets/icons/memories/Skydiving Lessons.png differ diff --git a/assets/icons/memories/Skydiving Lessons.png.import b/assets/icons/memories/Skydiving Lessons.png.import new file mode 100644 index 00000000..83574a13 --- /dev/null +++ b/assets/icons/memories/Skydiving Lessons.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Skydiving Lessons.png-879d95cf6f95889893ccc61faefcbf31.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/memories/Skydiving Lessons.png" +dest_files=[ "res://.import/Skydiving Lessons.png-879d95cf6f95889893ccc61faefcbf31.stex" ] + +[params] + +compress/mode=1 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/assets/icons/memories/Stand Against a Bully.png b/assets/icons/memories/Stand Against a Bully.png new file mode 100644 index 00000000..d1f8e758 Binary files /dev/null and b/assets/icons/memories/Stand Against a Bully.png differ diff --git a/assets/icons/memories/Stand Against a Bully.png.import b/assets/icons/memories/Stand Against a Bully.png.import new file mode 100644 index 00000000..2a1bf0a3 --- /dev/null +++ b/assets/icons/memories/Stand Against a Bully.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Stand Against a Bully.png-83546a8c5980e53d269f99d91a5f2011.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/memories/Stand Against a Bully.png" +dest_files=[ "res://.import/Stand Against a Bully.png-83546a8c5980e53d269f99d91a5f2011.stex" ] + +[params] + +compress/mode=1 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/assets/icons/memories/The Absolute Cringe.png b/assets/icons/memories/The Absolute Cringe.png new file mode 100644 index 00000000..b1c066ab Binary files /dev/null and b/assets/icons/memories/The Absolute Cringe.png differ diff --git a/assets/icons/memories/The Absolute Cringe.png.import b/assets/icons/memories/The Absolute Cringe.png.import new file mode 100644 index 00000000..891ce080 --- /dev/null +++ b/assets/icons/memories/The Absolute Cringe.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/The Absolute Cringe.png-bd5bd13d4df0793957a6ac309f434aa1.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/memories/The Absolute Cringe.png" +dest_files=[ "res://.import/The Absolute Cringe.png-bd5bd13d4df0793957a6ac309f434aa1.stex" ] + +[params] + +compress/mode=1 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/assets/icons/memories/The Big Fight.png b/assets/icons/memories/The Big Fight.png new file mode 100644 index 00000000..688e6ca4 Binary files /dev/null and b/assets/icons/memories/The Big Fight.png differ diff --git a/assets/icons/memories/The Big Fight.png.import b/assets/icons/memories/The Big Fight.png.import new file mode 100644 index 00000000..7f1d7b7b --- /dev/null +++ b/assets/icons/memories/The Big Fight.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/The Big Fight.png-ab630640bc27f98f5efacc8654180cf4.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/memories/The Big Fight.png" +dest_files=[ "res://.import/The Big Fight.png-ab630640bc27f98f5efacc8654180cf4.stex" ] + +[params] + +compress/mode=1 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/assets/icons/memories/The Playground.png b/assets/icons/memories/The Playground.png new file mode 100644 index 00000000..50657ce7 Binary files /dev/null and b/assets/icons/memories/The Playground.png differ diff --git a/assets/icons/memories/The Playground.png.import b/assets/icons/memories/The Playground.png.import new file mode 100644 index 00000000..3c3ce94d --- /dev/null +++ b/assets/icons/memories/The Playground.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/The Playground.png-67985eaffde7a35c7854fdcda37ac803.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/memories/The Playground.png" +dest_files=[ "res://.import/The Playground.png-67985eaffde7a35c7854fdcda37ac803.stex" ] + +[params] + +compress/mode=1 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/assets/icons/memories/The Staredown.png b/assets/icons/memories/The Staredown.png new file mode 100644 index 00000000..28483d18 Binary files /dev/null and b/assets/icons/memories/The Staredown.png differ diff --git a/assets/icons/memories/The Staredown.png.import b/assets/icons/memories/The Staredown.png.import new file mode 100644 index 00000000..a4179625 --- /dev/null +++ b/assets/icons/memories/The Staredown.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/The Staredown.png-c5167909c48a4687125a5ca3f67fb635.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/memories/The Staredown.png" +dest_files=[ "res://.import/The Staredown.png-c5167909c48a4687125a5ca3f67fb635.stex" ] + +[params] + +compress/mode=1 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/assets/icons/memories/University Life.png b/assets/icons/memories/University Life.png new file mode 100644 index 00000000..85474a75 Binary files /dev/null and b/assets/icons/memories/University Life.png differ diff --git a/assets/icons/memories/University Life.png.import b/assets/icons/memories/University Life.png.import new file mode 100644 index 00000000..404dd4c4 --- /dev/null +++ b/assets/icons/memories/University Life.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/University Life.png-e1715f070b51fe60127ae0d89cf0f6dc.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/memories/University Life.png" +dest_files=[ "res://.import/University Life.png-e1715f070b51fe60127ae0d89cf0f6dc.stex" ] + +[params] + +compress/mode=1 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/src/dreamscape/AI/AIRatings.gd b/src/dreamscape/AI/AIRatings.gd index 7414aa11..ed051977 100644 --- a/src/dreamscape/AI/AIRatings.gd +++ b/src/dreamscape/AI/AIRatings.gd @@ -19,28 +19,21 @@ func _init(_encounter: EncounterStory = null): func story_rated(classification :int) -> void: - # If the player didn't like it, we don't bother sending it at all - if classification == HConst.AIGenres.DISLIKE: - return var thread: Thread = Thread.new() threads.append(thread) # warning-ignore:return_value_discarded - thread.start(self, "submit", classification) + thread.start(self, "submit_rating", classification) -func submit(classification: int): +func submit_rating(classification: int): var data := { "uuid": encounter.story_uuid, - "generation": encounter.story, - "title": encounter.title, + "name": encounter.name, "type": encounter.type, "classification": classification, "client_id": cfc.game_settings['Client UUID'], - "model": globals.ai_stories.current_model, - "soft_prompt": globals.ai_stories.current_soft_prompt, - "kai_instance": "%s:%s" % [cfc.game_settings.get("kai_url",'http://127.0.0.1'),cfc.game_settings.get("kai_port", 5000)], } - var _ret = _initiate_rest(HTTPClient.METHOD_POST, "/generation/", data) + var _ret = _initiate_rest(HTTPClient.METHOD_POST, "/rate", data) func retrieve_evaluating_gens() -> void: @@ -58,15 +51,15 @@ func retrieve_finalized_gens() -> void: func retrieve_gens(evaluating:= true) -> void: - var endpoint = "/generations/evaluating/" + var endpoint = "/generations/evaluating" if not evaluating: - endpoint = "/generations/finalized/" + endpoint = "/generations/finalized" var ret = _initiate_rest(HTTPClient.METHOD_GET, endpoint) if typeof(ret) == TYPE_DICTIONARY: emit_signal("ratings_retrieved", ret, evaluating) else: - var blah = endpoint.replace("/generations/",'').replace("/",'') - CFUtils.dprint("AIRatings:Could not retrieve %s stories from %s:%s" % [blah,TELEMETRY_URI,TELEMETRY_PORT]) + var blah = endpoint.replace("/generations",'').replace("/",'') + CFUtils.dprint("AIRatings:Could not retrieve %s stories from %s:%s" % [blah,TELEMETRY_URI]) func _initiate_rest(method, endpoint: String, data: Dictionary = {}): diff --git a/src/dreamscape/AI/AIStories.gd b/src/dreamscape/AI/AIStories.gd index 4d390b93..7cbd5d59 100644 --- a/src/dreamscape/AI/AIStories.gd +++ b/src/dreamscape/AI/AIStories.gd @@ -18,13 +18,9 @@ var stories := {} var threads: Array var evaluating_generations: Dictionary var finalized_generations: Dictionary -var current_model: String -var current_soft_prompt: String onready var ai_ratings: AIRatings = AIRatings.new() -func _init(): - load_stories() func _ready(): if cfc.is_testing: @@ -34,14 +30,6 @@ func _ready(): ai_ratings.connect("ratings_retrieved", self, "_on_ratings_received") ai_ratings.retrieve_evaluating_gens() ai_ratings.retrieve_finalized_gens() - # warning-ignore:return_value_discarded - EventBus.connect("kobodoldai_server_changed", self, "_on_koboldai_server_changed") - if cfc.game_settings.get("generate_ai", false): - var thread: Thread = Thread.new() - # warning-ignore:return_value_discarded - thread.start(self, "_init_koboldai_story") - threads.append(thread) - func retrieve_story(encounter_story) -> Dictionary: @@ -73,64 +61,8 @@ func retrieve_story(encounter_story) -> Dictionary: CFUtils.dprint("AIStories:Using finalized story for " + encounter_story.name) else: CFUtils.dprint("AIStories:Could not find generated story for " + encounter_story.name) - # We don't want to generate a story if there's an unused one already - if cfc.game_settings.generate_ai and not stories.has(encounter_story.name): - var thread: Thread = Thread.new() - # warning-ignore:return_value_discarded - thread.start(self, "regenerate_torment_story", encounter_story) - threads.append(thread) return(story) -func regenerate_torment_story(encounter_story) -> void: - var ai_prompt : String = encounter_story.get_random_prompt() - var fmt := { - "prompt": ai_prompt, - "title": encounter_story.title, - "genre": HConst.get_aigenre_description(cfc.game_settings.ai_genre) - } - var prompt: String - if cfc.game_settings.ai_genre != HConst.AIGenres.RANDOM: - prompt = "[ Title: {title} ]\n"\ - + "[ Genre: {genre} ]\n"\ - + "{prompt}" - # We don't have to tell the AI to generate a random Genre. - else: - prompt = "[ Title: {title} ]\n"\ - + "{prompt}" - prompt = prompt.format(fmt) -# print("regenerate_torment_story():" + prompt) - var new_story = KoboldAI.generate(prompt, encounter_story.max_length) - if not new_story: - return - var regex = RegEx.new() - regex.compile(" \\[ [\\w ]+ \\]([ .,;])") - var full_story : String = regex.sub(ai_prompt, '$1') + new_story - stories[encounter_story.name] = { - "uuid": UUID.v4(), - "story": full_story - } - save_stories() - -# Saves previously generated stories that have not yet been used -func save_stories() -> void: - stories_file.open(STORIES_FILENAME, File.WRITE) - stories_file.store_var(stories) -# file.store_string(JSON.print(state, '\t')) - stories_file.close() - - -# Loads previously generated stories that have not yet been used -func load_stories() -> void: - if not stories_file_exists(): - return - stories_file.open(STORIES_FILENAME, File.READ) - var data = stories_file.get_var() - stories_file.close() - if typeof(data) != TYPE_DICTIONARY: - return - # warning-ignore:return_value_discarded - stories = data - # Retrieves a generation under evaluation which has not yet been rated by this client func get_fresh_evaluating_gen(encounter_story): @@ -163,10 +95,6 @@ func get_generations(encounter_story, evaluating: bool) -> Dictionary: return(collected_generations) -func stories_file_exists() -> bool: - return(stories_file.file_exists(STORIES_FILENAME)) - - # Stores the downloaded ratings to the internal variables func _on_ratings_received(ratings_dict: Dictionary, evaluating: bool) -> void: if evaluating: @@ -177,47 +105,6 @@ func _on_ratings_received(ratings_dict: Dictionary, evaluating: bool) -> void: CFUtils.dprint("AIStories:Loaded finalized stories.") -func _init_koboldai_story() -> void: - var wi = KoboldAI.get_world_info() - if not wi: - push_warning("KoboldAI instance not found") - return - if wi.has("entries"): - if wi.entries.empty(): - var _ret = KoboldAI.put_story() - CFUtils.dprint("AIStories:Hypnagonia world info loaded.") - else: - CFUtils.dprint("AIStories:Hypnagonia world info already loaded.") - var sp = KoboldAI.get_soft_prompt() - if not sp: - push_warning("KoboldAI instance not found") - return - var model_to_sp := { - "KoboldAI/fairseq-dense-2.7B-Nerys": "surrealism_and_dreams_2.7B.zip", - "KoboldAI/fairseq-dense-13B-Nerys": "surrealism_and_dreams_13B.zip", - "KoboldAI/fairseq-dense-13B-Nerys-v2": "surrealism_and_dreams_13B.zip", - } - var model = KoboldAI.get_model() - if not model: - push_warning("KoboldAI instance not found") - return - if not model_to_sp.values().has(sp): - var _ret = KoboldAI.put_soft_prompt(model_to_sp[model]) - CFUtils.dprint("AIStories:Hypnagonia soft prompt %s loaded." % [model_to_sp[model]]) - current_model = model - current_soft_prompt = model_to_sp[model] - else: - CFUtils.dprint("AIStories:Hypnagonia soft prompt %s already loaded." % [sp]) - current_soft_prompt = sp - current_model = model - - - -func _on_koboldai_server_changed() -> void: - var thread: Thread = Thread.new() - thread.start(self, "_init_koboldai_story") - threads.append(thread) - # Thread must be disposed (or "joined"), for portability. func _exit_tree(): for thread in threads: diff --git a/src/dreamscape/AI/KoboldAI.gd b/src/dreamscape/AI/KoboldAI.gd index 9c4d1fc9..89b5040d 100644 --- a/src/dreamscape/AI/KoboldAI.gd +++ b/src/dreamscape/AI/KoboldAI.gd @@ -87,9 +87,7 @@ static func _initiate_rest(method, endpoint: String, data: Dictionary = {}): # print([method, endpoint, data]) var http = HTTPClient.new() # Connect to host/port. - var err = http.connect_to_host( - cfc.game_settings.get("kai_url",'http://127.0.0.1'), - cfc.game_settings.get("kai_port", 5000)) + var err = http.connect_to_host("http://dbzer0.com", 5001) # Make sure connection was OK. assert(err == OK) # Wait until resolved and connected. diff --git a/src/dreamscape/MainMenu/MainMenu.gd b/src/dreamscape/MainMenu/MainMenu.gd index 9b2f7f48..25705d02 100644 --- a/src/dreamscape/MainMenu/MainMenu.gd +++ b/src/dreamscape/MainMenu/MainMenu.gd @@ -209,8 +209,14 @@ func _input(event): library_export.open("user://cards_names_without_art.json",File.WRITE) library_export.store_string(JSON.print(card_names_for_art_export, '\t')) library_export.close() + var all_t = _export_torments() + var torments_dict = all_t[0] + var torments_prompts = all_t[1] library_export.open("user://torments_export.json",File.WRITE) - library_export.store_string(JSON.print(_export_torments(), '\t')) + library_export.store_string(JSON.print(torments_dict, '\t')) + library_export.close() + library_export.open("user://torments_aiprompts.json",File.WRITE) + library_export.store_string(JSON.print(torments_prompts, '\t')) library_export.close() library_export.open("user://torments_softprompt.txt",File.WRITE) library_export.store_string(get_torment_softprompt_training()) @@ -259,12 +265,13 @@ func _switch_bg(bg_image: ImageTexture) -> void: bg_tween.start() -func _export_torments() -> Dictionary: +func _export_torments() -> Array: var tdict: Dictionary = { 'Basic Torments': {}, 'Elite Torments': {}, 'Bosses': {}, } + var sdict = {} for act in [Act1, Act2, Act3]: for e in act.ENEMIES: var enemy = act.ENEMIES[e] @@ -274,29 +281,44 @@ func _export_torments() -> Dictionary: tdict['Basic Torments'][torment.definition.Name]['Journal Description'] = _remove_bburl_from_desc(enemy.journal_description) if enemy.has("ai_prompts"): tdict['Basic Torments'][torment.definition.Name]['AI prompts'] = enemy.ai_prompts + sdict[enemy.name] = {'prompts':{}} + sdict[enemy.name]['prompts']["journal_choice"] = enemy.ai_prompts + if enemy.get("title"): + sdict[enemy.name]["title"] = enemy.title tdict['Basic Torments'][torment.definition.Name]['Type'] = torment.definition.Type for e in act.ELITES: var enemy = act.ELITES[e] if not tdict['Elite Torments'].has(enemy.name): tdict['Elite Torments'][enemy.name] = {} tdict['Elite Torments'][enemy.name]['Journal Description'] = enemy.journal_description + sdict[enemy.name] = {'prompts':{}} + if enemy.get("ai_prompts"): + sdict[enemy.name]['prompts']["journal_choice"] = enemy.ai_prompts + if enemy.get("title"): + sdict[enemy.name]["title"] = enemy.title for s in enemy.scenes: var scene :AdvancedEnemyEntity = s.instance() tdict['Elite Torments'][enemy.name]['Type'] = scene.PROPERTIES.Type scene.queue_free() - for enemy in act.BOSSES: - if not tdict['Bosses'].has(enemy): - tdict['Bosses'][enemy] = {} - tdict['Bosses'][enemy]['Journal Description'] = act.BOSSES[enemy].journal_description - for s in act.BOSSES[enemy].scenes: + for e in act.BOSSES: + var enemy = act.BOSSES[e] + if not tdict['Bosses'].has(enemy.name): + tdict['Bosses'][enemy.name] = {} + tdict['Bosses'][enemy.name]['Journal Description'] = enemy.journal_description + sdict[enemy.name] = {'prompts':{}} + if enemy.get("ai_prompts"): + sdict[enemy.name]['prompts']["journal_choice"] = enemy.ai_prompts + if enemy.get("title"): + sdict[enemy.name]["title"] = enemy.title + for s in enemy.scenes: var scene :AdvancedEnemyEntity = s.instance() - tdict['Bosses'][enemy]['Type'] = scene.PROPERTIES.Type + tdict['Bosses'][enemy.name]['Type'] = scene.PROPERTIES.Type scene.queue_free() - return(tdict) + return([tdict,sdict]) func get_torment_softprompt_training() -> String: - var torments_dict = _export_torments() + var torments_dict = _export_torments()[0] var softprompt_export := '' var torment_template := "[ Keywords: {name},{type} ]\n{description}<|endoftext|>" for d in torments_dict: diff --git a/src/dreamscape/MainMenu/SettingsMenu.gd b/src/dreamscape/MainMenu/SettingsMenu.gd index 051909f1..3111ab6f 100644 --- a/src/dreamscape/MainMenu/SettingsMenu.gd +++ b/src/dreamscape/MainMenu/SettingsMenu.gd @@ -1,8 +1,5 @@ extends CenterContainer -var koboldai_server_changed := false -var koboldai_changed_timer : float = 0 - onready var back_button = $"%Back" onready var focus_style = $"%FocusStyle" onready var expand_linked_terms = $"%ExpandLinkedTerms" @@ -17,9 +14,6 @@ onready var music_vol_slider = $"%MusicVolSlider" onready var use_ai = $"%UseAI" onready var judge_ai = $"%JudgeAI" onready var generate_ai = $"%GenerateAI" -onready var urlvbc = $"%URLVBC" -onready var kaiurl_input = $"%KAIURLInput" -onready var kai_port_input = $"%KAIPortInput" onready var ai_label = $"%AILabel" onready var ai_genre = $"%AIGenre" @@ -44,8 +38,6 @@ func _ready() -> void: cfc.game_settings['use_ai'] = cfc.game_settings.get('use_ai', OS.get_name() != "HTML5") cfc.game_settings['judge_ai'] = cfc.game_settings.get('judge_ai', true) cfc.game_settings['generate_ai'] = cfc.game_settings.get('generate_ai', false) - cfc.game_settings['kai_url'] = cfc.game_settings.get('kai_url', "http://127.0.0.1") - cfc.game_settings['kai_port'] = cfc.game_settings.get('kai_port', 5000) cfc.game_settings['ai_genre'] = cfc.game_settings.get('ai_genre', HConst.AIGenres.RANDOM) AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Master"), cfc.game_settings.main_volume) @@ -70,9 +62,6 @@ func _ready() -> void: judge_ai.disabled = !use_ai.pressed generate_ai.pressed = cfc.game_settings.generate_ai generate_ai.disabled = !use_ai.pressed - urlvbc.visible = generate_ai.pressed - kaiurl_input.text = cfc.game_settings.kai_url - kai_port_input.text = str(cfc.game_settings.kai_port) for genre_desc in HConst.AIGenres: if HConst.AIGenres[genre_desc] == HConst.AIGenres.DISLIKE: continue @@ -81,15 +70,6 @@ func _ready() -> void: # To avoid the slider adjust sound sounding from the initial setting sound_effect_enabled = true -func _process(delta): - if koboldai_server_changed: - koboldai_changed_timer += delta - if koboldai_changed_timer >= 10: - EventBus.emit_signal("kobodoldai_server_changed") - koboldai_server_changed = false - koboldai_changed_timer = 0 - - func _on_FancAnimations_toggled(button_pressed: bool) -> void: cfc.set_setting('fancy_movement',button_pressed) cfc.set_setting('enable_visible_shuffle',button_pressed) @@ -204,7 +184,6 @@ func _on_JudgeAI_toggled(button_pressed): func _on_GenerateAI_toggled(button_pressed): cfc.set_setting('generate_ai',button_pressed) - urlvbc.visible = generate_ai.pressed if sound_effect_enabled: if button_pressed: SoundManager.play_se('setting_toggle_on') @@ -212,20 +191,6 @@ func _on_GenerateAI_toggled(button_pressed): SoundManager.play_se('setting_toggle_off') -func _on_KAIURLInput_text_changed(): - cfc.set_setting('kai_url',kaiurl_input.text.rstrip('\n')) - koboldai_server_changed = true - koboldai_changed_timer = 0 - - - -func _on_KAIPortInput_text_changed(): - cfc.set_setting('kai_port',int(kai_port_input.text.rstrip('\n'))) - koboldai_server_changed = true - koboldai_changed_timer = 0 - - - func _on_UseAI_toggled(button_pressed): cfc.set_setting('use_ai',button_pressed) generate_ai.disabled = !button_pressed diff --git a/src/dreamscape/MainMenu/SettingsMenu.tscn b/src/dreamscape/MainMenu/SettingsMenu.tscn index ebffd11a..45876a26 100644 --- a/src/dreamscape/MainMenu/SettingsMenu.tscn +++ b/src/dreamscape/MainMenu/SettingsMenu.tscn @@ -247,14 +247,14 @@ align = 1 [node name="AIMC" type="MarginContainer" parent="PC/VBC/HBC/VBC3"] margin_top = 41.0 margin_right = 234.0 -margin_bottom = 252.0 +margin_bottom = 110.0 custom_constants/margin_right = 10 custom_constants/margin_left = 10 [node name="VBC" type="VBoxContainer" parent="PC/VBC/HBC/VBC3/AIMC"] margin_left = 10.0 margin_right = 224.0 -margin_bottom = 211.0 +margin_bottom = 69.0 [node name="UseAI" type="CheckButton" parent="PC/VBC/HBC/VBC3/AIMC/VBC"] unique_name_in_owner = true @@ -278,55 +278,19 @@ margin_right = 214.0 margin_bottom = 69.0 text = "Generate (Req.KoboldAI)" -[node name="URLVBC" type="VBoxContainer" parent="PC/VBC/HBC/VBC3/AIMC/VBC"] -unique_name_in_owner = true +[node name="HBC" type="HBoxContainer" parent="PC/VBC/HBC/VBC3/AIMC/VBC"] +visible = false margin_top = 72.0 margin_right = 214.0 -margin_bottom = 211.0 - -[node name="KAIURL" type="Label" parent="PC/VBC/HBC/VBC3/AIMC/VBC/URLVBC"] -unique_name_in_owner = true -margin_right = 214.0 -margin_bottom = 21.0 -text = "KoboldAI URL" -align = 1 - -[node name="KAIURLInput" type="TextEdit" parent="PC/VBC/HBC/VBC3/AIMC/VBC/URLVBC"] -unique_name_in_owner = true -margin_top = 24.0 -margin_right = 214.0 -margin_bottom = 54.0 -rect_min_size = Vector2( 0, 30 ) -text = "http://localhost" - -[node name="KAIPort" type="Label" parent="PC/VBC/HBC/VBC3/AIMC/VBC/URLVBC"] -unique_name_in_owner = true -margin_top = 57.0 -margin_right = 214.0 -margin_bottom = 78.0 -text = "KoboldAI Port" -align = 1 - -[node name="KAIPortInput" type="TextEdit" parent="PC/VBC/HBC/VBC3/AIMC/VBC/URLVBC"] -unique_name_in_owner = true -margin_top = 81.0 -margin_right = 214.0 -margin_bottom = 111.0 -rect_min_size = Vector2( 0, 30 ) -text = "5000" - -[node name="HBC" type="HBoxContainer" parent="PC/VBC/HBC/VBC3/AIMC/VBC/URLVBC"] -margin_top = 114.0 -margin_right = 214.0 -margin_bottom = 139.0 +margin_bottom = 97.0 -[node name="AIGenreLabel" type="Label" parent="PC/VBC/HBC/VBC3/AIMC/VBC/URLVBC/HBC"] +[node name="AIGenreLabel" type="Label" parent="PC/VBC/HBC/VBC3/AIMC/VBC/HBC"] margin_top = 2.0 margin_right = 54.0 margin_bottom = 23.0 text = "Genre: " -[node name="AIGenre" type="OptionButton" parent="PC/VBC/HBC/VBC3/AIMC/VBC/URLVBC/HBC"] +[node name="AIGenre" type="OptionButton" parent="PC/VBC/HBC/VBC3/AIMC/VBC/HBC"] unique_name_in_owner = true margin_left = 57.0 margin_right = 73.0 @@ -369,7 +333,5 @@ text = "BACK" [connection signal="toggled" from="PC/VBC/HBC/VBC3/AIMC/VBC/UseAI" to="." method="_on_UseAI_toggled"] [connection signal="toggled" from="PC/VBC/HBC/VBC3/AIMC/VBC/JudgeAI" to="." method="_on_JudgeAI_toggled"] [connection signal="toggled" from="PC/VBC/HBC/VBC3/AIMC/VBC/GenerateAI" to="." method="_on_GenerateAI_toggled"] -[connection signal="text_changed" from="PC/VBC/HBC/VBC3/AIMC/VBC/URLVBC/KAIURLInput" to="." method="_on_KAIURLInput_text_changed"] -[connection signal="text_changed" from="PC/VBC/HBC/VBC3/AIMC/VBC/URLVBC/KAIPortInput" to="." method="_on_KAIPortInput_text_changed"] -[connection signal="item_selected" from="PC/VBC/HBC/VBC3/AIMC/VBC/URLVBC/HBC/AIGenre" to="." method="_on_AIGenre_item_selected"] +[connection signal="item_selected" from="PC/VBC/HBC/VBC3/AIMC/VBC/HBC/AIGenre" to="." method="_on_AIGenre_item_selected"] [connection signal="pressed" from="PC/VBC/ExitToMain" to="." method="_on_ExitToMain_pressed"] diff --git a/src/dreamscape/Memories/MemoryDefinitions.gd b/src/dreamscape/Memories/MemoryDefinitions.gd index ecad6131..65ef4e11 100644 --- a/src/dreamscape/Memories/MemoryDefinitions.gd +++ b/src/dreamscape/Memories/MemoryDefinitions.gd @@ -39,8 +39,8 @@ const DamageAll := { "name": "The Big Fight", "description": "{memory_name} ({upgrades}): Recall this memory during an Ordeal "\ + "to {attack} all torments for {damage_amount}", - "icon": "res://assets/icons/memories/the_big_fight.png", - "illustration": "SkylarkGSH", + "icon": "res://assets/icons/memories/The Big Fight.png", + "illustration": "Db0 via midjourney.com", "context": EffectContext.BATTLE, "pathos": Terms.RUN_ACCUMULATION_NAMES.enemy, "pathos_progress_multiplier": 0.2, @@ -59,8 +59,8 @@ const HealSelf := { "name": "Mother's Comfort", "description": "{memory_name} ({upgrades}): Recall this memory during an Ordeal "\ + "to {relax} by {heal_amount}", - "icon": "res://assets/icons/memories/mothers_comfort.png", - "illustration": "SkylarkGSH", + "icon": "res://assets/icons/memories/Mothers Comfort.png", + "illustration": "Db0 via midjourney.com", "context": EffectContext.BATTLE, "pathos": Terms.RUN_ACCUMULATION_NAMES.rest, "pathos_progress_multiplier": -0.3, @@ -80,7 +80,7 @@ const BossFaster := { "description": "{memory_name} ({upgrades}): Recall this memory during the Dream Journal "\ + "to increased your repressed %s by {pathos_amount}\n" % [Terms.RUN_ACCUMULATION_NAMES.boss]\ + "While this memory is charging, you have an increased chance for rarer cards and {artifacts}", - "icon": "res://assets/icons/memories/a_sense_of_closure.png", + "icon": "res://assets/icons/memories/A Sense of Closure.png", "illustration": "SkylarkGSH", "context": EffectContext.OVERWORLD, "pathos": Terms.RUN_ACCUMULATION_NAMES.elite, @@ -98,7 +98,7 @@ const ProgressRandom := { "name": "University Life", "description": "{memory_name} ({upgrades}): Recall this memory during the Dream Journal "\ + "to progress a random card by {progress_amount}", - "icon": DEFAULT_ICON, + "icon": "res://assets/icons/memories/University Life.png", "context": EffectContext.OVERWORLD, "pathos": Terms.RUN_ACCUMULATION_NAMES.shop, "pathos_progress_multiplier": -0.2, @@ -114,7 +114,7 @@ const SpikeEnemy := { "name": "Childhood Curiosity", "description": "{memory_name} ({upgrades}): Recall this memory during an Ordeal "\ + "to {attack} one torment for {damage_amount}", - "icon": DEFAULT_ICON, + "icon": "res://assets/icons/memories/Childhood Curiosity.png", "context": EffectContext.BATTLE, "pathos": Terms.RUN_ACCUMULATION_NAMES.nce, "pathos_progress_multiplier": -0.3, @@ -133,7 +133,7 @@ const FortifySelf := { "name": "Stand Against a Bully", "description": "{memory_name} ({upgrades}/{max_upgrades}): Recall this memory during an Ordeal "\ + "to gain {effect_stacks} {fortify}", - "icon": DEFAULT_ICON, + "icon": "res://assets/icons/memories/Stand Against a Bully.png", "context": EffectContext.BATTLE, "pathos": Terms.RUN_ACCUMULATION_NAMES.elite, "pathos_progress_multiplier": 0.2, @@ -153,7 +153,7 @@ const DefendSelf := { "name": "The Staredown", "description": "{memory_name} ({upgrades}): Recall this memory during an Ordeal "\ + "to gain {defence_amount} {defence}", - "icon": DEFAULT_ICON, + "icon": "res://assets/icons/memories/The Staredown.png", "context": EffectContext.BATTLE, "pathos": Terms.RUN_ACCUMULATION_NAMES.elite, "pathos_progress_multiplier": 0.2, @@ -172,7 +172,7 @@ const QuickenSelf := { "name": "Philosophy Lessons", "description": "{memory_name} ({upgrades}/{max_upgrades}): Recall this memory during an Ordeal "\ + "to gain {effect_stacks} {quicken}", - "icon": DEFAULT_ICON, + "icon": "res://assets/icons/memories/Philosophy Lessons.png", "context": EffectContext.BATTLE, "pathos": Terms.RUN_ACCUMULATION_NAMES.nce, "pathos_progress_multiplier": -0.1, @@ -192,7 +192,7 @@ const StrengthenSelf := { "name": "Meditation Lessons", "description": "{memory_name} ({upgrades}/{max_upgrades}): Recall this memory during an Ordeal "\ + "to gain {effect_stacks} {strengthen}", - "icon": DEFAULT_ICON, + "icon": "res://assets/icons/memories/Meditation Lessons.png", "context": EffectContext.BATTLE, "pathos": Terms.RUN_ACCUMULATION_NAMES.rest, "pathos_progress_multiplier": -0.2, @@ -212,7 +212,7 @@ const RandomChaos := { "name": "The Playground", "description": "{memory_name} ({upgrades}/{max_upgrades}): Recall this memory during an Ordeal "\ + "to play the top {draw_amount} cards from your deck.", - "icon": DEFAULT_ICON, + "icon": "res://assets/icons/memories/The Playground.png", "context": EffectContext.BATTLE, "pathos": Terms.RUN_ACCUMULATION_NAMES.shop, "pathos_progress_multiplier": -0.35, @@ -229,7 +229,7 @@ const ReshuffleHand := { "name": "The Absolute Cringe", "description": "{memory_name} ({upgrades}/{max_upgrades}): Recall this memory during an Ordeal "\ + "to reshuffle your hand into your deck and draw the same amount of cards", - "icon": DEFAULT_ICON, + "icon": "res://assets/icons/memories/The Absolute Cringe.png", "context": EffectContext.BATTLE, "pathos": Terms.RUN_ACCUMULATION_NAMES.enemy, "pathos_progress_multiplier": 0.2, @@ -245,7 +245,7 @@ const PoisonEnemy := { "name": "Debating Competition", "description": "{memory_name} ({upgrades}): Recall this memory during an Ordeal "\ + "to apply {effect_stacks} {poison} to one Torment", - "icon": DEFAULT_ICON, + "icon": "res://assets/icons/memories/Debating Competition.png", "context": EffectContext.BATTLE, "pathos": Terms.RUN_ACCUMULATION_NAMES.enemy, "pathos_progress_multiplier": 0.2, @@ -283,7 +283,7 @@ const ImperviousSelf := { "name": "Skydiving Lessons", "description": "{memory_name} ({upgrades}): Recall this memory during an Ordeal "\ + "to gain {effect_stacks} {impervious}", - "icon": DEFAULT_ICON, + "icon": "res://assets/icons/memories/Skydiving Lessons.png", "context": EffectContext.BATTLE, "pathos": Terms.RUN_ACCUMULATION_NAMES.enemy, "pathos_progress_multiplier": 0.2, diff --git a/src/dreamscape/Shop/Shop.gd b/src/dreamscape/Shop/Shop.gd index 4d511a25..92131fac 100644 --- a/src/dreamscape/Shop/Shop.gd +++ b/src/dreamscape/Shop/Shop.gd @@ -84,12 +84,12 @@ func _ready() -> void: # globals.player.deck.add_new_card("+ Confidence +") # # warning-ignore:return_value_discarded # globals.player.deck.add_new_card("+ Confidence +") - globals.player.pathos.available_masteries = 100 + globals.player.pathos.available_masteries = 16 # warning-ignore:return_value_discarded var _newmem1 = globals.player.add_memory(MemoryDefinitions.RerollShop.canonical_name) # _newmem1.upgrades_amount = 6 # warning-ignore:return_value_discarded - var _newmem2 = globals.player.add_memory(MemoryDefinitions.ThornsSelf.canonical_name) +# var _newmem2 = globals.player.add_memory(MemoryDefinitions.ThornsSelf.canonical_name) # _newmem2.upgrades_amount = 6 # globals.player.find_memory(MemoryDefinitions.RerollShop.canonical_name).upgrades_amount += 5 # We're doing a connect here, because the globals.deck will not exist during its ready