Re: Help making simple RPG game less boring
by marto (Cardinal) on Oct 30, 2012 at 12:21 UTC
|
Since you're not asking a Perl question, rather a game design quesiton I'm confused as to why you're posting here. However, so far:
C:\>perl rpg.pl
And adventure awaits to the east, do you wish to embark?
1 for yes, 2 for no
1
You find an old Katana, strength + 20
You pick up some ancient armor, def + 100
A wolf appears
You attack the wolf for 43
The wolf retaliates with 150
The wolf has 58 health, you have 205
You attack the wolf for 45
The wolf retaliates with 150
The wolf has 13 health, you have 105
You attack the wolf for 54
The wolf retaliates with 150
The wolf has -41 health, you have -45
You defeated the monster
You gained 101 XP
You are now level 2 on stage 1
***************
***New Stats***
***************
LEVEL2
Base strength 21
Extra strength 46
Max HP 207
Def 276
You are now level 3 on stage 1
***************
***New Stats***
***************
LEVEL3
Base strength 23
Extra strength 58
Max HP 209
Def 353
You are now level 4 on stage 1
***************
***New Stats***
***************
LEVEL4
Base strength 26
Extra strength 71
Max HP 212
Def 431
You are now level 5 on stage 1
***************
***New Stats***
***************
LEVEL5
Base strength 30
Extra strength 85
Max HP 216
Def 510
You are now level 6 on stage 1
***************
***New Stats***
***************
LEVEL6
Base strength 35
Extra strength 100
Max HP 221
Def 590
You are now level 7 on stage 1
***************
***New Stats***
***************
LEVEL7
Base strength 41
Extra strength 116
Max HP 227
Def 671
You are now level 8 on stage 1
***************
***New Stats***
***************
LEVEL8
Base strength 48
Extra strength 133
Max HP 234
Def 753
You are now level 9 on stage 1
***************
***New Stats***
***************
LEVEL9
Base strength 56
Extra strength 151
Max HP 242
Def 836
Do you wish to go forwards, stay or retreat?
1 for trucking on east, 2 for staying 3 for retreating
At this point I've pressed one button, this one decision has resulted in all the action taking place. I'm now level 9 for deciding to play the game by pressing '1' rather than the script dying at line 120 with an "uncaught exception" (which occurs when you select "2" rather than "1").
The game lacks any real user involvement I've experienced with other text based RPGs. If you want it to be interesting for people I suggest more user involvement, less automated actions. Perhaps you should check out some other games of this nature and see how they engage users.
Update: Added option "2" explanation.
| [reply] [d/l] |
|
|
I posted it here because I coded it as a Perl learning exercise. Currently restructuring the whole thing to be more user oriented.
Thanks for your input!
| [reply] |
|
|
| [reply] |
|
|
You pick up some ancient armor, def + 100
A wolf appears
You attack the wolf for 43
The wolf retaliates with 150
The wolf has 58 health, you have 205
You attack the wolf for 45
The wolf retaliates with 150
The wolf has 13 health, you have 105
You attack the wolf for 54
The wolf retaliates with 150
The wolf has -41 health, you have -45
I now have less health than the wolf, which dies, but am somehow still alive and leveling up. | [reply] [d/l] |
|
|
Since you're not asking a Perl question, rather a game design quesiton I'm confused as to why you're posting here. Should post in Meditations? Design is part of everything
| [reply] |
|
|
For clarification, the question of this being "boring" doesn't relate to a perl problem with this program, if this were written in BASIC it'd be just as "boring". It's somewhat subjective, what one person finds boring another may not. As described in Where should I post X?, Seekers of Perl Wisdom is for problems specifically relating to perl, rather than solving the problem of how make something less boring to use/play.
The fact that it the program doesn't work as intended (for example, I later posted how I died yet defeated a wolf) is a programming problem, I noticed this as I reevaluated the programs vast output based on my one decision/choice. The question OP asked was how to make the game less boring, which is outwith the scope of Perl.
| [reply] |
|
|
Re: Help making simple RPG game less boring
by jethro (Monsignor) on Oct 30, 2012 at 13:22 UTC
|
You don't have a single subroutine in your script. I have coded lots of simple scripts without subroutines or modularisation, but even a simple game should be so complex that it becomes impossible to manage without some abstraction and structure.
For example, make a subroutine that does the monster selection. The subroutine should be called with the parameters $lvl and possibly location type (so that wild pigs are only encountered in forests, Mothers-in-Law only in towns). Also not every location should have a monster
Make a subroutine that is called whenever the player moves into a new location. It should select and print what the location is (hill, road, forest, town) and return the location type. Maybe add some special events that can happen
Make a subroutine that asks the player what to do when he enters a location without a monster. Possible things to do: Heal, select a different weapon, search the area, goto next location
Make a subroutine for fighting monsters. This subroutine should ask the player each round what to do (attack, change weapon, run away, make a special attack (more damage, but less defense on the counter attack of the monster), heal ...) and resolve that. Don't hesitate to put each action the player can do in its own subroutine.
Try to give each subroutine everything it needs as a parameter. Your main script should essentially be a few subroutine calls that show the structure of the game.
If you have done that your script has become more maintainable and your game is probably a bit more fun.
UPDATE: I forgot the usability hint: Don't let the player enter 1,2,3... to select the options, attack should be 'a' not '1'.
| [reply] |
|
|
Yep,
After the previous comments I'm restructuring the whole thing to work with subroutines.
I really like the location idea.
| [reply] |
Re: Help making simple RPG game less boring
by pvaldes (Chaplain) on Oct 30, 2012 at 13:18 UTC
|
More RPG: the biggest fail is that the game is plain because your characters are plain. Your hero don't even has a name, origin, or a description.
Detailed description of the surroundings, scene and monsters, less plain descriptions of the monsters and not standard monster names (why to have a wild boar when you can have a vampire babirusa instead, or to have a wolf when you can have a ice canyon's wolf?), use your imagination, don't mix very different monsters in unprobable surroundings, and basically, tell a history
More Perl: maybe a sub {} for each monster, a line that shows briefly an image of each monster and a few sound files played at random times, (Use Inline::Files), or a gtk structure of windows and buttons... There is a lot of room to improve and make your game special
| [reply] |