Integrating Unity into a larger Mac/Windows app (RealBasic?)

I’ve got a project that needs both 3D power (Unity) and conventional app functionality (OS windows, text fields, sliders, menu bar etc.). I’m considering RealBasic for the app (never used it, but it’s cross-platform which is good).

Can Unity content be integrated into a RealBasic app (or other environment if not)? Maybe as a Web view of some kind? (Requiring the webplayer is OK, as long as it runs in the app and not in a browser.

And will the browser communication stuff work to send data back and forth to/from Unity?

Any suggested approaches?

(I may fall back on Web app, with Unity sharing the page with JavaScript, PHP, whatever–but a standalone executable would be much nicer.)

Thanks in advance!

Are you absolutely sure you can’t do what you want entirely in Unity? UnityGUI is pretty darn flexible / powerful. The natural solution for what you want to do is to use an engine that supports ActiveX, which AFAIK Unity does not.

You can use a Cocoa webview to embed Unity content in whatever application. It would require the Unity web player, then, yeah. An example using this is: http://www.unifycommunity.com/wiki/index.php?title=Creating_Screen_Savers

Cheers,
-Jon

BigKahuna:

All-in-Unity is possible I’m sure, and might be necessary as a last resort, but it wouldn’t give me a nice, professional, native GUI. I want a “real” app where the menus and controls look–and work–exactly like regular OS X and Windows menus/controls. This is important both for polish and also to keep the learning curve low and the comfort-level high, for a non-technical audience. I want my app to be “just another app” like they are used to. (Even Flash isn’t acceptable on that score.) That’s why RealBasic would be perfect.

And 95% of the app would be nothing to do with 3D or Unity–unless, that is, I can get the Unity stuff really well integrated and persuade the client to expand that portion :slight_smile:

Johnathan:

Do Cocoa webviews work in RealBasic? (Fear not, I’m asking in their forum too :slight_smile: ) What about a solution for Windows? (My client uses Windows–the Mac support is desirable but less important.)

Thanks, all!

RealBasic is not bad, but it’s not as outstanding nowadays as it was a few years back. Last time I used it, there was a web page rendering control, and I think it was based on WebKit on the Mac and IE on Windows - it probably could house a Unity web player, but I would check before buying a licence.

Coding in Objective-C/Cocoa with Xcode is often as good or better than RealBasic and it costs nothing to try. You can definitely render web pages with all content types using WebKit. However, you can only develop for Mac OSX, so no good if you need something cross-platform.

Another possibility is Runtime Revolution, which does menu-based GUIs, is very much cross-platform and arguably more of a high-level language than RB. This apparently has a web renderer too, but again, you should check that it can handle plug-ins.

Yet another possibility is to use the Mozilla suite, which can be used to write GUI apps (eg, Firefox, Nvu), is free and definitely has a web rendering component. The problem in this case might be the lack of documentation. There is an O’Reilly book about creating Mozilla-based apps, but it’s quite old now and the project has undoubtedly moved on since it was written.

Of course, ideally there would be a embeddable Unity component with a C/C++ API but I wouldn’t hold your breath for that;-)

Good ideas. I think RB has a free trial I can play with, and I’ll see what suggestions I may get from their forums as well.

What are your criticisms of the newer versions of RB?

Yes, you can do this in RealBasic. I did it once for a demo. Give it a shot, it’s pretty easy to do.

Well, the turning point was when MS announced they would drop support for Visual Basic. At this point, RB decided to court former VB users and so they heavily altered the editor to make it more VB-ish. Unfortunately, they didn’t do a particularly good job of updating RB, in my opinion, and it was never as elegant or easy to use from that point on. It was about that time that I stopped using RB - it may have improved again since then. In any case, if you’ve never used it before then you might not be so disappointed with its current state.

However, my greater criticism of RB is that it hasn’t really moved on as much as I would have liked. It was originally a very innovative and refreshing approach to development, much as Unity is today. The first few version upgrades really cemented its position, but it seemed to lose momentum after that. Nowadays, it looks very ordinary.

