Recommended Posts

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 :lol:).

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

Share this post


Link to post
Share on other sites

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 

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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 :D

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

@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.

Share this post


Link to post
Share on other sites

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" :D

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 :P, 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 ! ;)

Share this post


Link to post
Share on other sites

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 :D

Share this post


Link to post
Share on other sites

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 :P 

Otherwise it's really cool :D

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.