Compiling PGE For Web Browsers!

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ก.ย. 2024
  • Now you can take your olc::PixelGameEngine programs, and run them in the browser. Great for jams, great for distribution, even works with mobiles! A huge effort from the OLC community putting this together, so a huge thanks from me to them! Using Emscripten to convert C++ code into Web Assembly (WASM) it is now trivial to transpile your applications to work with performance in browsers. An awesome convergence of technologies.
    Yes - I'm aware of occasional audio clipping in this video. I have a wretched sore throat and struggled to find a good balance, so that's just how it is.
    Patreon: / javidx9
    TH-cam: / javidx9
    / javidx9extra
    Discord: / discord
    Twitter: / javidx9
    Twitch: / javidx9
    GitHub: www.github.com...
    Homepage: www.onelonecod...

ความคิดเห็น • 127

  • @javidx9
    @javidx9  3 ปีที่แล้ว +85

    Firstly, yes there is occasional audio clipping. As you can probably tell I have a wretched sore throat and finding the right balance was difficult as my voice is disappearing XD. Secondly - how amazing is this??? Massive thanks again to the guys on Discord who put the effort into making this happen. I'm not a web person at all, and without them this would have been beyond me.

    • @OlavDanielGrosser
      @OlavDanielGrosser 3 ปีที่แล้ว +6

      Get well soon. 👍

    • @javidx9
      @javidx9  3 ปีที่แล้ว +6

      Hey cheers buddy!

    • @snesmaniac228
      @snesmaniac228 3 ปีที่แล้ว +1

      Does this works with Java applications?

    • @colonelcornelius7420
      @colonelcornelius7420 3 ปีที่แล้ว

      hey javidx9! i've been having the same issue for a while now.
      i often follow your tutorials, but when i actually run the program, it always crashes.
      if this is important, i use notepad++
      also, i was wondering what you use for your code.

    • @javidx9
      @javidx9  3 ปีที่แล้ว +3

      Engaging remote screen reading powers.... Ooof blocked. Since I can't see your screen to assess the errors you see, you'll just have to describe them here. 😊

  • @Whateverworksism
    @Whateverworksism 3 ปีที่แล้ว +60

    This is amazing! What a wealth of talent and passion the community has shown over the years.

  • @LundBrandon
    @LundBrandon 3 ปีที่แล้ว +3

    My Data Structures class used pixel game engine for a lot of our assignments. Planning on using this to display my projects for interviews and such! Thank you community!

  • @MarsCorporations
    @MarsCorporations 3 ปีที่แล้ว +1

    This is the best thing in 2021 so far. I programmed a lot of small (sometimes even "big" (well... big for a single person to program)) games (mostly towerdefense) and everything is always for people that have Windows and are willing to start some random .exe. I looked into so many "browser game dev things" over the years, I even started to try out JS or Processing (may god have mercy when I die), but I always missed my good old C++ (it is just better...). And now it is here. This changed everything. Big thanks. You gave me what I was looking for, and I didnt even ask.

    • @justgame5508
      @justgame5508 3 ปีที่แล้ว +1

      I was in a similar spot, I wanted something I could use the graphics for a network deployment simulation and optimisation tool I was building and as someone who’s codes mainly in C# there wasn’t a lot, I tried processing and after about a day of using it I decided it was less painful to switch back to C# and just teach myself OpenGL and use C# with the OpenTK wrapper, that’s how bad JavaScript is, learning OpenGL and implementing my own graphics engine was less painful😂

  • @backhoff
    @backhoff 3 ปีที่แล้ว +9

    Amazing stuff. Congrats to everyone involved. It is indeed a game changer :D

  • @dondubeau2874
    @dondubeau2874 3 ปีที่แล้ว +1

    I was just trying to figure out how to get emscripten working with pge a few weeks ago. Thanks for this!

  • @plueschAMAZONE
    @plueschAMAZONE 3 ปีที่แล้ว +2

    Again a real cool work. No programmingchannel makes me want to lern C++ so hard, like your does.

  • @MCChubbyUnicorn
    @MCChubbyUnicorn 3 ปีที่แล้ว

    Glad to see that it is in fact possible to make C++ work in browsers. A few years back, I tried, and couldn't even get even a cout to work. It ignored the fact I had the header for it or something. Bow I can try again

  • @SourceCodeDeleted
    @SourceCodeDeleted 3 ปีที่แล้ว +1

    This is indeed game changing.
    It is funny how the pixel game engine started as a project and has grown so much.

  • @SBH618
    @SBH618 3 ปีที่แล้ว +2

    Your stuff has been incredibly helpful as a game dev. Thanks for this!

  • @DaveChurchill
    @DaveChurchill 3 ปีที่แล้ว +9

    Great video! I love using emscripten for my projects. However I think you made a mistake with the aspect ratio when you said "currently it's a 4 by 3 ratio"
    According to my mental math, neither 256x240 nor 512x480 are 4:3 aspect ratios (as you mentioned in the video), in fact they are 16:15 aspect ratios.
    640x480 or 320x240 would have been 4:3 ratios. Or am I going bonkers? I know that this takes little to nothing away from the video, it just may throw a little confusion to some viewers

  • @StuBonham
    @StuBonham 3 ปีที่แล้ว +5

    Great stuff! Superb community effort!

  • @SparxableTunes
    @SparxableTunes 3 ปีที่แล้ว +1

    Thank you so much! You've unlocked a new mysterious portal for us all

  • @wChris_
    @wChris_ 3 ปีที่แล้ว +14

    you should make a CMake project for Emscripten, so it can be compiled and run basically anywhere
    (Visual Studio does support CMake projects!)

    • @javidx9
      @javidx9  3 ปีที่แล้ว +13

      Go for it! Im not a CMake person :D

    • @jaysistar2711
      @jaysistar2711 3 ปีที่แล้ว

      Yeah, I thought premake was going to take off. It turns out that CMake took off instead. Premake was renamed to Genie, but I think SCONS got more popular than Genie, especially with Godot using SCONS. I almost returned to my `make` only and "C über alles!" days with no C++, but I found Rust, Cargo, and the `cc` crate. Now, I only use C and C++ in libraries, and that's only when I need to do so. All of my new projects are in Rust, where Cargo is known to be the dominate build system, and buildtime code, if nessisary, are written in Rust, not some scripting language, and not the (CMake) worse option of a stringly typed one-off DSL.

    • @javidx9
      @javidx9  3 ปีที่แล้ว +2

      Welcome to modern day development.......

    • @clydx1239
      @clydx1239 3 ปีที่แล้ว

      @@javidx9 xD.

  • @billybest5276
    @billybest5276 3 ปีที่แล้ว

    Super cool! This will make sharing projects easier and even more impressive imo

  • @vatemsura
    @vatemsura 3 ปีที่แล้ว

    You're a good man. People in Russia watch you and love you.

  • @taraxacum2633
    @taraxacum2633 3 ปีที่แล้ว +14

    No more p5 I guess? 😂
    This is super awesome!!!

  • @agemans_stuff
    @agemans_stuff 3 ปีที่แล้ว +3

    By looking at your code it seems you have your abbreviated pi wrong (3.1459). It should be more like 3.14159...

  • @htrayford122
    @htrayford122 3 ปีที่แล้ว

    So exciting! Congrats to those who contributed.

  • @Volian0
    @Volian0 3 ปีที่แล้ว +3

    thank you Javid, very cool

  • @Digidan5
    @Digidan5 3 ปีที่แล้ว +3

    6:03 ahh well thats me buggered then XD

  • @Enriath
    @Enriath 3 ปีที่แล้ว +31

    You mention you don't like Git, and now I'm curious why?

    • @BenMakesGames
      @BenMakesGames 3 ปีที่แล้ว +3

      that stood out to me as well!

    • @GorkSIG
      @GorkSIG 3 ปีที่แล้ว +1

      Sadly if you want to use git, you need to learn it first. Ideal tool would not burden programmer with any learning, it would just work, leaving programmer with more time to spend it on actual work.

    • @Derrickasaur
      @Derrickasaur 3 ปีที่แล้ว +4

      @@GorkSIG you can learn the basics in an afternoon so if you're a programmer and refuse to learn Git you might be just lazy ( and anti-collaborative - given there is no better technology for sharing and merging code among multiple developers in context of working together on common codebase )

    • @dreamyrhodes
      @dreamyrhodes 3 ปีที่แล้ว

      @@kidmosey Same nowadays happens in node or Ruby, Python, PHP too... proliferation of dependencies and toolchains (all with their own dependency trees). It's a plague.

    • @wopmf4345FxFDxdGaa20
      @wopmf4345FxFDxdGaa20 3 ปีที่แล้ว +1

      @@JFlatby Git is a tool that you can install anywhere. Git respositories also can be hosted anywhere. For these reasons "Git" cannot be "filled" with anything, but sure someone may be hosting git repositories that are garbage.

  • @taraxacum2633
    @taraxacum2633 3 ปีที่แล้ว +8

    Wait wait wait, is the star field project a reference to the first coding challenge on the coding train? Are you trying to replace p5.js with PGE? Hell yeah!!! Diversity rocks!

  • @AI-ec2qb
    @AI-ec2qb 3 ปีที่แล้ว

    Rumor has it, that Javidx9 is a Pleiadian 👽

  • @jesse103
    @jesse103 3 ปีที่แล้ว +2

    yes

  • @keremkalntas7137
    @keremkalntas7137 3 ปีที่แล้ว +1

    wow, this is awesome

  • @Plrang
    @Plrang 3 ปีที่แล้ว

    Thanks, I was just about to refresh that one

  • @stefanfrei6199
    @stefanfrei6199 3 ปีที่แล้ว

    exactly what i needed, much appreciated!

  • @Mozartenhimer
    @Mozartenhimer 3 ปีที่แล้ว

    This is super exciting.

  • @carlosandresconrado461
    @carlosandresconrado461 3 ปีที่แล้ว +1

    Wait wait wait, you can add files to an existing zip only by dropping them on the zip file?

    • @javidx9
      @javidx9  3 ปีที่แล้ว +1

      Why yes you can! 😂

  • @PANDY_________________________
    @PANDY_________________________ 3 ปีที่แล้ว +1

    Hi @javidx9, I don't know if I should ask this here, but here it goes: Regarding the raycasting engine and the 3d software rasterizer that you have presented in the video series, what project do you think has more possibilities of scaling in such a way that you can add more features to achieve the most immersive experience and maintain decent performance? I must clarify that I would use that scenario as an experimentation for some hobby development and see how much it can be improved. I see the raycasting technique somewhat limited to experimenting with added stuff but I may be wrong. Thanks

    • @javidx9
      @javidx9  3 ปีที่แล้ว

      Definitely the 3d rasterizer gives you the more options going forward, it's effectively limitless what you can implement.

    • @PANDY_________________________
      @PANDY_________________________ 3 ปีที่แล้ว +1

      Thank you very much for the advice, it is what I was looking for, your channel is awesome !!

  • @Exi0n
    @Exi0n 3 ปีที่แล้ว +1

    Love your videos!

  • @rodionsabbath9722
    @rodionsabbath9722 3 ปีที่แล้ว +12

    lol popularity comes with a price now you have js code in your header file :D

    • @javidx9
      @javidx9  3 ปีที่แล้ว +5

      ... indeed 😒

  • @laureven
    @laureven 3 ปีที่แล้ว +2

    :) just another comment about how awesome this is :)

    • @javidx9
      @javidx9  3 ปีที่แล้ว

      Thanks Marcin!

  • @ishdx9374
    @ishdx9374 3 ปีที่แล้ว

    Helped me during gamejam

  • @JohnSmith-es2fh
    @JohnSmith-es2fh 3 ปีที่แล้ว

    hello, ive just finished with studying c++ from some guides i've found in internet and im interested in making games, and for the beginning i want to understand how to work with win api, what can you recommend as a studying material?
    also: im really interested in making my own engines like your ols pixel engine

  • @walney2008
    @walney2008 2 ปีที่แล้ว

    hello, for example in unity it has the functions start,update, and uses the built-in c#, how to create this? I saw your C video with lua, more how to create these built-in functions.

  • @NikkiMcMistie
    @NikkiMcMistie 3 ปีที่แล้ว

    Ah I heard about this. Never quite knew how it worked,

  • @tropicheist6347
    @tropicheist6347 3 ปีที่แล้ว

    Woah this is awesome news!

  • @my_temporary_name
    @my_temporary_name 3 ปีที่แล้ว

    That's really neat, but how is the final product half a megabyte in size? I thought WebAssembly was supposed to be tiny.

    • @javidx9
      @javidx9  3 ปีที่แล้ว

      Average webpage size is just over 2MB these days, so it is by comparison.

  • @redstoneplayz09
    @redstoneplayz09 3 ปีที่แล้ว

    What are you rules for naming variables? I see you use small case letters before the actual name all of the time. What does it mean?
    It just seems like your names are such a perfect fit and mine look horrible.

  • @doublegdog
    @doublegdog 3 ปีที่แล้ว +1

    youtube stopped recommending your videos to me even though i am subscribed. i made sure to search an dlike this video.

  • @just_code
    @just_code 2 ปีที่แล้ว

    Do you know how to fix Uncaught RuntimeError: unreachable executed
    ?

  • @TimothyChapman
    @TimothyChapman 3 ปีที่แล้ว

    Can you make a video to extend Visual Studio to compile to a custom-designed processor?

  • @Codepeats
    @Codepeats 3 ปีที่แล้ว

    Amazing

  • @OriginRow
    @OriginRow 2 ปีที่แล้ว

    You should have featured for Unreal Engine new versions HTML5 support atleast 4.27

  • @dasten123
    @dasten123 3 ปีที่แล้ว +1

    this is cool! :D

  • @Furkan-ll4gy
    @Furkan-ll4gy 3 ปีที่แล้ว

    After collission series can you make addon or feature to physycs in olc engine

  • @saysoy1
    @saysoy1 3 ปีที่แล้ว

    look, for no reason i want to offend you... JAVA

  • @stephenkamenar
    @stephenkamenar 3 ปีที่แล้ว +1

    build tools make me sad :(
    this is awesome though

  • @thalescarl1589
    @thalescarl1589 3 ปีที่แล้ว +3

    Forget Javascript. I want PGE to run everything on web.

  • @jaysistar2711
    @jaysistar2711 3 ปีที่แล้ว +1

    I thought that it already supported wasm. I guess it just got it.

    • @javidx9
      @javidx9  3 ปีที่แล้ว +1

      In truth a test version has been lurking in the shadows for about 10 months, while we got to grips with the technology. One of the major changes was the renderer requirements thus the introduction of the OGL33 renderer a couple of months ago.

  • @coolcodingcat
    @coolcodingcat 5 หลายเดือนก่อน

    I got emscripten to work with pure C code, but not with C++ code.

    • @coolcodingcat
      @coolcodingcat 5 หลายเดือนก่อน

      Well now I see why, didnt know there was an em++ command. Was using emcc.

  • @thecakeredux
    @thecakeredux 3 ปีที่แล้ว

    "Hello" indeed.

  • @dreamyrhodes
    @dreamyrhodes 3 ปีที่แล้ว

    Microsoft has in 35 years not managed to create a proper comandline window (no, PowerShell doesn't count as it is an own environment).

  • @BudgiePanic
    @BudgiePanic 3 ปีที่แล้ว

    nice

  • @WikiPeoples
    @WikiPeoples 3 ปีที่แล้ว

    important question: do you drink coffee / caffeine?

  • @frankbj57
    @frankbj57 3 ปีที่แล้ว

    Did you add the source code for this to github? Can't seem to find it.

    • @javidx9
      @javidx9  3 ปีที่แล้ว

      It's part of the PGE header, no extra files required (other than emscripten compiler)

  • @jechet10
    @jechet10 3 ปีที่แล้ว

    Absolutely stunning. Is this the first C++ game engine to support compiling to WASM for use in the browser?

    • @javidx9
      @javidx9  3 ปีที่แล้ว

      I highly doubt it. At the rate I develop things it's very likely the last 🤣

  • @tawandagamedevs
    @tawandagamedevs 3 ปีที่แล้ว +4

    Im first to comment love this guy

  • @GameBacardi
    @GameBacardi 3 ปีที่แล้ว

    Neat

  • @walney2008
    @walney2008 2 ปีที่แล้ว

    please speak create compiler, lexer,parser , use portugol exemple, generate codigo in C, create exe, please

  • @stinkytoby
    @stinkytoby 3 ปีที่แล้ว

    Where can I find the tool you mention at the end?

    • @javidx9
      @javidx9  3 ปีที่แล้ว

      In the OneLoneCoder GitHub repo

  • @hermannpaschulke1583
    @hermannpaschulke1583 3 ปีที่แล้ว +1

    What version control do you prefer?

    • @javidx9
      @javidx9  3 ปีที่แล้ว +12

      version_old_aaa_2_1_new_beforebug_6_new_new_AAA

    • @AB-uk4pd
      @AB-uk4pd 3 ปีที่แล้ว

      @@javidx9 >:D

    • @hermannpaschulke1583
      @hermannpaschulke1583 3 ปีที่แล้ว

      @@javidx9 lol

  • @quickscope3643
    @quickscope3643 3 ปีที่แล้ว

    dope video

  • @poorman-trending
    @poorman-trending 3 ปีที่แล้ว

    Can you make a rogue clone?

  • @resw
    @resw 3 ปีที่แล้ว

    Hi javidx9, can you also prepare a video to explain how to use visual studio for C++ development? Thanks.

    • @javidx9
      @javidx9  3 ปีที่แล้ว +4

      th-cam.com/video/eTGSTTxR-Ss/w-d-xo.html and th-cam.com/video/53b5oJDu-C4/w-d-xo.html

    • @resw
      @resw 3 ปีที่แล้ว

      @@javidx9 Thanks again. Your videos are really helpful.

  • @spiikesan
    @spiikesan 3 ปีที่แล้ว +3

    I like the "2 views - 40 likes". Sure i'm one of those likes, as it's the first thing I do.
    Thank you.

  • @Joysolidario
    @Joysolidario 3 ปีที่แล้ว

    How do you debug it?

  • @nacnud_
    @nacnud_ 3 ปีที่แล้ว

    " not a big fan of git"..... How does that even happen?

    • @javidx9
      @javidx9  3 ปีที่แล้ว

      I used it once. It was enough.

    • @nacnud_
      @nacnud_ 3 ปีที่แล้ว

      @@javidx9 fascinating. What's your SCM then?

  • @JkyLi
    @JkyLi 3 ปีที่แล้ว

    Sadly, javascrip finally polluted my favourite coding channel. I thought here was the last heaven of purity. I sincerely hope that the browsers would no longer depends on javascript to run wasm.

    • @Derrickasaur
      @Derrickasaur 3 ปีที่แล้ว

      what difference does it make? JavaScript is the native programming language for the web; that will never change. WASM is simply an assembly-like brutalized version of it so that it can churn out max performance and be easy compiliation target from other langs. Saying you want browsers to drop JS support is like saying you want Windows to drop C. It makes no sense since it underpins the entire platform and if you don't want to use it you don't have to (ie- by using Emscriptten).

  • @avocadotomato1789
    @avocadotomato1789 3 ปีที่แล้ว +1

    do you guys have a problem with transgender people being on your discord server or something...? emmy#9332 is my discord and ive never broken one rule on your server but for some reason ive been banned. sorry to say but im left to assume you banned me in a discriminatory manner as ive done nothing wrong and you can check my post history there to see the proof. what's up with this? are you not a fan of me being transgender...? this is pretty messed up im sick and tired of being discriminated against online and i considered your server a safe space for me but i guess not considering you or some rogue admin hates transgenders and banned me. i see no other reason they would have done it... my discord made it obvious that i am... so why... im assuming i wont even get a reply from you if you know that it happened because you are gonna want to cover this up and throw it under the bus... messed up dude. i supported you and your channel for a long time and this is what I get for wanting to be apart of your community?

    • @javidx9
      @javidx9  3 ปีที่แล้ว

      This is now the second place where you are publicly accusing me of discrimination without any evidence. And I will repeat what others have told you. You have not been banned by any moderator or myself from the OLC discord. Discord keeps records of banned accounts that we can access, on which you are not listed. What happens occasionally (and has to a couple of members recently) is you share an IP address range or VPN with someone that has been banned. There is nothing we can do about that, and you will have to take that up with Discord directly.

    • @avocadotomato1789
      @avocadotomato1789 3 ปีที่แล้ว

      @@javidx9 I do not share an IP address and I was not on a VPN... Your server is the only server that disappeared from my list of servers and joining back does not work. You don't see how that would be suspicious at all?

    • @javidx9
      @javidx9  3 ปีที่แล้ว

      So your approach is to first accuse me of discrimination across various public platforms instead of using those platforms to reach out and enquire about what is likely a technical fault? Regardless, you are not on our banned list, but because you have technically "left" the server, I can't interact with your profile in any way to resolve the issue. Your posts are still there, and I agree you have broken no rules. And as you've probably read on one of the other platforms you've accused me on, this is not isolated to just you.

  • @tomtravis858
    @tomtravis858 3 ปีที่แล้ว

    Windows is cringe

    • @javidx9
      @javidx9  3 ปีที่แล้ว +13

      Fanboism is cringe too 😂

    • @JG-nm9zk
      @JG-nm9zk 3 ปีที่แล้ว +2

      Says the Pixel Game Engine fanboi 🙃

    • @justgame5508
      @justgame5508 3 ปีที่แล้ว +2

      Imagine being that childish you genuinely believe an operating system is “cringe”😂