Starting a Mobile Game and Learning a lot! [part 1]

Поділитися
Вставка
  • Опубліковано 15 чер 2024
  • In this video, I started making a mobile game! I also learned a lot of new tricks about game dev, so make sure you watch the whole thing to figure them out for yourself!
    Part 2 has unfortunately been postponed indefinitely :(
    Distribution class link: github.com/WillHess3/Distribu...
    Complex color replace shader explanation:
    I show the whole thing in the video, so pause at 8:13 to see it. Sorry if my body is in the way!
    So, we first start with the main texture, and for me that's the sprite sheet. This is the most important part: in order for this to work with a sprite renderer, your texture input to the sample texture node must have "_MainTex" as a reference. I would not have figured this out without a video I found online so full credit to this guy. ( • Color Swap Shader Unde... ).
    So anyways from the sample texture node, drag the r, g, and b outputs into a vector 3 to get the rgb color, and drag the alpha into the alpha part of the fragment shader. We will use the vector 3 a little but we are done with the alpha.
    Now we have to cut the image in half so we can replace the bottom. The way I did this is by putting the output of the uv node into a split node to get the information from the green channel. This basically gives us a value from 0 to 1 of where the pixel is, so the row of pixels at the center of the texture has .5 for their g. (I think at least, I'm not too confident with uvs). Because all the player images are perfectly in line, we can expose a property called eyeline to determine what height from 0 to 1 we want to replace up to. We plug the green channel from the split uv into a step node in the edge input, and eyeline in for the in input. This splits the image with black values above eyeline and white values below it.
    Taking the output of the step node, we can put it in a vector 3 node for all inputs, and then multiply it with the vector 3 color from the texture. This makes the bottom half normal (everything times 1 is itself (white is 1)), and the top half black (everything times 0 is 0 (black is 0)). Then we can feed this output into the replace color node the same exact way we did in the video. So now we have a bottom half with a replaced color and a completely black top half.
    We now need to get the top half, and convenient for us, we can go back to the step node and put the output into a 1 minus node. This flips the output of the step node because 1 - 0 = 1 (black becomes white), and 1 - 1 = 0 (white becomes black). Then we can plug the output of this into a vector 3 node in all inputs so we can multiply it with the color from the main texture again. This results in a completely normal top half because again it's being multiplied by 1 (white) and the bottom half is being multiplied by 0 so it turns black.
    Now we have a normal top half, and a replaced bottom half. In the area that the other has color, both are black, so how will we combine these. It's actually really easy and pretty intuitive, you just add them. Just like anything times 1 is the number, anything plus 0 is the number, and remember black is 0. This perfectly combines the two textures together and we can just plug this sum into the base color input in our fragment shader. IDK how good this explanation was, but if you're confused by anything, leave a comment or dm me.
    Normal SEO optimized description:
    Making a mobile game for apple iPhone and Android Phones in the unity game engine starts with planning out the video game. Here I decided to remake the game I made for the 2022 GMTK (Game Makers Toolkit) Game Jam. Because I was doing the game jam as an indie dev, it was messy code so I remade it with clean code.
    I made a grid system for this mobile indie game so the players can move around. I then added some enemies using abstract classes in C# programming. I used to use abstract classes like 5 years ago back in my Java (programming language) days, so I was a bit rusty and was confused a little bit about the abstract classes and inheritance in C# with unity.
    I also made this really cool and complicated shader that I explained in detail earlier in the description of the video. I also made my own generic class in C# to make item drops from chests customizable.
    Mobile game dev has taught me a lot and I learned a lot from game dev in unity for mobile.
    Chapters:
    0:00 - Intro / planning
    0:45 - Starting over
    2:29 - Enemies?
    4:34 - Colors!
    6:20 - Finishing the sprites
    7:28 - the shader...
    8:38 - Weapons and Chests
    10:40 - Outro
    Subscribe: ua-cam.com/users/WillHessGameD...
    Instagram: / will_hess_yt
    Discord: Will Hess(hashtag)9883
    If you have any questions DM me over Instagram or Discord
  • Розваги

КОМЕНТАРІ • 14

  • @paulytheking7365
    @paulytheking7365 Рік тому +1

    Wow, this looks amazing! If you ever need any music for the game, you know who too call!
    (Just so you know, that means me)

  • @user-ob2zf1ki8n
    @user-ob2zf1ki8n 17 днів тому

    hello, first of all i wanna thank you so much for the tutorials you are making, they have been a life saver for me and really gave me all the information i needed yet i didn't know where to find, thanks again :)
    one question, in the shader part, why not use a mask and change the color of that mask? it might be more work but it's more flexible

    • @WillHessGameDev
      @WillHessGameDev  16 днів тому

      It was a while ago, and I had to rewatch that part to jog my memory, but I think I did it because there would be different poses. With the poses I would have to make a mask of each one, which would be more work, but making a shader to skip that step is also a lot of work. I also probably just wanted some practice making shaders with shadergraph too.

  • @Lizzybeth321
    @Lizzybeth321 Рік тому

    You are awesome ! This is so cool!!

  • @microdavid7098
    @microdavid7098 Рік тому

    nice

  • @Ell900
    @Ell900 Рік тому

    U re amazing

  • @ORTyOW
    @ORTyOW Рік тому

    Ahahahaha

  • @Ell900
    @Ell900 Рік тому

    B