• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
phil67rpg

adventure dungeon game

19 posts in this topic

here is a little adventure game I have made. it is not perfect. I made this game because I wanted to get better at c++. let me know what  you think.[attachment=17930:adventure.zip]

0

Share this post


Link to post
Share on other sites

When I went to the M and I pressed f after I killed the orc he comes back and I have to fight him again. I think this is a bug. also, I went to the other M and it there was an orc there and then he dissapeared.

0

Share this post


Link to post
Share on other sites

I like it. I have a few small issues.

 

  1. I get the same bug as mentioned, the Orc keeps fighting me even if I kill him.
  2. The second 'M' just says I found an Orc, but I never fight him
  3. Include your source code, as it is a much better way of telling you how to improve directly.

Regards,

 

Stitchs.

0

Share this post


Link to post
Share on other sites

well this is probably crappy code but it does work. there is always room for improvement. here is my source code

[attachment=17941:adventure (2).zip]

 

 

0

Share this post


Link to post
Share on other sites

I also noticed the map doesn't get shown after you defeat the bottom monster(orc), and that you will still find orcs at their locations even after they aren't shown on the map, and even though you can't fight them anymore.

 

This is nice little game, I guess I should follow your example and keep it simple as I'm learning c++. I realize I was overcomplicating my ideas on what to do while learning and it was being sort of an obstacle, I think it's better to do it simpler and expand from there...

 

Oh and one thing I might do if I was making a game like this one (you may have already thought about it) would be to clear the screen before updating the map with the new player position.

Edited by Master thief
0

Share this post


Link to post
Share on other sites

I've looked at your source code... I think you should pay more attention to code formatting, like consistent indentation and more empty lines.

0

Share this post


Link to post
Share on other sites

Well, I just looked over your code and here are a few comments:

 

1- There are no comments. When someone is reading your code, you should make it as easy as possible for him/her to figure out what you are doing.

2-Some of your variables are quite vague. Flag for what?  hp of whom? You should make your variables as descriptive as possible without them being ridiculously long. 

3-You should use more spacing and tabs to make your code more readable.

0

Share this post


Link to post
Share on other sites

I played this but I haven't looked at the source code. Here's some things I noticed, and some suggestions on where to go next if you'd like to improve it/fix it:

 

* If you go into the space with a sword repeatedly, you will continue to pick up the sword. Since there's no indiciation of inventory, I can't tell if I'm getting multiple swords, or if it's just giving me the notification for walking on the space.

* When I fought the monster on the left, I got stuck. First I killed him, then he refought (like people have been saying) but no matter how many times I hit him, neither of us died. I pressed f like a million times.

* The map doesn't display again after a battle, so I have no idea where I am if I've forgotten my location. Since it updates every move phase, I think it should update here, too.

 

Here's some things you could try adding, that I think would be a good challenge based on what it seems you can do so far:

 

* Have the room be a random size and shape (even if it's just differenlty proportioned rectangles), instead of the same square every time.

* Have monsters and items appear at random locations. You don't have to have random amounts -- it could always be the same sword and two monsters, but in different places every time.

* Have a victory and loss condition (run out of HP and die, defeat all monsters and win, for example)

* Different weapons with different abilities, that they player can choose to replace with his current weapon.

 

Once you've done those, you can even try adding monsters that move and chase the player (or run, or do different things... they could have a simple AI). So you'll have to make an AI and turn-taking system.

 

Though to add these things, it might be good to look into object-oriented programming. I think that seems like a good next step after this. I haven't looked at the source code yet, but it doesn't seem like you're using classes based on the way it plays.

 

For example, if you wanted the monsters to be of random types and in random places, you could make a monster class, and when creating the initial map, create monster objects and assign them random coordinates (which are stored in the class in variables). Stuff like that. This will also make the program more expandable so you can add new things more easily.

 

OK, I decided to downlaod the source code. It's very difficult to read. Like said, use comments everywhere. Unless something would be glaringly obvious to someone looking at your code (imagine they've never even run the program and they're JUST looking at the code, figuring out what it does... they might not even know it's a game... pretend they'll never run the program and need to figure it out just from the code... comment all the time!)

 

Also, the formatting... like said, white space is important. You want to tab stuff. When your blocks are indented, they are a lot easier to read... especially when there are blocks within blocks. Just looking for braces nad trying to figure them in your head is a strain.

 

This will not only help others reading your code, but it will help you, too. If you leave to work on something else, then come back to this project later, you may find you have no idea what your code even does anymore... and without comments and nothing being indented or spaced well, you will have a lot of trouble trying to figure out how your program works anymore.

0

Share this post


Link to post
Share on other sites


int x=0,y=0,w=4,attack=0,hp=6;//global variables

 

They are declared inside main(), how are they global? Maybe they "feel" global, because you dumped your whole program into a single function, but that's not the same thing.

 


cout << "***Welcome to Adventure***";//welcome text

 

This is a prime example for useless comments that only exist because someone said "you need to comment more".

 


for (int i=0; i<9; i++)//draw grid

 

I was wondering how many times you would copy/paste the same comment without eventually realizing that this code shouldn't be commented, but get its own function.

 

 

Comments should only be used where necessary. Prefer writing clean and readable code with decent names for variables and functions. Which means, don't be lazy and abbreviate the hell out of everything, keep functions short and have them do ONE thing, avoid confusion (don't use i and j as loop variables or any other combination of letters that look alike).

 

