1
\$\begingroup\$

So, my game is being developed in pure C++, with very limited dependencies (Mostly just pocoproject). The main goal here is portability, not performance. The code runs on multi-platform clients, as well as the server itself.

This is all headless, not graphics whatsoever. Everything is implemented, though. Menus, navigation, the game itself, online, single player, ... etc. You can essentially play the whole game with this C++ library. I added simple console bindings, so I can visually test and play the game, but haven't hooked it with a game engine yet.

I would really like to use Unity3D for the graphical part, as it kicks ass when it comes to rapidly developing graphics, but it was a hellish experience to try and marry Mono with C++, even when using SWIG. (Basically, Mono has limited C++ compatibility, but it is really annoying to work with).

Here is the problem, I am stuck between these two islands; C++ program and Unity3D. I am not very good with OS concepts, so I don't know if it's possible to fork the main process and run a local C++ server, and have the Unity game communicate using RPCs or even REST API. Performance isn't an issue, the only issue is maintainability. I need a robust and simple system that I can wrap my head around easily.

Other solutions welcome!

\$\endgroup\$
5
  • \$\begingroup\$ I'm pretty sure you could have unity work with a custom dll you make. You might have to make calls into it from c# and make the c# take the results and pass it onto the unity engine but I think it's possible to go this route. \$\endgroup\$
    – Alan Wolfe
    Aug 3, 2015 at 0:54
  • \$\begingroup\$ @AlanWolfe Thanks, but dlls are dynamic libraries, I think. So, portability won't be satisfied for iOS (requires static linkage). \$\endgroup\$
    – Mazyod
    Aug 3, 2015 at 3:35
  • \$\begingroup\$ I really think you are out of luck with the unity route if you want client code to be written in c++ then unfortunately ): \$\endgroup\$
    – Alan Wolfe
    Aug 3, 2015 at 3:52
  • \$\begingroup\$ Actually check this out, it might be what you need answers.unity3d.com/questions/166543/… \$\endgroup\$
    – Alan Wolfe
    Aug 3, 2015 at 3:54
  • \$\begingroup\$ @alanwolfe thanks again, that's the route I took with SWIG, however, I found it to be extremely limiting and fragile :( I am gonna experiment with different stuff, but that will take time. Will hopefully post back the results \$\endgroup\$
    – Mazyod
    Aug 3, 2015 at 9:59

1 Answer 1

0
\$\begingroup\$

You can use Visual Studio 2013 with Unity, you just have to download the tools package from Microsoft. Not sure if this would help with using C++ but I know that C++ works in VS and may or may not work in the VS/Unity environment. I'd recommend using VS with Unity regardless, it's much better all around. If you attach VS to Unity just make sure you disable Monodevelop as you'll get annoying conflicts if you don't...

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged .