Skip to content

Commit

Permalink
Merge pull request #92 from neph1/update-v0.35.0
Browse files Browse the repository at this point in the history
Update v0.35.0
  • Loading branch information
neph1 authored Oct 5, 2024
2 parents 762698f + 3fee49b commit c9fe019
Show file tree
Hide file tree
Showing 63 changed files with 1,811 additions and 813 deletions.
61 changes: 60 additions & 1 deletion generic_items.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
"base_damage": 1,
"weight": 1,
"type": "Weapon"
},
{
"name": "Pitchfork",
"weapon_type": "TWO_HANDED",
"short_descr": "A pitchfork",
"base_damage": 1,
"weight": 3,
"type": "Weapon"
}
],
"fantasy_weapons": [
Expand Down Expand Up @@ -44,6 +52,15 @@
"weight": 5,
"value": 50,
"type": "Weapon"
},
{
"name": "Staff",
"weapon_type": "TWO_HANDED",
"short_descr": "A wooden staff",
"base_damage": 1,
"weight": 3,
"value": 5,
"type": "Weapon"
}
],
"modern_weapons": [
Expand Down Expand Up @@ -79,12 +96,54 @@
"name": "Note",
"weight": 0.1,
"type": "Note"
}
],
"generic_drinks": [
{
"name": "Water",
"weight": 0.5,
"short_descr": "A flask of water",
"effect": 5,
"type": "Drink",
"value": 1
},
{
"name": "Beer",
"weight": 0.5,
"short_descr": "A glass of beer",
"effect": 5,
"type": "Drink",
"value": 2
},
{
"name": "Wine",
"weight": 0.5,
"short_descr": "A glass of wine",
"effect": 5,
"type": "Drink",
"value": 3
}
],
"generic_food": [
{
"name": "Apple",
"weight": 0.5,
"short_descr": "A juicy apple",
"effect": 2,
"type": "Food"
},
{
"name": "Cheese",
"weight": 0.5,
"short_descr": "A piece of cheese",
"effect": 3,
"type": "Food"
},
{
"name": "Bread",
"weight": 0.5,
"short_descr": "A loaf of bread",
"effect": 10,
"effect": 5,
"type": "Food"
}
]
Expand Down
6 changes: 2 additions & 4 deletions llm_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ DUNGEON_LOCATION_TEMPLATE: '{"index": (int), "name": "", "description": 25 words
CHARACTER_TEMPLATE: '{"name":"", "description": "50 words", "appearance": "25 words", "personality": "50 words", "money":(int), "level":"", "gender":"m/f/n", "age":(int), "race":""}'
FOLLOW_TEMPLATE: '{{"response":"yes or no", "reason":"50 words"}}'
ITEM_TYPES: ["Weapon", "Wearable", "Health", "Money", "Trash", "Food", "Drink", "Key"]
PRE_PROMPT: 'You are a creative game keeper for a role playing game (RPG). You craft detailed worlds and interesting characters with unique and deep personalities for the player to interact with. Do not acknowledge the task or speak directly to the user, just perform it.'
PRE_PROMPT: 'You are a creative game keeper for an interactive fiction story telling session. You craft detailed worlds and interesting characters with unique and deep personalities for the player to interact with. Do not acknowledge the task or speak directly to the user, or respond with anything besides the request..'
BASE_PROMPT: '<context>{context}</context>\n[USER_START] Rewrite [{input_text}] in your own words. The information inside the <context> tags should be used to ensure it fits the story. Use about {max_words} words.'
DIALOGUE_PROMPT: '<context>{context}</context>\nThe following is a conversation between {character1} and {character2}; {character2}s sentiment towards {character1}: {sentiment}. Write a single response as {character2} in third person pov, using {character2} description and other information found inside the <context> tags. If {character2} has a quest active, they will discuss it based on its status. Respond in JSON using this template: """{dialogue_template}""". [USER_START]Continue the following conversation as {character2}: {previous_conversation}'
COMBAT_PROMPT: '<context>{context}</context>\nThe following is a combat scene between {attackers} and {defenders} in {location}. [USER_START] Describe the following combat result in about 150 words in vivid language, using the characters weapons and their health status: 1.0 is highest, 0.0 is lowest. Combat Result: {input_text}'
Expand Down Expand Up @@ -45,6 +45,4 @@ ACTION_PROMPT: '<context>{context}</context>\n[USER_START]Act as as {character_n
REQUEST_FOLLOW_PROMPT: '<context>{context}</context>\n[USER_START]Act as as {character_name}.\nUsing the information supplied inside the <context> tag. {character_name} has received a request to follow {target}. Answer based on {character_name}s description and mood. Reason given by {target}: {target_reason}. Respond using JSON in the following format: {follow_template}'
DAY_CYCLE_EVENT_PROMPT: '<context>{context}</context>\n[USER_START] Write up to two sentences describing the transition from {from_time} to {to_time} in {location_name}, using the information supplied inside the <context> tags.'
NARRATIVE_EVENT_PROMPT: '<context>{context}</context>\n[USER_START] Write a narrative event that occurs in {location_name} using the information supplied inside the <context> tags. The event should be related to the location and the characters present. Use up to 50 words.'
RANDOM_SPAWN_PROMPT: '<context>{context}</context>\n[USER_START] An npc or a mob has entered {location_name}. Select either and fill in one of the following templates using the information supplied inside the <context> tags. Respond using JSON in the following format: {npc_template}'
USER_START: '### Instruction:\n'
USER_END: '### Response:\n'
RANDOM_SPAWN_PROMPT: '<context>{context}</context>\n[USER_START] An npc or a mob has entered {location_name}. Select either and fill in one of the following templates using the information supplied inside the <context> tags. Respond using JSON in the following format: {npc_template}'
44 changes: 21 additions & 23 deletions stories/anything/story.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ def init_player(self, player: Player) -> None:
Called by the game driver when it has created the player object (after successful login).
You can set the hint texts on the player object, or change the state object, etc.
"""
player.stats.set_weapon_skill(weapon_type=WeaponType.ONE_HANDED_RANGED, value=random.randint(10, 30))
player.stats.set_weapon_skill(weapon_type=WeaponType.TWO_HANDED_RANGED, value=random.randint(10, 30))
player.stats.set_weapon_skill(weapon_type=WeaponType.ONE_HANDED, value=random.randint(10, 30))
player.stats.set_weapon_skill(weapon_type=WeaponType.TWO_HANDED, value=random.randint(10, 30))
player.stats.set_weapon_skill(weapon_type=WeaponType.UNARMED, value=random.randint(20, 30))
player.stats.magic_skills[MagicType.HEAL] = 30
player.stats.magic_skills[MagicType.BOLT] = 30
player.stats.magic_skills[MagicType.DRAIN] = 30
player.stats.magic_skills[MagicType.REJUVENATE] = 30
player.stats.weapon_skills.set(weapon_type=WeaponType.ONE_HANDED_RANGED, value=random.randint(10, 30))
player.stats.weapon_skills.set(weapon_type=WeaponType.TWO_HANDED_RANGED, value=random.randint(10, 30))
player.stats.weapon_skills.set(weapon_type=WeaponType.ONE_HANDED, value=random.randint(10, 30))
player.stats.weapon_skills.set(weapon_type=WeaponType.TWO_HANDED, value=random.randint(10, 30))
player.stats.weapon_skills.set(weapon_type=WeaponType.UNARMED, value=random.randint(20, 30))
player.stats.magic_skills.set(MagicType.HEAL, 30)
player.stats.magic_skills.set(MagicType.BOLT, 30)
player.stats.magic_skills.set(MagicType.DRAIN, 30)
player.stats.magic_skills.set(MagicType.REJUVENATE, 30)
pass

def create_account_dialog(self, playerconnection: PlayerConnection, playernaming: PlayerNaming) -> Generator:
Expand All @@ -51,36 +51,34 @@ def create_account_dialog(self, playerconnection: PlayerConnection, playernaming
"""
ranged = yield "input", ("Do you prefer ranged over close combat? (yes/no)", lang.yesno)
if ranged:
playerconnection.player.stats.set_weapon_skill(weapon_type=WeaponType.ONE_HANDED_RANGED, value=random.randint(20, 40))
playerconnection.player.stats.set_weapon_skill(weapon_type=WeaponType.TWO_HANDED_RANGED, value=random.randint(20, 40))
playerconnection.player.stats.weapon_skills.set(weapon_type=WeaponType.ONE_HANDED_RANGED, value=random.randint(20, 40))
playerconnection.player.stats.weapon_skills.set(weapon_type=WeaponType.TWO_HANDED_RANGED, value=random.randint(20, 40))
else:
playerconnection.player.stats.set_weapon_skill(weapon_type=WeaponType.ONE_HANDED, value=random.randint(20, 40))
playerconnection.player.stats.set_weapon_skill(weapon_type=WeaponType.TWO_HANDED, value=random.randint(20, 40))
playerconnection.player.stats.weapon_skills.set(weapon_type=WeaponType.ONE_HANDED, value=random.randint(20, 40))
playerconnection.player.stats.weapon_skills.set(weapon_type=WeaponType.TWO_HANDED, value=random.randint(20, 40))
stealth = yield "input", ("Are you sneaky? (yes/no)", lang.yesno)
if stealth:
playerconnection.player.stats.skills[SkillType.HIDE] = random.randint(30, 50)
playerconnection.player.stats.skills[SkillType.PICK_LOCK] = random.randint(30, 50)
else:
playerconnection.player.stats.skills[SkillType.HIDE] = random.randint(10, 30)
playerconnection.player.stats.skills[SkillType.PICK_LOCK] = random.randint(10, 30)
playerconnection.player.stats.skills[SkillType.SEARCH] = random.randint(20, 40)
playerconnection.player.stats.skills.set(SkillType.HIDE, random.randint(30, 50))
if stealth:
playerconnection.player.stats.skills.set(SkillType.HIDE, random.randint(10, 30))
playerconnection.player.stats.skills.set(SkillType.PICK_LOCK, random.randint(30, 50))
else:
playerconnection.player.stats.skills.set(SkillType.HIDE, random.randint(10, 30))
playerconnection.player.stats.skills.set(SkillType.PICK_LOCK, random.randint(10, 30))
playerconnection.player.stats.skills.set(SkillType.SEARCH, random.randint(20, 40))

