A Look at Java 3D Programming for Mobile Devices
An anonymous reader writes "IBM developerworks is running an article that describes the Mobile 3D Graphics API and introduces you to 3D programming for Java mobile devices. Sony's PSP has shown the graphics power you can put into a mobile device and mobile gaming. Although the average mobile phone is technologically behind this specialized game machine, Java seems to be helping to drive the market in a very definite direction."
...it wants its bloat back.
You know what would be nifty instead? A scripting language....
if (received_SMS_number == mom_number and time_of_day > 23.00 and time_of_day 6.00):
sms (mom_number, "I'm still at my friend's house")
Wow! Finally I can code 'Hello World' in full 3D glory with realistic 3D shadows!
The developer pages of SE offer Mobile Java 3D Tutorials as well: http://developer.sonyericsson.com/site/global/tech support/tipstrickscode/mobilejava3d/p_mobilejava3d _tips_new.jsp
Life is just nature's way of keeping meat fresh.
Quite a few handsets already support M3G, among them the Siemens S65, Motorola E680, E1000, V980, SonyEricsson V800 and K750i, and the Nokia 6630 and 6680.
M3G is a lot lighter weight than Java3D, has high and low level APIs, and has its own compact file format for efficient packaging of assets.
I've been developing M3G technology, both engines and games, since day 1 (I was our company's representative on the expert group), and I am happy that Slashdot has at last highlighted it.
If you think retreads of "Mr. Do" and "Snake" are going to cut it in the Java space from now on, think again. You might like to look at Superscape's site for a taste of the kind of 3D games that are already out there.
Developers might also want to visit Benhui.net's 3D Developer Forum.
Sean Ellis
Follow OfQuack's antics on Twitter.
Yeah the direction of crummy little Java games - now in crummy 3D!
I have a freind who used to work at a major cell phone company. I remember him telling me people would NEVER use java or linux in embedded products because the memory foot print was just too big.
Ah, Moore's Law, what isn't practical today will be in 18 months (or 36 months, etc.).
He is a smart guy, he just doesn't have the vision to look out that far into the future.
Think Deeply.
So will I see the frontside of the object on one screen, and when I turn the phone around to watch the other screen, the back side of the object? That would be pretty cool!
My wife's sketchblog Blob[p]: Gastrono-me
3D Java Games? Anyone re-call the N-Gage?
This seems like a bad idea to me. Instead of trying to make a phone compete with a gaming console they should be looking for more innovate things that they can make phones do.
Have you metaroderated recently?
How much would it cost these days for a phone that did not have any unnecessities like 3D graphics, address books, calendars, clocks, and so forth? I'm talking about a cell phone equivalent feature-wise to your typical 1960s telephone. How terribly cheap could something like that be produced for? I'd almost be inclined to think that you could find them in vending machines.
Cyric Zndovzny at your service.
...even though back in 2000 I wrote a 3D software engine in Java that was more than acceptably fast enough to run Wolfenstein-quality gfx on a P75. And I knew fairly little about optimisation in Java, so that could probably have been faster. Throw in hardware acceleration, and you can bet these'll be fast enough for at least ok game-level graphics. Beyond games, I don't know what use this would have...
Game dev and music blog
Why would I want (or even care) to have 3D graphics on my mobile phone/device? The screen is already tiny. I'm sure 3D graphics are more computationally expensive and power-consuming than traditional 2D graphics. And in the end, I'm still just looking at a 2D projection of a 3D image. Its not like I want to be playing Half-life or another FPS on my cellphone. I'm sorry but this just seems stupid to me and I get the feeling that the only people who will want this "feature" will be the hard-core tech gadget geeks out there. Does a 3D API bring *anything* useful to the mobile table???
Hero of Allacrost, a FOSS RPG for *NIX/*BSD/OS X/Win
Does it mean OpenGL is too fat? Why can't I have a lightwigth and fast API on my mobile notebook?
One of the early companies focusing on Mobile Phones was Fathammer. Initially they started out with a ports of Doom engine based classics; now seem to have a nice collection. I believe the stronger driver of applications on phone platforms is the phone hardware. Java 3D API is one more trial at luring in more applications by providing easy-to-use API. But even if Handspring and Palm were to provide 3D programming API for their Treo series (or anyone else does likewise), it still depends on the hardware. Things one would be bothered about would be battery times and audio which actually adds on to gaming experience (and already no one wants to hear loud ringtones everywhere!)
Nokia airs an ad in India which almost drives in a message saying "phones are for talking" while showing a model with a vidcam and video playback. I wonder how many people find time to use the "other" applications on the phone apart from a PIM (Phonebook/Calendar). Further, with 3D games what about an added issue of people getting something akin to Doom Induced Motion Sickness(DIMS)? I have found controls for a 3D game (on my Treo) pretty difficult to use for a 3D racer game, which kind of kills the experience. I wonder how many people play 3D games on their phones comfortably, and where they get them from!
No Greater Friend, No Greater Enemy! (Lucius Cornelius Sulla)
I have some friends who are working with developing Java games. So far the big money is not in developing titles for phone companies portals (or even worse trying to sell them to the end user yourself) but to develop ad games for companies who make them available for free downloads, usually as a part of a competition.
From what I understand, the best part of the job is that since graphics on mobile phones and other limited devices are so cruddy development focus tends to be on addictive gameplay rather than eyecandy. It is also still possible to be a small independent game studio, no need for a big art studio to render hours of CGI, etc.
Worst part is that just about all phone developers are very sloppy when it comes to implementing the J2ME standards and all models tend to have their own quirks. Sony Ericsson and Nokia are probably the best, but that is not saying much. So in this case, it really is "write once, debug everywhere" type java.
Mobile gaming is really taking off, I read on GameDev for instance that mobile game developers Gameloft increased their workforce from 432 to 1375 employees.
Being bitter is drinking poison and hoping someone else will die
There are so many people (me included) who would love to be able to program for the PSP, but they won't open it up for various reasons (fear of piracy, mostly).
So why not give people a Java sandbox (J2ME would be fine) to play in? That way they can make games and other fun things, but they won't be able to use it to boot pirated games off memory sticks and such (unless they REALLY mess up the JVM). Seems like a perfect solution.
They sold the Net Yahorzee, why not give us this? Download a copy today (tied to the PSP's serial number to prevent copying?) for only $20! They'd make a fortune.
Comment forecast: Bits of genius surrounded by a sea of mediocrity.
Here is a Venn diagram showing the interest in Java on mobile devices e.g. phones (MIDP) and Java 3D and the intersection between them:
/ \ / \
/ Phones /\ \ /
_________ _________
/ Java On \/ Java 3D \
\ \/
\ /\ /
\_________/ \_________/
Hope both of those guys enjoyed the article!
${YEAR+1} is going to be the year of Linux on the desktop!
The article is interesting and is very informative.
My only objection is that I do not like playing games on a tiny screen using tiny buttons. Since most games nowadays are not just 'steer and shoot,' the complexity of the controls and intricacy of the graphics plays into the overall fun of the game.
I applaud the efforts to get better 3D graphics for mobile devices, but I don't think I will ever be wasting my time playing games on my cell phone. It is much more enjoyable to play a console system on a large projection TV. But of course that is just MY opinion.
He who knows best knows how little he knows. - Thomas Jefferson
I move to strike the "PSP" comment from this posting... this post has nothing to do with the PSP by its own admission. This is just gratuitous PSP-mentioning.
He made a comment a while back:
"The biggest problem is that Java is really slow. On a pure cpu / memory / display / communications level, most modern cell phones should be considerably better gaming platforms than a Game Boy Advanced. With Java, on most phones you are left with about the CPU power of an original 4.77 mhz IBM PC, and lousy control over everything."
I'm still waiting for a sub-$200 phone that'll integrate with *SOME* calendaring system from Sprint.
Just get all of the old commodore 64 games on the phone and you would make a ton of cash. M.U.L.E. for starters. Archon, Ultima, hell they are still better than most modern games.
Just to let you know, that 3D is possible on most java phones
with my embryonic diet3d library :
http://rzr.online.fr.nyud.net:8090/java.htm
OK lot of work to be done to be M3G compliant... (btw, i am open to contribs)
But what is bugging me : is J2ME the only alternative to WinCE or symbian ?
since most Linux handset doesnt not provide other API (beside QTopia and his friends)
-- http://rzr.online.fr/
This troll has had such a mistake for such a long time. It should be 1%.
It's all about choosing the right language for the right job. 3D Java would be perfect for that 3D glacier screensaver I had in mind. You'd be able to watch it travel down the mountain and melt. Don't worry. Java is fast enough to still be realistic when you take global warming into account.
"You'll get nothing, and you'll like it!"
Perhaps I have misunderstood, but I thought that Java 3D made OpenGL calls under the covers. Is this the case. Java's fatal flaw has always been that it must use low level NMI modules written in C or C++ to get anything done. When Jim Gosling choose not to have pointers he basically decapitated the language. Therefore, all Java programs that need to manipulate memory mapped registers are a kludge by design.
an ill wind that blows no good
When was the last time Java made a meaningful advance on the UI front?
I guess I'm still jaded from the 3 years I spent in the Java applet paradigm, trying to bring a vision of mine to the web, only to find I was working in the "last gasp" of client-side Java - an era marked by the release of Swing and then... nothing.
Forget about Java 3D on cell phones. What we need is a Java interface to DirectX and OpenGL. I'd do it myself if I thought there was actually still any way to make money by developing software. Today all the money goes to CEOs and not developers, so I have no incentives to spend the time doing this myself.
I have just had my final lecture in a course on Mobile Computer Graphics and there is a lot more to mobile 3d graphics than producing nice games. Especially there was one lecturer from TAT that makes user interfaces for mobile devices, and the possibilities for creating more userfriendly interfaces are endless with 3d graphics. I am not just speaking of eye candy, but useful animations that help the user navigate the menu tree.
The base embedded subset of OpenGL leaves out display lists, any geometry more complicated than a triangle, and all the new programmable shader stuff. It's basically what an SGI machine had twenty years ago.
This may or may not be useful for cell phones, but it will be useful for things like car navigation systems and other embedded devices.
What are the odds that mobile phone manufacturers will bother
with JIT systems for 101 different CPU types out there that the
phones use? Pretty slim I reckon. So it'll be a standard
interpreter type JVM with the accompanying slowdown.
So what chance does a 3D game have of looking even remotely decent on .... errr... 4 ... no wait ... thats a coffee spot ...
something a few inches square? OMG! WATCH OUT FOR THE
pixel squidge coming at you
I'm afraid that this is incorrect. M3G does, intentionally, borrow concepts from OpenGL and is implementable on top of OpenGL, but M3G is not just OpenGL/ES wrappers for Java. (That's JSR-231 and JSR-239.)
The article in the original post is part 1 of 2. Part 2 will show the scene tree manipulation functions and the high-level stuff. This includes file loading, animation, alignment, etc.
Sean Ellis
Follow OfQuack's antics on Twitter.
They would cost about the same.
... if measured by money.
But IMO it isn't true if we measure the "price" in time or nerves you spend "wrestling" with you "smart", "feature packed" and whatever phone while trying to make something which should be easy on the mobile phone, like making a call or sending a text message. :)
Because I suspect software for phones (that part of software which we can call "smart", i.e. not that part which handles signal processing etc. but those calendars, games, address books, ...) is done "as ussual" thus it is done quickly, looks nice ... but has bugs, is slow, ...
Given few years, it'll improve. But by that time there will be another round of new features and they may be again "done quickly". :)
I just hope that there are enought people willing to buy "simple" (but quick, stable, ...) phones for "free market" to deliver some.
hany
Alas, they are not real gamers unless their phone supports Sidetalkin'.
Hey, can the effect be emulated through some Java 3D Audio library even on a phone without actual hardware Sidetalkin'? I smell a business opportunity here!
lp goes through the loop X times (2 or 4 billion?) and who fucking knows where ilp started. And for what it's worth, the 5-billion loop code takes 10 to 13 seconds (gcc -O2 ...) to execute on an AMD 3000+ box, using ints, doubles, or long doubles for lp and ilp.
And only f-tards use floats as loop counters.
Scene graph systems are somewhat out of favor in the game developer community. They're not powerful enough to be a game engine, and they're overkill for a 3D drawing engine. There have been many scene graph systems, SGI's Inventor being the first big success. They're nice for simple little games, but they usually scale up badly. For the small screen, they might work for low-end games.
Here's an example of the problem with scene graph systems. M3G has no collision detection. If you add collision detection, you'll need a separate set of data structures, organized for collision detection. Then you have to keep those in sync with M3G's scene graph. It's usually easier to have only one representation of the scene and draw in non-retained mode.
It's one of those things where the extremes are more useful than the middle. A full game engine, with collisions, physics, and triggers is useful. A non-retained mode 3D graphics API is useful. Most of the stops in the middle are not too useful.
Still, maybe for the small screen...
Java is not an enabling technology for mobile phones. A good portable C or C++ library would have been an enabling technology.
Also, they should try to agree on certaing pixel size standards, like VGA, SVGA, XGA etc. were for computers. For small screens this is even more important.
If we had screen size standards and a reasonably good C-library for mobile phones, we would be years ahead in development and consumer level application adoptation. Symbian does not have a proper posix-like API. The developers are really waiting for that.
Another blocking thing has been that the bugs in APIs (JAVA or C) have not been published. The mobile phone manufacturers work in complete secrecy and do not publish their bugs nor the fixes to the bugs. Each ISV has to find out all the bugs on their own. This is really bad.
-- Imperial units must die --
The M3G file loader is a bit too powerful, because it can load general Java objects
This is incorrect. The file loader allows loading of the M3G scene objects, plus a hash table of string/string pairs. That's all. There is no "virus" issue.
Plus, loading Java objects isn't a security hole in the first place. Loading external Java classes might be, but that's not enabled on any of the MIDP platforms.
Scene graph systems are somewhat out of favor in the game developer community.
In the console developer community, maybe. With C or C++, there's no performance differential between code you wrote to do your scene management, and code the middleware people wrote. You can always write a specialized scene mahagement/traversal engine that works faster for your one game than the general purpose middleware one, and you have space to burn on your CD.
In mobile Java, scene graphs can be very useful. Using them allows you to move all your scene graph management code into native code. And since the native code is already on the handset, you free up space from your precious 256K download budget for more actual game code.
Sean Ellis
Follow OfQuack's antics on Twitter.
While the M3G file format doesn't contain code, the M3G loader in JSR 184 will load any serialized class that descends from Object3D. Exploits, here we come!
really, don't read this if you have an aversion to windows.
right, i'm getting to be an old fart (and this is going to talk about some windows and worse...) and i can remember loads of up-their-own-**** C++ guys banging on about how slooooow VB was, erm mid-90s, when all it was doing was windows dialogs, all video blits really.
suffice to say they had lots of fun sending MFC WM_OPEN_THE_WINDOW_WITH_A_BLEEP messages to some grim looping CPU hogger while some dumbass VB programmer would type formHello.open() or whatever... the VB guys were a bit lost with the multi-threading but actually got a lot more work done.
end of the day, if you wanted to be precise about shit, you didn't use VB. if you want to be really fast about shit, don't use java. but if you ain't a fricking superstar, don't get hung up on C++ (since when is complex good? oops...) because you're probably screwing things up yourself much worse than any language ever did... most of us just aren't good enough, use what's simple and availabe, imho.
thing is, there's a frickin LOT of people with java compatible phones, on them all the time, there's a lot to think about beyond computing perfection here...
sorry, had beers, i just re-read and that was rubbish, but i'm not a bad person, honest,
i use linux everyday,
i think google is broken,
um, whatever else is cool,
dan.
In the article you refer to, Mikael Baros writes: The best one is that the Loader class can load much more than M3G files, it can basically deserialize any class that inherits from Object3D.
If true, this would open up a security hole. Fortunately, he is incorrect. The Loader will only deserialize the classes in the spec that are derived from Object3D. That's a very different claim.
The file format does not use standard Java serialization and instead uses a compact binary encoding of the specific data from the classes defined in the spec. Loading the file consists of reading the type ID for each object, verifying that that ID corresponds to one of the 24 known object types, and if so creating an object of that type using an internal factory function. The new object can then be populated using the following chunk of data.
Since the factory does not have a method of creating arbitrary classes outside the set of 24 mandated by the specification, the loader cannot be used for exploits in the way you describe.
Sean Ellis
Follow OfQuack's antics on Twitter.