If cross-platform compilation is the deciding factor then RB is probably still a pretty good choice, since it is quite an easy way to maintain an app for up to three platforms from a single codebase. I think Revolution is more oriented toward multimedia, though - if your app is multimedia-heavy then Rev might be a better system for you.

Got it. I’ll certainly look into Runtime Revolution + Unity as well. Thanks. (My needs are mainly not multimedia for now–except for the 3D aspect.)

last test i did in RB using Unity in it’s webview component… it kept crashing… haven’t tried since. Which is a shame… would’ve been a powerful combo for creating kiosk apps, etc. Also there are some really nice USB interface libraries availabe for RB that would be cool to use together with Unity and RB.

But with Unity2 and it’s new GUI system and with some creative plugin writing then I suspect most things would be doable in Unity directly… especially if that HTML plugin for Unity becomes cross-platform! :wink:

Cheers.

Someone shoot me here if I am wrong. You could create a Java application and pass it information (to and from the Java appliation) to Unity using the WWW interface.

On top of that, you could get creative and use PIPES and inject data back and forth. Although, an all inclusive GUI interface that you are talking about would require that it knows about the OS on both ends. Well, Mono does. So, scratches head, ok if its web browser based and GUI based, Java, if its soley application based, well, hmm… just thinking outloud since I have a lockout issue at the moment with my Unity, but, why not create a DLL that launches a Windows form in Windows? This doesn’t solve the Mac side, you would definately have to use COCOA.

shrugs
I don’t really know the goal of this exercise to give any real proof of concept help.

All ideas are welcome! Some of them I may just try :slight_smile:

Does the container app have a lot to do? If it is just doing basic stuff then it might be worth using Cocoa on mac and one of the .NET languages on windows, provided you can deal with the limitation of requiring the .NET framework on windows.

You will have to manage two codebases, but it might turn out to be the best solution.

-Jeremy

I’m not sure, but isn’t Unity implemented as ActiveX control in Windows? It should be possible to load the “Unity-ActiveX-plugin” in any application that supports ActiveX. (like Firefox does) I don’t know how to do this but hey, Firefox is Open Source…

Thanks for the suggestions.

I would definitely need a rapid-development environment (like RealBasic) to control cost/time on the project.

The container app is really the main app–it does most everything (which is nothing to do with 3D) and will grow to do much more. The 3D part is an optional “extra” they want me to quote, but which might also grow if the small beginning works out well.

It’s workplace training content, involving simulating parts of an existing app–and the main material is text/math-based, but 3D simulation is of some small relevance. Future expansion into other topics, though, could make much more use of 3D.

couldn’t you launch the 3d component in it own browser window? Have some javascript/css in the html page that strips the chrome from around the browser window and position the window where you want it on the screen. 99.9% people have a browser on their machine. The only real concern is that nowhere near that amount of people have the plugin installed. So I guess it isn’t such a good solution at all… :?

Or for that matter launch a unity player that positions and sizes itself to the right monitor ratio…?

Cheers.

That’s a thought–and I don’t mind making people install the Unity webplayer.

But the thing is, the Unity content and the rest of the app must be able to communicate in both directions.

That’s the catch I guess… as you will run into permission problems, there is a way apparently using ActiveX controls, but that requires IE, and you will run into permission errors in XP SP2 and no doubt the paranoid Vista, and it won’t work on OSX. So you’re back to the beginning, using RB or some such.

But after some thought. There may be a way to get around the crashing issues I was having with RB’s HTML component and Unity plugin. Is to use the Active X controller directly in RB for Windows, and use MBS Plugin’s WebKit ( http://www.monkeybreadsoftware.de/ ) implementation to embed in the Mac side of things. You will still need to maintain two code bases, but as you’re using RB it will be a lot easier then coding in XCode. :wink:

Cheers.

Going with the seperate, windowed, standalone idea, why not use sockets communicating on a loopback (127.0.0.1) to handle communication between Unity and your “host” app? Just use different ports for send and receive.

-Jeremy

I guess the only issue with that is if it is robust enough? Will it work on a large enough user base to justify ignoring those users where it doesn’t work?

Cheers.