jerome Posted June 28, 2016 Share Posted June 28, 2016 Hi beloved Babylonians, Well, I'm not that young compared to many of you and I'm coming straight from the 8-bit era. During this wonderful (to me) period, I spend so many hours playing on Atari Star Raiders and so many money on Star Wars arcade game (note that I could now pilot any space fighter after so much time in learning ). So I wanted to code a playabe BJS demo as a tribute to these fantastic old video games with some constraints : - must be runable in the PG : so the less external assets and only one createScene() method with plenty of comments - must run near 60 FPS on most of the computers - must be playable Although ever improvable, it's almost done. Stay tuned [EDIT] WIP here : https://github.com/jbousquie/Starfighter Sebavan, cartman, NasimiAsl and 1 other 4 Quote Link to comment Share on other sites More sharing options...
Dal Posted June 29, 2016 Share Posted June 29, 2016 Hey, this is actually quite fun! I think this could be worth spending some more time to make it really polished Quote Link to comment Share on other sites More sharing options...
jerome Posted June 30, 2016 Author Share Posted June 30, 2016 well, this will be just be a basis for some hypothetical more polished real game. This demo won't have any IA, complex enemy trajectory, score, real gameplay, scenario, etc ... well just a light demo running in the PG so people can edit or hack the code for their own needs. Still in progress, I wish I can make the enemy retaliate the next days and then publish a first PG Dal 1 Quote Link to comment Share on other sites More sharing options...
cartman Posted June 30, 2016 Share Posted June 30, 2016 really cool view! Quote Link to comment Share on other sites More sharing options...
Milton Posted June 30, 2016 Share Posted June 30, 2016 Should be a bit more tolerant on hitting the enemy Quote Link to comment Share on other sites More sharing options...
jerome Posted June 30, 2016 Author Share Posted June 30, 2016 wait for the next commit Quote Link to comment Share on other sites More sharing options...
Milton Posted June 30, 2016 Share Posted June 30, 2016 Are there any Babylon games out there? You're creating something that actually doesn't need a 3D engine Quote Link to comment Share on other sites More sharing options...
jerome Posted June 30, 2016 Author Share Posted June 30, 2016 Well, making 3D without a 3D engine is quite complex :-P Quote Link to comment Share on other sites More sharing options...
Milton Posted June 30, 2016 Share Posted June 30, 2016 Not really, since you're not using textures. Nothing easier than rotating lines. But the question remains, are there any Babylon games out there? Quote Link to comment Share on other sites More sharing options...
jerome Posted June 30, 2016 Author Share Posted June 30, 2016 huuu... just rotating lines seems still quite complex to me Quote Link to comment Share on other sites More sharing options...
Milton Posted June 30, 2016 Share Posted June 30, 2016 Well, I'm sure you know better. It doesn't take more than 1 cos or sin angle to rotate a coordinate. That's why games like Star Wars exist. But just answer the question. Is there a Babylon game out there? Quote Link to comment Share on other sites More sharing options...
jerome Posted June 30, 2016 Author Share Posted June 30, 2016 no idea [EDIT] : http://race.assassinscreedpirates.com/ http://flightarcade.com/ http://www.babylon.actifgames.com/Survival/index.php http://www.pixelcodr.com/games/shinobomb/index.html Quote Link to comment Share on other sites More sharing options...
Milton Posted June 30, 2016 Share Posted June 30, 2016 And that's why I would rewrite your game in 2D. There is no need what so ever to use 3D. You are relying on 3D to create an insanely simple 2D game. Quote Link to comment Share on other sites More sharing options...
Boz Posted June 30, 2016 Share Posted June 30, 2016 What is the problem between you and 3D ? ^^ Jerome is using BabylonJS for some time now, he knows the framework pretty well, so he wanted to create something with it. Learn a new 2D framework take some time (who has too much time here ? I'm trying to buy some, thanks in advance) And you know what ? You can create a 2D game with a 3D engine. Not the opposite. BabylonJS can do everything Quote Link to comment Share on other sites More sharing options...
jerome Posted June 30, 2016 Author Share Posted June 30, 2016 mmmh... as the screen is only, for now, in 2D, I suppose that any 3D game could be done in 2D because we finally project everything on the screen plane. That said, if rotating enemy ships, moving particles on the Z axis, computing some (the less possible, ok) 3D rotation matrices, moving blowed parts in the space, etc is not 3D, well... why not ? Then consider I'm using a WebGL engine instead. Quote Link to comment Share on other sites More sharing options...
Milton Posted June 30, 2016 Share Posted June 30, 2016 @jerome I'm not sure what you're saying. As long as you could use a 2D solution, you should. If you need a 3D engine, go with it. But it's not like you're creating Battlefield or COD. They need a dedicated GPU. If you code your game right, you could run it on a Z80. Quote Link to comment Share on other sites More sharing options...
jerome Posted June 30, 2016 Author Share Posted June 30, 2016 I never achieved to have a decent light reflection code with my ZX81 Quote Link to comment Share on other sites More sharing options...
Milton Posted June 30, 2016 Share Posted June 30, 2016 I sense you understand my point As long as you create a 'lines only' game, lighting is the least of your worries... Quote Link to comment Share on other sites More sharing options...
Dal Posted June 30, 2016 Share Posted June 30, 2016 @jerome Why not make it full 3d? Like X-wing vs Tie Fighter? That would be awesome. Quote Link to comment Share on other sites More sharing options...
jerome Posted June 30, 2016 Author Share Posted June 30, 2016 Well, it's just an attempt for me with the constraints I gave to myself : - as fast as possible - in the spirit of the two old games I mentioned in the first post - playable (yep, this is objective, but if I find it playable or my son, it's ok for me) - to be run in the PG (so with the less assets possible) so other people can use it as a basis for their needs or improve it... and maybe to be added as a small demo in the BJS site if DK approves it I know it's really improvable, but it's my very first attempt to do something playable and not only a demo case of a given feature as I usually do... and it's a real challenge for me. Doing something complete with user interactions, constant high perfs, infinity handling (infinite starfield with a fixed camera) and feeling playable is not that easy for me... even if Milton believes I would be able to do such an "insanely simple 2D game" No, I would definitely not. I find it complex to do, more than I expected initially. And yes, I mix 2D techniques with 3D behavior, essentially for performance reasons (my test case is my 10-year old laptop : if 60 fps, then OK), because I want the code to keep short and because I feel proud when I can cheat the users , faking sometimes 3D with 2D in some cases. In this demo, the cam is fixed, looking towards Z, all is axis aligned, but things really move in the 3 dimensions, so it's a specific case for 3D because it allows to simplify all the computations and to reduce the use of transformation or rotation matrices. But for me, 2D, 3D, 4D nothing really matters...but only playability, webGL use and perfs. And the fact to achieve to code such a demo... For those asking themselves what we are talking about here, they can check a live (not the last) version of the WIP here : http://jerome.bousquie.fr/BJS/Starfighter/ (fire = SHIFT) I'll keep this udpated until I push a first PG demo [EDIT] and guys, I know it's not at the expected level of current video games, but compared to my old 8-bit Star Raider experience, I already like it as it is for now ! Quote Link to comment Share on other sites More sharing options...
Milton Posted June 30, 2016 Share Posted June 30, 2016 I automatically try left mouse button to shoot, why SHIFT? (And I see textures , I kind of liked the old school wireframe though...) Quote Link to comment Share on other sites More sharing options...
jerome Posted June 30, 2016 Author Share Posted June 30, 2016 Arrff... because I wanted my son to spare my mouse button (he's a compulsive clicker), because SHIFT is a robust key on my keyboard and because I want to test/code it at work and I don't like earing the button click permanently [EDIT] the hidden reason is that it keeps my left hand occupied, so I don't put my fingers in my nose or somewhere else you don't want to know meanwhile. I know those are very subjective reasons, but, well, I'm the coder for now Boz and iiceman 2 Quote Link to comment Share on other sites More sharing options...
jerome Posted July 1, 2016 Author Share Posted July 1, 2016 Still some bugs and some needed tweakings, but almost done (soon) ... so http://jerome.bousquie.fr/BJS/Starfighter/ + F5 to clear your cache and the latest current version as usual, SHIFT to fire iiceman 1 Quote Link to comment Share on other sites More sharing options...
Dal Posted July 1, 2016 Share Posted July 1, 2016 I think the tie fighters are moving and spinning too fast now... and the rotations look wrong to me, they should only roll in the same axis as an aircraft. A "real" tie fighter couldn't move forwards whilst one of the circle parts is facing the camera, but yours can Otherwise it's really cool Quote Link to comment Share on other sites More sharing options...
jerome Posted July 1, 2016 Author Share Posted July 1, 2016 yep, the rotations and trajectory aren't realistic... this would be done in a further version, maybe with some IA I just implemented something that looks infinite and not that predictable or readable I will slow down, thank you for the feedback... and there are plenty of other tiny bugs Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.