Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (521)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (589)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 2 [3]
  ignore  |  Print  
  Dreamscape  (Read 13084 times)
0 Members and 1 Guest are viewing this topic.
Offline tyeeeee1
« Reply #60 - Posted 2013-03-24 14:37:05 »

Where can I download the new version? Grin

Here's the current version, all you can do is walk around and walk into the pathway tiles which I'm using as 'walls' to test the collision detection for now. I'm going to be fixing up the code a little bit more so that it stops you from going into the black areas and a few other tweaks today.

http://www.mediafire.com/?2qg360fqgb5z9p6
Offline Gjallar

JGO Coder


Medals: 13
Projects: 1


Follower of Nurgle


« Reply #61 - Posted 2013-03-24 19:56:52 »

Do you plan on keeping the controlls that way? Meaning that you cannot go, for example down and left at the same time? Because if you do plan on allowing the player to do that you might run into new problems with the collision avoidance, just a heads up. (I did at least)
Offline tyeeeee1
« Reply #62 - Posted 2013-03-24 20:01:09 »

I was actually just thinking about allowing the player to move in that way; I'm going to attempt to get diagonal movement working in a moment. As far as I know, due to the way I've implemented collision detection, there shouldn't be any problems with moving diagonally.

Edit:
I managed to add diagonal movement but it ended up being a bit too awkward and buggy so I've decided to scrap that idea. It looked decent but having characters speed up when walking against walls along with a few other things made me have to give up on the idea for now.
The current way that characters move, in one direction only, will be, in the long run, easier for me, in my opinion, to code with when it comes to waypoints for NPCs.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline tyeeeee1
« Reply #63 - Posted 2013-03-27 19:41:30 »

There isn't too much to say in this update but it got me excited so I decided to post it anyway. ^.^ Over the past few days I managed to fix up the code a little bit and drastically improve the performance of the game by selectively rendering only the area within x number of tiles above, below and to the sides of the player; this gave me the idea to have infinitely sized maps or at least very-very large maps.
After a lot of trial and error trying to 'optimize' the code that loads the map.png image pixel-by-pixel into an int[][] array which I use to tell where to render certain tiles I finally came to the conclusion that there way no reason for it to be running as slowly as it was. After a few minutes of intense staring at the code that loads the map I decided to remove a single System.out.println(); statement; after that I tested the game and it loaded a 1,000,000 tile map within a second instead of three minutes or more.

Updates:
  • Selective Map Rendering
  • Can now handle maps of over 4,000,000 tiles. (Note: Never try loading a 1 billion tile map... Computer was frozen for awhile and then Java crashed)
Offline matheus23

JGO Kernel


Medals: 112
Projects: 3


You think about my Avatar right now!


« Reply #64 - Posted 2013-03-27 19:43:45 »

System.out.println(); statement; after that I tested the game and it loaded a 1,000,000 tile map within a second instead of three minutes or more.

Wohooow! Cheesy yeah, Java's console write is ridiculously slow... Cheesy

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline tyeeeee1
« Reply #65 - Posted 2013-03-27 19:47:38 »

I never thought that it would make a simple piece of code lag that horribly though, at least it's fixed now. ^.^
Offline HeroesGraveDev

JGO Kernel


Medals: 283
Projects: 11
Exp: 3 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #66 - Posted 2013-03-28 03:46:33 »

Got a name yet?

Offline tyeeeee1
« Reply #67 - Posted 2013-03-28 15:05:31 »

Got a name yet?

I have a few ideas but they all depend on what I decide to use as the story. The only name that I thought of that might work is Dreamscape; it is the name of a Warcraft 3 project that I was working on a few years ago, I was never able to finish it due to the limitations of the game but the story that we had brainstormed for it might just work for this RPG. Actually, now that I think about it, I will continue Dreamscape here.

Looks like the project does have a name now. ^.^
Offline tyeeeee1
« Reply #68 - Posted 2013-04-23 17:12:32 »

I haven't been working on this project too much but I've been thinking about how to do certain things that I plan to include. Although I haven't worked on it too much, I do have a small update:

  • Figured out how to render enemies onto the screen along with deciding when to render them and getting them to walk along waypoints.
  • Added an FPS and RAM used display for debugging and making sure that everything is running smoothly.
  • Attempted to rewrite certain parts of the code to allow for the window to be resized; it seems as if I'll need to do a major rewrite on the render method and on some calculation methods.
  • Rewrote many parts of the code to conform to the Java standards and to do some micro-optimization. I really need to stop micro-optimizing...

What I'll be doing next is probably figuring out how to load a whole map worth of NPCs and their data and update their positions and that instead of just one NPC. After that I'll probably attempt to rewrite a lot of the code to allow for a resizable window.
Offline tyeeeee1
« Reply #69 - Posted 2013-05-13 15:14:34 »

Here's another small update:

  • Finally discovered the movement bug that was overriding certain keys and fixed it pretty easily.
  • Discovered and fixed another bug where the player's walking animation would still play when it shouldn't have.
  • Deleted the entire NPC class; it was a huge trainwreck and I just couldn't bare to work on it. I'll be rewriting NPC movement and that over the next little while.
  • Photoshopped up two images as an example of how to use an interface later on. They're just two black images being rendered to the screen.

Here is the latest version of the program. There's still nothing to do other than walk around and that but I'll start working on some features after I get NPCs working somewhat decently.

http://www.java-gaming.org/user-generated-content/members/151044/sword-v2.jar
(Hopefully that link works...)
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline opiop65

JGO Kernel


Medals: 159
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #70 - Posted 2013-05-13 21:10:10 »

Its a nice start, but I noticed you are lacking the ability to move in more than one direction at the same time. For instance, when I hold D and W at the same time, I do not actually move up and to the right. Instead, the player completely stops moving. I don't entirely understand why that would happen unless you are seriously only letting one key be pressed at a time. If you are doing that, stop now please. You need to allow for more than one key press!

Offline tyeeeee1
« Reply #71 - Posted 2013-05-13 22:16:04 »

The collision code doesn't work with diagonal movement so you're only allowed to use one key at a time for now. I'll see about a fix later on though.

1  
2  
3  
4  
 if((KeyboardListener.isKeyPressed(KeyEvent.VK_W) && KeyboardListener.isKeyPressed(KeyEvent.VK_S) || KeyboardListener.isKeyPressed(KeyEvent.VK_UP) && KeyboardListener.isKeyPressed(KeyEvent.VK_DOWN)) || (KeyboardListener.isKeyPressed(KeyEvent.VK_W) && KeyboardListener.isKeyPressed(KeyEvent.VK_A) || KeyboardListener.isKeyPressed(KeyEvent.VK_UP) && KeyboardListener.isKeyPressed(KeyEvent.VK_LEFT)) || (KeyboardListener.isKeyPressed(KeyEvent.VK_W) && KeyboardListener.isKeyPressed(KeyEvent.VK_D) || KeyboardListener.isKeyPressed(KeyEvent.VK_UP) && KeyboardListener.isKeyPressed(KeyEvent.VK_RIGHT)) || (KeyboardListener.isKeyPressed(KeyEvent.VK_S) && KeyboardListener.isKeyPressed(KeyEvent.VK_A) || KeyboardListener.isKeyPressed(KeyEvent.VK_DOWN) && KeyboardListener.isKeyPressed(KeyEvent.VK_LEFT)) || (KeyboardListener.isKeyPressed(KeyEvent.VK_S) && KeyboardListener.isKeyPressed(KeyEvent.VK_D) || KeyboardListener.isKeyPressed(KeyEvent.VK_DOWN) && KeyboardListener.isKeyPressed(KeyEvent.VK_RIGHT)) || (KeyboardListener.isKeyPressed(KeyEvent.VK_A) && KeyboardListener.isKeyPressed(KeyEvent.VK_D) || KeyboardListener.isKeyPressed(KeyEvent.VK_LEFT) && KeyboardListener.isKeyPressed(KeyEvent.VK_RIGHT)))
        {
            isWalking = false;
        }


That's what's stopping you for now =P
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 138
Projects: 4
Exp: 3 years



« Reply #72 - Posted 2013-05-13 22:21:05 »

There isn't any reason for your collision code not to be working with diagonal movement...
Offline tyeeeee1
« Reply #73 - Posted 2013-05-14 00:08:33 »

There isn't any reason for your collision code not to be working with diagonal movement...

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
public boolean checkPointCollision(final int xPosition, final int yPosition)
    {
        final int[] temp = MiscellaniousCalculations.collisionDetection_GetXYPositionsOnMap(xPosition, yPosition);

        switch(currentMap[temp[0]][temp[1]])
        {
            case -16777216: //Black Map Border
            {
                return false;
            }
            case -14503604: //Stone Path
            {
                return false;
            }
            default:
            {
                return true;
            }
        }


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
 //This while statement checks 4 different points around the player's sprite, if any of them return false then the player's position is changed until they all return true.
        while(collision.checkPointCollision(playerXLocation - 12, playerYLocation + 22) == false /*LowerLeftPoint*/ || collision.checkPointCollision(playerXLocation + 12, playerYLocation + 22) == false /*Lower Right Point*/ || collision.checkPointCollision(playerXLocation - 12, playerYLocation) == false /*Middle Left Point*/ || collision.checkPointCollision(playerXLocation + 12, playerYLocation) == false /*Middle Right Point*/)
        {
            switch(playerDirection)
            {
                case 0:
                {
                    player.setXLocation(1);
                    playerXLocation++;
                    break;
                }
               
                case 1:
                {
                    player.setYLocation(1);
                    playerYLocation++;
                    break;
                }
                   
                case 2:
                {
                    player.setXLocation(-1);
                    playerXLocation--;
                    break;
                }
                   
                case 3:
                {
                    player.setYLocation(-1);
                    playerYLocation--;
                    break;
                }
            }
        }


Walk into the top-middle of a block while using diagonal movement and it'll place you on one of the sides of the block; or walk into the side of a block walking down-left, up-left, down-right or up-right and it'll move you either downwards or upwards very quickly.
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 138
Projects: 4
Exp: 3 years



« Reply #74 - Posted 2013-05-14 00:59:59 »

No, I mean, you really should fix that...really no rpg doesn't allow diagonal movement, unless maybe if it's turn based.
Offline tyeeeee1
« Reply #75 - Posted 2013-05-14 16:44:58 »

No, I mean, you really should fix that...really no rpg doesn't allow diagonal movement, unless maybe if it's turn based.

Ah, well it's been on my to-do list for a while. I think that it can be fixed with a few more if-else statements and a few checks. If everything goes as planned it should be fixed right before I finish this next part of the NPC class.

Edit:
O.o I guess my code rewrites actually helped a lot! ^.^ It only took me 10 minutes to get diagonal movement working perfectly. I was more-or-less avoiding adding diagonal movement because the first time I tried adding it, there were problems everywhere; at least it's done now.
Offline ctomni231

JGO Wizard


Medals: 99
Projects: 1
Exp: 7 years


Not a glitch. Just have a lil' pixelexia...


« Reply #76 - Posted 2013-05-14 22:18:17 »

No, I mean, you really should fix that...really no rpg doesn't allow diagonal movement, unless maybe if it's turn based.

Well, I think the GBA Pokemon series of RPG's don't allow diagonal movement. [/offtopic]

But, you should be able to handle multiple collision detection if you handle each axis of collision separately.

Offline tyeeeee1
« Reply #77 - Posted 2013-07-13 17:28:26 »

It's been about a month since my last update and now it's time for another update!

Since the last update I've watched all of the, at this time, 74 of TheCherno's tutorials and re-wrote the entire game. After watching his tutorials IO found out pretty quickly that the way I was doing many of the things was the worst way that I could have been doing them.

There's not too much to say other than that everything is now different and that I'm currently working on getting sound/music into the game and looking up how path finding works for mobs.

If anyone wants to check out the current, as of this posting, program you can find it here: http://www.mediafire.com/download/po1k69vl342o2ms/Sword_V3.jar
Pages: 1 2 [3]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xFryIx (58 views)
2014-11-13 12:34:49

digdugdiggy (37 views)
2014-11-12 21:11:50

digdugdiggy (30 views)
2014-11-12 21:10:15

digdugdiggy (26 views)
2014-11-12 21:09:33

kovacsa (48 views)
2014-11-07 19:57:14

TehJavaDev (51 views)
2014-11-03 22:04:50

BurntPizza (51 views)
2014-11-03 18:54:52

moogie (66 views)
2014-11-03 06:22:04

CopyableCougar4 (65 views)
2014-11-01 23:36:41

DarkCart (150 views)
2014-11-01 14:51:03
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!