Barney Codes
Barney Codes
  • 46
  • 790 596
Star Mining Co. Devlog - New Drop Ship System
WISHLIST Star Mining Co. on Steam (and join the playtest!):
s.team/a/2584800/
Support the development:
www.youtube.com/@BarneyCodes/join
Join the discord!
discord.gg/Qnc3jWTeEW
Chapters:
0:00 The idea
0:39 Friday
5:20 Saturday
9:04 Sunday
Follow along a weekend of game dev as a hobbyist! It can be a challenge to fit development in around work and life, but if you can make it work it's a lot of fun!
This video shows the process of me adding a new "drop ship" feature into my game Star Mining Co.
In Star Mining Co. you go from asteroid to asteroid mining for valuable resources that let you upgrade your super drill. The drop ship now lets you choose where on the asteroid you want to land and sets the location you have to return to before your oxygen runs out. Will you make it bake in time?
Follow me:
Twitter: barney_codes
Reddit: www.reddit.com/user/BarneyCodes/
#indiedev #gamedev #devlog
zhlédnutí: 1 569

Video

Real-time 2D shadows | HUGE improvements!
zhlédnutí 38KPřed 2 měsíci
40% off CodeCrafters membership: app.codecrafters.io/join?via=BarneyCodes Become a member: www.youtube.com/@BarneyCodes/join Join the discord: discord.gg/Qnc3jWTeEW Code from the video: editor.p5js.org/BarneyCodes/sketches/oZaRiBI5j Wishlist Star Mining Co. on Steam and join the play test: s.team/a/2584800/ Original reddit post: www.reddit.com/r/generative/comments/xz7tlf/comparison_with_and_wi...
Making my game more replayable (devlog)
zhlédnutí 1,4KPřed 3 měsíci
WISHLIST Star Mining Co. on Steam (and join the playtest!): s.team/a/2584800/ Become a member! www.youtube.com/@BarneyCodes/join Join the discord! discord.gg/Qnc3jWTeEW Chapters: 0:00 Replayability 0:43 Air tank 1:29 Drill setup overhaul 4:20 Asteroid types 5:34 Randomised parts 6:43 Initial parts 6:55 Tutorial 7:16 Playtest Replayability is a really important part of any game, but especially s...
Fixing the REALTIME terrain shadows using YOUR suggestions!
zhlédnutí 70KPřed 5 měsíci
Become a member! www.youtube.com/@BarneyCodes/join Join the discord! discord.gg/Qnc3jWTeEW Code from this video: editor.p5js.org/BarneyCodes/sketches/rEmwEye8F Chapters: 0:00 Recap on shadows 1:00 Fixing the broken shadows 1:39 Mipmap quad tree 2:51 Vertical distance based step size 3:55 Fixing the speckles with texture sampling 5:30 Normal mapping 7:04 Visual upgrades In a previous video I mad...
Completely overhauling my game
zhlédnutí 2,5KPřed 5 měsíci
WISHLIST Star Mining Co. on STEAM: store.steampowered.com/app/2584800/Star_Mining_Co/ Become a member! www.youtube.com/@BarneyCodes/join Join the discord! discord.gg/Qnc3jWTeEW Follow me: Twitter: barney_codes Reddit: www.reddit.com/user/BarneyCodes/ Chapters: 0:00 Why it sucked 1:48 THE DRILL 2:56 Lessons learned 3:49 Other updates 5:27 Wishlist NOW! I'd originally intended my game...
Realtime shadow casting on 2D terrain
zhlédnutí 115KPřed 7 měsíci
Become a member! www.youtube.com/@BarneyCodes/join Join the discord! discord.gg/Qnc3jWTeEW Original reddit post: www.reddit.com/r/generative/comments/xz7tlf/comparison_with_and_without_raytracing_for_my_2d/ Code from the video: editor.p5js.org/BarneyCodes/sketches/brfZ0NNpZ Chapters: 0:00 Intro 0:37 Height maps 1:03 Generating the terrain 1:50 Shadows 3:37 Limitations 4:16 Next steps Shadows ha...
Adding buffs, upgrades & more to my space mining game
zhlédnutí 2,4KPřed 7 měsíci
WISHLIST Star Mining Co. on STEAM: store.steampowered.com/app/2584800/Star_Mining_Co/ Become a member! www.youtube.com/@BarneyCodes/join Join the discord! discord.gg/Qnc3jWTeEW Chapters: 0:00 Your suggestion for asteroid generation 0:53 Buffs & debuffs 2:01 Building your deck 3:07 The gameplay loop 4:11 Getting your input! Space Mining Co. is a rogue-like deck-builder where you blast your way t...
Using noise in shaders (texture blending)
zhlédnutí 9KPřed 8 měsíci
0:00 Intro 0:30 What is noise? 1:48 Setup 3:23 Vertex Shader 3:50 Reading textures 4:27 Blending with mix 5:01 Reading noise values 5:39 Controlling the noise 7:07 Scaling the noise 7:58 Conclusion Code from this video: editor.p5js.org/BarneyCodes/sketches/PYGTrBHTW Introduction to shaders: czcams.com/video/3mfvZ-mdtZQ/video.html Examples used: “Base warp fBM” by trinketMage: www.shadertoy.com/...
Fixing the asteroid generation in my space mining game
zhlédnutí 8KPřed 10 měsíci
WISHLIST Star Mining Co. on STEAM: store.steampowered.com/app/2584800/Star_Mining_Co/ Minecraft terrain generation video: czcams.com/video/ob3VwY4JyzE/video.html In this video I go over the techniques I've used to generate the asteroids in my space mining game. I use Voronoi cells to create clumps of basic materials, and then use remapped perlin noise to carve tunnels into the asteroids. Origin...
Can You Make a Game with P5js? Fractal Finder Devlog
zhlédnutí 7KPřed 10 měsíci
Play Fractal Finder right now: barneycodes.itch.io/fractal-finder P5js is a really great creative coding library for JavaScript, which I use a lot in my videos. Is it possible to make a game with P5js and upload it to itch? Absolutely, but is it a good idea? That's a bit more complicated. Join me in this devlog as I take you on the journey of developing, and publishing my P5js JavaScript game "...
Introduction to shaders: Learn the basics!
zhlédnutí 298KPřed 11 měsíci
0:00 Intro 1:24 What is a shader? 3:37 Setting up shaders in P5js 5:58 GLSL data types 7:00 Vectors 8:58 Attributes, Uniforms and Varying 10:19 Barebones fragment shader 11:00 Vertex shader 14:57 Fragment shader revisited 15:30 Gradients 16:45 FragCoord tangent 18:28 Mix function 21:22 Setting uniforms 22:43 Uniform images (sampler2D) 24:58 p5.filterShader 25:12 Uniform arrays 27:05 Circles and...
Fullscreen Shader Effects with the p5.filterShader Library
zhlédnutí 2,1KPřed rokem
p5.filterShader GitHub: github.com/BarneyWhiteman/p5.filterShader p5js Reference: Shader Object: p5js.org/reference/#/p5.Shader Existing Filter Function: p5js.org/reference/#/p5.Image/filter Examples: Greyscale Filter: editor.p5js.org/BarneyCodes/sketches/SGaANoXS2 Posterise Filter: editor.p5js.org/BarneyCodes/sketches/xfVcdKmtM All Examples: editor.p5js.org/BarneyCodes/collections/qwCiTya1e In...
Easy Generative Art and Scanner Effect with JavaScript + P5js
zhlédnutí 1,5KPřed rokem
Code from video: editor.p5js.org/BarneyCodes/sketches/SHWPGoc-V Online P5js editor: editor.p5js.org In this video I show you how to code some simple generative art using perlin noise as well as an awesome looking "scanner" effect (I have no idea what to call it, please help!). The concepts in this video will help you to create your own amazing generative art pieces and help you along in your cr...
How to make the Stacker Game in JavaScript + P5js
zhlédnutí 1,6KPřed rokem
Code from video: editor.p5js.org/BarneyCodes/sketches/DHuoT1QDE Stacker is an iconic game and you can make it yourself! In this video you can follow along as I make stacker using JavaScript and P5js. You'll learn how to make the blocks move, how to use keyboard interaction to place the blocks, how to set up menu screens, the whole lot! Follow me: Support the channel: www.youtube.com/@BarneyCode...
Caves Generation that ANYONE can do! (Cellular automata caves in P5js)
zhlédnutí 3,3KPřed rokem
Rogue Basin Article: www.roguebasin.com/index.php/Cellular_Automata_Method_for_Generating_Random_Cave-Like_Levels Code from video: editor.p5js.org/BarneyCodes/sketches/_N3elxySa Procedural Terrain Generation can sound incredible daunting and the scary name can put you off, but I promise that anyone can make these caves! This method uses cellular automata to turn random noise into lovely looking...
Animating Procedural Plant Growth (L System Lerp)
zhlédnutí 5KPřed rokem
Animating Procedural Plant Growth (L System Lerp)
Infinite Snowflakes: The Basics of Random Generation with P5js
zhlédnutí 1,5KPřed rokem
Infinite Snowflakes: The Basics of Random Generation with P5js
Mandelbrot in Real-Time: Fractal Shaders with P5js
zhlédnutí 3,8KPřed rokem
Mandelbrot in Real-Time: Fractal Shaders with P5js
Fixing The Coding Train’s Code (Water Ripple Shader)
zhlédnutí 11KPřed rokem
Fixing The Coding Train’s Code (Water Ripple Shader)
How to Code a 4D World from Scratch with P5js
zhlédnutí 5KPřed rokem
How to Code a 4D World from Scratch with P5js
Infinite Plant Generation with Random L Systems Rules
zhlédnutí 4KPřed rokem
Infinite Plant Generation with Random L Systems Rules
Making Cellular Automata Run MUCH Faster (Game of Life)
zhlédnutí 11KPřed rokem
Making Cellular Automata Run MUCH Faster (Game of Life)
Using shaders for terrain destruction?
zhlédnutí 1,3KPřed rokem
Using shaders for terrain destruction?
Simulating Water Colour Paint in P5js
zhlédnutí 3,5KPřed rokem
Simulating Water Colour Paint in P5js
Beginner's Guide: Make things move with keyboard input in P5js
zhlédnutí 4,4KPřed rokem
Beginner's Guide: Make things move with keyboard input in P5js
Chromatic Aberration Glitch Shader in P5js
zhlédnutí 8KPřed rokem
Chromatic Aberration Glitch Shader in P5js
Scratch Off/Cut Out Effect (Using Layers in P5js)
zhlédnutí 2,3KPřed rokem
Scratch Off/Cut Out Effect (Using Layers in P5js)
Star Field Hyperdrive Light Speed Effect
zhlédnutí 4,5KPřed rokem
Star Field Hyperdrive Light Speed Effect
Beginner's Guide: How to Click and Drag Objects in Your P5js Sketch
zhlédnutí 8KPřed rokem
Beginner's Guide: How to Click and Drag Objects in Your P5js Sketch
Complex Patterns From SIMPLE Maths
zhlédnutí 2KPřed rokem
Complex Patterns From SIMPLE Maths