If you have a piece of code and feel the need to put a comment over it saying "this block does x", put it in a function and call it "x".

 

Comments are the last thing anyone ever updates, they are frequently copy/pasted along with the code and it's usually less than a month before they turn into a confusing mess of lies and deceit. Write code that speaks for itself and doesn't need comments in the first place.

 

Use comments where explanations are required or a chunk of code is impossible to quickly look at and understand what it's doing. "Find shortest path using A* (<link to more info about A*)" would be a helpful comment. "Assign sum of x and y to variable a" on the other hand is nothing but noise that actually makes it harder to read the code (seriously, if somebody needs you to explain what a=x+y does, they probably shouldn't be looking at any kind of source code in the first place).

 

Frankly, nothing I see in your code needs to be commented, because it's about as trivial and straight forward as it gets. Better names, clean formatting and at least an attempt at well structured code would make any kind of comment superfluous.

 

Get a book like "Clean Code", ignore the dogmatic parts and rather than taking everything as "how it always must be", read it as "what you should strive for within reasonable limits".

2

Share this post


Link to post
Share on other sites


Frankly, nothing I see in your code needs to be commented, because it's about as trivial and straight forward as it gets. Better names, clean formatting and at least an attempt at well structured code would make any kind of comment superfluous.
so I  don't need any comments?
0

Share this post


Link to post
Share on other sites

There are some game design related changes i would like to see (Hope you want feedback on that too). They will also give you some more stuff to program :).

 

Randomness ; Give the hits some chance, and with it some more outcomes. Think of DnD's die rolls to determine damage. This will give more depth than just the simple "hit or miss". 

Motivation ; What is the motivation behind hitting or running or doing anything in the game right now? Give the player a goal and with that possibly a winstate. A reason to run is also missing. Why would I run? I can't die anyways. 

Feedback ; Give some more feedback to the player as to what happens or what his surroundings look like. With the earlier mentioned damage  you can give a couple of different texts based on the severity of the hit. Also some feedback on how the enemy is doing after you hit him would be nice. 

 

I can't think of anymore right now but this should keep you busy for a bit too. :)

 

Cheers, 

IYIonster

0

Share this post


Link to post
Share on other sites

 


Frankly, nothing I see in your code needs to be commented, because it's about as trivial and straight forward as it gets. Better names, clean formatting and at least an attempt at well structured code would make any kind of comment superfluous.
so I  don't need any comments?

 

honestly, write all the comments you feel that you need, for yourself, 1 month from now

you are just starting out, and you will no doubt leave this project for another as you get better at programming and you realize that there are things that could be solved with easier and simpler code

so, this project could be like a reference for you, if you need to take alook at how you did a specific thing, when you need it

 

i frequently take a look at my previous code just because otherwise i would have to re-read documentation or "google it".. no one remembers every little thing smile.png

 

making your variable and function names "short sweet and to the point" is more important

so, for your ogres HP variable:

"hp"  bad

"ogre.getHP()" good

 

me post now (PS. take a quick look at classes, they really do help compartmentalize both your code and your thoughts)

Edited by Kaptein
0

Share this post


Link to post
Share on other sites

"Writing the right comments" is an art an takes time to learn (heck, I need to constantly strive to improve myself). What you want your comments to do is to explain WHY the code does what it does, NOT what it does or how it does it. E.g. see the difference on the example that was posted above:

 

cout << "***Welcome to Adventure***";//welcome text

 

cout << "***Welcome to Adventure***";//need to display the welcome text already now or player won't know what game this is

 

Somewhat contrived example given how useless that text is anyway, but.. smile.png

 

Not that comments for explaining why will always be longer, sometimes they are shorter. What you want to ensure is that your variable and function names are so clear that people can figure out what the code does for themselves, but you explain the motivations with your comments. To compare with a normal language sentence "I do X because Y", you want to include the Y as your comment, rather than X (most of the time, there are always exceptions) - since the code should already say what X is if it's clear enough.

 

Even though I said "people", it will benefit your future self as well if you have to revisit the code.

Edited by Petter Hansson
1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0