Share your repls and programming experiences

← Back to all posts
139
Dragon Eye RPG

This is an RPG made for the AI competition. The game is intelligent by generating a story and determining enemy moves.

About

Dragon Eye is a terminal based RPG. It may not be a AAA game, but it does have one special thing about it. Since there is no story, the game is generated by an AI based on decisions you have made.

Enemies

You can fight a variety of enemy's in the game. Before combat the game generates your enemy to be close to your level and damage, that way every fight is fair, and a decent challenge.

class Enemy{
  public int Level;
  public int Health;
  public string Race;
  public int Damage;
  public int Defense;
}

Items

Items are essential to playing Dragon Eye, without them you would most likely be on a death loop.

class Item{
  public string ItemType;
  public string ItemName;
  public int ItemLevel;
  public int Damage;
  public int Value;
}

Strategy

The gameplay is based on strategically making decisions. You always have 3 options in combat, attack, defend, and use item. Using an item will heal you with an item, defend will use your defense to counter the enemies next attack, and attacking will use your attack and subtract that from the enemies health.

class Player{
  public string Name;
  public int Level;
  public int Health;
  public string Race;
  public int Damage;
  public int GP;
  public int Defense;
  public int xp;
  public List<Item> Inventory = new List<Item>();
}
Commentshotnewtop
3
3

Hey can you make it that when you choose an item, that you dont have to type in capital letters for ex. you just type in “stick” instead of “Stick” it would make it easier for people I would think.

3
1

@NarenR im actually working on a extended version of this with a lot more, and i took your feedback so that will be in it, i might finish in a week or so.

2

@PixelBitez Very nice. Overall it works really well. It's just the UI that needs a little work. But nice job!

1

@Sparkster or he can just put .lower() so that either way it is recieved as "stick" which can be the correct answer

3

its very
good but needs a toootorial

2

the game is generated by an AI based on decisions you have made

No it's not.

Seriously, am I missing something here? There's no AI at all, there's no tracking of user decisions. It just randomly does something each turn of the game...

4

@nathanburgess owchie, it may not be the best "ai" in the competition but reading over the competition page, it follows all rules. it shows some form of intelligence, enemies defend themselves when needed, characters can ask you for money, etc.. so it may not be sophisticated but its within the rules. i am working on a new version of this game with complete ai for enemies and a story driven by decisions, so if you want to see that instead of this.

2
A level 3 Dwaf started a fight.

did anybody else catch this?

2

Very cool!

Unrelated question: How do you generate random numbers?

2

@KasCode_Inc u gotta type:

Random rnd = new Random();
int randomNumber = rnd.Next(min, max);

max being the maximum number and min being the minimum

1

@LOLLOL3 dang u broke, pay me your debt in gold

2

When monsters are low on health they can regenerate some health back every turn?

1
2

FYI - someone has taken this game and posted it saying it is theirs https://repl.it/talk/challenge/Loa-RPG-WIP/10637
i ma absolutley DISGUSTED

2

@LukeGordon2 dang that person needs to be creative instead of stealing work

2

When the game say's "Someone walks up to , and asks him/her to slay a monster." Mine auto says "declined the offer" but then automatticaly says "Someone walks up to _, and asks him/her to slay a monster" then "___accepted the offer" fix that part maybe

1

@cease Exact same problem.

2
1

@ebest yeh u better not lose to him

1

@PixelBitez Won. It did not give me health though...

2

WOW! AMAZING! I made a hacked version with the stick called "DB" it has 1000 Damage.
Here is the link to it if you wanna play it: https://repl.it/@ChristianThone/Dragon-Eye-RPG-HACKED

1
2

Why people always tryna hustle me for my money?

2

It has some lack of info, but overall it is a very good attempt. Noice!

2

at the first battle how do i attack?

2

@skull_is_dull You have to type the number of the action, so in order to attack you type "1". Then it will ask what to attack with, type in "Stick" as it is the starting item in your inventory.

2

@PixelBitez Although there is the problem if you type Attack instead of 1 your turn is skipped. Also, typing stick instead of Stick is also invalid.

3

@EatTofuEveryDay @PixelBitez You can easily fix this by using the .lower() function on your inputted variable, and the code will no longer be cap sensitive.

if input("Attack with what? ").lower() in inventory:
1

@KiKUP yeh ik but then i'd have to add a lot more code because the way I made combat is complicated

2

@PixelBitez Sure thing! I'm anxious to see what more you can do with this! :)

1

@EatTofuEveryDay im actually working on a second version of this game so i heard your feedback and am using it in the next version

1

Are you submitting this to the Game Jam?

1

@KatyaDelaney im actually working on a separate game that renders visuals in a terminal / console based on highlighting the text, i don't want to ruin the surprise of what its going to be about though

1

needs a tutorial
but overall fun to waste time in a comp science lesson

1

I'm making a similar game with c++. Instead of typing out the name of the item, I made it so that I enter the number of the place holder in the inventory. For example, instead of typing "Stick", I enter '1'. If you want to know how, you can simply make an array for your inventory variable and use conditional statements that accept numbers as input.

1
1

Initially we do not know what we have in the inventory. It appears only after the first turn. What do I attack with? What item do I use? I don't know.

1

you can just spam defense when ur low and you can get back to max health lol

1

Hi but i think its broken :/ it started to make decisions without my input?

1

@16040 naw its programmed to answer that automatically cuz it doesnt reward you for it, its supposed to be a "story element"

1

You should try to add more things to do other that killing thins and giving away money kind of like having ways so spend money or a way of choosing your stats increase or having relationships with characters that can develop

1

I got a
<somtin special ;)>
easter egg?

1

"Stick" should be the same with "stick" tho
but the AI said that its invalid when i inputed "stick"

1

There seems to be a logic fail in there - when the enemy has 0 HP left after the player's attack, the player gets attacked twice:

Tom's Health: 45
Elf's Health: 8
1
Attack with what?
Axe
Tom attacked enemy Elf with a Axe, the Elf lost 23 health.
---Inventory---

<Stick><Axe>

[Damage: 10][Defense: 13][Health: 45/100]
Elf attacks, Tom loses 11 health.
Elf attacks, Tom loses 11 health.
Tom won the fight!
Rewards: 129 xp, 1 Gold Peices.

Also there's a typo in "Pieces"