olcPixelGameEngine

Поділитися
Вставка
  • Опубліковано 8 вер 2018
  • Introducing the olcPixelGameEngine, a powerful, cross platform, single file and simple to use game engine aimed at pixel based applications and games, which requires minimal external dependencies or setup. It could be considered a successor to the olcConsoleGameEngine.
    Source: github.com/OneLoneCoder/olcPi...
    / discord
    Blog: www.onelonecoder.com
    Twitter: @javidx9
    Twitch: javidx9
  • Наука та технологія

КОМЕНТАРІ • 464

  • @javidx9
    @javidx9  5 років тому +153

    A massive thanks to members of the OLC Discord community who put up with my requests for testers, in particular big shout outs to Eremiell, Slavka & Dragoneye for Linux trials and suggestions.

    • @javidx9
      @javidx9  5 років тому +2

      MaGetzUb feeds me music and style XD

    • @sakuhoa
      @sakuhoa 5 років тому +1

      maybe you can let olcConsoleGameEngine as a repo, so there will be a wiki of it

    • @guzman-do
      @guzman-do 3 роки тому +1

      Found your channel yesterday... Thank God UA-cam recommended it... I was praying for a channel like this for a long time 🌟🌟🌟🌟🌟

  • @FROZENbender
    @FROZENbender 5 років тому +194

    I love how the bitrate just shat itself at 11:45

    • @obinator9065
      @obinator9065 4 роки тому +11

      UA-cam Compression At Its Finest

    • @Sparkette
      @Sparkette 3 роки тому +1

      @@obinator9065 You mean encryption? (/s)

    • @7.59-fmclosed7
      @7.59-fmclosed7 3 роки тому +4

      @@Sparkette It's not encryption, it's compression
      UA-cam has BILLIONS of 1080p and 4K videos on their platform. A 10 minute 1080p video is like 2 GB on it's own. Without their extreme compression they would have to have way over 1953125 TERABYTES worth of space just to store all these videos.

    • @zheil9152
      @zheil9152 3 роки тому +4

      7.59-fm [Closed] for future reference, “/s” represents sarcasm

    • @7.59-fmclosed7
      @7.59-fmclosed7 3 роки тому +1

      @@zheil9152 Glad i didn't get r/wooshed with r/ihavereddit replies flooding down my notifications

  • @inhaledeath3899
    @inhaledeath3899 5 років тому +148

    I just recently discovered your channel. Something completely off the rest of programming channels on UA-cam. It's relaxing, educating calming, to watch you speak. All the best for you and your channel.

    • @javidx9
      @javidx9  5 років тому +34

      Hey thanks Inhale Death(!) I just try to keep it focused and clear, I dont like watching tutorials where there is loads of extra stuff going on, and so if I dont like it, why should I expect anyone else to? Cheers buddy!

  • @241lolololol
    @241lolololol 5 років тому +116

    As a primarily Computer Science student, I am so grateful I found your channel so I can learn so much more than I currently am. Keep up the great work!

    • @javidx9
      @javidx9  5 років тому +37

      Micheal, comments like that make it so worth while so thank you very much!

    • @MaledictGaming
      @MaledictGaming 5 років тому

      I know the feels :(

    • @B2SProductions
      @B2SProductions 4 роки тому +3

      Micheal i'm not trying to take you away from David. But I always watch this c++ plus there is chili who has tutorials on c++ Direct3d between the 2 you can become a c++ God here is his channel ua-cam.com/users/ChiliTomatoNoodle

  • @fckyo333ujhjjkrrrr
    @fckyo333ujhjjkrrrr 5 років тому +106

    Oh my god Javid. This is amazing. I love it

    • @javidx9
      @javidx9  5 років тому +4

      Thanks Dayyan! Code::Blocks compatible too! :P

    • @fckyo333ujhjjkrrrr
      @fckyo333ujhjjkrrrr 5 років тому +1

      javidx9 don’t spite me Javid or else! Smh

  • @seditt5146
    @seditt5146 5 років тому +75

    You wanna know a weird brain trick, When you fill the screen with Random pixels like that and move your mouse cursor over it, the mouse cursor vanishes. For the longest time I really believed it just went invisible until I realized my brain was just erasing it and I have found the oddest form of camo I have ever seen in my life.

    • @abdulahad200
      @abdulahad200 5 років тому +9

      Lel I always thought my windows was bugged

    • @TimeoutMegagameplays
      @TimeoutMegagameplays 4 роки тому +6

      It's not your brain that's erasing it, it's UA-cam video compression, it just blurs everything on the screen because the bitrate is not enough, it blurs so much the mouse disappears because of the compression trying to take info from other parts of the screen, take a search on it, it's actually very interesting system.

    • @JohnDavidDunlap
      @JohnDavidDunlap 4 роки тому +6

      I can see the mouse if I focus on it but it disappears if I focus on the background.
      Edit: It's not a UA-cam compression affect. I compiled this example program on my computer and the mouse still disappears if I focus my eyes on the background.

    • @laurinneff4304
      @laurinneff4304 4 роки тому +2

      @@JohnDavidDunlap The same happened to me. I compiled it (in my case on Linux) and my cursor appeared to disappear when over the window

    • @JohnDavidDunlap
      @JohnDavidDunlap 4 роки тому +2

      @@laurinneff4304 I compiled it on Linux too!

  • @robertboran6234
    @robertboran6234 5 років тому +62

    Fantastic. This is perfect for making small gridworlds for testing AI safety concepts. Your channel is paradise.

    • @javidx9
      @javidx9  5 років тому +9

      Hi Robert, I'm pleased you may find it applicable to something practical.

  • @crusaderanimation6967
    @crusaderanimation6967 2 роки тому +1

    Dear YT I was (more or less) 2 day figting with SDL2, WXwidgets to force them to work only for some simple playground to play with individual pixels and failed and NOW you recommended me this film ? Well better late than never.

  • @cooperpilot8094
    @cooperpilot8094 5 років тому +20

    That full color hd Spyro level running in a console kind of blew my mind a bit.

    • @cooperpilot8094
      @cooperpilot8094 4 роки тому

      @@rswa well, either way, it was still a journey seeing the whole 3d engine being programmed with just c++ tools and finally have a product that's pretty decent.

    • @cooperpilot8094
      @cooperpilot8094 4 роки тому

      @@rswa The console can only draw text which takes a certain amount of time on top of whatever you are rendering. Pixels are much faster to draw because you don't need to have the ability to draw every character and so you can eliminate a lot of overhead.

  • @chriswinslow
    @chriswinslow 5 років тому +8

    I’ve almost finished binge-watching all your videos as I’ve had today off work.
    I found your spline videos very interesting, I feel it has given me an even greater insight of what techniques my racing game will need when I'm ready to create it.
    I can now see why you’ve chosen the console screen as the output over a GUI, it allows you to really focus on the core logic of the program without getting entangled with the OS GUI as well.
    I also liked the sound synthesiser videos too, very clever. I also wanted to create a sim city style game but it will be more of a simulation of the world and not a game, without points, lives, continues etc. It will take real-world data.
    I was going to start making a racing game using a game engine like Unreal, Unity or Cryengine armed with only procedural programming knowledge courtesy of PHP and learning OOP over time, what a fool I now feel! I will make sure to get to grips with OOP and make a clone of pong then move to something harder like Tetris and move up the difficulty ladder over months and years while also messing around with accessing hardware as you did with the Command Line Webcam Video - “Gray scales is good enough? No, of course you want colour!” (made me laugh). It will take a while to re-create a game like Zelda - Breath of the wild, but I think I’m crazy enough to give it a go one day anyway over many many years and within a team.
    The only sad thing now is we all have to wait patiently for your next video release.
    I feel very privileged to have access to these highly educational videos you are producing. Thank you for your time and effort. Oh and please more vlogs in the car (if it is safe to do so!). Sorry posted this in the community section as well!

    • @javidx9
      @javidx9  5 років тому +4

      Hi Chris, I'm really pleased youve found something good in the videos, It makes it all worthwhile - I was thinking of doing a few more car vlogs (for old times sake :D) but I'll have to think of some interesting topics now I know people may actually watch them!
      Thanks again buddy!

  • @georgevasiliadis4228
    @georgevasiliadis4228 5 років тому +4

    Man I love your work. I've just discovered your channel and it's outstanding. You literally turn some primitive tools into gold.
    Idk, i'm super hyped😁
    Keep it up

    • @javidx9
      @javidx9  5 років тому +3

      lol thanks George, Im hoping to get the message across that using simple tools well is just as powerful as using advanced tools.

  • @ExistenceV2
    @ExistenceV2 5 років тому +7

    Wow... that level with the castles is just amazing

  • @TheRealFaceyNeck
    @TheRealFaceyNeck 5 років тому +2

    Wish I would've found your channel years ago. Glad I found it eventually.
    Thanks for all your hard work and sharing it with the rest of us. :-)

    • @javidx9
      @javidx9  5 років тому

      Hey thanks Facey, I really appreciate your support!

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

    There's something so calming in Javid's voice that i sometimes play a hard to understand c++ video and place the phone under my pillow to fall asleep 😅😅

  • @derekcope3803
    @derekcope3803 5 років тому +31

    Extremely well done!! Thank God for geniuses like you! I have a son who is teaching himself how to code, He turned me on to your channel. He likes you and "The Coding Train!! Liking and subscribing now!!!

    • @javidx9
      @javidx9  5 років тому +8

      lol thanks Derek, and to your son!

  • @jgartworld
    @jgartworld 5 років тому +1

    I've been learning lots from your videos. Great content! Subbed.

    • @javidx9
      @javidx9  5 років тому

      Thats great to hear, thanks Jessie!

  • @MrSuamps
    @MrSuamps 5 років тому +6

    Your channel is gold. Thank you so much.

  • @jesusjuarez1579
    @jesusjuarez1579 3 роки тому +1

    Brillant! The explanation is clear and elegant. Congrats!

  • @justgame5508
    @justgame5508 5 років тому +1

    I bought a massive book on C++, already basically fluent in C# and know the basics of C, pointers etc. Never had time to get stuck into C++ because of university work, but now I’ve finished for summer, these videos have inspired me to learn C++

  • @FrancoSang
    @FrancoSang 3 роки тому

    Really nice work!
    The last version from GitHub is compiling just fine on Mac using the command from the header documentation. Now I can start with your videos!
    Thanks!

  • @QouteOfTheDay
    @QouteOfTheDay 5 років тому +1

    That is absolutely astonishing. Thank you very much for sharing all these amazing videos. Please keep up the excellent work 2019 and beyond.

    • @javidx9
      @javidx9  5 років тому

      Hi and thanks First Mill, I will!

  • @CosmicBrain21
    @CosmicBrain21 5 років тому +2

    Hey Javid, just wanted to say thanks for the tutorials my friend!

    • @javidx9
      @javidx9  5 років тому

      Hey cheers CosmicBrain!

  • @simong7568
    @simong7568 5 років тому +1

    I love your tutorials, you make it really easy to understand! :D

    • @javidx9
      @javidx9  5 років тому

      Hi Roudey, cheers buddy, I try to just present the ideas, hopefully the viewers fill in the gaps and link things together.

  • @DubiCube
    @DubiCube 3 роки тому +3

    Absolute legend, thank you for doing this!

  • @thereborne5219
    @thereborne5219 2 роки тому +1

    i was literally playing spyro on my ps1 and you showed spyro. amazing

  • @steverichards966
    @steverichards966 5 років тому +4

    Awesome, just what I was looking for to expand my knowledge of OpenGL, and game engines in general. All compiled OK on my linux machine using Eclipse CDT. I did need to add in png.h, and due to include paths mess around a bit with sqrtf, abs, and malloc (noting that you didn't explicitly include stdlib.h or . All sorted and the examples run fine. Now if I can stop watching your other algorithm videos I could get on and program something.

    • @javidx9
      @javidx9  5 років тому +3

      Hey Steve, thanks for trying it out! The problem I face with linux is everyone has different default build environments and IDEs, so its good to get feedback like this. Could you possible link to your source somewhere so I can study the changes you made? I should then be able to absorb them into the build for others.

  • @AnsityHD
    @AnsityHD 5 років тому +1

    I'm looking forward to having a go with this, the thing I loved about the console game engine was it's simplicity and accessibility so this is super cool :)

    • @javidx9
      @javidx9  5 років тому

      That's great to hear Ansity, the simplicity is what I think I liked most about the console game engine too, I can't wait to see people coming up with crazy things here :D

  • @bryphi77
    @bryphi77 5 років тому +1

    I'd be interested to see octree and collision demo. This is really REALLY great stuff. Many thanks for your effort!

    • @javidx9
      @javidx9  5 років тому

      Thanks bryphi, I think trees are on the agenda - I like quad trees a lot, and havent done a video about those yet

  • @20thCB
    @20thCB 5 років тому +1

    Great work, your channel is turning into a real treasure trove!

    • @javidx9
      @javidx9  5 років тому

      lol, shucks, cheers 20thCB!

  • @aptech2933
    @aptech2933 5 років тому +4

    Awesome stuff Javid.

    • @javidx9
      @javidx9  5 років тому +1

      Thanks APtech!

  • @andreivlad6874
    @andreivlad6874 4 роки тому

    That 3dDemo looks amazing!

  • @WizardOfArc
    @WizardOfArc 5 років тому +1

    This is awesome! I look forward to playing with this!

    • @javidx9
      @javidx9  5 років тому

      Excellent Azi - it gets updated quite frequently so make sure you get the latest stuff!

  • @danielharding3688
    @danielharding3688 5 років тому +9

    My mind is absolutely blown.... AGAIN
    Just wow. At 16:04 I was floored

    • @javidx9
      @javidx9  5 років тому +4

      Hi Daniel, yeah, I'm really pleased with how well the spyro demo performed

    • @danielharding3688
      @danielharding3688 5 років тому +1

      I'm starting a programming tutorial series on the JPEG format, and I gave you a shout-out in the beginning for giving me inspiration :)
      ua-cam.com/video/CPT4FSkFUgs/v-deo.html

  • @Rraccd
    @Rraccd 5 років тому +5

    You never disappoint!

    • @javidx9
      @javidx9  5 років тому +1

      Hello!, Cheers :D It's nice to hear from the original Lone Coders once in a while!

  • @SmashHighlights
    @SmashHighlights 5 років тому +1

    This is fascinating, really enjoying the videos.

    • @javidx9
      @javidx9  5 років тому

      Thanks Smash!

  • @nazmicancalk2415
    @nazmicancalk2415 5 років тому +2

    Everyone who is interested in computer graphics should watch this video :). Great work as always, you deserve much more appreciation for this channel and for your efforts. Keep up the good work :D

    • @javidx9
      @javidx9  5 років тому

      Thanks Nazmican, I think it is an excellent prototyping tool for studying graphics.

  • @kamran_aghlami
    @kamran_aghlami 5 років тому +11

    This is super cool!
    Have you tried compiling for mac?
    If you don’t need OpenGL > 4.1 it should be pretty easy considering you already have it working under linux.
    I really like the header only nature of it so I can just make new project for small tests fast and easy.
    Does it support custom shaders?
    It would make a really nice testing environment for people like me trying to learn GLSL.
    Amazing work as always, Keep it up! 🤟

    • @javidx9
      @javidx9  5 років тому +2

      Hi and thanks Kamran, in principle it should, but I dont have access to enough mac testers in the community. There are some changes I am aware need to be made things like gl/gl.h become OpenGL/gl.h etc
      As for shaders it does not, primarily because its still a 2D application, I just use OpenGL 1.0 of all things to draw the data to the window. If you want to give me some feedback on mac, then please do! Either via github or discord, I'd like to make it compatible.

    • @kamran_aghlami
      @kamran_aghlami 5 років тому +1

      I'll see if i can make it compile on mac as soon as I'm done with my tomorrow exam. I'd be more than glad to contribute.

    • @oj0024
      @oj0024 5 років тому +3

      @@kamran_aghlami if you whant to learn glsl and modern oepngl try learnopengl.com. If you don't know it already. Otherwise use it to.

    • @ricardoaponte1166
      @ricardoaponte1166 5 років тому +1

      Hello Kamran, did you get to compile on Mac? I would love to use this library on my Mac.

    • @kamran_aghlami
      @kamran_aghlami 5 років тому

      No unfortunately, I tried but since i don't have any experience working with native mac windowing system (cocoa and so on) and really don't have desire to learn those as they are exclusive to mac and also my working schedule being tight... uh, I failed. :)
      Needless to say I would love to see olcPixelGameEngine compile on mac too.

  • @PaulSmith-gt2lm
    @PaulSmith-gt2lm 5 років тому +2

    What an amazing project, love it!

    • @javidx9
      @javidx9  5 років тому

      Thanks Paul!

  • @captainufo4587
    @captainufo4587 5 років тому +1

    I've been following you for a while, and as a mostly self-taught programmer this channel has been very helpful, thank you.
    I have a question that is a bit off topic, as it has nothing to do with the engine, just your coding style. I can't help but notice that you happily use hungarian notation; in my early days as a self learning coder everyone and their mother in every internet community I came across to learn things talked me out of using it.
    Given that you're a professional coder and that this is your naming convention of choice, I'd like to hear your take on the topic, if you have time to share it.

    • @javidx9
      @javidx9  5 років тому +1

      Hi Cristian, I do use Hungarian notation (a little more loosely these days, but still...) as I find it very useful! I started coding in a time where there wasn't even syntax highlighting, let alone autocomplete and IDEs that tell you whats going on. I also work on large code bases, primarily embedded systems, which can have hundreds of variables in a single file.
      In order to code fluidly, I need to be able to read code very quickly, and Hungarian notation allows me to see precisely what a variable is doing, and reminds me of its type. This means I can focus on thinking about the solution rather than remembering what things are. Some argue that it makes code difficult to refactor, my counter argument is that you should not need to refactor in the first place (though it is sometimes unavoidable), but if you need to, I like to see and manage all the refactored locations myself, again, priming my mind with what I am doing to my program, increasing my awareness of the bigger picture.
      Ultimately its personal taste, as long as your variable names are somewhat meaningful, I think its ok.

    • @captainufo4587
      @captainufo4587 5 років тому

      Thank you for the answer!

  • @Ganondurk
    @Ganondurk 5 років тому +1

    Please consider continuing your 3D graphics engine series, covering topics like normal mapping, lighting, and possibly raymarched and raytraced graphics. Thanks!

    • @javidx9
      @javidx9  5 років тому

      Hi Maurdekye, I am, I will!

  • @BrianMendoza93
    @BrianMendoza93 5 років тому

    Hey Javidx! Thank you for your great videos. I'm new in CPP and I'm able to get olcPixelGameEngine working on MacOs and Xcode IDE. Maybe this is a dumb question as you explained the main difference that you still use olcConsoleGameEngineSDL but: can I follow along your previous videos with PixelGame instead of ConsoleGameEngine? I'm asking because I can't get to work the SDL version on Xcode.
    I can build EngineSDL but in line 1207 (throw 1;) I get a "Thread 2: signal SIGABRT" error. Thank you again for your help!

  • @EldronGah
    @EldronGah 5 років тому +1

    Wow, this is very amazing! Very nice job

    • @javidx9
      @javidx9  5 років тому +1

      Thanks SuperSalvatore!

  • @antoinefortin1386
    @antoinefortin1386 5 років тому +1

    Man ! This is so fucking perfect! Thank you so much for producing such a high value content. :)

  • @peter881
    @peter881 3 роки тому

    i have been strugling with graphic i love you man

  • @user-gw4zg1bx8d
    @user-gw4zg1bx8d 5 років тому +3

    It's really amazing!cool!Thanks for your video.

  • @phraggers
    @phraggers 5 років тому +1

    This is awesome! Fantastic work

    • @javidx9
      @javidx9  5 років тому

      Thanks Molivos!

  • @js-alias
    @js-alias 5 років тому +1

    Awesome, thanks Javid. Not sure if others had the same problem but I couldn't run it until I added a #define OLC_PGE_APPLICATION at the top of my file.

    • @javidx9
      @javidx9  5 років тому +1

      Thanks Julian, yeah I had to make that change since I released the video. It doesnt matter how much I publicise it, it still catches people out, but at least you resolved it!

    • @IAmCorbin
      @IAmCorbin 5 років тому +1

      This finally solved my issue and got the engine up and running with Visual Studio Code! Thanks!
      It was throwing strange errors about
      ...\AppData\Local\Temp\ccbsCluO.o: In function `__static_initialization_and_destruction_0':
      ...undefined reference to `olc::Pixel::Pixel(unsigned char, unsigned char, unsigned char, unsigned char)'
      ...undefined reference to `olc::PixelGameEngine::PixelGameEngine()'
      ....rdata$_ZTV6Engine[_ZTV6Engine]+0x20): undefined reference to `olc::PixelGameEngine::OnUserDestroy()'?
      but simply adding #define OLC_PGE_APPLICATION at the top of the implementation.cpp file solved the issue.

  • @dailyshadow
    @dailyshadow 4 роки тому +2

    javidx9, firstly. I love your videos, and this is amazing. I'm a computer science student, so I'm really enjoying these.
    But I just have a question. When you are running the spyro demo at the end with a higher resolution, your FPS drops to 50-60. I'm super impressed obviously, because you made this from scratch. But this is still a simple 'game' with pretty low graphics. I'm just wondering, what are more established graphics engines doing that increase the efficiency? For instance, I can run a modern AAA game at 144 fps, which is a bit more complicated. Thank you for your time, and for sharing your knowledge.

    • @javidx9
      @javidx9  3 роки тому +1

      Very late reply here, my apologies and I suspect you already answered your question - but in the demo shown here, everything is being computed by the CPU, it does not use the GPU at all.

  • @nampukk6119
    @nampukk6119 5 років тому +1

    This should be amazing for prototyping!

    • @javidx9
      @javidx9  5 років тому

      Exactly, thanks Nam!

  • @Akniy
    @Akniy 3 роки тому

    So much better than my lecturer's 2d graphics library!
    This one seems simpler too (to my trained eye)

  • @danmoos3635
    @danmoos3635 5 років тому +1

    I've often considered doing a software engine "old school", such as you have. Do you use just enough DirectX to get a pixel on screen, or is there a way to avoid even that?

    • @javidx9
      @javidx9  5 років тому

      You can avoid DirectX (or OpenGL in this case) entirely using OS calls, but these may have some overhead. I like the old-school approach because it is a great thing to learn the why rather than just the how, which a lot of modern tutorials and tools tend to focus on

  • @manuellehmann267
    @manuellehmann267 5 років тому +5

    Amazing. Will give it a shot right now. :-)

    • @javidx9
      @javidx9  5 років тому +1

      Thanks donnerbrenn!

    • @manuellehmann267
      @manuellehmann267 5 років тому

      Oh, I have to thank you. ;)
      It's fun. I'm wondering, if i could use it for some sizecodingstuff on linux. I'm using SDL2 at the moment for GFX Stuff. A dependency, i don't like for some reasons. Maybe i will try to do a more slim version of your engine.
      At the moment the noise example can be squeezed in a 8.7K executable with some additional compilerflags, stripping unnecessary stuff from the resulting binary and using lzma compression with a script i wrote. That's a little bit too heavy for my taste. (I like to do 4K Games and demos. ;) )
      I learned, when you make functions static, they won't be compiled. This doesn't seem to be a trivial job on this thingie. Does someone have any ideas, how I could this on olcPixelEngine?

  • @shifter65
    @shifter65 4 роки тому

    How can one go about adding text scrolling? I imagine you might need a text buffer, some on mouse drag/scroll event handlers...

  • @carlosaugustogurgel6887
    @carlosaugustogurgel6887 5 років тому +41

    hehe, I am wondering a bit in why your nickname is JaviDX9 and you don't use DirectX 9 for the videos. just kidding, thanks for the video, another opportunity to learn new techniques...

    • @javidx9
      @javidx9  5 років тому +34

      Thanks Carlos, you are quite right, its Java-David-DirectX9, two of which do not seem very applicable anymore :D

  • @ChisponGroxo
    @ChisponGroxo 5 років тому +1

    Now with the new graphics engine. Are you planning on adding gouraud shading to the 3d renderer?. Would be cool if someday you cover BSP maps too!
    Best programming channel I've ever found, praise the lord Javid!

    • @javidx9
      @javidx9  5 років тому +1

      lol thanks Chipson, I think I may do a video on simple lighting models now, and will probably consider trees and similar structures for spatial representations in the future

  • @ILGiullareDiCorte
    @ILGiullareDiCorte 5 років тому +2

    Just amazing!

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

    Can we just take a moment to appreciate that intro

  • @gbrls_yt
    @gbrls_yt 5 років тому +1

    great work as always!

    • @javidx9
      @javidx9  5 років тому

      Cheers Gabriel!

  • @JohnDavidDunlap
    @JohnDavidDunlap 4 роки тому

    I appreciate the crap out of you for taking the time to make this work on Linux. :)

    • @JohnDavidDunlap
      @JohnDavidDunlap 4 роки тому

      Successfully compiled on Pop!_OS 19.10(Ubuntu derivative).

  • @cprn.
    @cprn. 4 роки тому

    Also, I didn't know about your channel before and come here from the "Forbidden C++" video where I got to from list of videos related to one on coding a pixel level particle system which I was watching because I got stuck trying to implement persistent blood decals by drawing pixels on surfaces instead of adding new objects to memory. What I'm trying to say is UA-cam algorithms are bonkers.

  • @avvvqvvv99
    @avvvqvvv99 5 років тому +1

    absolute legend

  • @nicolaibergmann6613
    @nicolaibergmann6613 5 років тому +6

    Nice!!! I'll check it out! :)

    • @javidx9
      @javidx9  5 років тому +1

      Cheers Nicolai!

  • @TheGabrielMoon
    @TheGabrielMoon 5 років тому +1

    This is so wonderful!

    • @javidx9
      @javidx9  5 років тому

      Thanks Gobes!

  • @seditt5146
    @seditt5146 5 років тому +1

    You know Javid, I realized the Engine I was originally using that was SDL2 based was a Pixel engine, all my Primitives, Circles , Squares, Textures.... Everything... Was drawn pixel by pixel and it ran fast enough that I could fill a 640x480 screen completely with 45-50 FPS on my old 12 year old computer. Not to shabby and since it maps every pixel to a texture it should be relatively portable.

    • @javidx9
      @javidx9  5 років тому

      I think people underestimate the power of their CPUs, there are things they can do much faster than a GPU

    • @seditt5146
      @seditt5146 5 років тому

      I always wanted to convert the memory write of the Pixels to SIMD but could never really figure out how to divy up the work. I seen similar things done on CPU side and it seen a 2-3x increase in speed as long as it was done correctly, if it was not done correctly it actually decreased the speed of operation.

  • @jean-naymar602
    @jean-naymar602 5 років тому +1

    I'M ACTUALLY HYPED !
    (with 10 days of latency)

    • @javidx9
      @javidx9  5 років тому +3

      Hey Jean-Nay, Cheers! (2 days of latency with reply XD)

  • @Tony_Goat
    @Tony_Goat 5 років тому +1

    Damn, this is on par with SDL2 with the SDL_Draw extension, even slightly better.

    • @javidx9
      @javidx9  5 років тому

      Thanks Tony, its also much lower level, so requires a bit more work, but ultimately its only limited by your creativity, which is why I like it as a learning tool.

  • @resw
    @resw 4 роки тому

    Hi, Thanks for the help. I have a question thought, how did you make the start animation?

    • @javidx9
      @javidx9  4 роки тому

      Its just a programmed sequence. Nothing too clever

  • @KEKL_
    @KEKL_ 5 років тому +1

    your videos are amazing and inspiring

    • @javidx9
      @javidx9  5 років тому

      Hey thanks RV, thats really kind of you!

  • @filipfilip1767
    @filipfilip1767 4 роки тому

    A question:
    If I create resources in onCreate virtual function for example: int a;
    and then in update virtual function I can acces this variable meaby do: a++;
    then how is this possible? how can variable that is local be accesed from another function? what about the variable scope rules?

  • @lozD83
    @lozD83 4 роки тому +10

    ...Just realised, this was the last UA-cam video I watched as an EU citizen 😮

    • @javidx9
      @javidx9  4 роки тому +5

      You made the first comment to me as a non EU citizen 😔

  • @zhyere
    @zhyere 5 років тому +1

    Does your videos using C++ compile on Mac? I would like to start using your tutorials to learn to make games.

    • @javidx9
      @javidx9  5 років тому

      Hi Zhyere, some members of the community have been experimenting with mac. I don't own one myself so its not something I can easily test. The code "should" be quite portable, but some of the include setup might be different. Join in on the discord as we're hurting for mac programmers!

  • @msugal
    @msugal 4 роки тому

    Thanks for the amazing videos Javid. Is the olcPixelGameEngine works with Macs because I can't use the olcConsoleGameEngine because of the .

    • @javidx9
      @javidx9  4 роки тому

      Thanks Mohamed! Yes it does if you know how to configure your build environment. The github has some comments and discussion about how to do that. However, there is also a link to a mac port of the engine which people have had success with.

  • @mattbrewerton6884
    @mattbrewerton6884 3 роки тому

    I'm a front end Angular Dev with a decent C# history doing bits of game Dev on the side with Godot/Unity etc.... But damn these videos inspire me to learn C++

  • @MrJackojc90
    @MrJackojc90 5 років тому +2

    Fantastic!

    • @javidx9
      @javidx9  5 років тому

      Cheers Jack!

  • @russmack11
    @russmack11 5 років тому +1

    How do you not have more subscribers!! I've watched every one of your videos and am constantly impressed!

    • @javidx9
      @javidx9  5 років тому

      Thanks Russ, Its a little secret community, and you found us!

  • @avananana
    @avananana 5 років тому +1

    I don't know any C++ at all, but somehow I am deeply impressed at this. Time to figure out how game engines work, yay.

    • @javidx9
      @javidx9  5 років тому

      Well Avana, you could use this file to learn some C++ pretty rapidly (shamelss plug XD) Seriously though. thanks for your support!

  • @michelealessandrini3421
    @michelealessandrini3421 3 роки тому +1

    Hi, first of all you are my new hero. I have a technical curiosity: in the simple example of random pixels, I noticed that it uses a CPU core at 100%, so it seems like a CPU-bound process. So I was wondering: would the frame rate increase if drawing from several threads in multi-core mode? Because another voice tells me: you are accessing the graphic hardware, so basically a single resource. What do you think? Thanks!

    • @javidx9
      @javidx9  3 роки тому +1

      Hi Michele, the PGE is primarily a CPU bound software renderer yes, though PGE2.0 has some GPU assistance too. Splitting rendering tasks across multiple cores is tricky. Drawing a line for example, how would you partition that process across multiple cores? That said, some things can benefit from being multicore, and my video on fractals demonstrates this.

  • @giornikitop5373
    @giornikitop5373 5 років тому

    very nice and undestandable, made me want to start coding again.....maybe. one question though, i also convert the engine 4th tutorial with olcpixelgameengine and here is my snag: how did you manage to deal with the quads in the spyro_level.obj file? the code does not take more than 3 faces into account. i could only display the level correctly if i import, triangulate and re export the file. overall really nice work, keep it up sir and thank you.

    • @javidx9
      @javidx9  5 років тому

      Hi geo and thanks! A quad is just two triangles, so read the four face points and add two triangles to the mesh!

  • @ddream296
    @ddream296 5 років тому +2

    woah it looks nice :D
    gl

    • @javidx9
      @javidx9  5 років тому

      It does doesnt it? :D

  • @Veso266
    @Veso266 4 роки тому +1

    How did you squeeze cpp code into header file, isn't header file only for an interface which you then implement in your cpp file?can you do the oposite and squeeze everything in cpp file and include it?

    • @javidx9
      @javidx9  4 роки тому +1

      The compiler just sees source code, it cares not about file types. Convention dictates that declarations exist in headers and implementations exist in cpp files, and there are sound reasons for doing this, but it is possible to avoid it if you're careful with how the system is constructed.

  • @kingzeeb319
    @kingzeeb319 3 роки тому

    Would be awesome if you made a tutotorial series on how to create our own engine.

  • @yaroslavpanych2067
    @yaroslavpanych2067 5 років тому +2

    At 11:40 You must user %256 so color channel value 255 also can be used in color.
    Also you should separate color constants to dedicated inner namespace COLOR (or whatever) like you did with key codes.
    Hm... since you added transparency, you probably should fix Z-buffer part of 3D engine. I mean if closest rendered pixel to camera is semi-transparent, you need to know colors of pixels behind. I mean, I have no idea how traditionally such situation is handled in 3D engines, probably there is more efficient way to do that.
    PS: oh,, it starts to remind me old game engine I used to play with 10 years ago. Apocalyx, can be found on sourceforge. You probably can find something interesting there.

    • @javidx9
      @javidx9  5 років тому

      Hi Yaroslav, yeah, schoolboy error on the %256 thing :D Regarding Z-Buffers, if you use transparency then you still need to sort your triangles/objects first

    • @SerBallister
      @SerBallister 5 років тому +1

      transparent surfaces need separate handling, and possibly sorting depending on the blend mode, they cannot be thrown into the z-buffer alongside opaque stuff. Typically depth-writes are disabled for transparent objects too. They are quite a headache for modern deferred engines.

  • @alfabetet7489
    @alfabetet7489 5 років тому +1

    Amazing!!!

  • @cprn.
    @cprn. 4 роки тому +1

    I wasn't paying attention and misheard you referring to yourself as One Line Coder and thought to myself "Oh, what a freaking cool nickname!" and then I heard you right and I thought "Oh, what a sad sad lonely codeperson who I envy because he probably can focus on things..." ☹️

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

    How can i include in this using g++ command line
    (I'm on sublime text and have commands set up in a custom build configuration)

  • @booombaaam2370
    @booombaaam2370 5 років тому +1

    To run your programs I need Visual Studio 2017 with C++ desktop development right?

    • @javidx9
      @javidx9  5 років тому +1

      It depends. The quick answer is that is the easiest option, but the pixel game engine should work on most platforms and toolchains. The console game engine works in visual studio and there are a couple of variants for win7 and linux. I only use the free editions of VS.

    • @booombaaam2370
      @booombaaam2370 5 років тому +1

      @@javidx9 thanks for quick response I think I should opt for the VS 2017 Community Edition with C++ desktop development as this is the easiest way and furthermore I can also run more programs from different videos of your channel as you also work on VS 2017.

  • @astronime
    @astronime 4 роки тому

    Because of you I've actually started to develop a strong grip on C++, algorithms and even shown me why the maths I learned in school was useful.
    But...!
    I've run into an issue while trying to use the engine, mainly around abstracting the code. As an exercise and to mess around I tried to take the asteroids game you made and grow it, first I'm using the PixelEngine instead of the ConsoleEngine, and then I want to abstract things into classes like "Player" and "Enemy" which inherit from a "SpaceObject" etc (ultimately letting me make the game in a more robust manner). Issue is, for as something as simple as initializing the player to ScreenWidth()/2 and ScreenHeight()/2, I need "SpaceObject" to also inherit from olc::PixelGameEngine... I'm no professional at this stage :), but that doesn't seem ideal. I'm also a bit stumped when it comes to the drawing routine. I want to keep OnUserUpdate as clean as possible, and call something like Player.Update() which will draw the player (otherwise I'm not sure how to draw outside of the Player class) but that just doesn't feel right that every object is effectively inheriting from a base class "olc::PixelGameEngine". I'm sure there may be something that I'm just blatantly missing, but at the moment I can't figure it out. Any pointers?
    Side note, I've started reading about Composition vs Inheritance and I'm considering keeping my projects light on inheritence. But I think my questions above are still relevant to what's challenging me! You're a true coding hero to me and your generosity via these videos is inspiring!

    • @javidx9
      @javidx9  4 роки тому +1

      Only your main game needs to inherit from PGE. After that, give your objects a DrawYourself method and pass a reference of the PGE into them.

    • @astronime
      @astronime 4 роки тому

      @@javidx9 Thanks. I've spent a good few hours and stackoverflow exploring but I haven't figured out how to do this.
      Am I passing the game object I made into the DrawYourself(...) method itself, or into the constructor when I create the Player player(...);
      Another way I tried is like this, which is also not compiling: (sorry for the code dump!). If I could just figure out the correct line of code of the DrawYourself(...) method correctly I'll be able to figure the rest out!
      ============================engine.h
      #ifndef ENGINE_H
      #define ENGINE_H
      #include
      class Engine
      {
      public:
      void Draw(float x, float y);
      };
      Engine::Draw(float x, float y)
      {
      std::cout

    • @astronime
      @astronime 4 роки тому +1

      @@javidx9 I figured it out using your pass by reference advice. I had to fix the code below a little but afterwards I also had a header circular reference that was causing me pain! All solved now. Can't wait to experiment further, thanks for the help!

  • @jakovmarkovinovic7543
    @jakovmarkovinovic7543 4 роки тому +2

    I've been using olc Pixelgameengine for about a week now and it is fun to do but, the window can't be maximized or when I set the resolution to my screen resolution the window does not open in the middle, bottom right corner is always out of the screen and you need to drag the window manually. Can someone help with that please?

    • @javidx9
      @javidx9  4 роки тому

      Hi Jakov, you can specify the PGE to be full screen as part of the construct function. If you specify the resolution exactly to your display, and dont specify the full screen flag, don't forget windows will want to put a title bar on there, which makes it slightly larger than full screen.

    • @jakovmarkovinovic7543
      @jakovmarkovinovic7543 4 роки тому

      @@javidx9 I've gotten it answered on your discord server a day go, but still tnx

  • @focuseletronica
    @focuseletronica 5 років тому +1

    CARAMBA!!! Muito bom Mesmo. Grato.

    • @javidx9
      @javidx9  5 років тому

      Hey nenhum problema amigo e obrigado!

  • @FrostGamingHype
    @FrostGamingHype 2 роки тому

    is this in gui or in the console like before i loved the old console game engine so much i made it myself

  • @cariyaputta
    @cariyaputta 5 років тому +1

    Hi, I would like to know your idea behind using float instead of double? How to limit the FPS (i.e 60 FPS cap) using olcPixelGameEngine? Thanks you for creating such amazing game engine.

    • @javidx9
      @javidx9  5 років тому +1

      Hey! I use floats because i dont think i need the precision, simple as that. Also i like that floats and ints are both 32-bit so if i want to i can play with memory a bit, also if I wanted to use SSE it may make things easier. Also I like that float is explicit about what type it is, which makes the videos clearer.
      To lock the frame rate, there are two options, accumulate felapsedtime, until you reach the period you need in your case 1/60, and then update and draw everything, or in the case of PGE, remove the line SwapInterval(0) for now. I would exercise caution building applications which expect a particular frame rate though.

    • @cariyaputta
      @cariyaputta 5 років тому

      javidx9 Thank for your clarification. I have another question: when I run my game, the game window always reset to weird position (part of the window hidden below the taskbar), so I want ask you the way to set the position of the window to (0, 0) whenever the game start.
      I added 'SetWindowPos(olc_hWnd, nullptr, 0, 0, 0, 0, SWP_NOSIZE);' under Construct function but it didn't work.
      And also, how to port m_mouse and m_keys to PGE?

  • @Rimuru_Tempest_-
    @Rimuru_Tempest_- 5 років тому

    The thing i want to know is how you changed the "GetColour" function, or whatever method you used to shade the triangles in the port of the graphics engine.

    • @javidx9
      @javidx9  5 років тому

      Into pixel game engine? The lighting is simply the dot product now, which is between 0 and 1, so I just multiply that by 255 to get a pixel value.

    • @Rimuru_Tempest_-
      @Rimuru_Tempest_- 5 років тому

      @@javidx9 Thanks! I'm apparently too tired too use my brain xD

    • @Rimuru_Tempest_-
      @Rimuru_Tempest_- 5 років тому

      @@javidx9 Actually, could you link the code for the port? I'm getting some weird issues

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

    For some reason, I am seeing a completely white blank window with no title when I run the example. :( What am I missing?

  • @frankjibe
    @frankjibe 4 роки тому

    Javix9 it would be great if you could make a video explaining the code of PGE. I'm still struggling understanding some pieces and bits of the code and how you draw on the screen without using any of the commonly used library. Any hint from you or anyone in the community would be highly appreciated. Great job!

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

    I don't know if you take requests, but i would like to see how a "falling sand simulator" would be coded in your engine. i would be interested to see how this is done seeing that opengl seems to be the underlying api behind the game engine.

  • @nomoturtle1788
    @nomoturtle1788 4 роки тому

    Thank you so much

  • @JonnyRobbie
    @JonnyRobbie 5 років тому +2

    ...multiply...texture...shading...grr... :D jk, keep doing the great work. I just wished you finally got free of those limitations :)

    • @javidx9
      @javidx9  5 років тому +1

      lol, I know, I know! XD Will do, now I can cover lighting in detail at somepoint!

  • @hedwigacciari46
    @hedwigacciari46 5 років тому +1

    There's something I don't understand. It seems that you have your own implementation of shape drawing functions (lines, etc) but would it be beneficial to actually use OpenGL to draw these shapes directly on the GPU (with OpenGL functions)?

    • @javidx9
      @javidx9  5 років тому

      OpenGL isnt really set up for drawing pixels individually. Lets say I want to draw a circle, I would first have to approximate a circle with lines, populate a vertex buffer, then commission the GPU to actually draw it. Thats a lot of work, far more than just letting the CPU handle it. Also consider that OpenGL would require some sort of screen transformation too. There is always a trade off when rendering. If I had many circles, all similar, that I could batch render, then the GPU may become more efficient, but I'd need a lot of circles. I guess my point is GPUs suck at random access rendering, the CPU doesnt care, so for arbitrary drawing of pixels, most of the benefits of hardware rendering are lost. I do of course use OpenGL to render the final image to the screen, its effectively 2 triangles with the texture created by my CPU.

    • @hedwigacciari46
      @hedwigacciari46 5 років тому

      @@javidx9 Thanks, it clears things up in my mind!

  • @havocdev
    @havocdev 5 років тому +2

    Hey, I recently updated to VS2017 and am receiving this error: LNK2019 unresolved external symbol towards olc::Pixel::Pixel

    • @havocdev
      @havocdev 5 років тому +2

      Oh nevermind I forgot to define OLC_PGE_APPLICATION oops :p sorry.

    • @TealJosh
      @TealJosh 5 років тому

      @@havocdev
      What's that definition? I don't think it's mentioned anywhere.

  • @masterbedroom594
    @masterbedroom594 2 роки тому

    Dear javid, this is really great!!
    Can you please explain how do you scale the pixels to be bigger than the actual screen pixel? Couldn't get this from the code..
    Thank you!

    • @javidx9
      @javidx9  2 роки тому

      Thanks, it's arguments 3 and 4 of the Construct Function, it sets the initial pixel scale. However if you resize the window it gets changed automatically to maintain aspect ratio.

    • @masterbedroom594
      @masterbedroom594 2 роки тому

      @@javidx9 Yes, but where it goes from the Construct(..) function? Kind of lost there. It is used in the vPixelSize function, but what is the relation of the "pixel_w" and the "pixel_h" to the actual scaled pixel on the monitor?
      Thank you!

    • @javidx9
      @javidx9  2 роки тому +1

      @@masterbedroom594 it's a 1 to 1 relationship, so if you specify 2,2 then each game engine pixel begins life as 2x2 screen pixels.