Legend of the Secret - Text/GUI based RPG - My first game project

its quite difficult to reach the other towns. the only way seems to be to walk around in circles around the first town, killing monsters and healing/upgrading untill you are strong enough to get to another town.

so perhaps a few ideas:
*make minor locations scattered around the wilderness which are easier intermediate locations to get to where you can improve your character/heal to a lesser degree than towns allow.
*make less monsters when youre closer to a town, more when youre in the middle of nowhere.

the monsters are really the only thing which control the way the player explores the world. their occurrence is much too random and too linear for the player to form any kind of method of how to succeed other than to try to exploit loopholes in the programming. perhaps make a function for developer use only, which will show chances of monsters spawning on each map square. it should look organic, have some easy paths and some very dangerous areas. if your program generates this spawn rate map for you, it will be easy to tweak it untill it has the right feeling (it could even implement difficulty levels).

i think that one point could improve the fun of the game quite a lot, because it would allow the player to feel more like they understand how the world works. if things always jump out at you randomly and dont make sense, you hit the quit button pretty fast.

your game is working. it doesnt require any fancy graphics or sound to keep building on it - being text based. its all down to your imagination now and how much detail you can cram into it. not just text detail, but details of where things are and how they interact with each other within the program. read as much as you can on game design, theres an awful lot of it online covering various topics and all of it is very insightful. how to make games fun, how to make them meaningful, how to make them memorable, how to avoid adding features which ruin the game. spend a few days writing details of your world on several dozen sheets of paper. get the world a bit more solid feeling, then you can add some quests linked to the background story you have written down on paper. if you take 1 week to do these basics/research, i bet youll have an enjoyable game which you can then add a lot of content to over time.

Thank you for all of the advice. I sat down yesterday and played the game for awhile and I came up with this list of things I need to fix:

Fix points on map.
Only let you rest if your health is not full.
Subtotal the items selected.
Fix the amount of health you get when you die.
Look at the equation for the amount of money you get when you win.
Look at the attack calculation.
Add a cost to use the boat.
Don’t let you use rest if you have more than the default health.

After I fix these, I will start on the rest. Again you have been a great help.

EDIT: When I went to test the game it crashes after loading or creating a new character. Will update when fixed.

[s]These are the latest changes, let me know what you think. Download

  • The entire interface has been redesigned to look more organized.
  • The store and inventory screens now have weapons and items separated by tabs.
  • The store screen now has a running total of the cost for the items selected.
  • I have adjusted the money payout, hopefully for the best.
  • I have adjusted the amount of health you receive if you die during battle.
  • I have implemented a three class system that I will add to later. Right now they just have different starting weapons.
  • When loading your game save instead of typing the name of the hero, you can now select the saved game from a dialog box.
  • I have implemented a system that reads the color data from the map to determine various things, one being now depending on the color of the grass there is a different chance to be attacked.
  • Known Bug: I am still working on the collision detection with the water and other objects but I am having decent success with the color detection system.
  • I am getting ready to add quests and a story line. Also eventually there will be separate maps for the mountains, forest, and desert.

[/s]

crashes after creating/loading a character (process still running in background without a window) ill try run it in command

I saw that and I am trying to figure it out, I have no idea whatsoever. I am using NetBeans and it works fine in there.

Same problem here. It just crashes.

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at Tools.MapUtil.getRed(MapUtil.java:55)
        at Hero.Move.<init>(Move.java:34)
        at Hero.Hero.getHeroPlace(Hero.java:495)
        at Menus.Explore.<init>(Explore.java:41)
        at StartUp.NewGame.startGameButtonActionPerformed(NewGame.java:208)
        at StartUp.NewGame.access$100(NewGame.java:8)
        at StartUp.NewGame$2.actionPerformed(NewGame.java:56)
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
        at java.awt.Component.processMouseEvent(Unknown Source)
        at javax.swing.JComponent.processMouseEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$200(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)

Thanks, I will look at this right now.

@trollwarrior how do you get that output? ive just set the path to the java folder, but i cant get it to run the program from command.

i downloaded, dragged to desktop, renamed file to ggame.jar (because already have game.jar), opened cmd, cd desktop, java -jar ggame.jar

cool thanks, i didnt have the -jar option. runs now but still get no print out.

Well, I can’t figure it out right now, I was able to see the errors but I am having trouble fixing it. I need to go to bed. I will look at it tomorrow. Thank you guys for helping me :).

I really hate Java sometimes, I forgot to have 2 of my new classes implement serializable and the errors were caught but i didn’t have them say anything so i didn’t know. Of course I am using BufferedImage and found out that its not serializable so I have to figure out how to get my color data, i am thinking an array but if anyone has any ideas let me know.

Im pretty sure arrays are how its done (I don’t get color data myself though). When I was watching some beginner tutorials I saw something along the lines of this:


int[] colors = new int[];

or something like that.

I might just do that, I have an image that i was getting rgb data at a point x,y. i think ill just have it run a loop and read the color data from the entire image to an array and go from there.

Remember when doing loops with x and y always do y first. It looks like this:


...
for(int y = 0; y < pixels.length; y++) { //Assuming your pixels array is names pixels
     //Do Color setting things for y here
     for(int x = 0; x < pixels.length; x++) {
          //Do color setting things for x here
     }
}
...

Thus for every Y pixel, you set the color data or what ever for a whole row of x pixels. I may actually have this confused with spritesheets and rendering and color data all mashed up into one though, so don’t hold by that code too much.

This works, now it just need to rewrite the rest of the code.

private int[][] green = new int[800][600]; 
    
    public MapUtil()
    {
        File mapLoc = new File("src\\Menus\\map.png");
        try
        {
            BufferedImage image = ImageIO.read(mapLoc);
            
            for(int x = 0; x < 800; x++)
            {
                for(int y = 0; y < 600; y++)
                {
                                
                    Color c = new Color(image.getRGB(x, y));
                    green[x][y] = c.getGreen();
                }
            }   
            
        }
        catch(IOException ex)
        {
            
        }
        catch(ArrayIndexOutOfBoundsException aioobe)
        {
            
        }

Just a heads up, your loops won’t cycle through the whole image as you are only instructing the loops to loop through until it is one pixel away from the size of the image. Right now you are saying loop until x or y is less than 800 or 600, when in reality it should be less than or equal to 800 or 600. I think… unless I’m thinking about this wrong!

I think you are right.

the pixels should have indexes 0 to 799 horizontally, total:800.