Previous Blog Next Blog
Prev/Next Blog
by date

TGE Browser Plugin Online

TGE Browser Plugin Online
Name:Neil Marshall
Date Posted:Jul 19, 2006
Rating:4.7 out of 5
Public:YES
Comments:YES
RSS Feed:GarageGames Blog feedor Subscribe with .
Profile Page:View profile page for Neil Marshall

Blog post
It's TGE Browser Plugin time again...



* TDN Resource Page
* The code itself
* A Live example


Even though I haven't written a plan/blog in a while, I've still been working on the code. I finally got most of it working today and put it online for people to try out/download and mess around with. It would be great if people could test out, not only the live example, but the source code as well. I'm interested in knowing if all the steps on the wiki actually work for other people. I'm sure I've missed SOMETHING.

Known Bugs:
The plugin will crash when you close the tab/window which houses it in Firefox. If someone could help me with this one it would be fantastic. :)

Thats it!

- NeilM

Recent Blog Posts
List:08/18/06 - Experimenting with TSE
07/19/06 - TGE Browser Plugin Online
05/29/06 - TGE Browser Plugin
05/02/06 - The browser plugin - progress
04/24/06 - TGE Browser Plugin
04/11/06 - More TGE in the Browser
03/24/06 - TGE Plugin now working in IE 6.0
03/07/06 - It works!

Submit ResourceSubmit your own resources!

Timothy Aste   (Jul 19, 2006 at 20:57 GMT)
That's pretty awesome!

Jason McIntosh   (Jul 19, 2006 at 21:16 GMT)
Wow, that opens up a lot of possibilities. Nice work!

Anton Bursch   (Jul 19, 2006 at 21:22 GMT)
Absolute utter awesomeness!!!!!

Jeff Gran   (Jul 19, 2006 at 21:29 GMT)
Super Sweet.

Nicolas Quijano   (Jul 19, 2006 at 21:39 GMT)
Neil : can't you catch the tab/window closing event, and then send a proper event to the plugin who will then send one to TGE ?

Maxwell Marsh   (Jul 19, 2006 at 21:54 GMT)
I can tell someone has been working hard =D

James Urquhart   (Jul 19, 2006 at 22:06 GMT)   Resource Rating: 3
Great work, Neil!

Josiah Wang   (Jul 19, 2006 at 22:33 GMT)
opens up a ton of opportunities. nice!

Unsung Zero   (Jul 19, 2006 at 23:47 GMT)
That, is awesome!

Is there a way to capture the scroll wheel on the mouse, so that the browser doesn't scroll?

bank   (Jul 19, 2006 at 23:50 GMT)
i've just tested it with FF.. got online on "master server"... played a bit.. that cool!

Neil, it's great stuff you do! ;)

btw, I have a problems with "chat" while in game. I need to press alt+tab then back then click on "game" to be able to type in chat...
but anyway - so far it's really great!

Mincetro   (Jul 20, 2006 at 00:14 GMT)   Resource Rating: 4
Works fine in Firefox, but it didn't work in Opera for me.

Josh Williams   (Jul 20, 2006 at 01:09 GMT)
Awesome Neil!! You keep making great progress... keep us posted!

Neil Marshall   (Jul 20, 2006 at 01:11 GMT)
Nicolas, it`s not the fact that I have to send the quit event to the plugin, there is something going on in ram that I`m not seeing on my main dev box. I see it on every other machine though.

Unsung Zero, I trap the mouse wheel event in IE when it`s in the 3D view (not when it`s in the 2D one) but I haven`t figured out how to do it in Firefox yet. If anyone knows please let me know. I think the browser window is getting the event instead of the plugin.

bank, I never thought to look at chat. I`ll take a look at it tomorrow.

