I decided to make an alpha-version of gaming engine that I am currently developing available to the public (temporarily).
A discrete graphics card is highly recommended. 8 years old (ish) gaming PC or laptop should be fine. Don’t open it on mobile devices. It may load fine, but controls are not designed for mobile anyway.
You will need to download about 28.6MB (2.7 for menu and the rest for the level). But there are just static files which are very browser cache friendly.
I recommend Chrome or Edge browsers for the best results.
Here is sandbox-demo: https://babylonjs-fps.com
And here is what you can do.
In the level:
Push light objects (like crates and white cylinders) by running into them (like in Half-Life 2).
Pick up pickable objects from the floor by pressing the ACTIVATE button (F.E.A.R. style).
Pickup floating objects by walking into them (Quake style).
Most interactive objects have tooltips.
Use a variety of weapons. Some weapons may have fire modes (“B”), melee attack (“MOUSE4”), aiming down the sights to reduce recoil (“MOUSE2”), tactic and full reloads. Not all weapons have all the features. Also refer to keyboard bindings for more.
You can hide your gun in the holster by pressing the corresponding gun key again.
Bullets are physical and they lose altitude with the distance.
Bullets can ricochet. Ricochets are not dangerous, but still physical and can slightly push objects, including yourself.
Guns have accuracy and recoil features. Recoil is huge for the rocket launcher.
Explosions are smart, they don’t hurt through walls like in GTA 3/Vice City.
Doors can be opened using ACTIVATE button or using remote switch (configurable). There are sliding doors (opens upwards) and rotating doors (like normal ones).
Ascending stairs is harder than descending, just like in real life. Honestly, it was made by happy accident.
There are different kinds of monsters. Red ones (except turrets) have only melee attacks. Blue ones have melee and range attack. There is also a stationary turret (which is quite deadly).
Monsters can detour each other and obstacles; they also can climb stairs. I use spatial partitioning to check for collisions between objects only in proximity. Technically the engine can handle huge crowds of monsters (AKA slaughter maps), but it depends on mesh complexity of course.
If monsters accidentally hurt each other, they start to in-fight (Doom style).
Monsters will attack you if they see you (after you stepped in their FOV) or if you hurt them. However, they are deaf for now, so, your noises don’t bother them unless you hurt them.
If monsters lose visual contact with the target, they still try to chase and find it.
Player drops gun on death.
There are 3 types of triggers: functional (triggers function, for example, remote explosion in this case), teleport and damage zone.
Monsters can activate triggers too (configurable).
Damage zone can damage only players, only monsters or both (configurable).
Monsters can collect floating medkits if they accidentally run into them. Thus, monsters can even exceed their initial health (80 HP), but no more than predefined maximum (200HP). If the monster already has maximum possible health, he will leave medkit in place.
You can break the glass with bullets, explosions or melee attacks.
Two floating red panels are switches. Press ACTIVATE next to them. One just permanently changes color. The second one opens the nearby door and can be used multiple times.
In the main menu:
Change keyboard bindings and sound settings.
Choose chapter. Now available only test level and placeholder demo-scene.
Load and save game. Saving game forces downloading the save-file. Saving is optimized, I don’t save the whole scene or meshes, instead I save only necessary in-game objects states, so save files are relatively small. To load the game, you need to choose the previously saved file on your drive. Saving will work only in the levels or scenes where it’s explicitly enabled. It’s enabled for Test Level 0. Save files are generated (and loaded) on the client, so they don’t add to network usage. Quick save is bounded to F5 and quick load is bounded to F9. Default behavior for those buttons is prevented.
Start new game (do it!).
Return to game or main menu. Available when playing level.
Keyboard navigation works.
Other funny things to do:
You can push objects with bullets, including pickable guns and med kits.
You can walk on top of the glass.
Explosive barrels!
Smart sound queue is used. If many explosions happen simultaneously, your ear drums will not explode (compare to explosion of huge cluster of Revenant missiles in Doom 2).
You can fool around with the main menu background a little on the first screen.
You can throw away your gun (“G”) with all the ammo in the magazine. It doesn’t affect the ammo saved in your backpack/ammo belt. You can pick up dropped gun again with the same ammo in magazine.
Implemented, but not included in demo:
Monsters can step on each other (can be configured individually).
Monsters can patrol the designated route (if set).
Strong wind can push the player and objects. But you can create safe zones, protected from the wind. Functionality needs to be totally remade within new spatial partitioning architecture.
Server info:
I configured HTTP2 on the server, so all resources can be downloaded faster due to unlimited number of simultaneous requests. I also wanted to implement Server Push, but it appears to be deprecated in most of the browsers, while the new Early Hints are not useful for static websites, which is the case. So, I don’t use any of those. I don’t use any CDNs like CloudFront, because it costs money. But the download speed is not that bad anyway. Anywhere in the US it is 1-2 seconds literally. In remote locations, especially with worse internet, it may take some time (even up to 20-30 seconds). But again, the content is very browser cache friendly.
Everything runs on t2.micro EC2 instance in AWS, which is Free Tier Eligible, but I still have to pay for outbound traffic and public IP usage though . I also installed free HTTPS certificates which will expire in about 50 days from now. HTTPS is required for HTTP2. I may update certificates, but everything will continue to work even after expiration (you will just start to see annoying browser warning). I configured automatic redirect HTTP->HTTPS. But use HTTPS link from above just to be sure.
If you know any free webhosting with HTTP2 + HTTPS for just static files: HTML/JS/images, please let me know.
Currently, I am desperately looking for a job in LA or remote anywhere in the US. Not necessarily BabylonJS related. I have more than 10 years of experience as a web-developer. Mostly frontend (Angular, React, Next.js) but experienced with backend and full stack (NodeJS, Python). AWS certified. My LinkedIn.
UPDATES from 2024-12-16: See the comment 18