0
\$\begingroup\$

I'm currently running to a wall in my game development and I need now some discussion to clear my mind... In my mind I have a plan for some little online game (focused around clicking and idling), which I imagined could be served both on website and winapp, and in future even in mobile platforms.

I have chosen C# for it, build some server backend (join server, game server), but 'cause I want this server components be runned on linux, I have chosen .net core. Which is now my problem, because I'm building the game client in Unity, which only works in .net standard.

My main problem now is that I have build some "base network library" for communication, written in .netcore with plenty of NuGet packages, which I now have implement to Unity to get it work, but there are now conflicts (the main one is that unity is using another version of System.Threading).

Now I am wondering what steps should I choose nexts... There are some work behind now (but not so much, there are only some basic proceses for login and creating game worlds), so probably make that base network package compatible with .netstandard and .netcore.

Or I am thinking if it isn't more suitable to choose some another technology like c++ and some 2D engine in it (which to choose?).

What are you opinions? And what would you do in this situation?

\$\endgroup\$
  • \$\begingroup\$ If you use a protocol based on raw TCP or UDP sockets, then it should be possible to implement client and server in completely different technologies. But you won't be able to do a WebGL build. There are no raw sockets in the web browser. Only WebSockets, which work differently and won't be understood by a server which doesn't implement the websocket protocol. \$\endgroup\$ – Philipp Jun 29 '20 at 9:59
  • \$\begingroup\$ Well, I created some network library with client and server, message protocol... With usage of DI from NuGet, .netcore JSON... DI isn't the main problem in the end... But probably I will need better structure than JSON, which is a problem for implementing in unity, or at least for usage of System.Text.Json library, with is colliding with .netstandard Threading lib. And of course, this library is now compiled with .netcore. \$\endgroup\$ – Zechy Jun 29 '20 at 10:05
  • \$\begingroup\$ So my first step could be compile that network library for .netcore and .netstandard, and maybe get rid of JSON in message body and make it somehow better... I'm thinking about creating some message protocol for uniting the communication, but not sure how to make it properly. If I get this message protocol out of my "network library" I can build something for the unity project. \$\endgroup\$ – Zechy Jun 29 '20 at 10:16
  • \$\begingroup\$ Unity has an own JSON implementation. \$\endgroup\$ – Philipp Jun 29 '20 at 10:21
1
\$\begingroup\$

Sometimes a time and discussion is everything, what man needs!

Seperated my Message Protocol to custom library suitable for building for .net standard (unity) and .net core (server-side). Of course I get rid of native implementation of JSON in it, so it isn't dependent on some JSON library. So now it isn't pain to get it into Unity project.

Now make some nice Tcp Client usable in Unity project.

\$\endgroup\$
  • \$\begingroup\$ If this solves your problem, could you mark your answer as Accepted? Unless you are still waiting for a new answer. \$\endgroup\$ – Candid Moon _Max_ Jul 30 '20 at 8:32
  • 1
    \$\begingroup\$ oh, marked as Accepted :) \$\endgroup\$ – Zechy Jul 31 '20 at 9:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.