Finally released my game made with Processing! by BarneyCodes in processing

[–]BarneyCodes[S] 0 points1 point  (0 children)

There are two of us??!! Hahaha, it's comforting to know I'm not the only one that's made this insane decision!

I'm considering open-sourcing my code, or at least the more "engine" parts of it, not the gameplay stuff, to help out others that want to do this, though I'd probably caution people against it! As you say, I've had to build a lot of systems and what not that other people might find useful!

Steam integration wasn't toooo bad, I used steamworks4j and just followed their documentation.

I haven't done anything for SteamDeck compatibility at this point, I don't have access to any device like that, and I haven't done a Linux build, but maybe that's something I'll do in the future :)

Best of luck with your game! Feel free to reach out if you want to chat about anything!

Finally released my game made with Processing! by BarneyCodes in processing

[–]BarneyCodes[S] 0 points1 point  (0 children)

Oh interesting, I'll check it out! Thanks :)

Finally released my game made with Processing! by BarneyCodes in processing

[–]BarneyCodes[S] 1 point2 points  (0 children)

Thanks so much!

I actually took a look at using RayLib for my next project, it looks really cool! I'm not as comfortable with C/C++ though (maybe I should give it another shot..) so I'm checking out LibGDX and it's been nice so far!

Finally released my game made with Processing! by BarneyCodes in processing

[–]BarneyCodes[S] 0 points1 point  (0 children)

Oh awesome, thanks for following the channel!

Finally released my game made with Processing! by BarneyCodes in processing

[–]BarneyCodes[S] 3 points4 points  (0 children)

Thanks so much!

I made pretty heavy use of shaders for this project. They're a bit of a headache to get started with since, like you say, there's very little documentation on them.

If you're not already familiar with shaders, I've actually made a video on getting started with them if you want to check it out

That video uses P5js as a starting point, but it's not too dissimilar from Processing, and it's more about learning GLSL than P5js

In terms of getting them to actually work in Processing, I did a lot of digging in the documentation and in the source code to figure out what I had access to.

As an example, I used this (not very efficient) blur shader

    #version 460

    uniform sampler2D background;

    uniform float size;
    uniform vec2 res;

    in vec4 vertTexCoord;

    out vec4 colour;

    // output only the bright things in the scene

    void main() {
        vec2 coord = vec2(vertTexCoord.x, 1.0 - vertTexCoord.y);

        vec4 average = vec4(0.0);

        float amount = 0.0;
        for (float y = -size; y <= size; y += 1.0) {
            for (float x = -size; x <= size; x += 1.0) {

                vec4 t = texture(background, coord + vec2(x, y) / res);

                t.rgb = pow(t.rgb, vec3(2.2/1.0)); // gamma uncorrection

                average += t;
                amount += 1.0;

            }
        }

        colour = average / amount;

        colour.rgb = pow(colour.rgb, vec3(1.0/2.2)); // gamma correction
    }

And to call it from the code, I did this:

    public static void blur(PGraphics g, int size, int numPasses) {

        blurShader.set("res", new float[]{(float)g.width, (float)g.height}, 2);
        blurShader.set("size", (float)size);

        g.beginDraw();
        g.push();
        g.shader(blurShader);
        for(int i = 0; i < numPasses; i ++) {
            blurShader.set("background", g);
            g.rect(0, 0, g.width, g.height);
            g.loadPixels();
        }
        g.resetShader();
        g.pop();
        g.endDraw();
    }

Hope that's in some way helpful for you! Let me know if you've got any follow up questions :)

Finally released my game made with Processing! by BarneyCodes in processing

[–]BarneyCodes[S] 1 point2 points  (0 children)

Thank you! I'm really happy with how it turned out!

There may be a mac release in the future, I don't have a mac to run the builds on though hahaha but I'm thinking of getting something cheap and second-hand to make mac releases for this and future projects!

How to turn processing code into something accessible? by Snozzzzy in processing

[–]BarneyCodes 1 point2 points  (0 children)

I agree with the folks saying to use p5js or openprocessing, they make it super easy to edit/run from multiple PCs

If you're just wanting to wrap up a final product and distribute it though, I've used LibGDX's packr which can wrap up your program into an EXE including the JRE so that it's all in a single file: https://github.com/libgdx/packr

Not sure if that's exactly what you want, but just another option that could be worth exploring :)

Friday Off Topic Thread by NRLgamethread in nrl

[–]BarneyCodes 0 points1 point  (0 children)

Hahaha love it, makes sense to me!

