Quantcast

Jump to content

» «
Photo

C++ Webclient for gaming?

3 replies to this topic
Lee Everett
  • Lee Everett

    We need to keep you safe Clementine...

  • Members
  • Joined: 21 Jun 2009
  • None

#1

Posted 19 October 2015 - 01:15 PM

Is it possible to have a C++ webclient for games? I know it's possible with Java, but now Chrome doesn't support it. 

 

If yes, can you link me to a game that has support for C++ (webclient)?


K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Best Poster [Technology / Programming] 2016
    Best Poster [Programming] 2015
    Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#2

Posted 20 October 2015 - 12:18 AM

You can write a browser plugin and interface with it via JS. If you need something beyond that, you're using the wrong tools for the job.

Lee Everett
  • Lee Everett

    We need to keep you safe Clementine...

  • Members
  • Joined: 21 Jun 2009
  • None

#3

Posted 22 October 2015 - 07:52 PM

You can write a browser plugin and interface with it via JS. If you need something beyond that, you're using the wrong tools for the job.

 

 

Okay well the reason I'm asking is because I am creating an indie mmorpg (not to a great scale, but something that can support around 1,000-2,000 players). I've been programming in Java for about 6 years, and recently there have been a ton of security features that prevent me from making the game as accessible as I want. Example, Chrome blocked client that don't have a certificate, and then removed the webclient feature entirely. I do want to have a browser accessible client, because from my experience on a previous game server I used to work on about 70% of people used that since they didn't want to directly download. 

 

It's not something big like Call of Duty, or GTA V (since it's Indie), and there aren't any 3D elements, the game is completely 2D.

 

So for something like this would it be easier to rewrite everything in HTML5? And have a separate client in C++/Java? I'm looking for something that can be used on all platforms, so with Java I previously could have webclients, desktop clients, and even on the phones. It saves a lot of time and effort.


K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Best Poster [Technology / Programming] 2016
    Best Poster [Programming] 2015
    Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#4

Posted 22 October 2015 - 09:38 PM

If you want a game that can be ran in browser or as a stand alone  from the same code, my best recommendation is Unity. Now, running Unity games in browser requires users to install Unity web player, similar to how Java and Flash used to require a separate install back in the day. But it's a minimum hassle for end users, and a lot of people who play web games already have Unity installed.

 

As a stand alone, it works just like any other client. Best option for writing game code is C#, which won't give you quite the performance of C/C++ code, but it's pretty darn good. Certainly far better than anything you can do with JavaScript and HTML5. Unity also comes with a whole bunch of tools for graphics and networking built-in and has a huge community where you can get help.

 

Unity games are also relatively easily ported to iOS and Android. So if you were considering mobile market, this gives you better coverage out of the box. It's easy enough to use to make it a favorite as a game dev teaching tool, but also has features advanced enough to attract AAA developers. Hearthstone is probably the biggest name among Unity games, but there are many others.

 

 

That's as far as the client goes. If you need a server, that's a separate story. I don't know how complex it needs to be. Obviously, if it's something very simple that just needs to connect people together, you can throw something together in PHP and run it on any old LAMP. But if your server is complex enough to make you want to reuse code between server and client code, which would be case for most MMOs, and you're going with Unity for client, then you probably want a C# server as well. You can run C# under Linux, but obviously, Windows is a friendlier environment. If you're happy with a Windows server, then just run with C#. Like I said above, it's fast enough for most task, and if you get in a bind with performance for something like AI code (path finding tends to be a performance hog), you can always write a C/C++ library and import it into a C# project.

 

 

In short, with Unity/C# combo, you can have all the features and safety of Java-like environment, a big chunk of the C/C++ performance, and easy way to make web client, mobile client, and stand-alone client from the same code. For an indy MMO, I can't think of a better combination.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users