New Text Battle Engine

This is a discussion on New Text Battle Engine within the Game Programming forums, part of the General Programming Boards category; Hey everyone. I just completed my first "real" game. It's a text battle engine thing. I hope everyone enjoys it. ...

  1. #1
    Registered User gell10's Avatar
    Join Date
    Jul 2003
    Posts
    46

    New Text Battle Engine

    Hey everyone. I just completed my first "real" game. It's a text battle engine thing. I hope everyone enjoys it. The source code and the executable are in the one .zip file. Tell me what you think and suggestions are welcome. I need them
    Attached Files Attached Files
    Last edited by gell10; 06-14-2004 at 01:23 PM.

  2. #2
    ---
    Join Date
    May 2004
    Posts
    1,379
    why didnt you use multiple .cpp files instead of .h files?
    and color doesnt work on my machine.

    [edit] oh and your non standard functions need to be included inside " " instead of < >.
    unless you put them in you include folder...

    and where is this mystery load.h file?[/edit]
    Last edited by sand_man; 06-14-2004 at 07:12 AM.

  3. #3
    Registered User gell10's Avatar
    Join Date
    Jul 2003
    Posts
    46
    ok color was never implemented into the game. I removed that .h file from my zip program and I accidentally left load.h out. I have now included it in the zip file enjoy. I don't know why I used multiple .h files. I kindof like that. imo it was easy to seperate different functions that way. Why would local include files have to be in " ", is it syntax or is there a difference in the way the compiler reads it? What other comments do you all have? Is the layout for the battle system good. Is it comprehendable? More feedback thanks

  4. #4
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,738
    >I don't know why I used multiple .h files. I kindof like that. imo it was easy to seperate different functions that way.

    Dont worry I do the same thing. I completely agree with you.

    >Why would local include files have to be in " ", is it syntax or is there a difference in the way the compiler reads it?

    There is a difference in the way the compiler reads:

    #include <someheader.h>

    and

    #include "someheader.h"

    When you use the < > brackets, the compiler immediately goes to the "include" directory to look for the header file when including it. When you use the " " quotation marks, it searches the path that you give it, which would just be same directory that you are in if you do not give it a path.

    >Is the layout for the battle system good.

    It is awesome. I like it a lot. It reminds me of the first text game I made, except I didnt spend that much time on the layout I focused more on the storyline, but your game is meant just to be a battle engine while my first text game was meant to follow a story, so we had different objectives.

    Anyways, I think you built an excellent battle engine there. It works very well, and the output is very clear and readable. I did not look at the code to see if it was portable, but if it is not portable I encourage you to make it portable because it betters your coding habits.

    Overall: Excellent job. Good luck on your next project.
    My Website

    "Circular logic is good because it is."

  5. #5
    Registered User gell10's Avatar
    Join Date
    Jul 2003
    Posts
    46
    Thank you so much for the positive feed back . Yeah my next goal is to learn some open gl and a possibly port the battle algorithms to something with graphics. The eventual goal is something similar to the early final fantasy battle engines for the super nintendo. (I know that is a stretch but it is my long term goal )

  6. #6
    Registered User gell10's Avatar
    Join Date
    Jul 2003
    Posts
    46
    There was an error that when the character died the window would close really fast. I corrected this problem. It should be fine now.

  7. #7
    ---
    Join Date
    May 2004
    Posts
    1,379
    dont worry about color.
    color in a console is not easily portable anyway.
    your algorithms are good. i need to implement something similar in my text game.

  8. #8
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    Just one thing to point out. Header files should only have function declarations, not the actual implementations of the functions themselves. You should have 'load.h' contain all of the function prototypes, and then 'load.cpp' include 'load.h', and have the actual code in there. Your 'main.cpp' would then include 'load.h' only.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  9. #9
    Registered User gell10's Avatar
    Join Date
    Jul 2003
    Posts
    46
    so what would I put in load.h? I probably could then just make it load.cpp and not have load.h at all then? The way it is coded one function opens up to another. Which might be bad I suppose. I probably would have to just code it completely differently then so that every function ends back in the function that initiated it instead of leading to more and more seperate functions.

  10. #10
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,738
    yeah it is proper to put only function and variable declarations in the .h file, and then define them in a corresponding .cpp file, but i say to heck with that. That's one of the most annoying proper things to do.

    In the case of header files when I create them, I usually have one major class per header file. I declare the class at the top and all of its members, and then below that I define them. That's my preferred way of doing things. It is still organized (class declaration in part 1, definitions in part 2) and takes less files.
    My Website

    "Circular logic is good because it is."

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how do the game engine and the api interact?
    By Shadow12345 in forum Game Programming
    Replies: 9
    Last Post: 12-07-2010, 11:08 PM
  2. DirectX | Drawing text
    By gavra in forum Game Programming
    Replies: 4
    Last Post: 06-08-2009, 12:23 AM
  3. New Battle Engine Problem
    By drdroid in forum C++ Programming
    Replies: 12
    Last Post: 10-09-2002, 06:21 PM
  4. Replies: 1
    Last Post: 07-13-2002, 05:45 PM
  5. What's a 3D engine?
    By Garfield in forum Game Programming
    Replies: 6
    Last Post: 12-18-2001, 03:06 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21