Canvex - web browser FPS engine

Started by
8 comments, last by Chad Smith 17 years, 8 months ago
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]
Advertisement
Hmm, I can't seem to get it to work - just black - on Opera 9 on Linux/x86.

~phil
Damn, above post was from me.

~phil
~phil
Works for me (FF 1.5.0.6 on Win32).

Very, very cool. Awesome work using async requests to load textures mid-game.
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.

Worked great for me, nice stuff.
Hi,

Very cool man. I used Opera 9.01 for it... Was a bit slow, 4 FPS, but then my computer isn't really that fast :)

Greetings.

That is just awesome, ran it on Firefox 1.5, had some problems with textures going black as I came closer to walls, but other than that it was pretty cool.
"Think you Disco Duck, think!" Professor Farnsworth
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.
I can't play it, as where I am at I am using IE7. Very nice though! I love it!


Chad.

This topic is closed to new replies.

Advertisement