Code Gains
Code Gains
  • 10
  • 49 031
Creating a Basic Terrain But I am Dumb
Welcome back! I Finally crawled out of the architecture hole. We will now be able to work on features - starting with terrain.
Thank you for watching!
Github: github.com/Code-Gains/DX11-Engine
0:00 Intro
0:41 What Is Terrain
1:23 Heightmap Terrain
1:55 Plan For This Video
2:12 I Rewrote ECS
2:55 How We Render Geometry
4:34 Rendering Terrain
5:03 GPU Shader Switching
6:20 Adding Height To Vertex Layout
7:14 Texture Based Terrain Rendering
8:42 Normal Maps
9:11 Generating Normal Maps
10:32 Results
11:16 What's Next?
11:57 Thanks For Watching
Music:
The Four Seasons - Winter - Vivaldi (Gregor Quendel)
Fish Cannot Climb Trees - Ferco
Cooking - Alex-Productions
One - Sirius Beat
Staycation - Corbyn Kites
Aquarium - Kevin MacLeod
Okay - 13ounce
Jazz In Paris - Media Right Productions
Old World Saga - Hanu Dixit
Переглядів: 783

Відео

What Is a Build System and Why Do I Need it? But I am Dumb - Game Engine ep. #5
Переглядів 5 тис.2 місяці тому
One last push in the preparation to start implementing new features. After this I will make spaghetti versions of all game engine features in existence. Huge Thank You for watching! Github: github.com/Code-Gains/DX11-Engine Video from @TheCherno: ua-cam.com/video/5glH8dGoeCA/v-deo.html and his template: github.com/TheCherno/ProjectTemplate LearnD3D11 - graphicsprogramming.github.io/learnd3d11 0...
Why My Game Engine Sucks and How Will I Fix It?
Переглядів 2,3 тис.4 місяці тому
A little planning this time around, hopefully it will go well. The fire is not putting itself out. Github: github.com/Code-Gains/DX11-Engine Video from @TheCherno about C Projects ua-cam.com/video/5glH8dGoeCA/v-deo.html 0:00 Intro 0:50 Problems 3:43 Future Features 6:29 Summary and Outro Music composed by @BillBrownMusic linktr.ee/billbrownmusic: Shepherd's Flute (Dion Theme) Crossroad at Dawn ...
Creating a Basic Game Engine World Editor but I am Dumb. Game Engine ep. #4
Переглядів 3,2 тис.4 місяці тому
First video this year. Hopefully I am becoming smarter. github.com/Code-Gains/DX11-Engine Dear ImGui github.com/ocornut/imgui Cereal github.com/USCiLab/cereal 0:00 Intro Story 0:32 Real Intro 1:03 Editor UI 1:43 Dear ImGui 2:04 World Hierarchy Prototype 2:51 Saving and Loading 3:23 Serialization 3:56 Cereal C Serialization 5:08 The Universe 5:30 JSON File 5:46 Using My Brain 6:19 More Brain 6:4...
A Programmer "Fixes" a 17 Year Old Audio System
Переглядів 3485 місяців тому
I pretend to be an elementary school electrician making some black hole magic voodoo volume controller. 0:00 Intro 0:44 Surprise 1:20 How I Got it? 1:33 Messaging WaveMaster 2:16 Project Start 2:44 Schematic 3:38 Shopping Time 3:58 How I Think it Works 4:27 Confirming How it Works 6:07 Physics Stuff 6:56 Soldering Attempts 7:53 Troubleshooting 9:06 Functional Component 9:23 3D Printing 10:49 Lo...
Coding basic Entity Component System but I am dumb. Game Engine ep. #3
Переглядів 5 тис.6 місяців тому
Am I moving backwards or forwards? Nice to see you again for another time in the C engine series. This was an "adventure" to say the least and I hope that you were pleased. This was more of a theoretical video in terms of what you saw, but we will soon get to use this more in practice. Thank you for watching! Resources: github.com/SanderMertens/ecs-faq - has a lot of general information and lin...
Instanced Rendering but I am dumb. Game Engine ep. #2
Переглядів 2,3 тис.8 місяців тому
The more I know the less I know. Another episode of me cooking up some spaghetti, and hopefully someone has the appetite for it. GitHub repository: github.com/Code-Gains/DX11-Engine Performance was tested using Nvidia GeForce RTX 3080 & Ryzen 7700x, have in mind that recording high framerate applications reduces the framerate by more than 2x times. The cubes were also rendered from the inside. ...
I Created Windows Pipes 3D Using My Own Game Engine
Переглядів 1,8 тис.9 місяців тому
I hope you don't mind a little distraction of me re-creating Windows XP 3D Pipes screensaver simulation. I will occasionally do projects like this to showcase the features of the engine and of course to have fun/avoid burnout. If you are interested (not the exact ones I used, but explained well): Sphere generation: www.songho.ca/opengl/gl_sphere.html Cylinder generation: www.songho.ca/opengl/gl...
Lights and Materials but I am dumb. Game Engine ep. #1
Переглядів 10 тис.10 місяців тому
Thanks for watching. I did not expect to get so much attention from the start :) GitHub repository: github.com/Code-Gains/DX11-Engine Learn D3D11 project: graphicsprogramming.github.io/learnd3d11/ 0:00 - Intro 0:38 - Realism 0:58 - Current Cube 1:38 - Indexing 2:26 - Vertex & Index Buffers 3:44 - HLSL Shaders 5:22 - Interlude 5:54 - Phong Reflection Model 6:15 - Ambient Illumination 6:33 - Diff...
Making a Game Engine, but I am dumb - Ep. #0
Переглядів 19 тис.10 місяців тому
Watch me struggle. GitHub repository: github.com/Code-Gains/DX11-Engine Learn D3D11 project: graphicsprogramming.github.io/learnd3d11/ 0:00 Intro 0:45 Game Engines 2:06 Graphics APIs 2:34 GitHub Repository 2:42 C 2:50 Learn D3D11 3:35 How Graphics Work 5:16 Final Cube 5:48 Outro Music: Licensed under Creative Commons: By Attribution 3.0 License: • Mining by Moonlight Kevin MacLeod (incompetech....

КОМЕНТАРІ

  • @eduardopozos5022
    @eduardopozos5022 10 днів тому

    1.69..k subscribers? I'll fix it.

  • @topec1263
    @topec1263 18 днів тому

    bro created runescape at 7:04 GG

    • @Code_Gains
      @Code_Gains 18 днів тому

      It actually looks similar, now that I look at it

  • @qubitx64
    @qubitx64 18 днів тому

    bros doing gains in both Elden ring and game engine.

  • @sammer1122
    @sammer1122 18 днів тому

    its worse than scratch, but better than unity :D

  • @dontuo
    @dontuo 18 днів тому

    I will definitely use your engine when it is available on linux. I use arch btw

  • @dontknow7863
    @dontknow7863 18 днів тому

    💪💻 🤖

  • @rileyhawksworth8362
    @rileyhawksworth8362 Місяць тому

    I'm back from a previous episode. I remember commenting about my interest in creating my own game engine. I followed through with it and I have a GitHub for it. Development is slow though and it is in a very early state. I only started it 2 weeks ago. As a challenge I'm using Vulkan for rendering.

  • @python_n_c
    @python_n_c 2 місяці тому

    Subscribed because you use C++. Cool project!

  • @tsf8086
    @tsf8086 2 місяці тому

    Good. Now make it remote controlled.

  • @levmurflatazara9853
    @levmurflatazara9853 2 місяці тому

    Hey i am also dumb so i will ask question to same dubness but more experiencess human entity Is it good idea to make game editor separate programm that will somehow load game code and edit save files itself when running game to show game world and its transforms? Or it is better to somehow implement editor into game loop and idk like turn it off somehow in release version??

    • @Code_Gains
      @Code_Gains 2 місяці тому

      I wouldn't dare to say how it SHOULD be done, but I ended up making the Core a static library and the Editor a separate application (with the intent that games are also completely separate and would have no editor code in them). You can check out the latest video to this date.

  • @bioblazepayne
    @bioblazepayne 2 місяці тому

    I just worked on excluding editor/client/server code last night in VS2022. You can use #if IS_SERVER and then in VS2022 you can define it as a variable, and if that variable is set then it will only compile that code, else compile the other. **Thumbs up**

  • @tutacat
    @tutacat 2 місяці тому

    visual studio is literally just an editor. it doesnt do anything except integrate.

  • @dontuo
    @dontuo 2 місяці тому

    It's cool that you finally chose the build system. But I'm interested in one question. Will you make the engine cross-platform? (at least for linux and windows)

    • @Code_Gains
      @Code_Gains 2 місяці тому

      Yeah. I have plans for Vulkan in the future once the core architecture settles a bit. The plan is to make some sort of preprocessor code that would allow to compile for all platforms.

    • @dontuo
      @dontuo 2 місяці тому

      ​@@Code_Gains cool😎

  • @NexusGamingRadical
    @NexusGamingRadical 2 місяці тому

    I never thought to cook my spaghetti code, good thinking!

  • @Alguem387
    @Alguem387 2 місяці тому

    build.ps1 > build systems

  • @forest6008
    @forest6008 2 місяці тому

    I love this, hope you make something awesome, im trying to do the same thing

  • @DeuxisWasTaken
    @DeuxisWasTaken 2 місяці тому

    dx11?? but why tho edit: ok I saw the explanation in #0, doing it just to learn because it's beginner-friendly is probably the only sensible reason to use it. It's a shame that by choosing it you've immediately committed to the engine being Windows-only and kinda outdated from the get-go, but it's better than trying to start with Vulkan and then giving up because it's too hard.

    • @scrapmine
      @scrapmine 2 місяці тому

      dxvk and proton exists.

    • @DeuxisWasTaken
      @DeuxisWasTaken 2 місяці тому

      @@scrapmine yeah, and they're translation layers that introduce overhead and bug surface just to run an outdated (by 8+ years at this point) graphics API meant for Windows by design. It's awesome that they exist and have gotten to the point of working (pretty) well; it's understandable when people fall back to relying on them due to learning or severe time/budget/workforce constraints, but using them is still quite a bit worse than developing for native support using the modern multiplatform API that is Vulkan.

    • @scrapmine
      @scrapmine 2 місяці тому

      @@DeuxisWasTakenRunning dx11 games in proton gives near native performance for many games.

    • @DeuxisWasTaken
      @DeuxisWasTaken 2 місяці тому

      @@scrapmine many, not all, and that's only because the wine/proton people poured sweat and tears implementing it. "Performance in best case scenario" isn't all there is. Besides, I've seen that some games run faster on Proton than on Windows. That's not due to Proton being magic but due to the linux kernel, drivers and whatnot being more optimised enough to offset the overhead brought about by Proton. Running natively they'd get even better performance.

    • @dynamo_38
      @dynamo_38 2 місяці тому

      Vulkan only opens up the possibility for running on Linux which doesn't expand the userbase much at all. It might be a good idea compared to DX12, but it's not worth the headaches caused if it's unnecessary.

  • @Benjaneb
    @Benjaneb 2 місяці тому

    8:40 I see a lot of people write code like this, having a pretty much empty main function that just calls another function. I usually think it looks stupid but is there actually a good reason to do it? Did you do it because you know you want other code around the editor?

    • @Code_Gains
      @Code_Gains 2 місяці тому

      I don't think there are any hard set rules for this (because the program won't run faster or better), but for me If I have a project and see the main function I want to immediately understand what the entire application does and in this case it runs the editor (this is opposed to reading that messy code to understand that this is the editor).

    • @scrapmine
      @scrapmine 2 місяці тому

      I know that with rust it reduces build times by a significant about, might be the same for other languages.

    • @Benjaneb
      @Benjaneb 2 місяці тому

      @@scrapmine Build time would only be reduced if the code is separated out into another compilation unit (i.e. another file) and that unit is already compiled and you haven't made any changes to it, so if that's the piece of code you're actually working on it would do nothing to build time.

    • @thundertastic896
      @thundertastic896 2 місяці тому

      The cherno video he referenced touches a bit on this but it's a combination of DX ergonomics when debugging & having the ability to restart your whole editor "view" without closing your application process completely (which may be a hard requirement for certain features).

  • @Samrax86
    @Samrax86 2 місяці тому

    Nerd

  • @rordo.
    @rordo. 3 місяці тому

    Excited to see where this goes next!

  • @thomasp9511
    @thomasp9511 3 місяці тому

    knowledge acquired (IQ inceased +1 total 69)

  • @dontknow7863
    @dontknow7863 3 місяці тому

    💪

  • @fakedy9539
    @fakedy9539 3 місяці тому

    Im glad i found this channel. I'm planning on creating a new engine myself since ive matured a lot since my first attempt. I like your style :)

  • @drominitoketchup
    @drominitoketchup 3 місяці тому

    Nice, another guy who loves low level programming². Oh, I'm already a subscriber to your site, I didn't even notice 🤔

  • @nolram
    @nolram 3 місяці тому

    Do NOT use Cmake. Cmake is one of the worst programs ever written. Dependency management is hell with it, it’s not backwards compatible and breaks every few years, and doesn’t even allow multiple versions to coexist. The documentation is sparse and often features just… break. Use Premake if you value your sanity.

  • @guilhermerodrigues4853
    @guilhermerodrigues4853 3 місяці тому

    I’m using Cmake for my game engine and it’s alright. There ar some playlist that you can watch and learn, there is a video called “do you even test? - Cmakel” (or something like that) that you use to add modules to your project. I never tried premake, but whenever o check forum, the results say Cmake is kinda the standard

  • @anthonyapm
    @anthonyapm 3 місяці тому

    Good job man. I've been battling the same problems 😅

  • @hexdragon_
    @hexdragon_ 3 місяці тому

    you can actually draw a hexagon using just 4 triangles

    • @Code_Gains
      @Code_Gains 3 місяці тому

      And now I know. Thank you. I only saw it after you commented and I will not be able to unsee it.

    • @Code_Gains
      @Code_Gains 3 місяці тому

      I love your youtube handle as well. You live up to it.

  • @graphicstalk7609
    @graphicstalk7609 3 місяці тому

    Use tuples instead of vectors. Tuples allow you to have a dynamic array that contains multiple types.

    • @Code_Gains
      @Code_Gains 3 місяці тому

      Thanks for the tip. I will be sure to include tuples in my analysis once I come back to this in the future vids.

    • @timtreichel3161
      @timtreichel3161 2 місяці тому

      No I don't think this is a good if you want to go with an ECS architecture. You want the components to be stored continuously, for each component type. So going with a single vectors for each component is exactly the right way to go. Then you want to iterate over the components vectors individually when updating the game/simulation state. That way you have the most cash benefits. Code duplication can be avoided with templates. Looking up components can also be implemented with linear or binary search and will probably be fast enough in most cases. Dealing with hash maps brings their own draw back, but I guess it can be done and might be needed in some cases.

  • @MasterBroNetwork
    @MasterBroNetwork 3 місяці тому

    Great video, I think there is a way to disable that right-click menu in File Explorer with a registry tweak, I'm not sure though.

    • @Code_Gains
      @Code_Gains 3 місяці тому

      I found some github repositories that have an executable to remove that pesky menu later.

  • @kudorgyozo
    @kudorgyozo 4 місяці тому

    your engine looks great, with UI, enemies and everything. Very nice!

    • @Code_Gains
      @Code_Gains 4 місяці тому

      The only enemy is me. Thanks though.

  • @MJ123and5
    @MJ123and5 4 місяці тому

    Mine is worse ahaha

  • @Sam-rr4ek
    @Sam-rr4ek 4 місяці тому

    help i am big noob, what programs do i run so i can code in c++ for unreal engine 5

  • @xzaz2
    @xzaz2 4 місяці тому

    This looks like Silkroad online

  • @basboerboom9328
    @basboerboom9328 4 місяці тому

    I feel your pain. I am currently on my countless'th iteration of ECS for my game. Every time I almost get a Eureka moment, I run into a problem with my ECS system.

  • @aurimasjurgelis2261
    @aurimasjurgelis2261 4 місяці тому

    I found this video randomly, thanks to the UA-cam's algorithm. I wasn't disappointed because I used to be interested in game engines too (and Lineage 2). Nostalgic and educational.

  • @aliceberethart
    @aliceberethart 4 місяці тому

    0:17 lol ain’t that the truth Learning is addictive hell

  • @tarck333333rrrr
    @tarck333333rrrr 4 місяці тому

    Noooo, build systems are a trap! Never worry about BS like separating editor and code at this stage! I even seen AAA project that do that with extra build. Heck, look at DOOM BFG source! It has only 4 projects and it mainly for mod support. It even has editor build in into main exe! All crap like this just distract you from your main goal - making game or gameengine.

    • @Code_Gains
      @Code_Gains 4 місяці тому

      I think it is better done early, than when I have a completed project. Also I think it is a very valuable thing to know how to do and I want to learn it.

    • @tarck333333rrrr
      @tarck333333rrrr 4 місяці тому

      @@Code_GainsValue is doubtful. I can be done later or never - lots of AAA projects begin by checking in last title source into a new repo.

  • @thomasp9511
    @thomasp9511 4 місяці тому

    Hmmmm..yes..oh…true dat.. big brain

  • @rileyhawksworth8362
    @rileyhawksworth8362 4 місяці тому

    Hey, I really like the videos and you are convincing me to make my own game engine. Keep u the good work. I've used cmake before and it seems good but never used premake. If you plan on sticking with compiling on windows msys2 or the windows subsystem for Linux might be helpful.

    • @Code_Gains
      @Code_Gains 4 місяці тому

      Thanks! Good luck with your engine if you decide to do it in the end.

    • @rileyhawksworth8362
      @rileyhawksworth8362 4 місяці тому

      Thanks, good luck too. Currently I've just been learning Makefile because I was recommended that by someone part of Travis Vroman's discord server. He is also making a game engine, might be a useful reference. The reason I was recommended Makefile is because I'm only planning on supporting Windows.

  • @InfiniteCoder01
    @InfiniteCoder01 4 місяці тому

    Ha, you are following my way and the way Low Level Game Dev went. Welcome to the club!

  • @orbyfied
    @orbyfied 4 місяці тому

    🔥🔥🔥🔥🔥

  • @sleepymushroom9403
    @sleepymushroom9403 4 місяці тому

    Hello there

  • @GTGTRIK
    @GTGTRIK 4 місяці тому

    This is really helpful on my own ECS journey. I've been struggling with the whole magic layer of "linking components to entities".

    • @Code_Gains
      @Code_Gains 4 місяці тому

      Glad to hear I helped someone

  • @KarimHamdallah-gc2el
    @KarimHamdallah-gc2el 4 місяці тому

    amazing work, hope you get into material system with pbr and model loading

  • @grand1415
    @grand1415 4 місяці тому

    Insanely underrated channel, you are the goat o7

  • @SillyOrb
    @SillyOrb 4 місяці тому

    5:10 Uh-oh. Is anybody going to point out that world and universe are the same? World is often used to mean planet Earth, but it really means universe / cosmos. To be fair, the analogy still holds, if the "outer" universe is removed, due to e.g. the many-worlds-interpretation of quantum mechanics providing a linguistic precedent and concept. What is beyond the world / universe / cosmos? We don't know. You do you though, this has no bearing on what you call the concepts in your code. (Please use parent & child instead of father & child, which Unity does. 🤦) My irrelevant nitpicking aside, these videos are both very entertaining and quite informative. I am very partial to the presentation and the overall perspective. It is good to have the option to use bson, which is simply binary json (that Cereal apparently supports, as per the video). Especially for files, that don't absolutely must be text. Many people prefer text files for development data and binary files for final data, as the latter is more compact and faster to parse on top of that, but the former can be trivially inspected, fixed and merged.

    • @Code_Gains
      @Code_Gains 4 місяці тому

      Didn't think about that, indeed, it might make sense to re-name Universe into a World Manager, or just come up with a different naming scheme entirely. The thoughts on using text for development and binary for production makes sense to me especially considering that multiple people might work on a single project. Thank you for the support.