Firefox 3D Canvas FPS Engine 280
axonis writes "Benjamin Joffe has developed Canvascape - "3D Walker", a simple javascript browser based 3D first person game engine that shows off the capabilities of the Canvas tag found in Firefox, Safari and Opera. " Don't expect much except a proof of concept ;)
overhead (Score:4, Interesting)
Re:overhead (Score:4, Insightful)
Re:overhead (Score:2)
Well, if you need portability for some graphical gadget, why not do it in Java [nyu.edu]?
I'm really not too impressed with all this Javascript-used-for-graphics stuff that's in vogue right now - okay, so this Canvas element allows much more graphical control over page layout, but if this mini-FPS is anything to go by, it's horribly slow. As a comparison, see the famously slow Java do a far more complex scene entirely in software [nyu.edu]...
Re:overhead (Score:2)
That said, what he did is a good tech demo of what users/programmers out here can do with Canvas on the most recent Firefox versions ! Although older computers should not be neglected, the power of modern computers leaves some room for improvement: it is perfectly usable on my machine, which is more than two years old.
Re:overhead (Score:4, Funny)
Re:overhead (Score:3, Interesting)
Re:overhead (Score:2)
Re:overhead (Score:2)
The first part about special insights obtai
Re:overhead (Score:2)
Of course, I think it highly depends on the app. Java as a language has a bit more memory overhead for things like string operations.
People have described C as something like an architecture-independant assembler. In other words, if you know the C, you can easily translate it into assembler. C++ and Java are completely differnet beasts. And although I keep hearing people talk about overhead in one or the other, I have never seen particularly good benchmarks which wer
Re:overhead (Score:2)
Also, you said: People have described C as something like an architecture-independant assembler. In other words, if you know the C, you can easily translate it into assembler.
Re:overhead (Score:4, Insightful)
Having worked in Fortran, I can tell you that some things are just not possible to optimize well in Fortran either. And although I will admit that it is possible my knowledge of Fortran could be outdates (is there any other kind?) I suspect that you still have issues with optimizing for certain things (such as executables of sane sizes when dealing with huge arrays).
Again, I have friends who work as programmers in scientific fields who have complained about the overhead of Java in things like genetics analysis apps. On both the Fortran and Java the problem is not how fast can you pass X benchmark but rather how fast will your program work on a data set of arbitrary size.
Indeed Fortran makes this requirement next to impossible for the very fact that all memory allocation is done at *compile time* in Fortran 77, and in Fortran 90, you still extremely inflexible and this is what allows certain optimizations to take place.
Secondly, these posts only deal with pointer optimizations. They *do not* deal with the question of whether a given application will be faster than another one, especially in cases where many of the cycles are run through routines which don't involve user defined pointers. There is a very real question whether in memory or processor intensive applications whether these pointer optimizations will create a *net* gain of speed. For example, lets say in Fortran 77, I use a static array that is large enough to take up most of memory because this is the maximum size I *may* need for my application. At least with Fortran 77, this executable will be *big* and take time to load that could be better used actually running the program. Secondly, what happens when I also need to run another app on that same system? What is going to get swapped to disk? How is that going to impact performance? How does the kernel scheduling affect things?
Now supposed I write the same app in ANSI C using malloc and free where appropraite. The executable will load faster and *only use the memory it needs.* This means less swapping, and fewer delays due to outside factors.
In Fortran 90, things get somewhat better. I can create an array and then allocate space to it. But complex data structures are still lacking and so certain types of problems are going to get semantically *ugly* in Fortran 90. Ugly semantics makes for slow programs.
Here is the thing. There is no "perfect language." Fortran excells at allowing science students to rapidly develop quick and dirty programs to solve science problems safely (no buffer overruns, etc). These simulations, provided that they meet certain criteria, will probably run faster in Fortran than in any other language. But I don't think you can generalize this to an idea that "Fortran is faster than C" because in many cases, it won't be (many of these cases are corner cases in Fortran's core market though).
As for Java... It is great at some things. But there are many other areas where it simply doesn't perform well. Again processor and memory intensive apps (especially those involving string processing) come to mind. Java excells at being able to offer closed source software vendors a compiled environment with the portability of a scripting langauge. If performance continues to improve, great, but I don't think that performance will ever be the reason to choose Java, unless it is being compared to the likes of Python. Is it possible to determine circumstances where it may perform better than C, C++, or insert language here? Sure, but can one say that this means that Java is on a par performance wise with these languages? I don't think so.
Re:overhead (Score:4, Interesting)
I would suggest compiling performance sensitive apps to asm, and then optimizing nested loops and some comparison orderings. It is possible to get a lot better performance out of assembly.
Re:overhead (Score:4, Informative)
Bottom line, my register usage makes all the difference.
http://compucatedsolutions.com/asm.htm [compucatedsolutions.com] contains the C++ and assembly sorts, you'll notice they both operate in exactly the same way. I couldn't manage to get it past the lameness filter.
Re:overhead (Score:2)
And the assembler code breaks when CPU upgrades happen.
Re:overhead (Score:5, Informative)
Imprecise. If considering only a specific platform and no existing libraries, you're even completely wrong: Coding ASM is significantly more time-consuming than coding C, but the difference is 3-5 times "only".
Obviously, with C, you get a higher level of abstraction, therefore more reusability, portability, etc.
> Then the C code would end up faster because compiler optimizations are faster than anything a person could hope to do,
Depends on the platform. Hardly anybody is able to optimize for speed a modern x86 processor "by hand", but RISCs and even some CISCs like the 68000 are another story. I have been programming for years as a hobby on the 68000 processor, and I have seen:
* GCC missing completely obvious CSEs: a global array used about ten times in a row, the compiler won't put its address into a register even if it has many spare ones;
* GCC not using the instruction set possibilities (10-byte code instead of 4-byte code, and that spills one more register; bad code related to local variables on the stack; etc.);
* GCC completely messing up a calling convention that should be more optimized ( saves&restores on a register that isn't even changed);
* etc.
Wonder why a number of not-very-powerful embedded platforms, like calculators, are still partly programmed in ASM...
There may be more appropriate compilers for those processors, but hey, GCC is supposed to be portable, and it has (had, they deprecated some useful things like casts-as-lvalues in GCC 4.0) cool extensions that most other compilers don't have.
> and it would be portable too.
If you use external libraries like the SDL, yes. Otherwise, no, not more than ASM.
Re:overhead (Score:2)
With FPGA's I don't think anyone would seriously consider doing their own layout, cell by cell, for a design. The task would be nearly imossible, there is no way
Comment removed (Score:4, Interesting)
Re:overhead (Score:2)
Re:overhead (Score:2)
Even on my Athlon64 3200+, the game is jerky at best; whenever I move the character, the CPU usage shoots up to 100%.
Re:overhead (Score:3, Interesting)
Re:overhead (Score:2, Interesting)
games [mindread.com]
Re:overhead (Score:3, Funny)
I have to tell you an awfull secret about 3D software. None of them really renders graphics three-dimensionally. They all just emulate 3D using math and gradients ;).
Java Based 3D MMORPG in your Browser (Score:2)
It's a neat game, there's quite a bit of stuff to do for free. Subscription is cheap and gives you more quests. I don't know if the ads go away for members, but they have their own servers.
www.runescape.com give it a shot.
Re:overhead (Score:4, Interesting)
I disagree. The shareware release of Doom 1 was only 2.9MB compressed, and look at how much content it has. 2.9MB for all sounds, music, maps, code, etc. The game has a limited low-res textureset that is used creatively, used MIDI for music, and had a small number of sounds.
It isn't a matter of requireing too much data, it's a matter of not being able to use the same mindset when coding games for such platforms.
I'm not even a game developer, and I can think of a few tricks. For one thing, stream content as needed. Assume the player has broadband. Stream content as you play. Yes, have a loading screen, and use that initial load to grab the content for the first level. Then, while the user is playing, grab the content for the next level or two. Assuming low-end DSL (half a megabit), and 10MB of compressed content per level (Which can store a TON of content), you've got three minutes of load time per level. The initial load time is going to be the big crunch, because after that you can use gameplay time for downloading the next level.
You can also reduce initial load times by prioritizing content and streaming it in as-needed. If you have a level that is going to have 10 or 20 minutes of gameplay, then you don't need to load in sounds and textures that are only going to be used 15 minutes into the game. Those can be loaded while the user is playing. They only initially need to load stuff that is going to be present in the first few minutes of gameplay.
Another trick is procedural texture generation, where textures are mathematically generated rather than stored as bitmaps. And of course there's always the trick of combining multiple low-res textures to create higher res ones, like Halo did for terrain.
And assuming you have a 10 megabyte budget per level, you can always get more out of that by using textures from previously-loaded levels. This has the side effect of the game getting more graphically diverse as the player progresses, so it may not be something you want.
Anyhow, I think that considering how much can be done with a mere 2.9MB of data, having that much or more PER LEVEL can lead to some pretty good looking content.
Great, just what we need... (Score:5, Funny)
Re:Great, just what we need... (Score:3, Funny)
Woah! We get to kill real living sacks of dirty water? Neat! How does it work? remote operation?
Re:Great, just what we need... (Score:2)
Re:Great, just what we need... (Score:2)
Juxtaposition? (Score:5, Funny)
Then we have the last line of text:
This game is being developed but doesn't have much direction at this time, to make a suggestion email me. The gun is copyright by FarCry but is only here temporarily until I model the weapon set. Sydney Wedding Video and DVD
Wedding Video? Crazy Aussies...
Re:Juxtaposition? (Score:3, Informative)
http://www.abrahamjoffe.com.au.nyud.net:8090/ben/c anvascape/ [nyud.net]
Oddly enough, I get an error message for FF 1.07 but not IE6
(Yea, I know, use FF 1.5, it says so right in the error message)
The 2nd to last line of text;
Alot of people have suggested that I make the gun shoot or other equally redundant points. I only made this a couple of days ago so all in good time.
Kinda takes the shoot out of First Person Shooter
Wiki (Score:5, Interesting)
Re:Wiki (Score:5, Informative)
Opera (Score:5, Informative)
Re:Opera (Score:2)
The colours don't seem to load either.
Re:Opera (Score:2)
Opera 8.51 / MacOsX (Score:2, Informative)
Re:Opera 8.51 / MacOsX (Score:2)
Re:Opera (Score:2)
Firefox Compatibility (Score:5, Informative)
Re:Firefox Compatibility (Score:2, Informative)
Re:Firefox Compatibility (Score:2)
Re:Firefox Compatibility (Score:2)
Re:Firefox Compatibility (Score:3, Interesting)
Yeah, the <canvas> tag was introduced by Apple, so they were first-to-market with this one. Looks neat, which is probably why it's being adopted by others.
Re:Firefox Compatibility (Score:2, Insightful)
Re:Firefox Compatibility (Score:2)
No, you may not. And you get points off for using a period instead of a question mark.
However, my question is this: Is the canvas tag standards-compliant?
*will look up later*
Re:Firefox Compatibility (Score:4, Insightful)
Not in HTML4, nor in XHTML1.0 or 1.1
Canvas is a semi-proprietary element [whatwg.org] (originates from Apple, who first implemented it for Dashboard) that currently is in the under development HTML5/Web Applications 1.0 [whatwg.org] standard from WHATWG [whatwg.org], but is (as far as I know) not part of the W3C's XHTML2 draft [w3.org]
Re:Firefox Compatibility (Score:2)
Re:Firefox Compatibility (Score:2)
Unfortunatly you're right firefox does leak memory, but then so does Windows itself which dosn't help.
Re:Firefox Compatibility (Score:2)
I like to use text shadowing too which STILL only works in Safari. I really wish Firefox would add that style element. It really does make text jump off the page in a way flat text doesn't.
I ha
Re:Firefox Compatibility (Score:2)
Re:Firefox Compatibility (Score:2)
It's been that way as long as I've used Firefox and Mozilla.
My Linux box is continuously on, but I use the W
Re:Firefox Compatibility (Score:2)
My desktop at work, running Windows 2000 has been running Firefox for at least several weeks, though I'm not at it to check its exact uptime. Again, multiple tabs are open. No paged memory, 512 mb of RAM.
On my home desktop, running Windows XP, I don't tend to run Firefox too often since I game with it, and I have my laptop ne
Re:Firefox Compatibility (Score:2)
Tomorrow on Slashdot: A Firefox website did NOT get slashdotted yesterday!
Re:Firefox Compatibility (Score:3, Funny)
A cease and desist coming his way (Score:5, Informative)
And you can expect to be in trouble now that you've been slashdotted (I expect the legal document will come just as you finish putting out the fire your server caused). Even if it was only tempporary, lawyers have funny ways of dealing with copyright infringement. Which is sad, but protected by the law.
Re:A cease and desist coming his way (Score:4, Insightful)
1) that may well fall under fair use
2) so he gets a C&D letter, instructing him to remove the offending content... which he's planning on doing anyway. Net result, the company pays some lawyers needlessly.
Re:A cease and desist coming his way (Score:2)
This game is copyright by Benjamin Joffe.
You may not reproduce or modify this without
written permission by the origional author.
Email him: CanvasGame@gmail.com for suggestions.
Re:A cease and desist coming his way (Score:2)
Re:A cease and desist coming his way (Score:4, Informative)
Re:A cease and desist coming his way (Score:3, Insightful)
Such as reading a bedtime story from a book to your children is not a "Performance"; copying a vinyl record to cassette tape for use while jogging (those wearable 45's skip too much) is not "Piracy"; recording a TV show on your Betamax deck is not "Theft" (unless you fast forward through the commercials).
Fair Use shouldn't need to be specifically defined in the written law, but I'm sure many clarifications can be found in case law.
I would guess that since his use is
Re:A Wikientry coming your way (Score:2)
ATM the most they can do is to C&D him, which he will do, just removing the gun.
Opera 9 preview 1 (Score:4, Interesting)
Perhaps because the
Re:Opera 9 preview 1 (Score:5, Informative)
Re:Opera 9 preview 1 (Score:2)
Javascript is a client-side language, so as long as you have downloaded all of the code, then it should work at whatever speed your machine is capable of handing.
safari works (Score:4, Informative)
Re:safari works (Score:2)
Ideas (Score:5, Funny)
I hear Jack Thompson recently had some ideas.
Well.... (Score:5, Funny)
Jerry
http://www.cyvin.org/ [cyvin.org]
Re:Well.... (Score:2)
You laugh, but SpreadFirefox [spreadfirefox.com] are giving away dual-processor, Firefox-skinned Alienware machines (price tag: $4700) "to the three developers who extend firefox in ways that are worthy of such raw computing power."
works fine (Score:3, Informative)
Works fine on a 1GHz PIII actually (Score:2)
FPW (Score:2, Funny)
end result VRML without VRML (Score:5, Interesting)
Re:end result VRML without VRML (Score:2)
Re:end result VRML without VRML (Score:3, Funny)
Re:end result VRML without VRML (Score:4, Informative)
One of the longest running jokes in Internet history revolves around VRML... etc.
"Hilarious" and stolen from:
http://www.somethingawful.com/articles.php?a=926 [somethingawful.com]
here we go again... (Score:3, Insightful)
all the code neccesary to support this canvas thing (which will probably rarely be used) is just more junk that will slow down legit bug fixes, and probably be RIFE with security holes.
firefox will eventually just turn into 'Mozilla NG', and become yet another bloated turd of a browser, given the direction that 1.5 is taking, IMO.
this 'web app' support should be a sandboxed plugin, or something else that can be -optionally- added on, for firefox, not built directly into it.
Camino beats Safari/Firefox in speed on OS X (Score:3, Informative)
Shoot the Monkey and Win $20! (Score:5, Funny)
in other news (Score:2)
I like the idea of an open javascript driven presentation engine. by by flash? doubtful, lets see harvey cartels N games written in javascript first.
I like anyway.
And java3d takes yet another hit (Score:5, Insightful)
Not just for games (Score:5, Insightful)
It's coming..
Re:Not just for games (Score:2)
Re:Not just for games (Score:3, Interesting)
Regards,
Steve
Give Us Enough Rope (Score:2, Funny)
Re:Give Us Enough Rope (Score:2)
Re:Give Us Enough Rope (Score:2)
Re:Give Us Enough Rope (Score:2)
How long till doom (Score:3, Funny)
Try this (Score:5, Funny)
Click on the canvas, and walk around. You've turned into a rabbit.
But will IE7 support Canvas (Score:3, Insightful)
I think it will be a big factor to think about when thinkin about using canvas in some web app. Because noone will want to use it if only a handful of browsers can support it.
Re:But will IE7 support Canvas (Score:2)
Already supported with a plug-in (Score:3, Informative)
One more reason I 3 Firefox 1.5: 3D Canvas (Score:2, Interesting)
I'm taking a peek at the source codes for this web page and they are very well written. He says it does not have much direction at this time. On the contrary. This project has much potential.
Apple Powerbook G4@1.25ghz (Score:2)
Safari (OS X 10.4.3 with all standard updates) -> a bit slower...
Shiira 1.1 -> same as Safari, maybe a bit faster (should have the same engine as Safari, though)
Opera 8.5 -> Browser incompatibility... yadda yadda...
Anyway I think the most interesting test would be some kind of IE7 on some Vista's Beta...
Canvas is useful for other graphics tasks (Score:2)
What is this canvas thing? (Score:2)
Wow (Score:3, Informative)
Re:Not for Opera 8.5 for OSX? (Score:3, Informative)
Re:Different than IE ? (Score:3, Informative)