Home General Discussion

3D flash game engine demos

Hello people,

A few months ago I built my own proprietary 3D engine in AS3. I built it purely to make games. And because it's proprietary and I don't have to factor in usability etc I focus 100% on speed. Dilligently.

The results are good. It's significantly faster than commercial engines like Papervision, and actually faster than any other 3D engine I've seen in Flash.

Now although the speed is great, the rendering in my Flash 9 build isn't great. I used home made affine texture mapping, so of course any big polygons had horrible texture distortion.

As a means to combat that, I used dynamic triangulation to combat the texture distortion. Not only is this very slow, subdividing polygons for no other reason than to correct perspective, it also introduced artifacts of it's own - broken textures and texture swimming etc.

Flash 10 comes equipped with it's own class for rendering polygons, drawTriangles. Though I've known about this for a while, and experimented with it, I chose not to use it because it rendered at half the speed of affine textures.

What's great about it is it does the perspective correction for you. It uses an algorithm like the Quake era of software rendering, using the pixel's Z value to calculate the UV data and correct the perspective.

Unfortunately - unlike Quake that did the calculation every 8 or 16 pixels, it looks like this algorithm does it every 1 or 2 pixels, so it looks perfect, but could be faster.

However, a month or so a go I found a way to use it much more efficiently, and realised it's actually like a pseudo software based GPU. You feed it vectors of vertices/indices and UV data, and like a GPU, it's far more efficient to render in batches.

First of all I was doing a draw call per polygon. Now I'm rendering in batches, and it actually runs slightly faster than my Flash 9 engine, but with perfect perspective correction.

The only problem is working with it is slightly more limited than my Flash 9 engine. Because my Flash 9 affine texturing used a draw call per polygon, I could conceivably have a different texture per polygon.

With the new engine, it's using a draw call per texture, so I'm going to have to be clever with my use of textures, for example grouping the textures of several models onto 1 big bitmap, to minimise draw calls.

Anyway, there's the techno babble for those that are interested, and I thought I would post some demos here as there seems to be a certain appreciation for low poly stuff.

By the way, the performance is on par with a DS. 2000 polygons per frame at 60 frames a second, which by Flash standards - is excellent. That's a true in game performance too, with depth sorted, texture mapped polygons. Oh and that's on an average Core 2 Duo, not a beast of a computer.

The reason I joined polycount too, was to learn how to make models for use in my engine ;) Not only models, but level design too, I'd love to get some tips/advice on level design.

Here is my latest demo, it's a snowscape with 1000 trees and 12 ice boulders. Because I haven't built one yet, just imagine you're in a snowmobile ;)

Up or W is accelerate, and you use the mouse to steer. I was going to make some suspension and make the landings have more of a jolt, but I decided to make the landings soft, because you're on snow afterall.

http://rumblesushi.com/snowscape.html

I'll post some more demos later.

Cheers,
RumbleSushi