Mincetro, thanks for letting me know. I have only tried to load it in opera once a few months back. I don`t know the browser well enough yet to say one way or the other why it`s not working. I`ll look into it as soon as I can.

Berndt Garbotz   (Jul 20, 2006 at 06:56 GMT)
hang up in mozilla 1.7 while File Downloading on 100%.

Anyways, great Job

Frogger   (Jul 21, 2006 at 16:24 GMT)   Resource Rating: 5
Does this work on linux though? I'm guessing probably not yet....

Neil Marshall   (Jul 21, 2006 at 17:03 GMT)
No, someone would have to port it. It could though.

Anthony Rosenbaum   (Jul 22, 2006 at 13:31 GMT)
will this code work with TBG as well?

Neil Marshall   (Jul 22, 2006 at 16:01 GMT)
I wouldn't know if it work work in TGB. I don't have a license for that product. I'm sure it could be ported if you have the C++ code.

Seung Wook Kim   (Aug 11, 2006 at 05:08 GMT)   Resource Rating: 5
I was thrilled with this project. However, I tried to compile the source codes in Visual Studio 2005 without success. I guess there is something incompatible with 2003 version. Any help?

c:\torque\plugin\engine\np3dplugin\ax3DPlugin.h(116) : warning C4581: deprecated behavior: '"apartment"' replaced with 'apartment' to process attribute
c:\torque\plugin\engine\np3dplugin\ax3DPlugin.h(125) : error C2337: 'support_error_info' : attribute not found
c:\torque\plugin\engine\np3dplugin\ax3DPlugin.h(125) : error C2337: 'registration_script' : attribute not found
c:\torque\plugin\engine\np3dplugin\ax3DPlugin.h(125) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Edited on Aug 11, 2006 05:51 GMT

Neil Marshall   (Aug 11, 2006 at 14:36 GMT)
Sorry, I can't help you, I don't have 2005.

Gordon Marsh   (Dec 09, 2006 at 01:47 GMT)   Resource Rating: 5
Hi Neil,

This looks like a great resource.

Although I understand the resource notes you've written, could you give a few pointers to integrating this into an existing Torque project?

I have my current game with its own .SLN file in VC++ 2005. To make it into a plugin, if I do the following do you think it would work?

1. Extract your files over (a copy of!) my existing Torque folder.
2. Load up my existing solution file.
3. Add your new plugin-related project files
4. Compile the np3Dplugin project.

Hey presto my game is now a plugin?

Any pointers appreciated...

Gords

Neil Marshall   (Dec 09, 2006 at 15:10 GMT)
What I would suggest doing is grabbing a program called Beyond Compare. What it allows you to do is compare one directory structure to another, and then open the text files and copy line by line the changes. It makes merging 2 projects simple.

The plugin mainly makes changes in winWindow.cc so if you haven't changed those low level files any, then that shouldn't be a problem. The .vcproj files are new, so they shouldn't be a problem but you will have to add your files to that project file. In MSVC++ you should be able to right click on your project and import the existing .vcproj file.

The plugin project makes quite a few changes to the project settings but those SHOULD only be in the .vcproj file, but double check before you do anything. And remember, the plugin code is based on v1.4 not the latest 1.5.

Gordon Marsh   (Dec 09, 2006 at 15:27 GMT)   Resource Rating: 5
Thanks very much Neil. I'll give it a go and tell you how I get on.

Gordon

Gordon Marsh   (Dec 12, 2006 at 20:09 GMT)   Resource Rating: 5
Neil, when you say the plugin doesn't compile in VS2005 - is this actually a problem only for VC++2005 Express which doesn't have ATL support?

If there are other issues, I guess to get anywhere with this I'll need to upgrade to VC/VS 2005 Standard to get the ATL support in any case. Then fix up the other issues.

Gordon

Neil M.   (Dec 12, 2006 at 23:13 GMT)
I've never actually tried to compile it in 2005. The .vcproj and .sln files are 2003.net format.

Gordon Marsh   (Dec 12, 2006 at 23:17 GMT)   Resource Rating: 5
Ah, OK, it's just there's a comment in the resource about "Broken in VS2005" unless I misread it.

I followed your advice using Beyond Compare. Some files were a little tricky but generally painless. My next issue is, as I said above, that VC++ 2005 Express edition doesn't include the ATL libraries (you can include them but they are out of date). I'm going to have to get a copy of VS2005 Standard Edition and crack on from there.

Gordon Marsh   (Dec 23, 2006 at 00:04 GMT)   Resource Rating: 5
Hi Neil, just a quick query about the html/javascript example files you included. My HTML/Javascript knowledge is poor. Is what is happening here basically (1) the HTML calls the Javascript file (2) Javascript file contains a load of parameters for the plugin and then launches it?

I've got the plugin working in VS2005 btw. For anyone else trying to use the plugin in an existing project with 2005 here are some pointers:

1) Get a copy of VS2005 Standard, Express is no good as it doesn't have the proper ATL libraries.
2) As Neil suggested, extract the files and use Beyond Compare to integrate them into your project.
3) Add the np3DPlugin project to your Solution.
4) Copy into the np3DPlugin project any extra files your game may be using that you have added to the engine (otherwise, like me, you'll get loads of linker errors!)
5) A number of the functions have changed 2003 -> 2005. Generally these relate to UTF16 being replaced by wchar_t. I found that castings in the relevant places sorted this out.

Thanks for a great resource Neil, it really does open up some great possibilities!

Neil M.   (Dec 23, 2006 at 04:28 GMT)
Awesome to hear that it works in 2005! Feel free to update the TDN article with these notes on 2005.

Yes. The HTML calls the JavaScript, which then writes the plugin to the html page and then it runs. You need to have the Javascript write the object tag to the html on the fly to work around the Eolas patent "feature." Microsoft had to add it to the two latest versions of IE because they lost the court case. ( http://www.eweek.com/article2/0,1895,1932304,00.asp )

Also, IE doesn't support a standards compliant object tag call so that is why Firefox requires a different one.

Thomas Pedersen   (Jan 15, 2007 at 10:14 GMT)   Resource Rating: 5
Thanks Neil and co. it's a great project.

I want to help port this to TGEA too. I even want to pay someone to help me do it.
Please see:
www.garagegames.com/index.php?sec=mg&mod=project&page=view.job&qid=5...

If you know of anyone who can help or anyone who need the same thing, then please let me know.

Gordon Marsh   (Jan 15, 2007 at 14:01 GMT)   Resource Rating: 5
Thomas - I was about to see what happened to this and TGEA (I assume this acronym is now for TGE + Arcane FX?) I haven't started yet, but would be very interested in helping or testing. Have you tried? What are the problems?

The only problem I have is that I am also using the MMOKit with TGEA, which obviously affects my build.

Edit>> Now realise TGEA is TGE Advanced and not TGE + Arcane FX!!
Edited on Jan 22, 2007 00:19 GMT

Gordon Marsh   (Jan 22, 2007 at 00:25 GMT)   Resource Rating: 5
Neil,

I'm trying to get this to work with TGE 1.5 (and AFX). It all seems to compile fine, but what I'm seeing is nothing (white) where the plugin should appear. However, as I resize the browser window, the mainmenu.gui flickers into view. As soon as I stop resizing, it's back to white again.

Any idea in your code where I should start to look to try and fix this? Its as though the picture is being deleted immediately after being rendered.

Thanks,

Gords

Neil Marshall   (Jan 22, 2007 at 03:14 GMT)
I haven't really touched this in a long time, but the problem area is either in the WM_RESIZE event or WM_PAINT events. As for which files those are processed in, look in winWindow.cc and winD3DVideo.cc. You'll see some of the TORQUE_PLUGIN ifdef's in there and then you should compare the differences between 1.4 and 1.5 to see what has changed.

Gordon Marsh   (Jan 22, 2007 at 18:06 GMT)   Resource Rating: 5
I **think** I've just cracked this one for anyone interested. But I'm not sure if this opens up a whole other barrel of problems...

TGE1.5 or AFX changes the gameInterface.cc file a fair bit. By re-entering "processEvent(&event);" at the end of the postEvent function, this seems to solve the plugin-flickering problem I was previously having.

Hope this helps somone out!

Neil - was this designed to be used for standalone games or with a dedicated server? I get an odd error when the game itself tries to load (invalid packet) but I'm not sure if I've got the server build right yet.

Gords
Edited on Jan 22, 2007 18:51 GMT

Gordon Marsh   (Jan 31, 2007 at 02:31 GMT)   Resource Rating: 5
If anyone is trying to use the plugin with a dedicated server and hit mission loading problems, I started a thread here that may be useful... www.garagegames.com/mg/forums/result.thread.php?qt=57059#427974

Gords

Gordon Marsh   (Feb 04, 2007 at 01:15 GMT)   Resource Rating: 5
A qualification to one of my previous posts. If you are using TGE1.5 (+ AFX?) add the following code to the bottom of the gameInterface.cc postEvent function.


   #ifdef TORQUE_PLUGIN
processEvent(&event);
#endif


I have no idea why this works, but it seems to do the job. Without the #ifdefs the game goes into super-fast-motion if you do a non-plugin standalone build!

Neil - I'm just going through the download/code-signing stuff. Do I take it that the cab file that is downloaded expects the stub_setup.exe to copy the plugin into the relevant Firefox and IE directories?

For anyone's interest Paquet Builder seems to be a great tool for installs, although its code signing facilty is a bit poor. Better to do that on the command line!

Gords

Neil Marshall   (Feb 05, 2007 at 16:03 GMT)
Yes, the stub_setup.exe is just an install file which downloads the full installer which may be large in size. You could make the cab file install the full piece of software if you like, but some users may not think the plugin is downloading and hit reload.

Ed Zavada   (Feb 08, 2007 at 20:33 GMT)   Resource Rating: 5
I've integrated this with TGE 1.5 and updated the TDN page with the new version. I've left the 1.4 version there for people who haven't updated yet.

tdn.garagegames.com/wiki/TGE/Code/How_to_make_torque_a_plugin
Edited on Feb 09, 2007 13:22 GMT

Prodigy Andy   (Jun 30, 2007 at 09:52 GMT)   Resource Rating: 5
Are there new version of plugin for TGE 1.5.2?
Thanks.

Andy

Neil M.   (Jul 01, 2007 at 02:26 GMT)
I haven't worked on it for a long time. Whatever is up on the TDN is all there is.

Prodigy Andy   (Jul 01, 2007 at 05:04 GMT)   Resource Rating: 5
To Neil M.

There are two plugins for TGE 1.4 and TGE 1.5, but TGE 1.4 is old and TGE 1.5 can't be downloaded at all.

I tried to patch plugin to TGE 1.5.2, but failed.

Anyway, Thank you for your good resource.

Andy

Prodigy Andy   (Jul 01, 2007 at 13:45 GMT)   Resource Rating: 5
I tried my best to patch the plugin of 1.5 to TGE 1.5.2, but still failed.

Here is the error messages on linking:

np3DPlugin error LNK2019: unresolved external symbol "char const * __cdecl getNthCodepoint(char const *,unsigned int)" (?getNthCodepoint@@YAPBDPBDI@Z) ,referenced in function "public: virtual void __thiscall GuiMLTextCtrl::reflow(void)" (?reflow@GuiMLTextCtrl@@UAEXXZ)

np3DPlugin error LNK2019: unresolved external symbol "public: bool __thiscall ConstructorSimpleMesh::read(class Stream &)" (?read@ConstructorSimpleMesh@@QAE_NAAVStream@@@Z) ,referenced in function "public: bool __thiscall Interior::read(class Stream &)" (?read@Interior@@QAE_NAAVStream@@@Z)

np3DPlugin error LNK2019: unresolved external symbol "public: bool __thiscall ConstructorSimpleMesh::write(class Stream &)const " (?write@ConstructorSimpleMesh@@QBE_NAAVStream@@@Z) ,referenced in function "public: bool __thiscall Interior::write(class Stream &)const " (?write@Interior@@QBE_NAAVStream@@@Z)

np3DPlugin error LNK2019: unresolved external symbol "public: void __thiscall ConstructorSimpleMesh::render(bool,bool,bool,bool,unsigned int,unsigned int)" (?render@ConstructorSimpleMesh@@QAEX_N000II@Z) ,referenced in function "public: void __thiscall Interior::renderStaticMeshesSimple(bool,bool,unsigned int)" (?renderStaticMeshesSimple@Interior@@QAEX_N0I@Z)

np3DPlugin error LNK2019: unresolved external symbol "bool __cdecl castRayTriangle(class Point3D const &,class Point3D const &,class Point3D const &,class Point3D const &,class Point3D const &)" (?castRayTriangle@@YA_NABVPoint3D@@0000@Z) ,referenced in function "public: static bool __cdecl sgShadowObjects::sgCastRayStaticMesh(class Point3F,class Point3F,class ConstructorSimpleMesh *)" (?sgCastRayStaticMesh@sgShadowObjects@@SA_NVPoint3F@@0PAVConstructorSimpleMesh@@@Z)

Ed Zavada   (Jul 02, 2007 at 15:35 GMT)   Resource Rating: 5
I've been compiling this with 1.5.2 and no problems whatsoever. I just merged the 1.5.2 changes into my Plugin project with Araxis Merge.

It sounds like you are missing some files or possibly some chunks of files that were added in 1.5.2
Edited on Jul 02, 2007 15:36 GMT

Prodigy Andy   (Jul 03, 2007 at 03:11 GMT)   Resource Rating: 5
Thank you , Ed Zavada, you give me a hope to try it again.

andy

Prodigy Andy   (Jul 03, 2007 at 14:04 GMT)   Resource Rating: 5
Ed Zavada, can you help me? The project is very important to me that I have spend about 4 days to just patch the plugin to TGE 1.5.2. But I still failed even with Araxis Merge (though Araxis Merge is so powerful. I even compare files with UtraEdit before :) ).

I will appreciate you if you can send me the plugin source files for TGE 1.5.2.
Here is my email: prodigyandy2006@gmail.com

Andy.

Prodigy Andy   (Jul 05, 2007 at 08:58 GMT)   Resource Rating: 5
It's worked.
Thank you ,Ed Zavada.

Andy

Prodigy Andy   (Jul 05, 2007 at 09:21 GMT)   Resource Rating: 5
Another question: How to stop loading mission immediately when open dual.html file?

I just want it loading main screen as before.

Andy.

Ed Zavada   (Jul 06, 2007 at 00:44 GMT)   Resource Rating: 5
If you set the mission parameter in the object and embed tags to a mission that doesn't exist (or presumably just leave it off), then it should just drop to the main screen.

Prodigy Andy   (Jul 07, 2007 at 01:18 GMT)   Resource Rating: 5
Thank you again, Ed Zavada. You are a so nice guy.
:)

Andy

Prodigy Andy   (Aug 04, 2007 at 14:06 GMT)   Resource Rating: 5
I am here again.

I can't show the TGE plugin in IE anymore which can be shown before----there is just a red X shown in IE. But the same project is ok at another computer.

I want to know how to solve this problem or just to restore to the clean enviroment as before.

(8.5)Today, I tried the http://www.buildingtogo.com/yecho/torque/dual.html web page by using Maxthon, it's ok too. But it still can't be shown in IE.

at last , I have to reinstall my OS.

Thanks.
Edited on Aug 06, 2007 10:51 GMT

Neil Marshall   (Aug 07, 2007 at 14:07 GMT)
You probably just need to make sure that the activeX control is fully removed from your machine. Search for it in the registry editor and remove any reference to it. Also make sure that all copies of the dll are removed from your machine. Then recompile and try it again.

Prodigy Andy   (Aug 17, 2007 at 07:33 GMT)   Resource Rating: 5
Can the TGE plugin support unicode input?

I can input unicode in TGE demo now. But how can I input unicode in the TGE plugin project.

or where can I catch the messages : WM_IME_COMPOSITION, WM_IME_CHAR, WM_CHAR, etc. ?

andy
Edited on Aug 17, 2007 13:50 GMT

You must be a member and be logged in to either append comments or rate this resource.