Flash in Torque - almost there, but need help
by Thomas \"Man of Ice\" Lund · in Torque Game Engine · 01/30/2005 (1:30 pm) · 14 replies
I've managed to get a flash movie to play inside TGE as a GUI control.
There is a lovely library called GameSWF that does the actual processing/rendering, so all I had to do was to port their standalone player to a TGE GUI control.
The plan is to release this as a free resource to all once its all working perfectly.
Here is a lovely screenshot
files.questless.com/tge_flash/firstlight.png
"Ehhhh - what?" I hear you say after seeing the screenshot.
Yeah - thats 4*3 pixels of a 550x400 flash movie. Lovely isn't it? But not exactly usable as is.
Thats where I had to give up on my own and ask for help.
My current skill level in TGE rendering and OpenGL isn't going to finish this by itself, so I would like to take the opportunity to call out for someone to help finish up this resource. I've tried to debug this bastard now for almost the entire day, and I just got to stop now. The code plays nicely with that exact movie in the stand alone player, but when run inside TGE is scales totally different. So the "bug" is somewhere in the borderline of how TGE has set up the viewport and how GameSWF wants it.
I have all the source ready and will gladly share with someone to get this fixed. Proper credits and all given naturally.
Besides the scale problem, the movie actually plays and finishes. It can be set to loop and background can be set transparent etc.etc.etc. Perfect for your mission briefing screens or a startup animation.
GameSWF itself lacks proper ActionScript implementation, so don't expect this to do anything but render an animation. Sound is ripped out too - use the TGE sound player for that part. This was done to get rid of SDL dependencies.
Buzz me (email in profile) or post here if you are interested. I bet its a 10-15 minute job for someone who knows their way around TGE rendering/OpenGL.
There is a lovely library called GameSWF that does the actual processing/rendering, so all I had to do was to port their standalone player to a TGE GUI control.
The plan is to release this as a free resource to all once its all working perfectly.
Here is a lovely screenshot
files.questless.com/tge_flash/firstlight.png
"Ehhhh - what?" I hear you say after seeing the screenshot.
Yeah - thats 4*3 pixels of a 550x400 flash movie. Lovely isn't it? But not exactly usable as is.
Thats where I had to give up on my own and ask for help.
My current skill level in TGE rendering and OpenGL isn't going to finish this by itself, so I would like to take the opportunity to call out for someone to help finish up this resource. I've tried to debug this bastard now for almost the entire day, and I just got to stop now. The code plays nicely with that exact movie in the stand alone player, but when run inside TGE is scales totally different. So the "bug" is somewhere in the borderline of how TGE has set up the viewport and how GameSWF wants it.
I have all the source ready and will gladly share with someone to get this fixed. Proper credits and all given naturally.
Besides the scale problem, the movie actually plays and finishes. It can be set to loop and background can be set transparent etc.etc.etc. Perfect for your mission briefing screens or a startup animation.
GameSWF itself lacks proper ActionScript implementation, so don't expect this to do anything but render an animation. Sound is ripped out too - use the TGE sound player for that part. This was done to get rid of SDL dependencies.
Buzz me (email in profile) or post here if you are interested. I bet its a 10-15 minute job for someone who knows their way around TGE rendering/OpenGL.
#2