Replies

  • Slum
    Options
    Offline / Send Message
    Slum polycounter lvl 18
    That snow stuff is pretty cool, but your website is freaking fantastic.
  • rumblesushi
    Options
    Offline / Send Message
    Hahaha, thanks Slum, the motion graphics on my website is just a placeholder beofre I relaunch my site, that's 2D and done in AS2 (gasp).

    Here is a performance demo/benchmark of my 3D engine with stats.

    40 models with 192 polygons each.

    http://rumblesushi.com/katamari_baldwin.html

    Click your mouse down to zoom in and rotate around a model.
  • flaagan
    Options
    Offline / Send Message
    flaagan polycounter lvl 18
    Hey now, like Jobs said, Flash is useless! Who needs it!?

    (what a tool...)
    :poly142:

    Awesome stuff, man! :)
  • rumblesushi
    Options
    Offline / Send Message
    Thanks flaagan, are you talking about Steve Jobs? Hahaha.

    Obviously I'm not going to compete with Unity with my engine, because Unity uses the GPU, it's in another league of poly pushing power. But of course where I have a huge advantage is userbase, almost everyone has Flash.

    My main reason for developing it is I decided I wanted to make some simple but proper 3D games in Flash, ie DS or N64 level games. With the engines out there, that's not possible, so I built my own.

    It's been hard work, but the engine is nearly finished - I just need to develop the per polygon collision detection more and import rigged animation, then I'm ready to rock.

    Now that the mechanics of the engine are basically complete, I'm going to be working hardcore on learning modelling and level design ;)
  • rumblesushi
    Options
    Offline / Send Message
    Here are some of the demos from my flash 9 build.

    3 demos of my super quick flock code.

    http://rumblesushi.com/flock_01.html

    http://rumblesushi.com/flock_02.html

    http://rumblesushi.com/sea.html

    And here is an example of flash 10 rendering in my old framework, using 1 draw call per polygon - http://rumblesushi.com/city_F10.html
  • acc
    Options
    Offline / Send Message
    acc polycounter lvl 18
    You've made some pretty awesome progress. If you can get rigged animation working well with a friendly workflow you'll be basically top of the pack in terms of 3D Flash engines. It's difficult to even find mention of animation in other engines, which make them all... disappointing.

    I've had people bugging me to move into 3D games so if you keep going with this, I'd like to keep tabs on it. Do you have any plans to open source or license this?
  • hawken
    Options
    Offline / Send Message
    hawken polycounter lvl 19
    looking good!

    I've spent a lot of time with papervision and sandy, when it came to getting my own project off the ground I went for unity. But keep coming back to the idea of eventually making something work in flash to ensure all the bases are covered.

    As is mentioned here; the problem with papervision and it's ilk is that you can't import very easily from standard file formats. Bones animation was a right headache and in the end we gave up.

    Also Papervision has really nasty triangle clipping when intersections happen. As we all know, the secret to good low poly models is using tricks like intersections so this is really not on.

    If you bundled this with some kind of exporter that works with the major 3d programs (max, maya, cinema etc) and not just a buggy mid life crisis inducing plugin for blender, you might have an open source winner on your hands.
  • rumblesushi
    Options
    Offline / Send Message
    aac - Cheers. As I mentioned in the opening post, it's built as a proprietary engine, for developing games in house. If I released it, I would charge a license fee, as it would be a LOT of work to redesign it to be usable to the average developer, and to provide concise documentation and support.

    So I haven't decided 100% not to release it, it's more that it isn't part of my current plans, my efforts are focused 100% on making games, rather than making a public engine.
  • rumblesushi
    Options
    Offline / Send Message
    hawken - thanks.

    When I saw the island demo in unity I was blown away. The reason I'm not tempted by Unity just yet is user base. Right now, proper 3D flash games would be significant, because it would reach a much larger audience than Unity.

    Unity does look incredible though, and I shall have a dabble in it once this business is properly up and running.

    I was expecting director/shockwave level visuals, which is of course another hardware accelerated plug in that uses Open GL/DX - but Unity wipes the floor with it. Very, very impressive. It has PS2 level visuals it seems.

    You know, as I mentioned to aac, a public release has never been part of my plans. The engine has been built from the ground up to run as fast as possible, and for proprietary use only.

    And because I'm treating it as a business, and the amount of work involved in making a polished public release with documentation, I would license it out rather than open source it.

    Right now though my efforts are focused 100% on actually making games with it.

    Regarding animation, as it happens, importing rigged animation is the main step left of finishing the mechanics of the engine. After I've done that I'm ready to get on with some games.

    I didn't know that was a problem for PV3D/Sandy etc. I haven't used any of them extensively, I've just used them enough and benchmarked them enough to know that creating a DS or N64 level game is impossible, and that's the main reason I built my own.

    What exactly was the problem you found with importing animation into those engines?

    I'm going to develop collada imports with animation, what should I look out for? What problems did you find with the engines you tried?
  • hawken
    Options
    Offline / Send Message
    hawken polycounter lvl 19
    Collada is a great format, it really is. It's only let down by the various modelling programs that export it in different ways. For instance, cinema4d follows the Collada guidelines, but papervision was built to only interpret Collada exported from Max.

    Theres a whole world of pain there, but I can't imagine a better format.
  • rumblesushi
    Options
    Offline / Send Message
    Why is it preferable to the others hawken?

    I was interested to find out that the PS3 actually uses colladas right?

    Why would collada be preferable to a 3ds file for example, which also supports animation? Obviously other than collada being multi platform, so to speak.

    Right now I am just importing OBJs, for no other reason than they are much easier to parse than the other formats.

    By the way, what was going wrong exactly, when you gave up importing animation to PV3D? So I know what to watch out for.
Sign In or Register to comment.