- Look Up

[X] - Jump [^]

[ Spacebar - Crouch Down ] [<][V][>] - Move



Spindash = Crouch Dowm + Jump</div>



<!--sizeo:4--><span style="font-size:14pt;line-height:100%"><!--/sizeo-->Technical Info<!--sizec--></span><!--/sizec-->



- The engine uses simple JSON wrappers for GLSL fragment and vector shaders.

That seemed like a pretty good idea at the time, but is now one aspect of the

engine I'm not completely happy about.



- Textures are regular PNG or JPEG (or even SVG!) images loaded by the browser.



- Meshes are stored on a custom JSON based format. (Yeah I know, using ASCII

for binary data is kind of stupid, but it's easier to load.) Animations are

vertex-based. (Yeah I know.) The source code of a simple converter

from Quake's `md3` files to this custom format is included under `tools/`.

You'll need to compile it with a C compiler to use it.



- Sylvester is used for Matrix and Vector math. It's probably going to be

slow by today's standards, specially if compared to something using

`Float32Array`s, but it's only used on non-critical sections of the code.



- Maps are tile-based! We have 128x128x128 tiles, as you would expect from a

Sonic engine. :-) The JSON format used should be self-descriptive.



- Objects can be indexed spatially using a grid, to allow for greater

performance when having lots of objects.



- The only form of collision checking available is ray-triangle intersection.



- Check the Web Inspector / Web Console of your browser for (not-so)

interesting debug messages.



- The camera is always aligned to one of eight axes in relation to the player:



<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'> \ | /

\|/

-----+-----

/|\

/ | \</div>



This is very important, as it allows the player to move with great precision

on a 3D environment using only the arrow keys.



<!--sizeo:4--><span style="font-size:14pt;line-height:100%"><!--/sizeo-->FAQ<!--sizec--></span><!--/sizec-->



<b>The control scheme sucks!</b>



*This is not really a question*. Anyway, I like it this way. Feel free to

change it on the source.



<b>Can I play this with a Joystick?</b>



As of 2011, natively, no. You can use something like JoyToKey if you want it

*that bad*. Expect that to change as progress is done by WHATWG and browser

implementors with the HTML living standard's `<device>` tag.



<!--sizeo:4--><span style="font-size:14pt;line-height:100%"><!--/sizeo-->Known Bugs/Issues<!--sizec--></span><!--/sizec-->



- The matrix inversion algorithm used is numerically unstable. This is actually

a Sylvester issue, and might result in wrong lighting on the models when

they're rotated to specific angles.



- Post-processing effects were *super slow*, and are commented out.



- There's something very wrong with my shadow math. It currently depends on the

camera position, and will break if you change the camera distance, FoV or

orientation on any axis other than Y.



<!--sizeo:4--><span style="font-size:14pt;line-height:100%"><!--/sizeo-->Cool ideas if you have free time<!--sizec--></span><!--/sizec-->

<b>

Easy</b>



- Edit the current test level!

- Make a new level!

- Change/add more textures!



<b>Medium</b>



- Implement new objects!

- Add sound/music support!



<b>Hard</b>



- Add customizable control schemes!

- Change the shader format to something more reasonable!

- Add support for binary 3d model formats!

- Refactor/clean up the code!

- Fix the shadow code!

- Implement bone-based animation!

- Optimize/enhance post-processing code.

- Make a level editor!

- Implement online multiplayer using something like Socket.IO! (This one is

pretty cool)



<b>Near-impossible</b>



- Make a finished game out of this ;D<!--QuoteEnd--></div><!--QuoteEEnd-->



<!--sizeo:4--><span style="font-size:14pt;line-height:100%"><!--/sizeo-->Grab the source here:<!--sizec--></span><!--/sizec-->



<a href="https://github.com/Coreh/WebSonic" target="_blank">https://github.com/Coreh/WebSonic</a> - Enjoy!



<I>I was thinking that if we could get this to a more playable state, (with levels and enemies and whatnot) and if we could host it somewhere to whoever wanted to play, it would be mighty cool.</I>