I Tried to Make Star Wars Battlefront II in JavaScript

Sdílet
Vložit
  • čas přidán 13. 06. 2021
  • Tried building a Starfighter Assault clone, all in JavaScript.
    Support me on:
    Patreon: / simondevyt
    Follow me on:
    Twitter: / iced_coffee_dev
    Instagram: / beer_and_code
    Github: github.com/simondevyoutube/
    Here I tried to build a 3D JavaScript game, mostly from scratch, using libraries like Three.js/Ammo.js. This was heavily inspired (very heavily) inspired from the Star Wars: Battlefront II: Starfighter Assault game, which looks way better, but c'mon, this is just one guy and JavaScript. The code could definitely serve as a starting point for a way cooler game.
    The goal of the project was to mash together a bunch of elements we've already seen, such as particle systems, third person cameras, player input controls, and introduce a few new things too such as the gamepad API and ammo.js physics support, and a bit of WebAudio through Three.js's API. Hopefully from this, you'll be able to understand how to integrate these various components to build out your own games.
    What I'll cover:
    * Basic game construction
    * Player input, particle systems
    * UI Components
    * GamePad API
    * Three.js and Ammo.js
    References:
    Inigo Quilez's site, lots of magic on noise and shaders, really the goto reference: iquilezles.org/
    Star Wars Battlefront II, very cool game, I assume from the trailers, haven't played it: / eastarwars
  • Věda a technologie

