Created
December 29, 2024 01:14
-
-
Save nagolinc/5b25799f4128aeb2aebce78c256a83e1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Philisophically, this game consists of the following 5 elemnents: | |
| * the player | |
| * monsters | |
| * money | |
| * companions | |
| * skills | |
| * items | |
| * locations | |
| Game progression is as follows: | |
| * the player defeats monsters to earn money | |
| * money can be used to buy companions, skills, and items | |
| * companions help the player defeat monsters | |
| * skills and items can be equipped to the payer or companions to increase their power | |
| * each of these can be leveled up using different resources | |
| Notice that there are 3 different ways to improve companions/items/skills, each of which requires a different resource: | |
| * leveling up (generally requires currency) | |
| * level breaking (generally requires a special form of currency and other items) | |
| * evolving/increasing "star level" (requires duplicates of the original item AND special currency) | |
| Thus at any given time, the player is trying to do one of the following: | |
| * defeat monsters (to earn money, companions or items) | |
| * equip companions to team | |
| * equip items/skills to player or companions | |
| * improve companions/items/skills | |
| Key obstales the player will encounter are: | |
| * player cannot level up a character/item/skill if they do not have enough currency | |
| * player cannot level break a character/item/skill if they do not have enough special currency or items) | |
| * player cannot equip additional skills/companions/items if they do not have enough slots (which can be increased by increasing the star level of the player or companion) | |
| If we think of the game as a graph of of the form | |
| *player | |
| **items | |
| **skills | |
| **companion | |
| ***companion items | |
| ***companion skills | |
| We can consider a function metaLevel=sum of all levels of all nodes in the graph. The player's goal is to maximize this function. | |
| The balance of the game is such that the player's metaLevel should increase at a rate of say | |
| 1 metalevel/second. That is to say, at each moment, there should be some action | |
| that the player can take to increase their metalevel by 1. This is the essence of the game. | |
| Importantly, the player CANNOT simply focus on one node in the graph, or they will experience ever-slower progress (or they will hit a hard stop). | |
| For example, if the player focuses only on improving their level, they will hit a hard stop where they need to RANK UP. The optimal strategy is to balance the levels of each node in the graph. | |
| Notice that the game can be divided into an infinite number of minigames, and that the number of minigames the player has access to is proportional to their metalevel. | |
| That is to say, a specific minigame provides a type of resource neccessary to advance a specific node in the graph. The player must balance the minigames they play in order to maximize their metalevel. | |
| Consider the situation at the beginning of the game. The player has a single element in the metagraph (their level), a single minigame (defeat monsters to earn currency). | |
| As the game progresses, the player will unlock the following minigames: | |
| * level break | |
| * RANK UP | |
| * summon companions/items/skills | |
| * equip items | |
| * equip skills | |
| * equip companions | |
| * equip items to companions | |
| * equip skills to companions | |
| * level break companions/items/skills | |
| Because each companion/item/skill requires a unique currency to level up, level break or rank up, the player must play the associated minigame in order to advance that node in the graph. | |
| In order to make programming the game easier, we have the follwing functions: | |
| * computeMetaLevel() - returns the sum of all levels of all nodes in the graph | |
| * listNodes() - returns a list of all nodes in the graph | |
| * listMinigames() - returns a list of all minigames the player has access to | |
| Notice that minigames themselves can be LEVELED UP, in order to overcome the gradual slowdown in progress that the player will experience as they advance in the game. | |
| For example, if we consider the basic minigame "defeat monsters to earn currency", | |
| at level 0, the player earns 1 gold per monster. However, leveling up the chracter requires | |
| (num levels) * 10 gold. Thus, the player will need to defeat 10 monsters to level up the character at level 1, but 100 monsters to level up the character at level 10. However, when the player levels up the minigame, they will earn 10 gold per monster, and leveling up the character will require 20 gold. Thus, the average number of monsters the player must defeat remains constant (assuring constant progress in units of time regardless of the player's metalevel). | |
| Important: each minigame (other than the base minigame) requires a special currency to play or level up. This means that a player cannot simply SPAM that minigame, they must play the base game until they earn the special currency. Because context switching takes time, the player will generally want to play the minigame for which they have earned the MOST special currency. | |
| For now, we can assume that each minigame looks like a slot machine where they player inputs the special currency and recieves the specific item/companion/skill/currency associated with that minigame. The player can then use the item/companion/skill to level up, level break, or rank up the associated node in the graph. | |
| For now, we will assume that LEVEL BREAK is required each 10 levels and RANK UP is available every 10 LEVEL BREAKs (or 100 levels). This applies to the player as well as to companions/items/skills. | |
| Next to the level up/level break/rank up buttons, we will have "go to earn" button that will take the player to the minigame that will earn them the most special currency. | |
| For now, we will assume that once a companion/item/skill has been equipped it cannot be un-equipped. This is to simplify the game. In the future, we may add a "remove" button that will allow the player to remove an item/companion/skill from the player or companion. | |
| Finally, in order to prevent the player from getting stuck, there is a special "diamond" currency which can be used to by tickets for any minigame. | |
| Thus the total set of currencies is: | |
| *gold (used to level up) | |
| * diamonds (used to buy tickets for minigames) | |
| * minigame tickets (1 type for each minigame) | |
| * character level up currency (1 type for each equipped character) | |
| * character rank up currency (1 type for each equipped character) | |
| * item level up currency (1 type for each equipped item) | |
| * item rank up currency (1 type for each equipped item) | |
| Each character/skill/item also has an "element" and there is a slight bonus for equipping characters/skills/items of the same element (for now let's say this doubles the metalevel resulting from that node). | |
| Implementation notes: | |
| the server has an endpoint for each of the following: | |
| /monster | |
| /location | |
| /currency | |
| /treasure (returns items) | |
| /character (returns companions) | |
| /skill | |
| a typical request will look like: | |
| /monster?num=3 | |
| [{"description":"Time-Mummy Breath-Battlement is a mummy warrior with black hair and glowing orange eyes wielding a rusty claymore. The character is portrayed in a determined and menacing pose.","element":"Time","image":"/static/samples/img-20241127124952-Time_Mummy_Breath_Battlement_is_a_mummy_warrior_wi.png","index":0,"monster":"Mummy","name":"Time-Mummy Breath-Battlement","noun1":"plate","noun2":"breath","noun3":"battlement"},{"description":"Mimosa Crystal Beam is an elf warrior with vibrant orange hair and emerald eyes, wielding a shimmering crystal sword. She exudes a sense of serene strength and focused determination.","element":"berries","image":"/static/samples/img-20241127124952-Mimosa_Crystal_Beam_is_an_elf_warrior_with_vibrant.png","index":1,"monster":"Mimic","name":"Mimosa Crystal Beam","noun1":"crystal","noun2":"beam","noun3":"mimosa"},{"description":"Aquamarine Siren Bower, a siren ranger, is holding a shimmering mattock and wielding it with determination. Her sapphire eyes gleam with an intense focus.","element":"aquamarine","image":"/static/samples/img-20241127124952-Aquamarine_Siren_Bower_a_siren_ranger_is_holding_a.png","index":2,"monster":"Siren","name":"Aquamarine Siren Bower","noun1":"bower","noun2":"industry","noun3":"mattock"}] | |
| Which returns a list of monsters, each with a name, description, element, and image. | |
| The server also offers /save and /load endpoints which look like | |
| #/save (save the player data, which is passed as JSON, to the global database) | |
| @app.route('/save', methods=['POST']) | |
| def save(): | |
| data=request.get_json() | |
| player_id=data["player_id"] | |
| flatten_data=json.dumps(data["data"]) | |
| players.upsert(dict(player_id=player_id,data=flatten_data),["player_id"]) | |
| #return data | |
| return jsonify(data) | |
| #/load (load the player data from the global database, based on the player_id) | |
| @app.route('/load', methods=['GET']) | |
| def load(): | |
| player_id=request.args.get("player_id") | |
| player=players.find_one(player_id=player_id) | |
| if player: | |
| data=json.loads(player["data"]) | |
| else: | |
| data={} | |
| return jsonify(data) | |
| The player data will look like this: | |
| { | |
| "player_id":"1234", | |
| "level":1, | |
| "gold":0, | |
| "diamonds":0, | |
| "currency":{ | |
| "example currency name":{ | |
| "name":"example currency name", | |
| "description":"example currency description", | |
| "image":"example currency image", | |
| "index":0, | |
| "amount":0 | |
| }, | |
| ... | |
| }, | |
| "items":{ | |
| "example item name":{ | |
| "name":"example item name", | |
| "description":"example item description", | |
| "image":"example item image", | |
| "index":0, | |
| "level":0, | |
| "rank":0, | |
| "element":"example element", | |
| "equipped":"None"//one of "PLAYER", {companion name} or "NONE" | |
| "node_level"://equal to 0 if the item is not equipped, equpping an item sets node_level to the metalevel of the player | |
| }, | |
| ... | |
| }, | |
| "skills":{ | |
| "example skill name":{ | |
| "name":"example skill name", | |
| "description":"example skill description", | |
| "image":"example skill image", | |
| "index":0, | |
| "level":0, | |
| "rank":0, | |
| "element":"example element", | |
| "equipped":"None"//one of "PLAYER", {companion name} or "NONE" | |
| "node_level"://equal to 0 if the skill is not equipped, equpping a skill sets node_level to the metalevel of the player | |
| }, | |
| ... | |
| }, | |
| "companions":{ | |
| "example companion name":{ | |
| "name":"example companion name", | |
| "description":"example companion description", | |
| "image":"example companion image", | |
| "index":0, | |
| "level":0, | |
| "rank":0, | |
| "element":"example element", | |
| "equipped":"None"//one of "PLAYER" "NONE" | |
| "node_level"://equal to 0 if the companion is not equipped, equpping a companion sets node_level to the metalevel of the player | |
| }, | |
| ... | |
| }, | |
| "minigames":{ | |
| "example minigame name":{ | |
| "name":"example minigame name", | |
| "description":"example minigame description", | |
| "src"://links to an HTML file that contains the minigame (for now this is always just "slot_machine.html") | |
| "image":"example minigame image", | |
| "index":0, | |
| "level":0,//this is the maximum level unlocked by the player by spending diamonds | |
| "rank":0, | |
| "element":"example element", | |
| "associated_with"://one of "PLAYER", {companion name}, {item name}, {skill name} | |
| "associated_type"://one of "PLAYER","COMPANION","ITEM","SKILL" | |
| "used_for"://one of "level up", "level break", "rank up" | |
| "node_level"://equal to the node level of the associated node | |
| }, | |
| ... | |
| } | |
| } | |
| game balance notes: | |
| Each node in the graph has a "node_level", which is simply a 1-up counter that increases as we add nodes to the graph. | |
| in general, costs are the following: | |
| * level up (equals level * 10 in level up currency plus 100*level in gold) | |
| * rank up (equals level * 100 in rank up currency plus 10*level in same type items/skills/companions plus 100*level in gold) | |
| * star up (equals 10*level in star up currency plus 1*level in IDENDICAL items/skills/companions | |
| plus 1000*level in gold) | |
| Note that leveling up the player only requires gold, but leveling up companions/items/skills requires a special currency. | |
| Note that all companions of the same element use the same currency to level up, level break, and rank up. The same is true for items and skills. | |
| Costs for the base mingame are: | |
| * takes time equal to 2**(minigame_level - player metalevel) seconds | |
| Rewards for the base minigame are as follows: | |
| * gold 1*minigame_level | |
| * for each node in the graph, earn the corresponding levelup/rank up/star up currency with probability 1/10*(node_level-minigame_level) | |
| Note that if p>1 the player can earn more than 1 currency at a time. | |
| * earn a diamond with probability 1/10 | |
| * earn a ticket for each minigame with probability 1/10 | |
| * obtain a new item/skill/companion with probability 1/10 | |
| costs for the summon (character/item/skill) minigame are: | |
| * costs 10 diamonds | |
| reward for the summon minigame are as follows: | |
| * recieve an equipped item/skill/companion with probability 1/2 | |
| * recieve an unequipped item/skill/companion with probability 1/2 | |
| Note the summon minigame also has a "summon 10x" button that costs 100 diamonds and gives the player 10 items/skills/companions. | |
| Costs for the companion/item/skill minigames are: | |
| * costs "ticket" currency equal to 1* minigame level | |
| rewards for the companion/item/skill minigames are as follows: | |
| * earn random_reward*minigame_level of the corresponding levelup/rank up/star up currency | |
| random reward is a weighted random with the following probabilities: | |
| * 1, with weight 100 | |
| * 5, with weight 30 | |
| * 10, with weight 20 | |
| * 50, with weight 5 | |
| * 100, with weight 3 | |
| Note that most of the expected value is on the higher end of the scale, giving it a long tail. | |
| For now, leveling up minigames requires diamonds. Players can increase/decrease the minigame level at any time, but the cost of increasing the minigame level beyond the previous max level is 10 diamonds. In general, it should be optimal for the player to set the minigame level to the playerMetaLevel - minigame.nodeLevel. Higher than this will make the metalevel too slow and lower than this will make the metalevel pay out too few rewards/require excessive clicking. When the minigame level is set to the optimal level, playing the minigame should take about 1 second. | |
| Important: because the game is intentionally confusing and there are a large number of things a player could do at any given time, we add a system to highlight what the user can do next. This is done by adding a red exlamation symbol next to any node in the graph that can be leveled up, ranked up, equipped, etc. For example if the player has a chracter that can be leveled up, there will be a red excamation next to the level up button (on the screen for that character's info), next to that chraacter (on the screen that displays all chraacracters), and next to tto the "show all characters" button (on the main screen). This is to help the player avoid getting stuck. | |
| Achievements, anytime the player unlocks a new minigame, ranks up or stars up anything, they will get an achievement in the achievement window. Achievements are worth diamonds. | |
| Note that in general the goals of the game are the following: | |
| * the player should be completing 1 minigame every second or so | |
| * the player should be increasing their metalevel by 1 every 10 seconds or so | |
| * the player should be switching between minigames every 30 seconds or so | |
| * the player should be spending equal amounts of time on each of the minigames | |
| * the player should be earning 1 diamond every second or so (via main game or achievements) | |
| Note that other that the specified endpoints, everything should be implemented in javascript/html. | |
| For the initial version, we will have 2 html pages, one for the main game and one for the slot machine minigame. | |
| The main game will have the following elements: | |
| * main page: | |
| ** base minigame | |
| ** level up button | |
| ** rank up button (when appropriate) | |
| ** star up button (when appropriate) | |
| ** show all characters button (shows all equipped characters, and any empty slots) | |
| ** show all items button (shows all equipped items, and any empty slots) | |
| ** show all skills button (shows all equipped skills, and any empty slots) | |
| ** show all minigames button | |
| ** show all achievements button (this shows any achievement for which the player has not yet claimed the reward) | |
| ** show inventory button (this shows currency, tickets, and uneqipped items/skills/companions) | |
| ** summon character button (this takes the player to the summon character minigame, where the player can spend diamonds to get a new character) | |
| ** summon item button (this takes the player to the summon item minigame, where the player can spend diamonds to get a new item) | |
| ** summon skill button (this takes the player to the summon skill minigame, where the player can spend diamonds to get a new skill) | |
| clicking on a character/item/skill will take the player to a screen where they can level up, rank up, or star up that character/item/skill. next to the currencies for the level up/rank up/star up buttons, there will be a red exclamation point if the player has enough currency to level up/rank up/star up that character/item/skill. there is also a "go to earn" button that will take the player to the minigame that will earn them the corresponding special currency. | |
| Clicking on a minigame will take the player to the minigame screen. | |
| for now the minigame screen will be a slot machine consumes the minigame currency and returns a random item/skill/companion. The player can click the "spin" button to play the slot machine. spinning the slot machine will earn variable rewards proportional to the minigame level. | |
| adding nodes to the graph: | |
| * the number of nodes in the graph depends directly on the player's level | |
| * star level 0, the player has 1 node in the graph (their level) | |
| * star level 1, the player has 4 nodes in the graph (their level a companion, an item, and a skill) | |
| * star level 2, the player has 9 nodes in the graph (their level, 3 companions, 3 items, and 3 skills) | |
| * starring up any companion unlocks 2 additional nodes (a companion item and a companion skill) | |
| here is a basic example of the main game screen: | |
| ------------------------ | |
| | power Level: {player metalevel} | gold: {player gold} | diamonds: {player diamonds} | | |
| ------------------- | |
| | base minigame | |
| | {picure of monster} | |
| | {monster name} | |
| | "kill monster" button | |
| ------------------- | |
| | Current level: {player level} | |
| | Level up button | |
| | Rank up button (when appropriate) | |
| | Star up button (when appropriate) | |
| ------------------- | |
| | show all characters button | show all items button | show all skills button | show all minigames button | show all achievements button | show inventory button | |
| ------------------ | |
| level up | rank up | star up | show all characters | show all items | show all skills | show all minigames | show all achievements | show inventory | summon character | summon item | summon skill | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment