3D Rendering and Flash Games

Posted: February 8th, 2009 under Opinion.

There has been a lot of recent development in 3D ActionScript engines, the most popular of which is Papervision3D. What does this advance in technology mean for Flash games? I believe that it is going to be a while before 3D Flash games become common, and we have a long way to go before we see 3D Flash worlds.

3D rendering does not solve any of the current problems with building Flash games, in many ways it creates more problems and augments current issues. We still have to struggle with Flash’s UI components, and build our own data structures that we need. Most of the 3D engines do not have any collision support or have very basic collision support like bounding boxes, or spherical systems. The need for tools increases dramatically which both the new engines and Flash lack. If we had a 2D render profiler in Flash we would be interested in clipping, render time, objects on the stage, and counts of alpha and opaque renders. Once we start using models, culling and the number of textures becomes important; we would also want to know polygon and vertex counts as well. In a way, these 3D engines actually hurt the Flash game community because our audience expects us to incorporate this new technology in our games and we are ill equipped to do so.

The ability to render three dimensional objects is only one piece of the puzzle for 3D objects and environments. I already mentioned the need for collision detection and tools becomes more important, but there are other necessary features like lighting, shaders, perspective, and camera controls. Most of the engines have a fair amount of support for perspective and basic camera controls; however, lighting plays and enormous role in creating convincing 3D and not every engine out there supports it. Lighting is just another example of something that becomes incredibly important in the jump from 2D to 3D. Lighting also happens to be another intensive operation to calculate and draw.

There are certain issues intrinsic to Flash that cause problems for third party 3D engine development. Flash’s depth system will not allow two objects to exist on the same plane. Have you noticed that any Flash 3D example with multiple objects, either keep the objects from getting close to each other or only use shapes like spheres and cubes that are convex hulls? Models with concavities can cause some real render issues since they can have parts in front of and behind other objects. There is no nice way in Flash to handle it, sure, you could draw it if you drew both objects into one bitmap, but then you lose any kind of mouse or other interactions from two objects becoming one. A fundamental issue since games usually require objects to interact. Another issue is how Flash scales textures. Flash was built for speed so it does a fast but imperfect job at scaling png and jpg files. Bitmap smoothing helps but it is too memory intensive to be used for a large number of textures, and using bitmap smoothing would be more efficient than any third party ActionScript implementation of image scaling. Your work is going to look better if you stick to vector textures on models using current Flash 3D engines, and a lesson learned from benchmarking, vector assets do not have to be that complex to be a burden on the CPU. Having to stick to cube or sphere shapes and simple vector artwork is considerably limiting.

These 3D engines are slow. There is a larger number of textures being drawn and processed, every 3D object is essentially an alpha render (or depending on the implementation many alpha renders), and real time lighting and shadows are remarkably intensive. This is even before most engines have decent collision systems. The result is that you drastically cut you audience to only those with top of the line computers. Once you start using models that require multiple textures per model memory management becomes much more important. Why would you spend a longer time developing a project only to deliver it to a smaller audience? The classic counter argument is that computers will get faster, yes, that is true, but you still have to compete with developers that are avoiding the issues of the current 3D Flash engines. The old tricks to accomplishing 3 or 2.5D in Flash are still faster to render and easier to pull off. Plenty of developers have built models and scenes in Maya coupling those renders with depth management code to pull off some convincing 3D effects. The only caveat to this approach is that you have to be careful with the camera. If you really want more than one camera view of an object, you can store different views in the frames of a MovieClip to give the illusion of 3D (pre-rendered 3D versus real time 3D).

Assume that there was solid 3D support for Flash, all of the problems discussed were resolved and the 3D rendering was fast enough to make pre-rendered 3D tactics obsolete; Flash will not suddenly become the quality of Playstation 3, Xbox 360, the Wii or any other consol or PC game of the same era. Since Flash games are downloaded, all of the content needs to fit into a small amount of memory, where PC and Consol games can utilize gigabytes of storage space. Flash still has a long way to go before it can access graphic card optimizations, and since it is browser based, Flash will always have limits to resources that PC games do not suffer from. Whenever there is an advance in game technology, it is important to remember that innovation does not automatically make better games. If someone was terrible at making 2D experiences, they are not magically going to get better by jumping into three dimensions. Every tool at a developer’s disposal should be used wisely. Is this new technology worth the cost, and what does it contribute to the entertainment value of the experience? Currently, I believe that the cost of real time 3D outweighs the benefit, especially when our audience can pick up a consol or PC game with stunning 3D quality.

Current 3D engines are not going to have much effect on Flash games. I am as excited as everyone else to see the technology and I am sure it grabbed Adobe’s attention based on the new features of Flash 10; it is hard not to like something that makes people excited about Flash, and gets Adobe to add functionality. Current support for 3D models is great for websites and interesting widgets, but it is only one small piece of the support needed for 3D games. In order for 3D to be used for games there is going to have to be a fundamental change in how Flash renders, most likely separate 2D and 3D render trees. We might see some games with some 3D elements, but it is doubtful that we will see any complete 3D worlds. Flash developers will always have to rely on intriguing design, not graphic quality, to entertain their audience.

Thanks for reading, and remember, we are all in this together.

Bookmark this on Delicious

4 Comments »

  • Comment by Flo W. — February 10, 2009 @ 5:47 pm

    1

    Yeah you are right… it is a little bit sad that flash delivers so less tools for Game Developer. But you already said this. Game Developers are not really the target audience for the Adobe Flash Plattforms…

    And to support real Game Engine Powers for the Flash Player will cost Adobe a lot of man power and money… I think the benefit for Flash Sites and RIA Application is more valuable for Adobe then the Game Dev stuff…

    Anyway, there exist an interesting Game Engine for the Browser (and Wii) Market:
    http://unity3d.com/unity/

    Maybe the distribution will increase… I had a short look on it, and it seemed well. :-)


  • Comment by flash games — February 24, 2009 @ 6:45 am

    2

    good article!


  • Comment by 3d models — April 28, 2010 @ 11:44 pm

    3

    great Article please more article for games


  • Comment by Flash games Master — February 20, 2011 @ 5:54 pm

    4

    Very interesting article and I agree with Flo W, the cost for adobe would be huge.


RSS feed for comments on this post. TrackBack URL

Leave a comment