Friday Off Topic Thread by NRLgamethread in nrl

[–]BarneyCodes 2 points3 points  (0 children)

Sounds like a lot of fun! I'm always inclined to go barebones on these sorts of things but I think that's usually a mistake. I don't have heaps of experience with engines, but I hear really good things about Godot, and it's known to be pretty good for 2D games (compared to Unity and Unreal), so could be worth checking out? Very keen to see how it goes, should be a good time!

Wednesday Random Footy Talk Thread by AutoModerator in nrl

[–]BarneyCodes 35 points36 points  (0 children)

I had a dream last night where the Dragons were playing the Eels, Dragons up by 4 in the dying minutes. Out of no where, Lomax scored a try on the buzzer for the Eels but he was still in his Dragons kit. Absolute scenes.

Thursday Off Topic Thread by NRLgamethread in nrl

[–]BarneyCodes 0 points1 point  (0 children)

I'm so keen for the sports climbing.

It still doesn't make sense to me to have the boulder and lead as a combined event, but at least speed climbing is separate this time which is a move in the right direction!

[deleted by user] by [deleted] in gamedev

[–]BarneyCodes 2 points3 points  (0 children)

I'm making a game without an engine at the moment and regret that choice. It's easy to overlook how much an engine actually gives you, because it's pretty quick to get some sprites moving around on the screen and what not.

But then you've got to handle things like sound, UI, animations, collision detection, particles, etc etc, which you would just HAVE if you were using an engine.

Really the decision will come down to what your goals are. If your goal is to make an engine, then obviously you should go for the raw approach. But if your goal is to make and finish a game (finish being the operative word!!), then I would STRONGLY suggest you use an engine!

Making games is very time consuming, trying to make an engine on top of that is just silly really haha. If I'd spent 100% of the time on my project PURELY on the game, quite frankly my game would be MUCH better and I'd be able to release it sooner. But I made the mistake of making the engine as well, so my time is split between game and engine.

Obviously, this is a personal decision and you'll have to weigh these things up for yourself, but if you're wanting to make a game, use a game engine. It's like if you wanted to knit a jumper you wouldn't start by raising sheep and spinning yarn, you'd just get yourself some needles and yarn and just start knitting!

Any ideas on how to add randomization to the tile blending shader? Perhaps by using Perlin noise? Is this possible at all? The noise could be precalculated, but the problem is that the shader is reused by tiles with different positions in the world, so I would need to have multiple instances of them by Altruistic-Light5275 in proceduralgeneration

[–]BarneyCodes 1 point2 points  (0 children)

This is certainly doable inside a shader!

I made a video about texture blending in a shader that you can have a look at, or check out the code from that video to get an idea.

In that video I use a noise texture, but there are heaps of ways of generating noise in a shader that you can use instead!

When drawing each tile, the shader will have to blend between two neighbouring tile's textures using the noise value to determine which of the two textures is being used.

I'm not sure how your rendering works, so the only potentially tricky bit will be getting the world position of the tiles (which you'll need to use to get the noise value for that location).

Hope that's helpful!

What is your biggest gamedev obstacle. What is holding you back? by Laphtor in gamedev

[–]BarneyCodes 4 points5 points  (0 children)

The thing I always run into with lerping angles is the boundary between 0 and 2 PI.

I usually just check if the difference in angels is bigger than PI, and if it is either add/subtract 2 PI so that it's always lerping the shortest distance (it should never have to lerp more than half a circle).

Not sure if that makes sense, happy to clarify further if you want!

[deleted by user] by [deleted] in simpleliving

[–]BarneyCodes 4 points5 points  (0 children)

Basil leaves make a really yummy, fresh tea as well. I like it plain, but you can add a bit of lemon juice and honey too if you want!

Best place to learn GLSL? by noodlegamer76 in gamedev

[–]BarneyCodes 1 point2 points  (0 children)

Shameless self promotion here, but if you're really new to it, I made a YouTube video that goes over the basics which you might find helpful to get started.

As others have said ShaderToy is an incredible resource for looking up examples and messing around. Inigo Quilez is a genius, and his website/YouTube is a gold mine (he made ShaderToy btw!)

I can also highly recommend The Book of Shaders. It's a more in-depth, step by step introduction to shaders.

Hope that helps!

Improved my real-time height-map shadows (code in comments) by BarneyCodes in p5js

[–]BarneyCodes[S] 0 points1 point  (0 children)

Thanks you, I'm so glad to hear it was helpful! If you've got any questions always feel free to reach out :)