Komentáře • 413

  • @simondev758
    @simondev758  Před 2 lety +40

    Help support me: www.patreon.com/simondevyt

  • @mjs28s
    @mjs28s Před 3 lety +506

    you need to do some Udemy course for JS games!
    The current Udemy game selections are nothing like this. typically just bad side scrollers.

  • @alyctro8158
    @alyctro8158 Před 3 lety +56

    This straight looks like the oldschool battlefront game, amazing. Take me back to the glory days Simon.

  • @n8programs733
    @n8programs733 Před 3 lety +109

    Your use of shaders is so spectacular. You do all this advanced texturing and noise without any node-based programming or other GUIs.

    • @n8dev
      @n8dev Před 3 lety

      wowowoowowow

    • @blackcitadel37
      @blackcitadel37 Před 2 lety +4

      As they say, knowledge is power.

    • @aceman0000099
      @aceman0000099 Před 2 lety +7

      It's not much of a leap to go from node programming to code, if you're not dyslexic

  • @almostthere6116
    @almostthere6116 Před 3 lety +232

    Sometimes it isn't if you can, it's if you should, but you have my support anyway.

    • @simondev758
      @simondev758  Před 3 lety +89

      So keep doing everything in js is what I'm hearing?

    • @Soremwar
      @Soremwar Před 3 lety +6

      In today's world where you can write the more demanding parts in C++/Rust and the rest of it in JS/typed JS why wouldn't you?

    • @jimmychoong3014
      @jimmychoong3014 Před 2 lety +1

      Learner here trying to understand- is there a reason why it shouldn't be done? Performance related reason?

    • @simondev758
      @simondev758  Před 2 lety +38

      @@jimmychoong3014 Historically JS has been a slow language, that's been turning around a lot thanks to work from teams like the V8 team. As mentioned, you can develop parts in other languages (like Rust/C++), or just do the whole thing in JS, or just use Unity at this point. Everything has it's tradeoffs. JS tends to be easier and more forgiving than something like C++, although not as performant. See one of my last videos for a bit of a comparison.
      If you're interested in my background, I was a game developer for about 10 years, often led optimization on major titles, and was hired at Google for optimization, all C++.
      These videos are fun because they break the mould a bit, showing that complex games can be built without much trouble in languages you thought weren't capable of it.
      Ultimately it's up to you to decide what tradeoffs you're willing to live with.

    • @Merthalophor
      @Merthalophor Před 2 lety +8

      @@simondev758 JS has one thing going for it that the others don't: It's going to be huge. I think it's pretty plausible that web technology are going to take over 99% of graphical applications. The industry as a whole is moving away from local workstations, and towards cloud based applications that work 100% in the browser. MS Office will become browser based. VS Code runs in Chromium. Discord rund in Chromium. Slack runs in Chromium. Three.js ist just the start of 3d, there will be more & better tools. WASM will bring performant code & a diverse set of compiler front ends to the platform - C, C++, Java, Haskell, OCaml just through llvm alone. And JavaScript will be at the center of it. Modern JavaScript is pretty nice to write with. Transpilers for jsx & reason bring gui features to js that most other languages are still far away from aquiring. There is actually a react port of three.js in fact, if you're interested, called react thee fiber. Blew my mind how well it works. Haven't decided on weather it's good for game programming yet, but at the very least it expands the design space for regular websites to the entire world of 3d. You can literally mix & match html & three.js as you wish, 3d positioning and projection all work the way you'd intuitively expect them to.
      I'm pretty sure 5, 10 years from now, Windows will be dead, everything will be linux or macosx, but no one will notice because you'll work exclusively from your cloud storage via a fully integrated web browser. File systems will be more intuitive, and most importantly: all front end code will be built using current web technologies.

  • @AntonioCorrenti
    @AntonioCorrenti Před 3 lety +272

    Who wants a crossover with Sebastian Lague? SIMONDEV X CODING ADVENTURES

  • @julianstorm7722
    @julianstorm7722 Před 3 lety +141

    One of the most inspirational channels on this topic - if not the only one. Thanks for your work
    Edit: You might not consider yourself an artist but this is definitely a piece of art. Cheers

    • @Cal97g
      @Cal97g Před 3 lety +1

      Any similar channels?

    • @Bluepaccao
      @Bluepaccao Před 3 lety +1

      Sebastian Lague is great!

  • @LegoDinoMan
    @LegoDinoMan Před rokem +2

    9:39 Underrated Futurama joke wasn’t expecting Elzar

  • @ThunderstruckElectronix
    @ThunderstruckElectronix Před 3 lety +12

    I'm learning Web Dev and I think it's awesome to see all the cool stuff you can do with js.
    Cool video 👍

  • @MatthiasSchicker
    @MatthiasSchicker Před rokem +1

    9:22 "Noise is a great subsitute for actual art direction" :D

  • @russiangravy3870
    @russiangravy3870 Před 2 lety +2

    I like how smooth the movement is. Makes the actual game look like 100% lighting and particle-flare.

  • @kyou.rocher
    @kyou.rocher Před 3 lety +39

    "I'm a leaf on the wind" made me cry a little, still got PTSD from that scene

  • @aunyks
    @aunyks Před 3 lety +1

    Always so impressive. Thanks for sharing this with us!

  • @laja6108
    @laja6108 Před 3 lety +2

    This is so cool, I love when you make these videos 🙌🏽

  • @Bluepaccao
    @Bluepaccao Před 3 lety +1

    I love your dedication, awesome work man!

  • @gamershow5944
    @gamershow5944 Před 2 lety +3

    I can't believe you made this in JavaScript. It's really good looking. Your very talented to be able to code this together.

  • @stolensentience
    @stolensentience Před 2 lety +16

    4:07
    I’m crapping out particle systems myself as I watch this

  • @mobslayer211
    @mobslayer211 Před 2 lety +4

    This is where the fun begins
    I found you through the BOTW inspired rpg earlier. You've seem to have grown a lot in the last 5 months!

  • @drdonalfons
    @drdonalfons Před 3 lety +1

    You can export custom properties from Blender to GLTF files like this:
    1. In Blender, go to the Settings panel. There, you want to use either the "Object" or "Material" settings (maybe "Mesh" works, too).
    2. In those settings, scroll all the way down to "Custom Properties". Click Add
    3. Add your custom property. You can add numbers or strings
    4. Go to the export GLTF dialog (File > Export > GLTF / GLB)
    5. In that window in the "Include" section, hit the checkbox "Custom Properties".
    6. When loading the model in ThreeJS, custom properties are available under the object / material (mesh?) in the "userData" property.
    Keep up the good work! I definitely enjoy your videos - both from the technical level and style!

  • @danielzaiser
    @danielzaiser Před 3 lety +1

    Keep on rocking js game dev, you are unique, talented, entertaining, awe inspiring

  • @dempa3
    @dempa3 Před 3 lety +1

    Very interesting to listen to how you go about making these JavaScript games!

  • @Skeffles
    @Skeffles Před 2 lety +1

    Absolutely fantastic game! I loved the space battles in the now named 'Classic' Star Wars Battlefront 2

  • @JetLee1544
    @JetLee1544 Před rokem

    Exactly what I was looking for, thank you so much!

  • @AssasinZorro
    @AssasinZorro Před rokem +2

    When you showed your full game, I instantly understood the UI of Freelancer games that highlighted enemy ships and where to aim

  • @alvesvaren
    @alvesvaren Před 2 lety +1

    Looks really good, I think adding some not too bright light source reflecting from the planet would make it look even better

  • @CesarFelipeLopez
    @CesarFelipeLopez Před 2 lety +1

    Amazing as always👍

  • @GiusePooP
    @GiusePooP Před 2 lety +16

    10:52 tie fighter smashing into eachother

  • @francoisvermeulen706
    @francoisvermeulen706 Před 2 lety +1

    love your work

  • @jet-pack-zombie2258
    @jet-pack-zombie2258 Před 2 lety +1

    Actually really amazing. Simulates halo reach campaign misson and battlefront 2 amazingly great job

  • @sebajsilva
    @sebajsilva Před 3 lety +1

    Wow!!! Looks great!

  • @highzenburger1829
    @highzenburger1829 Před 3 lety +1

    Would 100% buy a JS game dev course. Didn't even think this was possible. Stumbled on your videos I'm happy I did.

  • @jimmyrustle271
    @jimmyrustle271 Před 2 lety +3

    Man I'd go crazy trying to write this in JavaScript instead of TypeScript. Nice job.

  • @geelemo
    @geelemo Před 3 lety +7

    I'm laughing/smiling watching this. especially when I saw the kid playing the game. wow!!!

  • @IwanPieterse-iwanzbiz
    @IwanPieterse-iwanzbiz Před 2 lety

    Incredible Job. This reminds me of the old Rogue Squadron game.

  • @daneilgreaves
    @daneilgreaves Před 2 lety +1

    Another amazing video

  • @drunkenpirate47x81
    @drunkenpirate47x81 Před 2 lety

    Man the idea of a web game is just a pain in the ass, like imagine making a responsive game, just the thought of it makes head start hurting

  • @stolensentience
    @stolensentience Před 2 lety +3

    Surprised no “do a barrel roll!” At the end
    Great work btw!

  • @eduardotobarjaque7758
    @eduardotobarjaque7758 Před rokem +1

    Really Amazing!!!!

  • @HereWasDede
    @HereWasDede Před 2 lety

    awesome work

  • @infocyde2024
    @infocyde2024 Před 2 lety

    You make me second guess my life as a developer :) You are brilliant man. Keep up the good work.

  • @UnidayStudio
    @UnidayStudio Před 3 lety +2

    Amazing video! I have a small tip to help you on 7:06 of the video:
    You could simply select all the turrets in blender and then use this bpy code to return their locations:
    [list(obj.location) for obj in bpy.context.selected_objects]
    To run it, simply open a new blender tab and select the python console (or press shift + f4).

    • @simondev758
      @simondev758  Před 2 lety

      Ooh thanks, I'll give that a try. Didn't even know there was a python console.

  • @JayanthBagare
    @JayanthBagare Před 2 lety

    Love your work and how you explain them. Just a suggestion, maybe you could cover 2d graphics also and some deep simulations such as fluid dynamics smoke etc.
    Would love to learn more from you

  • @spaceymen
    @spaceymen Před rokem +1

    Awesome video! WebGPU and Unreal engine 5 (web support) is coming soon, that would give so much power to web game devs.

  • @sanjaysinghbhandari3793
    @sanjaysinghbhandari3793 Před 2 lety +1

    really amazing job ❤️
    please put a video where you tell how you know so much, your journey...

  • @meepybeebaw4013
    @meepybeebaw4013 Před 2 lety +1

    Not even into coding, still a super interesting video. And incredible how you did it.
    I'd give three thumbs up, if I had them.

  • @theFuzzyWarble
    @theFuzzyWarble Před 2 lety +1

    Awesome inspiration, many thanks... and that Farscape reference in the game!! KUDOS!@#
    Long Live MOYA!!

  • @GhorthalonTheDragon
    @GhorthalonTheDragon Před 2 lety +2

    One of my favorite parts of this is that it uses web audio. And web audio by default uses HRTF for 3d positioning of sounds. So few games do this. I personally think all of them should at least have the option. Once you get used to actual 3d audio you never want to go back. Sound is extremely important. More game devs should be aware of this. Seriously put on some headphones and listen out for the explosions and how they move around. Web audio is epic. I'm very happy it exists. One of the most underappreciated things in web game dev I think.

    • @simondev758
      @simondev758  Před 2 lety +1

      Yeah I was pleasantly surprised with how three.js integrated that.

    • @Retrofire-47
      @Retrofire-47 Před rokem

      Sound design has always been disregarded in game design, erroneously I think. Look at every one of the most revered games in video game history, ALL of them, with almost no exceptions, have exceptional OST's, SFX, and ambient immersion.

  • @chrisjames278
    @chrisjames278 Před 2 lety +1

    This is awesome

  • @bunyslayer
    @bunyslayer Před 2 lety +2

    So uhh... turns out your a pretty good coder, this was fun to watch =)

  • @N_IndratejReddy
    @N_IndratejReddy Před 2 lety +5

    KID: MY DAD MAKES VIDEO GAMES FOR ME , HE IS A LEGEND.

  • @dalelandry8787
    @dalelandry8787 Před 4 měsíci

    "I'm just gonna crap out some manual particle systems" damned amazing! You sir are an inspiration to say the least, subbed!

  • @QuesterDesura
    @QuesterDesura Před 2 lety +1

    and again you did a great job :)

  • @viktorjacobsson4006
    @viktorjacobsson4006 Před 3 lety +13

    You can export metadata using the extras property in the gltf.
    According to the docs for the blender gltf exporter you should be able to check a box exporting custom properties as gltf extras.
    If I recall correctly, when loading the gltf the data ends up in userdata on the loaded model.

  • @krazybubbler
    @krazybubbler Před 3 lety +2

    I love your content. Awesome channel. I suggest you to check out react-three-fibre, maybe with use-cannon (physics) as this react stuff really makes game dev much easier IMO.

  • @americatoken3334
    @americatoken3334 Před 2 lety

    A gem on youtube , either I have not search enough or you are the only one doing this 🤭

  • @marmont8005
    @marmont8005 Před 2 lety +1

    you are such a cool guy!

  • @_Karlsson
    @_Karlsson Před 2 lety +5

    Everything looks so simple when you compress it like this =) Thanks for awesome content! (Yes, Star Trek is better)

  • @ustymukhman613
    @ustymukhman613 Před 3 lety +2

    Hi! Really awesome work, as always. And you've made me smile even more this time with your comments and the kid.

    • @simondev758
      @simondev758  Před 2 lety +1

      Codes coming, I don't work much on these videos/projects so it's whenever I have a spare moment. I'll upload the code when I get a chance to clean it up a bit.

    • @ustymukhman613
      @ustymukhman613 Před 2 lety

      @@simondev758 Totally understand that. Thanks for the reply, man!

    • @ASTERisk44946
      @ASTERisk44946 Před 9 měsíci

      @@simondev758 tried to play it but opened and nothing showed???? why doesnt the index display

  • @ademolaadenekan6869
    @ademolaadenekan6869 Před 2 lety +1

    Awesome!

  • @darialyphia
    @darialyphia Před 2 lety +1

    The legend is at it again

  • @buzbuz33-99
    @buzbuz33-99 Před 2 lety +1

    On the Destroyer gun turrets you could create animated parts in Blender, load the model and animations into JS, and then manipulate the animations within the game to move the turrets. (I used that method to creating working parts on an aircraft - ailerons, rudder, etc. - and to create a full set of working cockpit gauges with little animated pointers.) But that took many days. Alternatively, you could have created simple 3D turrets in JS, and attached them at various points to the model you downloaded (in three.js you would make each turret a 3D object and make them part of a Group). But I suspect that whatever method you used is much much simpler. Well done!!!

    • @simondev758
      @simondev758  Před 2 lety

      Great ideas, there's so many ways to approach it.

  • @michaelschlachter8865
    @michaelschlachter8865 Před 2 lety +1

    You can export metadata into gltf from blender.. you add "custom properties" to the mesh...
    and then make sure Include->Data->Custom Properties is checked in the Exporter,

  • @bennykell3
    @bennykell3 Před 2 lety +2

    Very cool

  • @blain20_
    @blain20_ Před 2 lety +1

    Very cool 😁👍

  • @Ryan_Perrin
    @Ryan_Perrin Před 2 lety +1

    I love three.js!

  • @keff_cb
    @keff_cb Před 3 lety +1

    cool stuff!!!

  • @UrielHK
    @UrielHK Před 2 lety +1

    Amazing!

  • @omgnowairly
    @omgnowairly Před 3 lety +1

    You inspired me to get busy again. Thank you.

  • @victorisrael6191
    @victorisrael6191 Před 2 lety

    You're amazing😵

  • @aaronhenry5376
    @aaronhenry5376 Před rokem +1

    I laughed quite a bit about the blender comment, because I am the same exact way with it.

  • @felleg4737
    @felleg4737 Před 2 lety +1

    Epic again! Came for the coding, stayed for the comedy (too) :D

  • @matthewhigley1018
    @matthewhigley1018 Před 3 lety +46

    Things I'll never be able to say:
    "I'm just gonna quickly crap out some particle systems..."
    "Then you gotta make a quicky crap AI for them..."
    Thing I have said:
    "Take the code and make this look less like crap..."

  • @kanpekiken2481
    @kanpekiken2481 Před 3 lety +1

    God it’s like Simon reads my mind when he makes new videos

  • @santozard
    @santozard Před 2 lety +1

    You’re amazing.

  • @pist5343
    @pist5343 Před 3 lety +2

    Awesome work! Great beta testers! Can't wait for the third edition a year from now 😁
    Btw simple way to make a space game look cooler is to add bloom. Its a pretty easy setup in 3js, wondering why didnt you go for it?

  • @esmailkhorchaniarts1142
    @esmailkhorchaniarts1142 Před 2 lety +1

    This guy's JavaScript is on another level

  • @cmcdonough2
    @cmcdonough2 Před 3 lety +1

    That's so cool.

  • @pandawoan
    @pandawoan Před 3 lety +12

    yoooo that's epic

  • @vegard172
    @vegard172 Před rokem +1

    haha, love the "Shut up Meg" x)

  • @therealjtgill
    @therealjtgill Před 2 lety +1

    Just found your channel, happy to become a patron

  • @MyXNH
    @MyXNH Před 2 lety

    Thank you for your awesome work! Can you please explain the benefits of using sphere mesh and shader material for the skybox instead of just a scene's background property?
    P.S. Would definitely love to see more of your videos with shaders explanations

  • @francisofthefilth8829
    @francisofthefilth8829 Před 3 lety +1

    Yes you can export metadata in Blender/GLTF. Simply set it as a key/value pair in the object's properties area, then access as mesh.userData inside three.js.

  • @braedengaines5089
    @braedengaines5089 Před 3 lety +1

    Great video man! Are you currently working on any official games, or just doing side projects right now?

    • @simondev758
      @simondev758  Před 2 lety +1

      Working on my house mostly (see Instagram), these videos are my side projects.

  • @SykoSilver
    @SykoSilver Před 3 lety +11

    This is fantastic. I was wondering, have you seen Sebastian Lague's channel? It's not JavaScript but if you ever want to go into procedural planet generation it might give you some ideas.

    • @simondev758
      @simondev758  Před 3 lety +16

      His videos are awesome, love the quality of those videos. I have a series on procedural planets too. I kinda go in a slightly different direction than Sebastian, overall goal is to one day make a JS version of No Man's Sky, but I get sidetracked with other projects like this one :)

  • @SuperlativeCG
    @SuperlativeCG Před 3 lety +7

    It’s unlikely that all the technology in Star Wars is standardized between planets, so cord compatibility must be a nightmare

    • @simondev758
      @simondev758  Před 2 lety +2

      It'd be like the old days of IBM pc vs macintosh

  • @kayak118
    @kayak118 Před 3 lety +2

    Can't wait to watch! 😁
    I'm gonna give UE4 a shot, and see what I can do with it.

    • @tomm.4447
      @tomm.4447 Před 3 lety +2

      they've just released UE5. Mb looking into that instead might be a good idea

    • @tylerclinton3475
      @tylerclinton3475 Před 2 lety

      @@tomm.4447 fight the temptation for now. UE5 still has bugs where UE4 doesn’t. If you jump into learning UE4 now, by the time UE5 gets a full release you’ll be fully prepared to take advantage of what it has to offer, and learn the new features

    • @tomm.4447
      @tomm.4447 Před 2 lety

      @@tylerclinton3475 fair point. Well decide for yourself OP

  • @martinnel2810
    @martinnel2810 Před 2 lety +1

    Really love your tutorials! Just a question, I'm looking for that explosion effect specifically... Is there anyway you can share just that 'ExplodeEffect' and 'ExplosionEffectEmitter' classes with me? It's around 3:04 in the video? Thank you very much and keep up the great work!

  • @carrotsandcats
    @carrotsandcats Před 3 lety +2

    Epic !!!

  • @ThePirateHistory
    @ThePirateHistory Před 3 lety +1

    Star conflict on minimals! but it's great

  • @xherdos400
    @xherdos400 Před 2 lety +2

    10:32 the gameplay there reminds me just of Star Fox free roam battle.
    still wish for a Star Fox game for pc :D

  • @CodingAbroad
    @CodingAbroad Před 2 lety +1

    Loving your videos. Have you used phaser js?

  • @HotShotMechPilot
    @HotShotMechPilot Před rokem +1

    Its too good man. I made a space shooter in js but it's not nearly as cool as this!

  • @michakrecisz5100
    @michakrecisz5100 Před 2 lety +1

    please make whole course about it... I will pay any money for that!

  • @kazimrahman7499
    @kazimrahman7499 Před rokem +1

    Genius....!!

  • @cidadaodeatlas125
    @cidadaodeatlas125 Před 2 lety +1

    omg, a true genius

  • @jeremycoleman3282
    @jeremycoleman3282 Před 3 lety +1

    I wanna play it! I ordered a $10 controller a week or so ago

  • @gnudj2918
    @gnudj2918 Před 2 lety +1

    Crazy

  • @colourfultoreador8467
    @colourfultoreador8467 Před 3 lety +1

    Amazing

  •  Před 3 lety +1

    AWESOME!

  • @stef9019
    @stef9019 Před 2 lety +3

    "Your scientists were so preoccupied with whether or not they could, they didn’t stop to think if they should."