10
\$\begingroup\$

I am a C# developer and wanted to start a hobby project building a persistent browser based game (PBBG). I work with C#, MSSQL and Angular and thought I would use those techniques for my hobby project as well.

When I started to search for do and donts and tips I realized that a lot of projects use PHP and I have actually not found any PBBG using C#, which I find really strange. It seems as the stack I'm working with (C#, MSSQL, Angular) could suit a PBBG.

The only reason I can think of C# not being used is the hefty price of Visual Studio and the fact that it wasn't open source.

Is there any other reason, or am I just bad at finding projects which use C#? Or can it be that I'm just bad at my work and don't realise that this stack is not good for PBBG?

\$\endgroup\$

closed as off-topic by Tyyppi_77, Almo, doppelgreener, Jimmy, Alexandre Vaillancourt May 29 '18 at 1:40

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about "how to get started," "what to learn next," or "which technology to use" are discussion-oriented questions which involve answers that are either based on opinion, or which are all equally valid. Those kinds of questions are outside the scope of this site. Visit our help center for more information." – Tyyppi_77, Almo, doppelgreener, Jimmy, Alexandre Vaillancourt
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    \$\begingroup\$ Also answers will be opinion-based. Some people just don't like C#. \$\endgroup\$ – Almo May 28 '18 at 13:26
  • 6
    \$\begingroup\$ @Almo And other people (like me) detest PHP. But I think I was able to write a neutral and helpful answer nevertheless. \$\endgroup\$ – Philipp May 28 '18 at 14:22
  • \$\begingroup\$ I think you'll find age to be one of the contributing factors here. PHP is much older and more deeply ingrained than C#. \$\endgroup\$ – Pharap May 28 '18 at 16:42
  • 4
    \$\begingroup\$ "the hefty price of Visual Studio" - 2017 Community Edition: 0. VERY hefty. \$\endgroup\$ – TomTom May 28 '18 at 17:47
  • 1
    \$\begingroup\$ What do you mean by "hefty price of Visual Studio"? It's been free for a while. \$\endgroup\$ – user1306322 May 28 '18 at 17:58
17
\$\begingroup\$

PHP has the advantage that it is very widely supported by cheap webhosters. You can rent some shared-hosting LAMP (Linux, Apache, MySQL, PHP) webspace for peanuts. And that webspace can also host your website and the game client. The setup of most PHP applications is equally easy. Just copy the files to the webserver and you are done. This makes it very easy and convenient to get a testserver running.

A C# gameserver, on the other hand, can be more complicated. You need to rent an actual rootserver, which is more expensive and requires far more work and know-how to set up and maintain properly. You didn't write if C# means an ASP.NET application running on a webserver (a pretty straight-forward solution for a PBBG if you ask me) or a C# standalone application running as a separate process (a bit unorthodox, but might work quite well if you have a more action-oriented game). If you mean the latter, you also need to install or rent a webserver for hosting your website and the client-sided parts of your game.

That additional overhead can be a barrier for most hobby developers, which can be a good reason to pick PHP. But when a hobbyist is successful with their game and decides to do this professionally, they already have their existing codebase and certainly won't start from scratch. So they will keep their LAMP technology stack even though their initial concerns for picking it aren't valid anymore (when you are running a serious operation on a LAMP stack you will sooner or later hit a point where shared hosting does not cut it anymore and you need your own servers).

But remember that if you look at the total project cost of developing a PBBG, then you will usually notice that the costs for server hosting and administration during the development phase are just a tiny fraction of the development budget.

So your decision which technology to use should be driven by which technology allows you to create the best game in the least amount of time. Picking the best tools money can buy (best for you and your project) does not cost you money, it saves you money.

\$\endgroup\$
  • 7
    \$\begingroup\$ A rootserver is not essentially necessary for C# web applications. See Microsoft Azure for example. \$\endgroup\$ – Michael Pittino May 28 '18 at 13:05
  • 11
    \$\begingroup\$ With Visual Studio Code and/or Visual Studio Community, the entry cost for the tools certainly isn't a barrier anymore for C#. \$\endgroup\$ – 0xFF May 28 '18 at 13:22
  • 1
    \$\begingroup\$ @Erik On the other hand, if you use sub-par tools you might take longer to realize that your game idea does not work, so you lose more human labor. Even worse: You might realize after 100 hours that your game can not be made with the sub-par tools you've chosen but would work with more expensive tools which you then would have to buy anyway (been there). \$\endgroup\$ – Philipp May 28 '18 at 14:37
  • 2
    \$\begingroup\$ @TylerH True, though since the C# compiler itself is free (at least since Roslyn) I wonder where they draw the line. \$\endgroup\$ – 0xFF May 28 '18 at 15:59
  • 4
    \$\begingroup\$ And actually, from VisualStudio's own webpage for the Community edition: "Any individual developer can use Visual Studio Community to create their own free or paid apps". \$\endgroup\$ – 0xFF May 28 '18 at 16:01
