Sign in to follow this  

Canvex - web browser FPS engine

This topic is 4131 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Early attempts at FPS games in web browsers, like Wolfenstein 5K, were somewhat limited by the graphical capabilities of JavaScript on the web. Modern web browsers are implementing the canvas tag, which provides much more power - Canvascape was an early (and as far as I know, about the only) example, but it is limited to very simple graphics. So I had a go at making my own FPS engine using the canvas, resulting in Canvex. It should work in Firefox 1.5+ and Opera 9 on any operating system, with no extra plugins or extensions, although there may be browser bugs on some platforms. It is rather processor-intensive, so a fast computer is recommended. Firefox 2 (currently in beta) gives the best performance, at least on Windows; Opera is a bit slower, and Firefox 1.5 is slower again and not very smooth. The site is using the Coral cache to save my limited bandwidth, but that is sometimes a bit temperamental - if you can't get it to work, remove the .nyud.net:8080 from the URL. The engine features polygonal environments, textured walls, lighting, animated sprites, non-Euclidean space, windows, moving geometry, and more, all in standard HTML and JavaScript. The current map is a bit boring (since it was made by me) but it does demonstrate most of the current capabilities. There's no real gameplay code, though it shouldn't be too hard to extend the engine into more of a game since the world is largely dynamic and everything is written in a scripting language. But I don't have any plans for working on such things in the near future. Anyway, I'd be interested in seeing what people think of it, and whether there are any compatibility problems, or ideas about where the project could be taken, or whether I'm just crazy for trying to write games this way [smile]

Share this post


Link to post
Share on other sites
Quote:
Original post by JonnyQuest
Hmm, I can't seem to get it to work - just black - on Opera 9 on Linux/x86.

I'd guess that's caused by the cache being slow and failing to serve some of the files (particularly the UI graphics) - sometimes the 'stop' button tells the browser to give up and it starts working with the ones it has managed to load. Otherwise, try the non-cached version instead.

Share this post


Link to post
Share on other sites
Quote:
Original post by Limitz
Was a bit slow, 4 FPS, but then my computer isn't really that fast :)

I tend to get about 20fps in the default 'small' size in Opera 9.01, Windows, P4 3GHz (which is just slightly above the system requirements of games with similar graphics that were released ten years ago...), but I get twice that in 'tiny' mode. The latest versions of Firefox 2 (beta 2 should be out next week) give me 30fps in 'small', and non-broken versions of Firefox 3 (long, long way from even alpha) give 40fps. I don't think there's much I can do to make my code faster other than waiting for the browsers to improve, unfortunately...

Quote:
Original post by Horatius83
problems with textures going black as I came closer to walls

Hmm, there are a number of bugs in Firefox (actually Gecko and Cairo) that cause that, especially on Windows, but I've added workarounds for all the ones I've seen. Another possibility is that it's missing some textures, in which case reloading the page might perhaps fix it. Not sure what else it could be, though.

Share this post


Link to post
Share on other sites
Sign in to follow this