Komentáře

  • @DynestiGTI
    @DynestiGTI Před dnem

    I’ve started learning to use OpenGL on LearnOpenGL and it’s been a really difficult and uphill battle, so videos like this are a godsend. Apparently WebGPU is faster and newer than WebGL but it might be harder to use since I think it’s implemented in Vulkan? I assume it would be better to learn WebGPU rather than WebGL, would the implementation be similar to what was done in this video or would it be a bit harder?

    • @BarneyCodes
      @BarneyCodes Před 45 minutami

      Glad you found the video helpful! My understanding is that WebGPU has it's own shading language (it's called WGSL I think?), where as many different frameworks use GLSL (WebGL, OpenGL, Vulkan), which is why I focussed on GLSL here. I guess if you're explicitly wanting to make high-performance stuff for the web, then it would make sense to learn WebGPU. I haven't had a proper look at WebGPU yet, but I would imagine a lot of the core concepts would translate over, just with a slightly different syntax? Let me know how you get on!

  • @Veptis
    @Veptis Před 7 dny

    You said that there is no GPU debuggers - but that's not true. There is software like RenderDoc which lets you inspect all stages of the render pipeline. Down to the GPU assembly and step a single pixel value. It also works with any program. So you can dissect games and figure out how some Fragment shaders work and reproduce it. Not quite sure how legal that is - but it's really powerful.

    • @BarneyCodes
      @BarneyCodes Před 4 dny

      Good shout! I've only recently come across RenderDoc, but it should be very helpful in the future!

  • @lainleaflet
    @lainleaflet Před 14 dny

    hello again! I'm trying to expand on this code by having multiple sets of "tentacles" appear on the screen guided by a mouse click and its position. the best i've gotten is to move the "points = [];" line within the if (point.rad <1){...} statement. however, a current issue i'm having is that once one set is complete, all other sets pause. would you have any guide on how to make each set completion independent of each other?

    • @BarneyCodes
      @BarneyCodes Před 11 dny

      Hi! Sounds like a fun project! My first thought would probably be to create a class which would handle a single set of tentacles, called something like TentacleManager (or maybe octopus? ha!). Each instance of the manager class would have it's own set of points, so one tentacle burst finishing doesn't interfere with any other. You would then have a global array of the managers, instead of single points, and when a manager has finished (you'll need some function on the manager to check for this!), you can remove it from the array of managers. And when you click, you can adda a new manager! I hope that makes sense, let me know if you've got any questions!

  • @bababavasadadada9441
    @bababavasadadada9441 Před 19 dny

    Could u do a video about diferent flow fields, i saw some cool stuff but im not sure how they do it, like spirals/flowing around a point, my guess is that some 3D noise or function is used

    • @BarneyCodes
      @BarneyCodes Před 18 dny

      Sounds really interesting, I'd love to see some examples! (might be easiest to share in my discord?) Using 3D noise for flow fields seems like a really interesting idea, might have to explore that! Thanks for the comment!

    • @bababavasadadada9441
      @bababavasadadada9441 Před 18 dny

      @@BarneyCodes hey barney, the only examples i found where: czcams.com/video/PHySrgK7sj0/video.htmlfeature=shared And a demo of "generative garden" channel By 3D i meant using time to change the flow fields angles, i saw it on a video about "steering behaviours" of the coding train.

  • @beidero
    @beidero Před 21 dnem

    Man watching your videos I feel the amount of work that went into them, particularly the visualizations .

    • @BarneyCodes
      @BarneyCodes Před 20 dny

      Haha yea they can take a bit of time but I think they help get the point across better than my words would on their own! (Hopefully!)

  • @MoonLight-eh7ok
    @MoonLight-eh7ok Před 22 dny

    Does it also work if the stamp is a gif with transparent background?

    • @BarneyCodes
      @BarneyCodes Před 22 dny

      This is a great question, and I don't actually know the answer! I've never tried using a gif in P5js. I'd encourage you to try it out and see how you go (and report back afterwards because I'm curious!!)

  • @weicco
    @weicco Před 22 dny

    They are not broken shadows. They are photons interacting with each others creating distortion. So it is not a bug, it is a feature :)

    • @BarneyCodes
      @BarneyCodes Před 22 dny

      Absolutely, it's actually the double slit experiment but the slits are so small you can't see them hahaha

  • @Khazam1992
    @Khazam1992 Před 23 dny

    Cool, thank you very much.

  • @yashbhatt4498
    @yashbhatt4498 Před 23 dny

    why js 😭😭😭

    • @BarneyCodes
      @BarneyCodes Před 23 dny

      I chose JS so that people can just run the examples in their browser without having to download anything or set any environments up! But the CPU language choice is pretty much irrelevant because the GPU code (which is the main topic of the video) will be the same whether you're using JS, C, Java, C++ or whatever else you want! Definitely use whatever is most comfortable for you!

  • @theseangle
    @theseangle Před 25 dny

    32:57 or you could just use bitwise OR instead of the step(0., A + B). As for the multiplication you could also use bitwise AND instead: color &= d

    • @BarneyCodes
      @BarneyCodes Před 25 dny

      Great point! Older versions of WebGL/GLSL ES don't support bitwise operations so it slipped my mind, but if you're using a version that supports them, they are incredibly powerful! Thanks for the comment :)

    • @theseangle
      @theseangle Před 25 dny

      @@BarneyCodes np, great video! You're doing the god's work with these videos. There's unbelievably small amount of content on graphics programming for beginners

    • @BarneyCodes
      @BarneyCodes Před 25 dny

      Thanks so much, I really appreciate it! I'm trying to fill that gap as best I can haha

  • @kinsukaweerasooriya2933

    this is pure gold for me ❤

  • @lainleaflet
    @lainleaflet Před 29 dny

    hi! i'm a beginner to p5.js and currently trying to have the particles shift colors (like a rainbow or gradient) as they move in the flow field--would you have any guide or tips on that?

    • @BarneyCodes
      @BarneyCodes Před 28 dny

      Hi! So glad to hear you're giving P5 a go, it's a lot of fun! And this is a great question! If you want to do anything with rainbow colours, your best bet is to probably use the HSB colour mode (p5js.org/reference/#/p5/colorMode). You're probably familiar with the RGB colour mode, where you specify how much Red, Green, and Blue you want in a pixel, but that makes it very hard to cycle through the rainbow. HSB stands for Hue, Saturation, and Brightness. Saturation is how much colour is present (no saturation will be greyscale, full saturation will be coloured) and brightness is how dark/light the colour is. The magic happens with the hue value, which dictates which colour you want, so if you increment the hue value you will get all the colours of the rainbow! So once you've got P5 running in HSB colour mode, you'll be able to set the colour of the particle just before it's drawn in the draw() function, just before the point(p.x, p.y) line. Since it's drawn using the point function, you'll want to use the stroke function to set the colour, using a hue, saturation and brightness value. To get started, you could try using the particles x coordinate to set the hue (you might want to look at the map function for an easy way to do this! p5js.org/reference/#/p5/map), but once you've got that figured out, you can use whatever you want to choose the position in the rainbow! I hope that helps, and I hope you have heaps of fun on your P5 journey! If you've got any more questions, please don't hesitate to ask!

    • @lainleaflet
      @lainleaflet Před 28 dny

      @@BarneyCodes thank you so much for the reply! i'll be sure to check this out!

  • @omari6108
    @omari6108 Před 29 dny

    This is amazingly helpful. I’ve been having hell of a frustrating time with OpenGL, and this can aid in my woes 😁 In following along, you’re passing pos in the shaders. Where is the value of it coming from? I do understand what’s going on, but having that bit of info known helps. Am I missing it somewhere?

    • @BarneyCodes
      @BarneyCodes Před 29 dny

      Glad you've found it helpful so far! I think I glossed over that in the video a bit. Basically the position value is being set in the vertex shader and is then passed through to the fragment shader (this is why the variable name in the vertex and fragment shaders have to match, because they're being used to pass the value across!) When sending geometry to the GPU to render, you have to specify the position of the vertices, but you can also specify the "UV" coordinates, which are basically the coordinates you'd like that vertex to use when looking up a texture, and this is the value I'm using to set the position variable in the vertex shader. How you set the UV coordinates from your CPU code will depend on what environment you're using, for P5js, they're set automatically! Since the UV/texture coordinate is per vertex, they get set as an attribute, which is only available in the vertex shader, which is why we need to set up the varying variable to pass the value into the fragment shader. I hope that makes sense, it's a bit of a rambling answer! If you've got any follow up questions, please just ask :)

  • @That_0ne_Dev
    @That_0ne_Dev Před měsícem

    The fact that this is just a 2D image with shaders ontop of it amazes me

    • @BarneyCodes
      @BarneyCodes Před měsícem

      It still amazes me too! Not sure how practical it is given how good 3D graphics are these days though hahaha

    • @That_0ne_Dev
      @That_0ne_Dev Před měsícem

      @@BarneyCodes even if it's just used as a showcase project it's still massively impressive

    • @BarneyCodes
      @BarneyCodes Před měsícem

      Thanks so much! :)

  • @nozome-jin
    @nozome-jin Před měsícem

    Greatly appreciated. This video helped me

    • @BarneyCodes
      @BarneyCodes Před měsícem

      That's great! Glad you found it useful!

  • @CoderDBF
    @CoderDBF Před měsícem

    You lost me at the 4 minute mark. Why do you use WebGL en JS?! Show me how to do it in C please, this video is useless.

    • @BarneyCodes
      @BarneyCodes Před měsícem

      This video is more about writing shaders themselves, not setting up the environment to run them in (The GLSL code running on the GPU will be the same whether the CPU is running WebGL in JS or OpenGL in C!). I chose to use WebGL and JS because it's really easy to share with people online and lets people try it out without having to set up a local dev environment just to run some example code. If you do want to use OpenGL and C, there are many tutorials online that will teach you how to set that up, and then you can watch the rest of this video to learn how to write the shaders you'll need I hope that helps!

  • @gutzimmumdo4910
    @gutzimmumdo4910 Před měsícem

    perfectly explained thank you

    • @BarneyCodes
      @BarneyCodes Před měsícem

      No problem, glad you found it useful!

  • @shauas4224
    @shauas4224 Před měsícem

    One of the best videos on practical applications of L systems for procedural plant generation on yt

    • @BarneyCodes
      @BarneyCodes Před měsícem

      Thank you! I think L systems are awesome, but there really doesn't seem to be much out there beyond the basics. Definitely something I'd like to keep working on in the future!

  • @xKond3i
    @xKond3i Před měsícem

    Really well structured video and easly explained subject. Keep up the good work! 😉

  • @johnyeap7133
    @johnyeap7133 Před měsícem

    starts 10:24

  • @HipToBeeSquare
    @HipToBeeSquare Před měsícem

    Demystifies a lot of the syntax that kinda stumped me while giving a cursory glance :)

  • @noemiklimpel5691
    @noemiklimpel5691 Před měsícem

    This was f*ing awesome

  • @moonhowler667
    @moonhowler667 Před měsícem

    Colors can be stored directly as a range of 0-1 per channel.

    • @BarneyCodes
      @BarneyCodes Před 18 dny

      This is true! But as I found out, each colour channel only gets 1 byte of data (256 values), so you can't get much precision out of them, which is what was causing the weird speckles! I tried to get around this by using all 4 bytes of the colour channel to store the value, to give more precision but turns out I did it in a silly way haha There are methods for setting up textures to use the channels in different ways, but P5js doesn't really expose these to the user. Definitely worth looking into if you're interested though!

  • @JacksonMurphyhaha
    @JacksonMurphyhaha Před měsícem

    This style of devlog is extremely watchable and I want more... Hopefully the views catch up to the quality and makes it worth doing more like this.

    • @BarneyCodes
      @BarneyCodes Před měsícem

      Thanks so much, that's very kind! At the moment I'm focusing more on development than filming but I definitely plan on doing more like this in the future! Thanks again for the comment :)

  • @LBCreateSpace
    @LBCreateSpace Před měsícem

    Awesome video Ty!

  • @butchcassidy1717
    @butchcassidy1717 Před měsícem

    link in the description for the data types is broken, its missing the closing ")". It appears to be text after the link

    • @BarneyCodes
      @BarneyCodes Před měsícem

      Thanks for catching that! I've hopefully fixed that up now :)

  • @mycollegeshirt
    @mycollegeshirt Před měsícem

    that was great!

  • @kinershah464
    @kinershah464 Před měsícem

    Voronoi looks nice. But maybe if can you make it move? Like shift slightly up, center and slightly down. It can be a vertex shader I think, sine function may work.

  • @aaronrockwell4576
    @aaronrockwell4576 Před měsícem

    Where the water depth is nearing 0, it should have waves cresting.

  • @elektro860
    @elektro860 Před měsícem

    If you could scale up the map it would definitely be a pretty good ground work for a naval strategy game

  • @jupiterbjy
    @jupiterbjy Před měsícem

    amazing work, looks drastically better!

  • @Kestrel_
    @Kestrel_ Před měsícem

    idk how it would look, but perhaps terrain smoothing based on altitude would look nice? the beaches would look less bumpy and the mountains could be made to look sharper

  • @lydiapellow1896
    @lydiapellow1896 Před měsícem

    I am familiar with java, but not Processing. Do you have any videos on getting it set up? I love your projects.

    • @BarneyCodes
      @BarneyCodes Před měsícem

      If you're just getting started with it, you really can't beat Dan Shiffman's videos here on CZcams (the channel is called 'The Coding Train'), he's got heaps of videos on using Processing so it's an excellent place to start. Otherwise, the documentation is decent enough that you can probably just download Processing and start messing around and figure a lot of it out!

  • @kiwis2923
    @kiwis2923 Před měsícem

    Hi Barney, is there a way to do this for moving particles being repelled by the mouse?

    • @BarneyCodes
      @BarneyCodes Před měsícem

      I think my first ever video on this channel did something similar to this. The general idea is the same, where the proximity to the mouse influences a particle, but instead of having a "home" position that the particle is trying to reach, they just have a velocity that they use to move around. The velocity can then just be pushed in a direction away from the mouse if the particle gets too close. Hope that helps!

  • @hldfgjsjbd
    @hldfgjsjbd Před měsícem

    Exploration game with procedural structures and base building, maybe some elements of tower defence where you are being attacked at night?

  • @sivadfa
    @sivadfa Před měsícem

    Not sure if you can simulate it but I thought it was worth mentioning that the cove that gives the impression of a smaller island being eaten by your main island would be surprisingly smooth most of the time. I live in a cove with a similar make up and it's often as smooth as a lake when there aren't any boats on the water.

  • @jtmcdole
    @jtmcdole Před měsícem

    You can start with the cozy fishing village and then gradually deal with OilCo buying up rights to the island, and the villagers having to fight back (with wind/solar/malicious interference)

  • @johnschmitt9158
    @johnschmitt9158 Před 2 měsíci

    I love this. Lots of information and no wasted time. Very well done.

    • @BarneyCodes
      @BarneyCodes Před 2 měsíci

      Thanks so much, glad you found it useful!

  • @Vodboi
    @Vodboi Před 2 měsíci

    Question about the example shown at 30:18 : One natural optimization to me is to break the for loop if d is 0, as you don't have to check any more circles if you know it is inside one of them. But I've also heard that having conditionals in shader code could be non-optimal. Or have you done it like this here just to keep it simple? EDIT: Oh you mentioned this a bit later. Still though, how does this downside weight up against potentially not having to check 80-90 circles if you landed inside one in the first iteration?

    • @BarneyCodes
      @BarneyCodes Před 2 měsíci

      This is a really great question! I think I forgot to include this in the video, but shaders are only as fast as the slowest case, which is probably a bit different from how you're used to things working on the CPU! On the CPU, since things are happening one after the other, if you can move on quickly to the next iteration you can save time overall. However on the GPU, because all the pixels are being calculated at the same time, the shader has to wait for all the pixels to finish before it can finalise the result, meaning that even if 99% of the cases break early, the shader still has to wait for the pixels that are in that final 1% that are taking their time! I don't think the optimisation you've suggested would hurt the performance at all, but it's better to focus on speeding up the worst case, rather than speeding up the most cases (which can take a bit of getting used to!) Hope that helps clear things up a bit, let me know if you have any more questions :)

    • @Vodboi
      @Vodboi Před 2 měsíci

      @@BarneyCodes Thanks for the answer, and thanks for the video! I still have one more question if you don't mind: You say "All the pixels are being calculated at the same time", so I'm trying to get a grasp of how gpu's do this. Say the gpu has 1000 cores. If a scene has a million pixels, each core would still have to do multiple pixels each. Can these calculations be parallel within one core, or does each core calculate "sequentially"? Because if they at some point have to do sequential calculations, then I feel like there should be a benefit to optimizing by breaking, as that core could then process more pixels. So I guess the question is if each core utilizes some internal parallelization technique, or if one core can only handle one calculation at a time?

    • @BarneyCodes
      @BarneyCodes Před 2 měsíci

      You know what, I don't actually know! I've read that they're all done at the same time before, but hadn't stopped to actually think how that would work in practice. I just did a bit of googling and it looks like each core can run multiple threads at once (each thread calculating a single pixel), but it's still not enough to actually do "all the pixels at the same time"! From what I've read the GPU executes a block of pixels at the same time, and only moves to the next block only if EVERY pixel in the first block has finished, so it's kind of a mix of what we were both saying! With my example code though, it's pretty likely that a lot of the blocks would be able to finish early, so your optimisation would definitely have an impact. I think it depends a lot on what you're actually doing in the shader and it wouldn't be quite as significant as the same optimisation on the CPU. Thanks again for the great question, I learned some new stuff, and hopefully that helps you as well!

    • @Vodboi
      @Vodboi Před 2 měsíci

      @@BarneyCodes I see, thanks again for the reply!

  • @MBAXAXAX
    @MBAXAXAX Před 2 měsíci

  • @jokosalsa
    @jokosalsa Před 2 měsíci

    this is bar none the BEST video explaining shaders I have watched in YT. Very very very well done!

    • @BarneyCodes
      @BarneyCodes Před 2 měsíci

      Thank you so much! Glad you found it helpful!

  • @realalphas
    @realalphas Před 2 měsíci

    I would make distance blur detection with taking 2 additional shadows (+ and - angles, gives additional parameter of blur) and getting inverse intersections and blur those. Good video!

    • @BarneyCodes
      @BarneyCodes Před 2 měsíci

      I definitely think this is the way to do it but, unfortunately, I don't think my current implementation is fast enough to handle multiple rays per pixel. I think the mip-map optimisation I covered in my last video would probably allow me to do that though so I'll look into it again when I make the move over to Godot Thanks for the comment!

  • @ruolbu
    @ruolbu Před 2 měsíci

    since height is a core element to this game-to-be I was thinking of a Worms style shooter. You bomb each other which rips craters into the landscapes and transforms what the island looks like and where shadows land. You could have an additional 2D view, a vertical plane that you rotate around your currently active unit and align it with your target unit.

    • @BarneyCodes
      @BarneyCodes Před 2 měsíci

      That could be a lot of fun and probably not too difficult to get working! Cheers for the comment :)

  • @ruolbu
    @ruolbu Před 2 měsíci

    could you get a slow sine curve that triggers tides and moves the water level up and down?

  • @ruolbu
    @ruolbu Před 2 měsíci

    the one thing I would change is the intensity of the sunset effect. I feel like the island becomes way too dark too soon. In your example everything is red when the shadows hardly leave the island. In reality you need a really shallow sun to get into deep reds.

    • @BarneyCodes
      @BarneyCodes Před 2 měsíci

      You're definitely right! At the moment it's just a linear interpolation based on the angle of the sun so not very accurate at all! Thanks for the suggestion!

  • @lucetubegplusstillsux2678
    @lucetubegplusstillsux2678 Před 2 měsíci

    This effect would look really nice combined with a voxel space engine (a 2.5d 3D engine that uses a heightmap to generate 3D voxel terrain)

    • @BarneyCodes
      @BarneyCodes Před 2 měsíci

      I haven't heard of voxel space engines before but they sound cool, I'll have to check them out. Thanks for the comment :)

  • @flashbond
    @flashbond Před 2 měsíci

    Your game iddea is great. And since you have the code for sun and shadows and other stuff, the way you place the solar panels or the way panels recieves sunlight may matter. And maybe you can add wind mechanics and wind turbines may have a role also.

    • @BarneyCodes
      @BarneyCodes Před 2 měsíci

      I was thinking along the same lines, it would be great to actually use the sunlight/shadow system as part of the gameplay and I think solar panels would be a great way to do that! I'll have to see about simulating wind as well, might be a bit more complex to figure out how wind would flow around the island! Thanks for the comment!

  • @JsbWalker
    @JsbWalker Před 2 měsíci

    I really wasn't expecting this video to be this difficult to adapt for Java Processing, but it's proving to be incredibly hard to make this example code work there.

    • @BarneyCodes
      @BarneyCodes Před 2 měsíci

      What issues are you running into? There are definitely some differences in getting the environment set up, but the actual shader code should be usable between both (you might just need to check what uniforms/attributes are available by default in Processing vs P5js) If you're getting any error in particular I can try to give you a hand to get it sorted out!

    • @JsbWalker
      @JsbWalker Před 2 měsíci

      @@BarneyCodes That's what I thought as well. When I first copied everything down the shaders just refused to compile, so I figured the names of the attributes must just be different. It took me a while to find any documentation about what attributes were available in the Processing environment (the official site has pretty much nothing that I could find about implementing shader functionality despite this being a feature for years at this point) vs P5, but eventually I found examples in an old backup of a blog that went pretty in depth about how this stuff worked for Processing. After replacing all of the attributes with their correct counterparts the shaders were finally able to compile and run, but specifically the vertex shader just doesn't have the expected behaviour. It refuses to shade anything in 2d that isn't a square that fills the whole screen. I've been tinkering with it off and on for a while trying to figure out what in the implementation is different enough to make this not work, but I don't have enough experience or documentation support to really know what's up here

    • @BarneyCodes
      @BarneyCodes Před 2 měsíci

      I've only used shaders in Processing for full screen effects, so unfortunately can't be too much help there sorry! A few of the example Processing shaders I've seen have different defines at the top, eg: #define PROCESSING_TEXTURE_SHADER or #define PROCESSING_COLOR_SHADER maybe something like that helps? I know Processing also lets you either supply a vertex shader or just use their default one, not sure which route you've been going down (maybe both already!) but it could be good to try them both out to see if that helps at all. As a last resort, the Processing source code is all available on GitHub so you can also dive into that (if you're feeling brave enough!) to try and figure out what's going on and why it might be behaving strangely! Sorry I don't have a more concrete bit of advice for you, but hopefully there's something in there that's helpful? Good luck!

  • @GodGladiator1
    @GodGladiator1 Před 2 měsíci

    Idea for the game. The water level is really high to begin with. The goal is to reach balance with water and force it to recede to an acceptable level you get it to recede by building carbon capture devices. The carbon capture device is dependent on electricity. The last solar generator on earth powers the first carbon capture device that keeps the water from taking over the top of the mountain. As the water recedes the biomes change. The mountain top becomes frigid and has more cloud cover making the electricity generation drop which then makes the carbon capture output drop.

    • @BarneyCodes
      @BarneyCodes Před 2 měsíci

      Interesting idea, I like it! I really like the idea of using solar power because it would work nicely with the sun/shadow system and I could somewhat accurately simulate the efficiency of the panels changing throughout the day, taking into account shadows and what not. Thanks for the comment!

  • @misaonthefly
    @misaonthefly Před 2 měsíci

    Too many complicated bs