5
\$\begingroup\$

The other answers are correct, but there's a historical factor that hasn't been mentioned.

When I started to search for do and donts and tips I realized that a lot of projects use PHP and I have actually not found any PBBG using C# which I find really strange.

Until a couple years ago, there was a PBBG development community that mostly existed on two forums: BBGameZone and MakeWebGames, both predominately filled with PHP programmers. Newcommers who didn't know how to make a game were pointed over to the awesome tutorials at BuildingBrowserGames.com which was all in PHP. The "PBBG" term comes mostly from games made by folks connected to these two forums, there was an effort to popularize the term so that the genre would have a recognizable name that players could search for and hopefully slow down the decline of the genre, it's no wonder if you're only getting PHP when you search the term.

It seems as the stack Im working with (C#, MSSQL, Angular) could suit a PBBG.

The only reason I can think of C# not being used is the hefty price of Visual Studio and the fact that it wasn't open source.

I think you're 100% fine to go ahead with using C#, MSSQL and Angular. You'll find that most of the PHP engines are outdated PHP4 or PHP5.

The BBGameZone folks were mostly against using engines (everyone was writing their own engine, including me) There was an effort by the MakeWebGames people to get new PHP engines in place (McCodes being their main old engine and NWE (New Worlds Engine) being regarded as the probable new one that was half-way done)

Here's a Google doc with an engine comparison from a few years ago, comparing McCode / NWE / ezRPG / GL Script: https://docs.google.com/spreadsheets/d/1WM3axFhYaAtjiKd1KRwibx9jEegwjwCJNhQmXP_jzss/pub?single=true&gid=0&output=html

There have been past efforts to put the old community back together, but not much luck so far: https://www.reddit.com/r/PBBG/comments/6r34vi/announcing_pbbgsite/


I think you'll be 100% OK going forward using a C#, MSSQL, Angular stack, just remember that you're probably the first person writing a PBBG with your toolchain and you'll have to create everything yourself without any past examples to look back on.

Just remember that the genre is dying right now, but all it needs is one or two popular games to revive itself, if you think you can do that in C# I'll be rooting for you.

\$\endgroup\$
1
\$\begingroup\$
  • Browser based games rose at a time when C# wasn't very popular, but PHP was. So many projects are done in that languages, many tutorials were written for that language and many experts in such games have adopted PHP as their main language and thus choose it by default,
  • PHP is seen as a language that scales easily from small to mid-size applications, while C# (and Java) is often seen as comparatively heavy-weight languages suitable for large business applications; most PBBG would fall into the small to mid-sized project category (at the very least initially/the core game concept without accumulated code-trash).
  • LAMP servers were easy to have, many hobby devs simply had one anyway, C# servers were more expensive; this still holds to some degree but not that strongly anymore
  • PHP may feel like it fits the job better: it is designed to respond to a web call with HTML based content/data, exactly what you need for the backend of a browser game (depending on the fanciness level); C# can do that too, but may feel more bloated (or powerful),
  • it was and probably is easier to get cheap PHP programmers than cheap C# programmers, this falls in line with PHP being easy "to get into" thus often the goto language to quickly get some basic "website thingy" up and running (and then just extend that prototype instead of reconsidering your technology for the long run and replacing it)
  • games are often quick shots, developed, publicly tested, then either a success or discarded; again, this ties in with the image of PHP to be comparatively good to get something running quickly

Opinionated Summary: If you don't know any (suitable) language (well enough), I'd assume you get "something" up and running faster with PHP. But if you already know a suitable language like C# and how to setup a server/backend with it, this will not apply (unless if you want to use a particular engine in that language). This prototyping advantage of PHP may also be non-existing the more complex/statefull your game will be.

\$\endgroup\$
  • 2
    \$\begingroup\$ "with PHP you only need one language (and HTML) to get the basic game going" - Same with C#. The rise of Javascript/Angular is the same in both - running the app in the browser. But asp.net can happily do html generation on the backend similar to PHP. Non-difference. \$\endgroup\$ – TomTom May 28 '18 at 17:50
  • \$\begingroup\$ @TomTom true, I removed that point \$\endgroup\$ – Frank Hopkins May 29 '18 at 8:46

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