Game Development Community

Build T3D into .swf file, possible?

by Nabarro · in Torque 3D Professional · 04/21/2012 (8:31 pm) · 14 replies

Since games built by using T3D can be launched from web, is it possible to build T3D into .swf file? If so, T3D games can be lauched on computer which has installed flash player directly.

Do you have any idea to add some codes or "add-on" so that T3D can be built into .swf file? Any suggestions are appreciated. Thank you.

#1
04/21/2012 (10:49 pm)
I am thinking that SWF is primarily Flash interpreter byte code and resource data. Trying to get Flash to launch an exe of any type that runs on a CPU, hence machine code, would look like a virus and probably is not possible with Flash technology. Also, it would not run on every platform so someone trying to run the Flash from Linux would end up most likely crashing the browser or the flash player. Flash is cross platform because it runs inside of a Flash interpreter.

T3D can be compiled as a plugin for a browser. A plugin is allowed to execute machine code native to the platform. So Mac, Windows, etc would have their own plugins compiled for each platform.
#2
04/22/2012 (7:38 am)
Since Unity3.5 can be compiled into .swf file, so if T3D or TGB can support this feature, most of Torque's users will highly appreciate it.

If we can build T3D's c++ code and it's script(.cs file) and other data resources into .swf file, then the built apps(by using T3D or TGB)can run normally with Flash interpreter.

Of course it's not easy, but if someone can have any ideas or suggestions with this, it will be very helpful for the whole forum. Thanks,
#3
04/22/2012 (1:08 pm)
This isn't a weekend project to port, you know. The WHOLE ENGINE has to be rewritten for the Flash API. Also, 3D Flash runs like shit on my laptop, while "native" code can be pretty decent for the same Unity project :)
#4
04/23/2012 (12:18 am)
@Nabarro,
I apologize I misunderstood what you were asking.

If that feature is something you want then I would use Unity for that. The reason is because that is a feature that seems important to you. I think Ronny is right is saying actually porting it to Flash would be a monstrous task. The engine already needs a decent video card to run, putting it into Flash will make it run even slower because it is byte code and not an actual executable. I think the best you will get for frame rates in Flash is like 100,000 polys a frame. The old number before flash got acceleration was like 5000. I have no idea how many polys per frame T3D is running at now, but for a non-simple level like china town I bet it is way higher. I am guessing that Flash probably does not have the shader support to the level that T3D would need either.

Thanks for the heads up on Unity in Flash. There is a project I am looking into to do 3D in flash. If Unity fits the bill I may use it.
#5
04/23/2012 (7:00 am)
It seems that Unity's using Adobe's Alchemy for its 3.5 version, which can build flash application from Unity's Editor. Thanks all your guys.
#6
04/23/2012 (7:04 am)
Yeah, I wouldn't consider even trying to port T3D to Flash, since it basically means close to an engine rewrite to support compiling to an AS3 intermediary, which then compiles to SWF. Unity has already done that legwork, and most features compile to SWF very nicely (networking does not, and you'll need to roll your own using AS3- which isn't really that bad a problem). Also, UDK may compile to Flash. I haven't checked lately, but I know they had a demo out where they were making that push as well.

Just be aware that Adobe wants royalties if you use Unity like that (or Stage3D, from how I read it, but I could be wrong), so going a more conventional web-player route would be prudent in a lot of cases.
#7
04/23/2012 (9:46 am)
Yeah, Flash has a royalty system in place now with their player. I'm not clear on exactly what the pricing scheme is for it though.
#9
04/23/2012 (10:41 am)
So, if a third party compiler such as haXe were used to create the flash game, and those two features were used, then how could Adobe prevent the use of those features? Will it have some form of a phone home? Or require registration by Adobe? I bet it will not take long for developers outside of Adobe tools to figure out how to enable these features.

This sounds like the death nail of flash.
#10
04/23/2012 (10:47 am)
Quote:This sounds like the death nail of flash.

Not unless that nail went through Adobe's temple (it could happen). Adobe can very easily look at a game, and have their lawyers say "hey, you make lots of money, use those features, and have not paid up...guess what?". No one really wants that situation.

What Adobe is doing right now is not so much providing Flash as a cute way to get live content on the web, but positioning Flash as a platform alongside more serious development content like C/C++ (and they've made some interesting strides towards that). Whether or not it works out, they're going to be around for a few years.
#11
04/24/2012 (3:14 pm)
For a fraction of the time and expense it would take to make such a thing possible (it's not a weekend project), a much better Torque web-plugin could be created.
#12
04/24/2012 (4:30 pm)
@Ted,
That implies an agreement was made with the developer. As far as I know the only way to make such an agreement is through a EULA for a software package to produce the actual program. Making software for the Flash VM does not have to use Adobe tools. Otherwise they would have to have the agreement on the Flash Plugin. Then at that point they could only go after the consumer. Which would be a very bad move. Even Microsoft cannot control software made for Windows. If you use your own compiler and tools they cannot make arbitrary rules or bind you into royalty agreements.

The lesson here is to KNOW what is in the EULA for the development tools you use.
#13
04/24/2012 (5:59 pm)
Go ask Adobe.
#14
04/24/2012 (6:28 pm)
@Ted,
www.adobe.com/devnet/flashplayer/articles/premium-features-licensing-faq.html#o

It looks like it is an auto-magic degradation of performance. In my un-expert opinion, this is the death of flash as a bleeding edge platform. This will usher in more demand for webGL and HTML5. I know as a developer I would think twice before using Flash as a target now. I had one project in mind for Flash, but I would not pursue it now.