return True

def welcome(self, player: Player) -> str:
"""welcome text when player enters a new game"""
player.tell("<bright>Hello, %s! Welcome to %s.</>" % (player.title, self.config.name), end=True)
player.tell("\n")
player.tell(self.driver.resources["messages/welcome.txt"].text)
player.tell("\n")
return ""

def welcome_savegame(self, player: Player) -> str:
"""welcome text when player enters the game after loading a saved game"""
player.tell("<bright>Hello %s, welcome back to %s.</>" % (player.title, self.config.name), end=True)
player.tell("\n")
player.tell(self.driver.resources["messages/welcome.txt"].text)
player.tell("\n")
return ""

def goodbye(self, player: Player) -> None:
Expand Down
6 changes: 3 additions & 3 deletions stories/combat_sandbox/story.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def init_player(self, player: Player) -> None:
Called by the game driver when it has created the player object (after successful login).
You can set the hint texts on the player object, or change the state object, etc.
"""
player.stats.set_weapon_skill(weapon_type=WeaponType.ONE_HANDED, value=45)
player.stats.set_weapon_skill(weapon_type=WeaponType.TWO_HANDED, value=15)
player.stats.set_weapon_skill(weapon_type=WeaponType.UNARMED, value=35)
player.stats.weapon_skills.set(weapon_type=WeaponType.ONE_HANDED, value=45)
player.stats.weapon_skills.set(weapon_type=WeaponType.TWO_HANDED, value=15)
player.stats.weapon_skills.set(weapon_type=WeaponType.UNARMED, value=35)

if __name__ == "__main__":
# story is invoked as a script, start it in the Tale Driver.
Expand Down
39 changes: 20 additions & 19 deletions stories/dungeon/story.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ def init_player(self, player: Player) -> None:
Called by the game driver when it has created the player object (after successful login).
You can set the hint texts on the player object, or change the state object, etc.
"""
player.stats.set_weapon_skill(weapon_type=WeaponType.ONE_HANDED_RANGED, value=random.randint(10, 30))
player.stats.set_weapon_skill(weapon_type=WeaponType.TWO_HANDED_RANGED, value=random.randint(10, 30))
player.stats.set_weapon_skill(weapon_type=WeaponType.ONE_HANDED, value=random.randint(10, 30))
player.stats.set_weapon_skill(weapon_type=WeaponType.TWO_HANDED, value=random.randint(10, 30))
player.stats.set_weapon_skill(weapon_type=WeaponType.UNARMED, value=random.randint(20, 30))
player.stats.magic_skills[MagicType.HEAL] = 30
player.stats.magic_skills[MagicType.BOLT] = 30
player.stats.magic_skills[MagicType.DRAIN] = 30
player.stats.magic_skills[MagicType.REJUVENATE] = 30
player.stats.weapon_skills.set(weapon_type=WeaponType.ONE_HANDED_RANGED, value=random.randint(10, 30))
player.stats.weapon_skills.set(weapon_type=WeaponType.TWO_HANDED_RANGED, value=random.randint(10, 30))
player.stats.weapon_skills.set(weapon_type=WeaponType.ONE_HANDED, value=random.randint(10, 30))
player.stats.weapon_skills.set(weapon_type=WeaponType.TWO_HANDED, value=random.randint(10, 30))
player.stats.weapon_skills.set(weapon_type=WeaponType.UNARMED, value=random.randint(20, 30))
player.stats.magic_skills.set(MagicType.HEAL, 30)
player.stats.magic_skills.set(MagicType.BOLT, 30)
player.stats.magic_skills.set(MagicType.DRAIN, 30)
player.stats.magic_skills.set(MagicType.REJUVENATE, 30)
pass

