Results 1 to 18 of 18
  1. #1
    SwEeTAcTioN's Avatar
    SwEeTAcTioN is offline Member
    Join Date
    Oct 2009
    Posts
    69
    Rep Power
    0

    Default RPG game question

    So im about to start a huge project for myself that will really challenge my abilities:D

    So my question is im gonna have monsters(all text based and JOptionPanes and buttons etc. no graphics not that good yet:mad:

    would i need to write like each monster up in different files and do like a project or can you put it in one big file?

    next is about weapons

    i want weapons with attack damage that you are "holding"
    how would i go about adding weapons to the "character"

    same with armor

    all help and ideas are very much appreciated:):):)
    Are you suggesting that Cocunuts migrate?!! -Monty Python

  2. #2
    mrmatt1111's Avatar
    mrmatt1111 is offline Senior Member
    Join Date
    Aug 2009
    Location
    San Jose, CA, USA
    Posts
    320
    Rep Power
    6

    Default

    There should be a base class called monster and each type of monster should inherit from that base class all the things that are in common with a "monster".

    Same with equipment. There should be a base class that is equipment, and from there inherits weapon and armor, and from there swords and bows and breastplates and helms, etc.

    Your goal is to reuse as much code as you can and be able to group like things together.

    With monsters, if you have a base class you can then dump all the monsters in a list, for example, and update the state of each monster.

    Or you can store all "equipment" in the players pack or equip only "armor".
    My Hobby Project: LegacyClone

  3. #3
    SwEeTAcTioN's Avatar
    SwEeTAcTioN is offline Member
    Join Date
    Oct 2009
    Posts
    69
    Rep Power
    0

    Default

    So i need to write a separate file with all the monsters and a separate file with all the weapons?
    Are you suggesting that Cocunuts migrate?!! -Monty Python

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    No. Each class will be in its own file. So you will have many classes/files based on the descriptions given by mr matt above.

  5. #5
    SwEeTAcTioN's Avatar
    SwEeTAcTioN is offline Member
    Join Date
    Oct 2009
    Posts
    69
    Rep Power
    0

    Default

    Still a little confused:confused:
    Are you suggesting that Cocunuts migrate?!! -Monty Python

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    What precisely is confusing you?

  7. #7
    SwEeTAcTioN's Avatar
    SwEeTAcTioN is offline Member
    Join Date
    Oct 2009
    Posts
    69
    Rep Power
    0

    Default

    2 things

    numero uno
    what kind of file would i use to write the weapons in?

    2
    like do i keep each weapon separate in separate files or in on big file
    Are you suggesting that Cocunuts migrate?!! -Monty Python

  8. #8
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    If we can teach you one thing today, it is hopefully a better understanding of the concept of a class. With a few exceptions that we won't go into and that don't apply here, each class should be in its own file. Each type of weapon (be it a gun or knife, or ICBM) should be a separate class and thus in its own file. You may wish to create an ancestor class that all weapons inherit from, perhaps even call it Weapon, and perhaps make it abstract, but it too will be in its own file.

    So for question number one:
    1) "weapons" won't go in a file, it will likely consist of a group of classes, each in their own file. Weapons likely will be composed of other objects from other classes. For instance, a Gun class may hold Bullet objects.

    2) See answer number 1).

  9. #9
    SwEeTAcTioN's Avatar
    SwEeTAcTioN is offline Member
    Join Date
    Oct 2009
    Posts
    69
    Rep Power
    0

    Default

    so im starting to get the concept of a class but im not sure on like how to write it kinda

    and like how to use it in the big program
    Are you suggesting that Cocunuts migrate?!! -Monty Python

  10. #10
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  11. #11
    SwEeTAcTioN's Avatar
    SwEeTAcTioN is offline Member
    Join Date
    Oct 2009
    Posts
    69
    Rep Power
    0

    Default

    no i dont i was gonna get a good one cuz my school one is dated like 1995 or something but the book was like $30 and im poor:(
    Are you suggesting that Cocunuts migrate?!! -Monty Python

  12. #12
    SwEeTAcTioN's Avatar
    SwEeTAcTioN is offline Member
    Join Date
    Oct 2009
    Posts
    69
    Rep Power
    0

    Default

    Is there anything online?
    Are you suggesting that Cocunuts migrate?!! -Monty Python

  13. #13
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Yes, there are several options online. First and foremost are the Sun Java tutorials which come highly recommended: Sun Java Tutorials

    Another option is to find second hand Java books on line. I got mine off of Amazon and they were quite helpful and quite cheap.

    Much luck!

  14. #14
    SwEeTAcTioN's Avatar
    SwEeTAcTioN is offline Member
    Join Date
    Oct 2009
    Posts
    69
    Rep Power
    0

    Default

    Thank you i will check them out
    Are you suggesting that Cocunuts migrate?!! -Monty Python

  15. #15
    Join Date
    Jun 2012
    Posts
    52
    Rep Power
    0

    Default Re: RPG game question

    Check out TheNewBoston's Java tutorials on YouTube. :) he is a very good teacher online

  16. #16
    kammce's Avatar
    kammce is offline Senior Member
    Join Date
    Dec 2010
    Location
    California
    Posts
    194
    Rep Power
    4

    Default Re: RPG game question

    I think you need a extremely good understanding of Game design as well as a excellent understanding of Programming languages. Then you can perform a project in Java that will allow you to effectively make a game in it.

    Not to make anyone feel bad, but you can do whatever convention you want when you make a gain. You can have 50,000 lines of code for the whole game and have it all in one file. If that is how you like it, then do it. But there are reasons why you would use external classes. A file for everything will make debugging easier and much faster to spot.

    So, if you are a newbie at Java, game design, and programming in general, jumping into such a huge project like this will be a huge issue. Make sure you understand how programs work and then make your way to programming games. Also, try Flash. Very simple, very easy to use, and the script is also very easy to use. If you want to stay with Java, stick with it and learn how it works first. Then jump into a game once you believe you have a grasp on how things work in Game/Software Design.
    My API:
    Java Code:
    cat > a.out || cat > main.class

  17. #17
    EscSequenceAlpha is offline Senior Member
    Join Date
    Apr 2012
    Posts
    115
    Rep Power
    0

    Default Re: RPG game question

    I think a text-based game would be easy... but then I'm not an expert so I could be missing a lot.

    weapons and equipment is the easy part, just a lot of classes. what I'm concerned about is the "story" you would have to branch out and keep track of events as they split and merge if you see what I mean. I think you could easily produce "battles" with a random generator that would pick enamies from a list (you could also get random drops from them in a similer way) the random generator would pick an index in a data structure... AHHH! you've just got me excited... want to partner up? could be fun
    Legend has it the moderators and senior members of java-forums.org were able to code skyrim using only 701 lines of java... or so the legend goes.

  18. #18
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    7

    Default Re: RPG game question

    Please note, this thread has been resurrected after almost 3 years old, the original poster not active for over a year, and is becoming a magnet for spam which has been deleted. I'm going to have to lock this thread

Similar Threads

  1. Question mark colon operator question
    By orchid in forum Advanced Java
    Replies: 9
    Last Post: 12-19-2010, 08:49 AM
  2. Replies: 2
    Last Post: 08-05-2010, 04:49 AM
  3. 2D strategy game or 2D war game
    By led1433 in forum Java 2D
    Replies: 5
    Last Post: 02-10-2009, 06:00 AM
  4. Tic Tac Game
    By loggen in forum New To Java
    Replies: 1
    Last Post: 12-12-2008, 07:36 AM
  5. game
    By amith in forum AWT / Swing
    Replies: 0
    Last Post: 05-19-2008, 05:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •