Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (732)
Games in Android Showcase (222)
games submitted by our members
Games in WIP (806)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2 3 ... 9
1  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-07-14 05:09:13
Took the advice of some crazy cowboy-hat guy from a GDC presentation video, and wrote a tool to make my life easier.
Sadly I couldn't find the video again, but he mentioned that he did a port for @princec so he might know who I'm talking about. (He seemed to like doing silly voices, idk if that helps) nvm I was thinking about someone else there

Anyways, I made a very bare-bones editor to create normal maps for png images:

2  Game Development / Newbie & Debugging Questions / Re: Switching Shaders - Painter's Algorithm on: 2017-05-11 21:35:49
thank you! very insightful
3  Game Development / Newbie & Debugging Questions / Switching Shaders - Painter's Algorithm on: 2017-05-10 22:23:36
Hello there,

I'm using libGdx but feel free to answer generally.

Let's say you have a 2D game where sprites are sorted by their y-coordinate, so sprites with a lower y-coordinate are "in the foreground" and get rendered over sprites with a higher y-coordinate. (assuming the y-coordinate is pointing upward)

Now let's say i want to render trees in two steps, first i render the stump and then the leaves on top of it with both of these sprites having their separate shaders (let's call it stumpShader and leaveShader). Now in a 3D environment this wouldn't be an issue: First i bind the stumpShader and render all the stumps, and then i bind the leaveShader and render all the leaves. Because of these neat thing called z-buffer i don't need to worry about my trees being rendered in a wrong "order".

But in a 2D environment where i just "paint" trees over other trees i do have to worry about that, because if i render all the stumps first, and then the leaves on the stumps, some leaves will be rendered over stumps that they should actually be behind of. So that way i'm forced to render stump, leaves, stump, leaves, stump, leaves.... and constantly switch between stumpShader and leaveShader.

As far as i know switching shaders is pretty costly and you should do it as sparingly as possible, so this is obviously not an option.

So my question is what do i do in this scenario?
Can i somehow utilize the z-buffer in this kind of 2D setup?
I guess i could write one shader that takes care of both things, but I've also heard that if statements should be avoided in glsl.

Thanks!
4  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-04-09 15:29:15
Trying my hands on some "special effects". This is the first iteration of water reflection.

Click to Play
5  Discussions / General Discussions / Re: New Year Resolutions -- 2017 on: 2016-12-24 19:28:55
Not really limited to 2017, but three things I want to accomplish in my life:

Release a game on Steam,
Publish a fantasy novel,
Join a band as the vocalist.

I think that's doable.
6  Discussions / Miscellaneous Topics / Re: What I drew today on: 2016-12-19 15:28:34
What I drew wrote today yesterday. ( i love writing poems c: )

Hey cool, do you have more stuff somewhere that I can check out? I like myself some poetry too.
7  Game Development / Newbie & Debugging Questions / Re: Issue With Collision Detection on: 2016-11-09 19:59:14
You clear the objects array after retrieving two objects (why?). Now objects.size() returns 0 and your for loops terminate.

edit: retrieving isn't the right word, get(i) just returns the object at index i without removing it from the array.
8  Games Center / WIP games, tools & toy projects / Re: Songs of Syx on: 2016-10-22 06:59:19
right, sorry. there ya go

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  
35  
22
Game version : 0.7

SYSTEM INFO
---Running on a: Windows 10, amd64 Platform.
---jre: 1.8.0_111
---Processors avalible: 4
---Reserved memory: 1900Mb
---Directory : C:\Users\Flo\Desktop\syx\res\
---Input Arguments :
---JRE Input Arguments :

Starting the Launcher....

Firing up an engine, v: 0.8

DISPLAY
---supported resolutions: 640x480, 640x480, 640x480, 640x480, 640x480, 720x480, 720x480, 720x480, 720x480, 720x480, 800x480, 800x480, 800x480, 800x480, 720x576, 720x576, 720x576, 720x576, 720x576, 800x600, 800x600, 800x600, 800x600, 1024x600, 1024x600, 1024x600, 1024x768, 1024x768, 1024x768, 1280x720, 1280x720, 1280x720, 1280x768, 1152x864, 1152x864, 1360x768, 1366x768, 1440x900, 1280x1024, 1280x1024, 1600x900, 1400x1050, 1680x1050, 1920x1080, 1920x1080, 1920x1080,
---current resolution: 960x480, RfrsRate: 75
---LWJGL: 3.0.0 build 90
---GLFW: 3.2.0 Win32 WGL EGL VisualC DLL
---23 supported video modes

OPEN_GL
---FB stencil Bits: 8
---FB depth Bits: 0
---FB Red Bits: 0
---FB Green Bits: 0
---FB Blue Bits: 0
---FB Alpha Bits: 0
---Version: 3.3.14008 Core Profile/Debug Context 21.19.137.1
---SL Version: 4.50
---glRenderer: ATI Technologies Inc., Radeon (TM) RX 480 Graphics

Core was sucessfully disposed
9  Games Center / WIP games, tools & toy projects / Re: Songs of Syx on: 2016-10-22 04:56:07
1  
2  
3  
4  
5  
6  
7  
java.lang.RuntimeException: GLerr: invalid enum
   at snake2d.GlHelper.checkErrors(GlHelper.java:60)
   at snake2d.GlHelper.<init>(GlHelper.java:44)
   at snake2d.GraphicContext.<init>(GraphicContext.java:179)
   at snake2d.CORE.create(CORE.java:51)
   at launcher.Launcher.start(Launcher.java:28)
   at main.Syx07.main(Syx07.java:31)
10  Game Development / Newbie & Debugging Questions / Re: Slick2D Top Down Control on: 2016-10-19 20:19:15
Glad I could help!
11  Game Development / Newbie & Debugging Questions / Re: Slick2D Top Down Control on: 2016-10-19 20:02:47
Okay friend, I got angry and used a list. But I think this is a pretty smart solution now. I just store they keys in the order they were pressed and always look at the last one. Again I can't test this, but I'll be damned if it doesn't work.

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  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
 boolean wKeyWasPressed, sKeyWasPressed, aKeyWasPressed, dKeyWasPressed = false;
    ArrayList<String> keyOrderList = new ArrayList<String>();

    private void determineKeyOrder() {
        if (!CoreGameState.inputHandler.isKeyDown(Input.KEY_W ) && wKeyWasPressed) {
            wKeyWasPressed = false;
            keyList.remove("W");
        }
        if (!CoreGameState.inputHandler.isKeyDown(Input.KEY_S ) && sKeyWasPressed) {
            sKeyWasPressed = false;
            keyList.remove("S");
        }
        if (!CoreGameState.inputHandler.isKeyDown(Input.KEY_A ) && aKeyWasPressed) {
            aKeyWasPressed = false;
            keyList.remove("A");
        }
        if (!CoreGameState.inputHandler.isKeyDown(Input.KEY_D ) && dKeyWasPressed) {
            dKeyWasPressed = false;
            keyList.remove("D");
        }

        if (CoreGameState.inputHandler.isKeyDown(Input.KEY_W ) && !wKeyWasPressed) {
            wKeyWasPressed = true;
            keyList.add("W");
        }
        if (CoreGameState.inputHandler.isKeyDown(Input.KEY_S ) && !sKeyWasPressed) {
            sKeyWasPressed = true;
            keyList.add("S");
        }
        if (CoreGameState.inputHandler.isKeyDown(Input.KEY_A ) && !aKeyWasPressed) {
            aKeyWasPressed = true;
            keyList.add("A");
        }
        if (CoreGameState.inputHandler.isKeyDown(Input.KEY_D ) && !dKeyWasPressed) {
            dKeyWasPressed = true;
            keyList.add("D");
        }
    }

    public void useControlls(){
        if (!(CoreGameState.inputHandler.isKeyDown(Input.KEY_W)) && !(CoreGameState.inputHandler.isKeyDown(Input.KEY_D)) && !(CoreGameState.inputHandler.isKeyDown(Input.KEY_A)) && !(CoreGameState.inputHandler.isKeyDown(Input.KEY_S))){
            pc.moving = false;
        }

        determineKeyOrder();
        String lastKey = keyOrderList.get(keyOrderList.size() - 1);

        if (CoreGameState.inputHandler.isKeyDown(Input.KEY_W) && lastKey.equals("W")) {
            pc.pDirection = PlayerDirections.North;
            if(!pc.checkCollisionNorth()){
                pc.y -= pc.maxSpeed;
                CoreGameState.inputHandler.clearKeyPressedRecord();
                pc.moving = true;
            }
        }
        else if (CoreGameState.inputHandler.isKeyDown(Input.KEY_S) && lastKey.equals("S")) {
            pc.pDirection = PlayerDirections.South;
            if(!pc.checkCollisionSouth()){
                pc.y += pc.maxSpeed;
                CoreGameState.inputHandler.clearKeyPressedRecord();
                pc.moving = true;
            }

        }
        else if (CoreGameState.inputHandler.isKeyDown(Input.KEY_A) && lastKey.equals("A")) {
            pc.pDirection = PlayerDirections.West;
            if(!pc.checkCollisionWest()){
                pc.x -= pc.maxSpeed;
                CoreGameState.inputHandler.clearKeyPressedRecord();
                pc.moving = true;
            }

        }
        else if (CoreGameState.inputHandler.isKeyDown(Input.KEY_D) && lastKey.equals("D")) {
            pc.pDirection = PlayerDirections.East;
            if(!pc.checkCollisionEast()){
                pc.x += pc.maxSpeed;
                CoreGameState.inputHandler.clearKeyPressedRecord();
                pc.moving = true;
            }

        }
    }


edit: removed the return in the first if statement of useControlls()
12  Game Development / Newbie & Debugging Questions / Re: Slick2D Top Down Control on: 2016-10-19 19:35:01
Just thought of a flaw with this... if you hold W, then press D and let go of D again, it still registers D as the last key pressed and will not move up.
So you'll also have to do a check to count a key as the "lastKey" if it's the only one that's pressed.

edit: aight wait a sec, let me think on this Cranky
13  Game Development / Newbie & Debugging Questions / Re: Slick2D Top Down Control on: 2016-10-19 19:28:05
Ah I see, I misunderstood you sorry.

I couldn't actually test this but I think it should have the desired effect.
Basically I have a lastKey variable that remembers the key that was pressed last, and only if the key was indeed pressed last will i move in that direction.
So if You were to press W and then D, it will recognize D as the latest one and move in that direction. If I let go of W and press it down again, it will move in that direction.

Hope that works, or at least gives you the right idea Smiley

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  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
boolean wKeyWasPressed, sKeyWasPressed, aKeyWasPressed, dKeyWasPressed = false;
    String lastKey = "";

    public void useControlls(){
        if (!(CoreGameState.inputHandler.isKeyDown(Input.KEY_W)) && !(CoreGameState.inputHandler.isKeyDown(Input.KEY_D)) && !(CoreGameState.inputHandler.isKeyDown(Input.KEY_A)) && !(CoreGameState.inputHandler.isKeyDown(Input.KEY_S))){
            pc.moving = false;
        }
       
        if (CoreGameState.inputHandler.isKeyDown(Input.KEY_W ) && !wKeyWasPressed) {
            wKeyWasPressed = true;
            lastKey = "W";
        }
        else if (!CoreGameState.inputHandler.isKeyDown(Input.KEY_W )) {
            wKeyWasPressed = false;
        }
       
        if (CoreGameState.inputHandler.isKeyDown(Input.KEY_S ) && !sKeyWasPressed) {
            sKeyWasPressed = true;
            lastKey = "S";
        }
        else if (!CoreGameState.inputHandler.isKeyDown(Input.KEY_S )) {
            sKeyWasPressed = false;
        }
       
        if (CoreGameState.inputHandler.isKeyDown(Input.KEY_A ) && !aKeyWasPressed) {
            aKeyWasPressed = true;
            lastKey = "A";
        }
        else if (!CoreGameState.inputHandler.isKeyDown(Input.KEY_A )) {
            aKeyWasPressed = false;
        }
       
        if (CoreGameState.inputHandler.isKeyDown(Input.KEY_D ) && !dKeyWasPressed) {
            dKeyWasPressed = true;
            lastKey = "D";
        }
        else if (!CoreGameState.inputHandler.isKeyDown(Input.KEY_D )) {
            dKeyWasPressed = false;
        }

        if (CoreGameState.inputHandler.isKeyDown(Input.KEY_W) && lastKey.equals("W")) {
            pc.pDirection = PlayerDirections.North;
            if(!pc.checkCollisionNorth()){
                pc.y -= pc.maxSpeed;
                CoreGameState.inputHandler.clearKeyPressedRecord();
                pc.moving = true;
            }
        }
        else if (CoreGameState.inputHandler.isKeyDown(Input.KEY_S) && lastKey.equals("S")) {
            pc.pDirection = PlayerDirections.South;
            if(!pc.checkCollisionSouth()){
                pc.y += pc.maxSpeed;
                CoreGameState.inputHandler.clearKeyPressedRecord();
                pc.moving = true;
            }

        }
        else if (CoreGameState.inputHandler.isKeyDown(Input.KEY_A) && lastKey.equals("A")) {
            pc.pDirection = PlayerDirections.West;
            if(!pc.checkCollisionWest()){
                pc.x -= pc.maxSpeed;
                CoreGameState.inputHandler.clearKeyPressedRecord();
                pc.moving = true;
            }

        }
        else if (CoreGameState.inputHandler.isKeyDown(Input.KEY_D) && lastKey.equals("D")) {
            pc.pDirection = PlayerDirections.East;
            if(!pc.checkCollisionEast()){
                pc.x += pc.maxSpeed;
                CoreGameState.inputHandler.clearKeyPressedRecord();
                pc.moving = true;
            }

        }
    }
14  Game Development / Newbie & Debugging Questions / Re: Slick2D Top Down Control on: 2016-10-19 19:00:16
Why not turn all the "else if" statements into just "if" statements. If you have "else if" statements I'd assume that only one of these conditions can be true, which is not the case for you. Multiple of these keys can be pressed at the same time, and not just one.
15  Discussions / General Discussions / Re: Ludum Dare 36 on: 2016-08-29 22:29:25
Finished! Ha! Beat the whole forum ._.

The king is an imbecile. Very realistic game!

16  Games Center / WIP games, tools & toy projects / Re: A Space To Bloom - Free 4X Strategy Game on: 2016-08-25 14:58:23
Thank you. And wow there's a lot of stuff in there, I'm impressed!

It's great that you made a tutorial because I would have been completely lost without it, but the problem is I was still kinda lost. It's a great start but I think you have to go a bit more into detail with your explanations. For example you wrote something like "Don't forget to select a model for you building before you can place it" without actually explaining how to do that. Took me a while to figure out that I had to click on the little rectangle in the bottom right of the building selection.

Also what confused me a lot is that i have no idea what the buildings I'm placing actually do. Clicking on them doesn't do anything so how do I figure out what they are good for?

Besides the fact that it's a little overwhelming because there is so much stuff in your game, I think this has a lot of potential! Especially that you can design your own buildings is a pretty cool idea.
17  Games Center / WIP games, tools & toy projects / Re: A Space To Bloom - Free 4X Strategy Game on: 2016-08-24 23:12:40
Your project seems pretty impressive and I'm sure a lot of people would love to take a look at it, but you are salting your own soup with those ad-fly links.
18  Games Center / WIP games, tools & toy projects / Re: Tramantula Rising on: 2016-08-02 12:43:06
I'm sure it wont get greenlit, but I already paid the $100 submission fee so I'm submitting as many games as possible to there.

This could really hurt you in the long run. If you have a reputation of uploading ridiculous games people might not take you seriously when you try to upload an actually polished game in the future. Just a thought.
19  Java Game APIs & Engines / Engines, Libraries and Tools / Re: LibZ - 2D Java Game Library on: 2016-07-27 15:41:53
Do you mind showing off some projects that have been created with your library? The "Games build with LibZ" link in your documentation leads to a 404
20  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Is it a good idea to make your own library to write less code in the future? on: 2016-07-21 21:15:22
I also use libGdx and when I have abandoned yet another game and start anew, I find myself copying half the code of the old game to the new one. It's not a bad idea to build yourself a library of reusable code. It's common practice.
21  Games Center / WIP games, tools & toy projects / Re: Questica -- Another Gosh Darn Pixel Game on: 2016-07-20 20:40:35
Yeah. Okay. Sure. Why don't you make a game in pixel art that looks absolutely stunning. But that's just not enough right? Here's a wild idea: Why don't you make it in M S  P A I N T

