View Full Version : 3d games in flash
flash4food
January 24th, 2004, 03:27 AM
hey ya'll
I recently read all of senocular's tutorials on 3d actionscripting and they blowed my mind, they are very good and I think you could get a lot done in 3d.
so i am currently working on two 3d games and ill post em as soon as they are finished, in the meanwhile i wanted to see if there is anyone who has made a 3d game in flash ( ive never seen a game that is completely in 3d on the web made in flash)
so if you know where to find examples, or have one of your own post em!
Voetsjoeba
January 24th, 2004, 03:45 AM
3D Game, awesome ! =) I'm sorry, I haven't seen a 3D game in Flash yet ... oh wait, yes I have: it was something with evil penguins you had to shoot. You were in a forest and there were penguins with weapons and you had to shoot them. I can't remember where it's at though, sorry :(
senocular
January 24th, 2004, 10:11 AM
In Flash, for a 3D game environment, often youd be dealing with flat movieclips positioned in a 3D space, much like the figures in some of the earlier 3D examples. As I've mentioned a few times in the tutorials, Flash can't handle much in terms of polignal rendering. So don't expect a quake anytime soon ;) A "good" 3D game would incorporate 2D elementes pre-rendered in 3D (from something like Swift3D) positioned in a 3D environment in Flash... or even a 2D environment. As long as you have 3D-looking imagery, the game can be pretty much considered 3D.
A game rendered fully 3D in Flash would need to be a simple one. Probably a puzzle game - something like a rubix cube spinning in the middle of the screen or something. You could also take the approach of rendering more complex elements on the fly but not continuously render them every frame. Render them once, keep them that way and then move them as a static movieclip from there. This could be used on something like a chess game. Allow the board to be moved and rotated, but only render the pieces at the end of each rotation (not during - maybe just show the board then) That way the pieces can be complex and the only slowdown you'll encounter is in that one frame following a board rotation which is basically negligible at that point.
I was working on a 3D fighter for a while there. I have nothing to show though. It actually became a little much for Flash to handle with the bone heirarchy I had going on - even with just using stick figures. I might come back to it though. It was fun to work on.
flash4food
January 24th, 2004, 02:32 PM
youre right, in fact, that is what I have been doing, prerendered objects in a 3d environment.
I expect to post a 3d first person shooter prototype some time soon so you can tell me what you think
senocular
January 24th, 2004, 02:39 PM
Cool! :) just for kicks, heres a simple little doom knockoff I whipped up in about an hour a couple of years ago :D
http://userpages.umbc.edu/~tmccau1/flash/test/doom.swf
splict
January 25th, 2004, 12:07 AM
That was fun! I still played it for a while even though health doesn't work:) Doom was always one of my favorite games. If I could 'whip up stuff' in about an hour - oh the fun I would have. :)
senocular
January 25th, 2004, 12:44 AM
most of the time was just trying to find friggen doom images :P I couldnt find a full imp death animation. you can see how I cheated that a little bit when they die :blush:
flash4food
January 25th, 2004, 07:09 PM
wow that doom game is really cool!
with my game ill have to stall because i still dont have any enemies and ive been having really weird problems with redrawing walls
alzor
January 29th, 2004, 12:21 PM
I was screwing around with some stuff, its not real 3d, but if you have a whole bunch of movie clips and you position them right and do a whole lot of x, y scale stuff you can hack out a simple (not too beautiful) first person engine, Im going to try out my ideas on this as soon as Im done with what Im working on now. if I ever do this, Ill post a link to it.
glordu
July 4th, 2007, 11:51 AM
i've done something like that doom half a year ago.... mine has a coupple of things more, but still the coding was really poor.....
a couple of months ago i gave up with a 3D Engine i've been working on.... well, not gave up really, actually i have everything that's missing done allready, in my head XD
really, isn't that easy XP besides, i'm still coding in AS2, i may rewrite this all later when i fell like AS3 is fully reliable.... in the meantime, i've work to do ^^
greattings you all
Charleh
July 4th, 2007, 01:21 PM
I don't understand why people bother using Flash in it's current state to try and make 3d games when it's easier to just do it in OpenGL/DirectX - the debugger in VC++ is better than the Flash one and using glut is easy enough - keyboard and mouse input is easy enough to grab and ... guess what.. you get hardware acceleration! Something that flash is lacking (therefore making it pretty much a waste of time to use for 3d when there are better alternatives)
Flash is designed for rich web content, not 3d games - 2d games are possible, but nothing that graphically intensive (yet). 3d is a waste...
pingnak
July 4th, 2007, 06:41 PM
Made a separate topic...
pingnak
July 4th, 2007, 06:58 PM
I don't understand why people bother using Flash in it's current state to try and make 3d games when it's easier to just do it in OpenGL/DirectX - the debugger in VC++ is better than the Flash one and using glut is easy enough - keyboard and mouse input is easy enough to grab and ... guess what.. you get hardware acceleration! Something that flash is lacking (therefore making it pretty much a waste of time to use for 3d when there are better alternatives)
Flash is designed for rich web content, not 3d games - 2d games are possible, but nothing that graphically intensive (yet). 3d is a waste...
Here's the short list:
1. If you do it in GL/DirectX, you are locked into a Windows application with an installer and distribution media, and billions of possible combinations of crappy hardware, buggy drivers and idiot users to deal with when the support calls come pouring in.
2. Flash can be slapped up on a web page and played immediately without setup. It's already cross-platform compatible.
3. People have low expectations for simple Flash, and they aren't much disappointed by something that wouldn't pass muster in 1990.
4. For a PC game. you are pitting yourself against big corporations with deep pockets for their development tools and teams. Your individually crafted game will be compared against the latest Halo and found lacking. You can't get any shelf space for it without enormous payola, and most major publishers and retail outfits won't give something that isn't full of flashy high-end hardware accelerated effects.
5. For console development, well that's HELL ON EARTH. Instead of hardware compatibility problems of a PC, you get to deal with the publisher AND the console manufacturer to get your product shipped, and they BOTH take substantial cut. To produce disks, you have to go through the manufacturer and their QA, and their production schedule.
6. For the PC, your game will be pirated practically before it hits the store shelves. For a console, your game will be 'traded', cutting you out of making any money. Even if your game COULD have gone double-platinum, the publisher could choose to push through 50,000 copies and never make another shipment. Your cut for that? About $1.98, MINUS whatever it cost you to make the game.
Anyway, Moore's law has caught up to Flash. AS3 is a substantial improvement in performance, and its enough to make 3D games with. The sooner that Adobe realizes this and sh!t-cans 'Shockwave' and moves some of the better game/render functions to Flash, the sooner the world will be a better place.
Charleh
July 4th, 2007, 07:28 PM
Here's the short list:
1. If you do it in GL/DirectX, you are locked into a Windows application with an installer and distribution media, and billions of possible combinations of crappy hardware, buggy drivers and idiot users to deal with when the support calls come pouring in.
2. Flash can be slapped up on a web page and played immediately without setup. It's already cross-platform compatible.
3. People have low expectations for simple Flash, and they aren't much disappointed by something that wouldn't pass muster in 1990.
4. For a PC game. you are pitting yourself against big corporations with deep pockets for their development tools and teams. Your individually crafted game will be compared against the latest Halo and found lacking. You can't get any shelf space for it without enormous payola, and most major publishers and retail outfits won't give something that isn't full of flashy high-end hardware accelerated effects.
5. For console development, well that's HELL ON EARTH. Instead of hardware compatibility problems of a PC, you get to deal with the publisher AND the console manufacturer to get your product shipped, and they BOTH take substantial cut. To produce disks, you have to go through the manufacturer and their QA, and their production schedule.
6. For the PC, your game will be pirated practically before it hits the store shelves. For a console, your game will be 'traded', cutting you out of making any money. Even if your game COULD have gone double-platinum, the publisher could choose to push through 50,000 copies and never make another shipment. Your cut for that? About $1.98, MINUS whatever it cost you to make the game.
Anyway, Moore's law has caught up to Flash. AS3 is a substantial improvement in performance, and its enough to make 3D games with. The sooner that Adobe realizes this and sh!t-cans 'Shockwave' and moves some of the better game/render functions to Flash, the sooner the world will be a better place.
I do understand the benefits of Flash in terms of distribution but I did say Flash in it's 'current state' is just not good enough. Plus to make a game run in OpenGL is no problem no matter the hardware - the GL library can render in software if needs be (albeit slowly).
Anyway I'm not talking about selling games, look at the number of indie games which are getting more and more popular - indie games are the place to try out new ideas, not just the big companies innovate - and most of the time they don't even try that, they just regurgitate sequel 305 of successful game x. Indie developers are still selling games and making a little money - even so I'm talking about making games for the love of making games. Most people on this forum are making RPGx/RPGy because they love RPGs - but they are doing them in 2D because it works...
I'm simply saying, that trying to render a game in 3D and get anything that's even remotely eye catching is nigh on an impossibility in Flash at the moment. You don't want to try and implement antialiasing, bilinear/trilinear/anisotropic filtering in software unless you want a framerate which is a fractional value.
pingnak
July 4th, 2007, 07:57 PM
All I'm saying is Moore's law is overtaking the differences between hardware accelerated and software, and native vs. interpreted. If you haven't, go download MAME. It's fascinating that some of the MAME emulations have been ported to Flash (AS2), and more are getting ported. Some of those were very cutting edge hardware accelerated games for their time. Now an emulator within an interpreter are running them.
The difference is narrowing, and the gap is getting narrow enough to bridge. I see no reason NOT TO.
A minor correction: The 'big companies' don't, as a rule, innovate. Virtually every release that's 'innovative' that comes out of a company like Microsoft or EA was BOUGHT from some smaller and innovative company that they threaten to bury, then consume and destroy, and they will typically have sequels come out that are progressively worse. Big companies have share-holders, and are risk-averse. They want to buy something complete, or nearly complete that they can slap their brand on and market without any risk. I fully expect Halo 3 to be very well rendered dog crap, if Halo 2 is any indication.
Even most individual people want to make what they've already played. They want to make RPGs because they have played RPGs. They want to make FPS or RTS games because they play those games, too. Read the posts more carefully. They usually start out with "I want to make something JUST LIKE..." They don't want to create something NEW. They want to make their own version of the same thing they've seen that was successful.
After 20 years of programming games in C/C++ for a living, I've switched over to Flash for a living. The only complaint I have is the learning curve for all the bugs and misfeatures in Flash and its scripting languages. AS3 is certainly much, much better, but AS2 sucks, and I don't even want to think about AS1. After a while, you get bitten enough and you stop doing the 'incompatible' things, and you get more efficient.
If you're happy with GL, then use GL. It still doesn't solve anything as far as hardware issues go, and the software render won't be, as you say 'eye catching', especially if it's at something less than 10 FPS when you're finished adding all of those 'eye catching' features in, and somebody's video card doesn't have enough RAM for it all, or doesn't have a particular 'eye catching' feature your pipeline demands. Even when it's 100% the user's fault, that support call to try to figure out why it didn't work will more than eliminate the profit to you for that user's purchase.
Charleh
July 4th, 2007, 08:06 PM
All I'm saying is Moore's law is overtaking the differences between hardware accelerated and software, and native vs. interpreted. If you haven't, go download MAME. It's fascinating that some of the MAME emulations have been ported to Flash (AS2), and more are getting ported. Some of those were very cutting edge hardware accelerated games for their time. Now an emulator within an interpreter are running them.
The difference is narrowing, and the gap is getting narrow enough to bridge. I see no reason NOT TO.
A minor correction: The 'big companies' don't, as a rule, innovate. Virtually every release that's 'innovative' that comes out of a company like Microsoft or EA was BOUGHT from some smaller and innovative company that they threaten to bury, then consume and destroy, and they will typically have sequels come out that are progressively worse. Big companies have share-holders, and are risk-averse. They want to buy something complete, or nearly complete that they can buy and market without any risk. I fully expect Halo 3 to be very well rendered dog crap, if Halo 2 is any indication.
Most people want to make what they've already played. They want to make RPGs because they have played RPGs. They want to make FPS or RTS games because they play those games, too. Read the posts more carefully. They usually start out with "I want to make something JUST LIKE..." They don't want to create something NEW. They want to make their own version of the same thing they've seen.
After 20 years of programming games in C/C++ for a living, I've switched over to Flash for a living. The only complaint I have is the learning curve for all the bugs and misfeatures in Flash and its scripting languages. AS3 is certainly much, much better, but AS2 sucks. After a while, you get bitten enough and you stop doing the 'incompatible' things, and you get more efficient.
If you're happy with GL, then use GL. It still doesn't solve anything as far as hardware issues go, and the software render won't be, as you say 'eye catching', especially if it's at something less than 10 FPS when you're finished adding all of those 'eye catching' features in, and somebody's video card doesn't have enough RAM for it all, or doesn't have a particular 'eye catching' feature your pipeline demands. Even when it's 100% the user's fault, that support call to try to figure out why it didn't work will more than eliminate the profit to you for that user's purchase.
I've never had a problem with GL and hardware - the fact that everything you buy nowadays renders GL with no problems - and most crappy Intel on board graphics accelerators can handle a GL app without too much fuss (bit crappier image quality and no shaders etc...but they can handle the rest ok). To make a good game does not require that you add 3 billion effects - but to render in 3D at the present time in Flash - and render with speed, would require hardware support. Unless that happens - there's no point in writing a 3D engine.
I've not written in AS2.0 before - I did some basic actionscripting a long while back for a project - but I just started this game and so far without 3D it's seeming quite playable and it looks pretty decent too. There don't appear to be any bugs or a steep learning curve for this AS2 and quite honestly the only bug I have found so far in the game is one that I've created which I just can't be bothered to fix at the moment. The game runs smooth assuming your PC can keep up with the rendering - but thats the bottleneck.. the rendering. Hardware support is a must.
pingnak
July 4th, 2007, 08:26 PM
We'll probably have to agree to disagree. As you say, your Flash game already works OK, and it's not using hardware. Certainly a hardware Z buffer and REAL containers that could be iterated in order would make a big difference.
For instance, if you add 'scattered' indexes to a sparse Array in AS3, will iterate them in unpredictable order. AS2 'for in' iterates them backwards. Nice to know?
In AS2, if you initialize an Array where you declare it in a class, it can treat it like a static? That's a super fun one.
Most of my AS2 woes had to do with the Flash 8 edition of it. Adobe fixed a lot of the bugs in CS3 (Caution! Exporting BACK to Flash 8, those bugs are still there, so there's no true code-compatible way to go back if you work with somebody with Flash 8). Nothing like stepping a little code to find a problem, only to discover 'this' changed halfway through the function, or half the function never gets executed at some arbitrary point.
Charleh
July 4th, 2007, 08:34 PM
Yeah I found the static array thing :) I'm in the practise of initialising my arrays on declaration - and boom, everything in the game started sharing attributes - I figured out why though and it only set me back half an hour or so - I'm using Flash 8 here anyway, there's bugs in any software but for what I'm doing it seems to be OK.
I'll let you know if anything strange starts happening!
pingnak
July 4th, 2007, 08:42 PM
Another good one: Try a non-integer array index!
Charleh
July 4th, 2007, 09:12 PM
Another good one: Try a non-integer array index!
Well before I go to bed - I was in the shower thinking about that static array thing, and in a way it makes sense...
I guess flash must create the new array when the class first gets loaded into memory - then all instances are pointing at that one array...
As for the floating point/string array indexes... you won't catch me using them anyway :D
pingnak
July 4th, 2007, 09:29 PM
In AS2, all you gots is a 'Number' (which is a 'float'), you'll trip over it sooner or later.
Where it got me was I was doing some math, dividing by the width/height of something to look something else up... and the art changed by a fraction of a pixel (one of those things where Flash makes a nearly invisible change for no reason you can see, usually because I started typing into that lame editor, and it didn't have focus, and all manner of 'shortcuts' went off). Went from exactly 2:1 to 2.0045:1.
Suddenly, I couldn't find anything in the Array. Bit me both ways. Made a table with members at 'unfindable' indexes of [1.002, 2.0025...], and in another case, non-integer indexes that didn't match a table of integer indexes.
Aquilonian
July 5th, 2007, 07:16 AM
There is a beta of a new flash player that can have 3d acelleration but only in fullscreem mode.It sucks for games cos it dont have key imput in fullscreem
lorenz82
May 21st, 2008, 01:27 AM
if you are intereste din 3d flash games look at this http://www.lorenzgames.com/blog/Away3D_-_The_future_of_3D_Flash_Games
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.