Cleaning up things and fixing the last bugs now
02/03/2005 (2:37 pm)
Brian Richardson won the beers!!!!
Cleaning up things and fixing the last bugs now
#3
02/03/2005 (2:44 pm)
Excellent !!!
#4
02/03/2005 (2:49 pm)
Very cool Thomas, I cannot wait to use this, the options that will be provided are engless :)
#5
02/03/2005 (3:06 pm)
This sounds like it could be really useful. Looking forward to seeing it.
#6
Do you have any plans to implement the actionscript support? IMO this type of functionality would put Torque a light year ahead of other engines because of its incredible possibilities. The only other question I have is what kinds of legal issues are at stake here? I'm no lawyer but it would seem that selling a game that had SWF support in it could be a legal issue if you haven't purchased some kind of license from Macromedia. Anyone know the answer to this?
02/04/2005 (3:45 am)
I had wished I could do this well over a year ago but I lack the skills for it. I greatly applaud your work here and look forward to it as well. Do you have any plans to implement the actionscript support? IMO this type of functionality would put Torque a light year ahead of other engines because of its incredible possibilities. The only other question I have is what kinds of legal issues are at stake here? I'm no lawyer but it would seem that selling a game that had SWF support in it could be a legal issue if you haven't purchased some kind of license from Macromedia. Anyone know the answer to this?
#7
I fixed a few bugs in the gui component with placement and crash when no movie was loaded. I also cleaned out the code and implemented console methods to control e.g. transparency of the background, looping of the movie etc.etc.
I am not a lawyer, but GameSWF is not created using Macromedia knowledge or API. He is very specific about this, so I do not thing that there are legal issues. From what I hear GameSWF has also been used in "real" commercially shipped titles on the xbox. but you better investigate yourself.
There is (as always) a few small hitches.
One is the use of STL in GameSWF. We got around that by implementing a stl_fix+patch that allows TGE memory manager and STL to be used at the same time.
Another one is that we have not been able to compile GameSWF with VC6. GameSWF uses some STL hash libraries that are not compiling nicely on VC6, so I hope someone wants to get that part working.
ActionScript is not fully supported by GameSWF. As its created totally without any documentation or support by Macromedia, not everything works and/or even exists. Flash 6 with some Flash 7 + a subset of the ActionScript. But the code is free for anyone to modify, so I would strongly push for sending any patches to the GameSWF guys.
Lastly this code is only tested on Windows. No Mac or Linux tested. Also another item I hope someone can help with.
02/04/2005 (3:57 am)
Last night Brian ported the mouse and also the callback for the actionscripts from the SDL demonstration player. So potentially we have gotten all the GameSWF functionality implemented now.I fixed a few bugs in the gui component with placement and crash when no movie was loaded. I also cleaned out the code and implemented console methods to control e.g. transparency of the background, looping of the movie etc.etc.
I am not a lawyer, but GameSWF is not created using Macromedia knowledge or API. He is very specific about this, so I do not thing that there are legal issues. From what I hear GameSWF has also been used in "real" commercially shipped titles on the xbox. but you better investigate yourself.
There is (as always) a few small hitches.
One is the use of STL in GameSWF. We got around that by implementing a stl_fix+patch that allows TGE memory manager and STL to be used at the same time.
Another one is that we have not been able to compile GameSWF with VC6. GameSWF uses some STL hash libraries that are not compiling nicely on VC6, so I hope someone wants to get that part working.
ActionScript is not fully supported by GameSWF. As its created totally without any documentation or support by Macromedia, not everything works and/or even exists. Flash 6 with some Flash 7 + a subset of the ActionScript. But the code is free for anyone to modify, so I would strongly push for sending any patches to the GameSWF guys.
Lastly this code is only tested on Windows. No Mac or Linux tested. Also another item I hope someone can help with.
#8
Well, about the license stuff? ;) Can we use it in our commercial games and keep the code closed?
02/04/2005 (4:50 am)
Very cool, actually, it's even good just to show a streamed movie!Well, about the license stuff? ;) Can we use it in our commercial games and keep the code closed?
#9
02/04/2005 (5:02 am)
GameSWF is public domain. So its fully usable in commercial products without any issues.
#10
02/04/2005 (9:15 am)
If I'm not mistaken (which I may be)... I beleive .SWF is an open format, why there are other programs that create .swf files other than Macromedia, .fla is reserved by macromedia.
#11
Small movie preview is here
There are a few issues that I need to solve first. The resource uses an unreleased fix to TGE by another author, and I need his permission first to release his code along with the flash gui
02/04/2005 (9:21 am)
Wrapping this up as a resource as we speak. We got the final issues solved.Small movie preview is here
There are a few issues that I need to solve first. The resource uses an unreleased fix to TGE by another author, and I need his permission first to release his code along with the flash gui
#12
02/07/2005 (11:21 pm)
Well, I'd love to see this as a solid resource... I have been planning on implementing an arcade for players of my game... this would be perfect as I could just throw in some flash games :).
#13
03/16/2005 (9:00 am)
How's the Flash project coming?
Torque 3D Owner Robert Blanchet Jr.