I quit.
22  Java Game APIs & Engines / Java 2D / Re: Changing the hue of an image on: 2016-07-04 10:14:42
Alternatively, if looping through the pixels is too slow for you (it was for me) and you are somewhat experienced with shaders: Here's one I've pieced together at the very bottom that does just that. Also changes the brightness.
23  Discussions / Miscellaneous Topics / Re: Is it possible to get sued by Donald Trump if..... on: 2016-06-24 19:53:13
In my game I have the words "Make Great America Again!" in the Main menu?

<a href="http://www.youtube.com/v/hk2wuT9GW3Y?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/hk2wuT9GW3Y?version=3&amp;hl=en_US&amp;start=</a>

I think you're golden.
24  Discussions / General Discussions / Re: Virtual Reality on: 2016-03-23 17:05:15
The novelty will rapidly wear off and then the inconvenience, pomp and ceremony will become a chore and the whole thing will be put into a cupboard and gather dust, and in the meantime the number of people creating content for VR will shrink drastically when it turns out there's better ways to spend money on development.

So you might aswell jump the bandwagon now and get all the new and shiny things while the "golden age" of VR still lasts  Wink
25  Discussions / General Discussions / Re: Virtual Reality on: 2016-03-23 16:13:49
I think a strategy top-down kind of game could also work really well for VR. All these little fellas running about at your command while you gaze at them from the sky like the god you are.

Has the added benefit that it's probably less nausea-inducing than 1st person and might be more suitable for most people. But yeah, 1st person has the bigger market for sure.
26  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-03-04 22:36:05
Thank you! That is very encouraging  Smiley
27  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-03-04 19:27:11
Today was the deadline of my GameDev class in uni. We pretty much had months to develop a game. 3 days ago we (me + 2) started piecing together a multiplayer card game with Unity and we actually made it in time. Five months of university and i can still barely spell time management...

Turns out Unity is pretty great if you want fast results. The interface is also pretty nifty, and if you finally wrapped your head around how they chose to do things it's pretty fun to use.
That said, it did hurt my 'programmer's pride' a little to fill in text fields and drag around components. I think I'll stick to just code if I have the option to.

Also worked up the courage to put my amateur vocals on the internet for public listening. Wrote the lyrics myself. If you are a fan of piano, Attack on Titan, and.. amateur singing.. you might just like it.

Creative week!
28  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-01-29 17:38:10
@Gjallar I hope you went anyway!

I did not Sad
180 minute traveltime for a 30minute talk is a bit much.
29  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-01-29 10:30:01
Mario Zechner aka @badlogicgames aka the godfather of libGDX is giving a talk for the Global Game Jam at my university today.
While I really want to attend this, i also just finished my last week of exams and want to do nothing else but play video games all day.

Sorry Mario, I choose videogames over you. I'm sure you understand.
30  Game Development / Newbie & Debugging Questions / Re: OpenGl Mesh Flickering/Broken Lines Between Vertices on: 2015-12-15 16:49:10
...And what theagendd is talking about is decreasing the size of your perspective fustrum...
...The fustrum is going to be really big and the values in the "Depth component" (Z Buffer) of the image will be skewed because of inaccuracies. The box is only taking up an extremely small part of that fustrum, which means part of the box will fight with the other part for who will be drawn.

You can fix this by shortening your fustrum...

Do you know how sometimes you discover that you've gone all your life misspelling a certain word and thinking it's correct? Sure has happened to me a couple of times. Also, it's frustum.
Pages: [1] 2 3 ... 9
 
Sralse (14 views)
2017-07-25 17:13:48

Archive (413 views)
2017-04-27 17:45:51

buddyBro (594 views)
2017-04-05 03:38:00

CopyableCougar4 (1056 views)
2017-03-24 15:39:42

theagentd (1087 views)
2017-03-24 15:32:08

Rule (1058 views)
2017-03-19 12:43:22

Rule (1043 views)
2017-03-19 12:42:17

Rule (1035 views)
2017-03-19 12:36:21

theagentd (1176 views)
2017-03-16 05:07:07

theagentd (1133 views)
2017-03-15 22:37:06
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
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!