TextRPG: [TRADER UPDATE]
NEW UPDATE: Traders are here! (full changelog at the bottom)
I've created a game called TextRPG. It's a roguelike, turn-based dungeon crawler, with infinite randomly generated floors. This game is still in the early stages (this is the first "playable" update), so the interface is a bit unpolished. It would be great if people could report bugs, and stay tuned for the next updates! (btw if u wanna report an error/crash please include the error message it makes it so much easier for me to track down said error with the output)
DISCLAIMER: The save system doesn't seem to work here. If you want to save your games, please fork this code into your own repl and run from there.
If you want to report any problems, ask any questions, or simply just wanna chat about the future of the game, feel free to join my discord server: https://discord.gg/aeN2wgs It would be greatly appreciated!
It seems that the interface of the game is more complicated than I thought!
I guess I'll describe how it works.
The dungeon is made of a series of floors, which are generated with rooms every time you descend down the steps.
There are 5 different types of rooms:
- U: This is a staircase going up. Use the "Continue" option while in this room to go up the stairs (you can't go up if you're on floor one!)
- D: This is a staircase, you guessed it, going down! Works similarly to the "U" stairs. You can still go down the stairs even if you haven't explored the entire floor.
- F: This is a "fight" room. Here you will find an enemy to fight, and enemy difficulty is based on your current floor.
- L: This is a loot chest! You will always get one food item from the chest and a 1/3 chance of getting a weapon. The loot of lowest quality has the highest chance of dropping, while high quality loot is quite rare!
- T: This is the "trader" room. Traders will either be a grocer or blacksmith. You can buy food from the grocer or buy weapons and repair your weapons at the blacksmith!
- Traversing through the rooms is quite easy! When you have the chance, choose the "Continue" option, and you will be shown a map of your floor. Choose the options to move in the four directions. On the map, each letter represents a room. A room of colour orange/yellow means it is unexplored. Green is explored, and red is where you are currently at.
Every 10 floors, the size of the floors increases and the quality of loot improves!
Have fun grinding infinitely!
Early Access Update 1 Changelog:
- Traders have been added! A trader will be either a grocer or a blacksmith. You can buy food from the grocer. You can buy weapons and repair your weapons at the blacksmith. Each trader will have a range of stock to sell!
- A bunch more content has been added! Grind for more weapons, eat a wider range of food, and face more enemies! Check the code for all the additions! Thanks to @EdmundNewman for helping me out with this.
- A bug has been fixed where the game could crash while moving floors beyond floor 9
- Fixed a bug where the options list would disappear after eating while fighting an enemy
- Fixed a bug where player position would not reset after death
- Some QoL additions: Health now shows on top of eat screen, Current floor is now shown in stats, Current enemy info is shown at the top of the fight options screen
- Your gold count is now halved upon death (still slightly buggy :/)
- Escape chance is now 25% instead of 50%, and when you escape from an enemy, you will have to fight it again if you re-enter the room
I can confirm that the next update will be centred around the introduction of armour, inventory management, and bosses. Hopefully a new save system as well, so it will work on this post!
just a suggestion, you should make a new data save for each player because I just logged into someone else's game and had all of their stuff
Wow this is cool. I'm working on a similar game. https://repl.it/@hello1964/An-adventuresurvival-game#main.py
@hello4691 Tried it out! Very, very cool. Traveled the full 1000 miles. I liked the mage/magician appearing, and the options were good. I thought the bottle showed up too many times - but maybe that was just for me? I also thought the protagonist is kinda a bad dude lol, making trouble everywhere he goes (as those were the options). Good game!~
i love your text rpg series! plz post more updates asap!
When trying to go from floor 12 to 13, I got the following error.
Traceback (most recent call last):
File "main.py", line 661, in <module>
game = Game()
File "main.py", line 581, in init
File "main.py", line 382, in mainMenu
File "main.py", line 398, in intro
File "main.py", line 428, in pause
File "main.py", line 481, in floorMovement
File "main.py", line 599, in createFloor
floorArray = self.populateFloor(floorArray, floor)
File "main.py", line 646, in populateFloor
j.loot = [random.choice(eligibleFood), random.choice(eligibleWeapon)]
File "/usr/lib/python3.8/random.py", line 290, in choice
raise IndexError('Cannot choose from an empty sequence') from None
IndexError: Cannot choose from an empty sequence
I also never got a weapon from a chest. Could there be an issue with the weapons list? Perhaps especially for floor 13?
For your bat stew, you can use the random module's randint to choose a random number in some range. Use an if else conditional, so that if the random number is like 5 or something, the health you gain is negative, hence you take damage. Else, you gain 20 health.
Im not too good at coding but would you be cool if I tried to make it online? and like gave friends the script so we could play together, ill credit you of course.
i made a game like this but in pygame. probably won't ever upload it because it's probably trash. a quick question: how did you get things to save? that's one of my limitations right now, it has to be played in one session.
Really Cool, but I have a bug to report
When you choose to eat, and after you eat an item the entire interface, ends and only says: What is you choice.
@bryancrisso I think I found the problem but it might be wrong (Under the function 'eat'):
for i in foodDictionary: if choice.name == i.name: print('The item you chose exists as a food item!') print('Your choice exists in your inventory!') print('Eating ' + choice.name + '\n') self.currentHealth += choice.healthRegen if self.currentHealth > self.maxHealth: self.currentHealth = self.maxHealth self.inventoryRemove(choiceNum) #self.saveInventory(self.inventory) #self.saveStats() selected = True break
After it actually gets the eating done, and improves your health it breaks and returns to here: (Under the Function "Encounter"):
while not hasAttacked: choice = "" while choice not in choices: choice = input("Choice: ") if choice in choices: os.system('cls||clear') if choice == '1': player.attack(enemy) hasAttacked = True elif choice == '2': return random.randint(1, 2) hasAttacked = True elif choice == '3': player.eat() elif choice == '4': player.selectWeapon() elif choice == '5': player.displayStats() else: print("Invalid number!")
I'm not sure where it goes after finishing "player.eat" but I think this may be the problem.
The save system is sad... I have the same problem with the .dat files to..... (This is in this )
Also you could even make this like a full game you can move around, i made a maze game here:
Using these physics you could maybe make events, like a
Q is an event, and if you move into it it triggers something
Also if you want to do anything with this i can help
@Muffinlavania i mean, the save system was never made for repl, it works perfectly fine on a local installation. I'm prototyping ways of using the repl database for saving data, for this post.
Your maze prototype is a good idea, but I definitely have different priorities for this. Anyways, as the saying goes, don't fix what ain't broke.
I'm totally fine on this project, I have like 4 friends already working with me on it, although I do most of the programming, and a couple of them create all the content.
It is pretty good, but I have one little suggestion. When you go downstairs, you gain a floor. When you go upstairs, you lose a floor. Why is that? I think it should be flipped.
@elizurfk Well, if you think about a classic dungeon, you would start at the top, and explore downwards, right? So this is what happens. We start at the top and you go downwards, and since the floors are technically infinitely generated, it's just a lot easier to get bigger floor numbers the more you go down (it helps with the generation algorithm, it's just a lot simpler)
Ummm dude I played for 20 minutes straight and on floor 10 I was going to floor 11 and this happened: It had errors from multiple lines and my thing just crashed