def create_account_dialog(self, playerconnection: PlayerConnection, playernaming: PlayerNaming) -> Generator:
Expand All @@ -62,19 +62,20 @@ def create_account_dialog(self, playerconnection: PlayerConnection, playernaming
"""
ranged = yield "input", ("Do you prefer ranged over close combat? (yes/no)", lang.yesno)
if ranged:
playerconnection.player.stats.set_weapon_skill(weapon_type=WeaponType.ONE_HANDED_RANGED, value=random.randint(20, 40))
playerconnection.player.stats.set_weapon_skill(weapon_type=WeaponType.TWO_HANDED_RANGED, value=random.randint(20, 40))
playerconnection.player.stats.weapon_skills.set(weapon_type=WeaponType.ONE_HANDED_RANGED, value=random.randint(20, 40))
playerconnection.player.stats.weapon_skills.set(weapon_type=WeaponType.TWO_HANDED_RANGED, value=random.randint(20, 40))
else:
playerconnection.player.stats.set_weapon_skill(weapon_type=WeaponType.ONE_HANDED, value=random.randint(20, 40))
playerconnection.player.stats.set_weapon_skill(weapon_type=WeaponType.TWO_HANDED, value=random.randint(20, 40))
playerconnection.player.stats.weapon_skills.set(weapon_type=WeaponType.ONE_HANDED, value=random.randint(20, 40))
playerconnection.player.stats.weapon_skills.set(weapon_type=WeaponType.TWO_HANDED, value=random.randint(20, 40))
stealth = yield "input", ("Are you sneaky? (yes/no)", lang.yesno)
if stealth:
playerconnection.player.stats.skills[SkillType.HIDE] = random.randint(30, 50)
playerconnection.player.stats.skills[SkillType.PICK_LOCK] = random.randint(30, 50)
else:
playerconnection.player.stats.skills[SkillType.HIDE] = random.randint(10, 30)
playerconnection.player.stats.skills[SkillType.PICK_LOCK] = random.randint(10, 30)
playerconnection.player.stats.skills[SkillType.SEARCH] = random.randint(20, 40)
if stealth:
playerconnection.player.stats.set(SkillType.HIDE, random.randint(30, 50))
playerconnection.player.stats.set(SkillType.PICK_LOCK, random.randint(30, 50))
else:
playerconnection.player.stats.set(SkillType.HIDE, random.randint(10, 30))
playerconnection.player.stats.set(SkillType.PICK_LOCK, random.randint(10, 30))
playerconnection.player.stats.set(SkillType.SEARCH, random.randint(20, 40))

return True

Expand Down
18 changes: 9 additions & 9 deletions stories/dungeon_test/story.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ def init_player(self, player: Player) -> None:
Called by the game driver when it has created the player object (after successful login).
You can set the hint texts on the player object, or change the state object, etc.
"""
player.stats.set_weapon_skill(weapon_type=WeaponType.ONE_HANDED_RANGED, value=random.randint(10, 30))
player.stats.set_weapon_skill(weapon_type=WeaponType.TWO_HANDED_RANGED, value=random.randint(10, 30))
player.stats.set_weapon_skill(weapon_type=WeaponType.ONE_HANDED, value=random.randint(10, 30))
player.stats.set_weapon_skill(weapon_type=WeaponType.TWO_HANDED, value=random.randint(10, 30))
player.stats.set_weapon_skill(weapon_type=WeaponType.UNARMED, value=random.randint(20, 30))
player.stats.weapon_skills.set(weapon_type=WeaponType.ONE_HANDED_RANGED, value=random.randint(10, 30))
player.stats.weapon_skills.set(weapon_type=WeaponType.TWO_HANDED_RANGED, value=random.randint(10, 30))
player.stats.weapon_skills.set(weapon_type=WeaponType.ONE_HANDED, value=random.randint(10, 30))
player.stats.weapon_skills.set(weapon_type=WeaponType.TWO_HANDED, value=random.randint(10, 30))
player.stats.weapon_skills.set(weapon_type=WeaponType.UNARMED, value=random.randint(20, 30))
pass

def create_account_dialog(self, playerconnection: PlayerConnection, playernaming: PlayerNaming) -> Generator:
Expand All @@ -55,11 +55,11 @@ def create_account_dialog(self, playerconnection: PlayerConnection, playernaming
"""
ranged = yield "input", ("Do you prefer ranged over close combat? (yes/no)", lang.yesno)
if ranged:
playerconnection.player.stats.set_weapon_skill(weapon_type=WeaponType.ONE_HANDED_RANGED, value=random.randint(20, 40))
playerconnection.player.stats.set_weapon_skill(weapon_type=WeaponType.TWO_HANDED_RANGED, value=random.randint(20, 40))
playerconnection.player.stats.weapon_skills.set(weapon_type=WeaponType.ONE_HANDED_RANGED, value=random.randint(20, 40))
playerconnection.player.stats.weapon_skills.set(weapon_type=WeaponType.TWO_HANDED_RANGED, value=random.randint(20, 40))
else:
playerconnection.player.stats.set_weapon_skill(weapon_type=WeaponType.ONE_HANDED, value=random.randint(20, 40))
playerconnection.player.stats.set_weapon_skill(weapon_type=WeaponType.TWO_HANDED, value=random.randint(20, 40))
playerconnection.player.stats.weapon_skills.set(weapon_type=WeaponType.ONE_HANDED, value=random.randint(20, 40))
playerconnection.player.stats.weapon_skills.set(weapon_type=WeaponType.TWO_HANDED, value=random.randint(20, 40))
return True

def welcome(self, player: Player) -> str:
Expand Down
Loading

0 comments on commit c9fe019

Please sign in to comment.