Link to home
Start Free TrialLog in
Avatar of Yurich
YurichFlag for New Zealand

asked on

Browser-based web game in C# or PHP?

Hello,

I'm a C# developer and I have an idea for a browser-based web game. I checked a few existing similar games and found that most if not all of them are made in php. I'm wondering if it's reasonable to write that kind of games in C# or .NET at all? What possible problems I should expect if I decide to use C#?

Thanks,
Yurich
Avatar of aibusinesssolutions
aibusinesssolutions
Flag of United States of America image

What interface are you doing to use to display the game?  Most browser based web games are done in either Flash or Java, mainly because Flash and Java are installed on just about every PC now.

If you are using C#, you will probably want to use Silverlight to create your game, it's new but it's starting to get out there.
Avatar of Yurich

ASKER

Thanks,

I'm not even sure that I will need to use either Flash or Java. The interface will be just as of a web page with graphics elements, but without any plug-ins. At least not if they're completely necessary. It will be a strategy game, so no walking around the map will be needed.
Ok, I just made a post on your other question.  If you will not have flashy graphics for it, I would just use javascript and web services to update things on the page.

Here is an example that comes with code to download on how to create a web service, and how to connect to it using javascript: http://www.codeguru.com/vb/vb_internet/webservices/article.php/c7781
Avatar of Yurich

ASKER

thank you. it's fine, but it's not sort of an answer I was expecting. I looking for reasons why C# or .NET is not used for great many online games we have. In fact, I haven't played to many, but every time I come across a game, I'd see what kind of language is used and I haven't seen C# even once!!

I understand that C# is more for corporative applications, but on the other hand, why not? MS SQL usualy out-performs MySQL (at least in my experience). They only thing that I can think of is that PHP is originally dynamic programming language (like silverlight), but that can be easily fixed with Java or AJAX (and silverlight now, but I'm not familiar with it).

The point is: I don't want to start developing a game, spend hours of my time and then find that this kind of games are not made in C# for: reason #1, reason #2, reason #3 :-\

Cheers,
ASKER CERTIFIED SOLUTION
Avatar of daveamour
daveamour
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
There is a right answer - the core quesion is "is it reasonable to write this in C#/" and the answer to that is yes.
No, the core question is "Should I make a browser-based web game in C# or PHP"?

Either will work, the one that Yurich is more comfortable working with will work best.
>>>>>>
I'm a C# developer and I have an idea for a browser-based web game. I checked a few existing similar games and found that most if not all of them are made in php. I'm wondering if it's reasonable to write that kind of games in C# or .NET at all? What possible problems I should expect if I decide to use C#?

The asker observes that he hasn't seen many in C#  - they have often been in PHP - he therefore asks if it is reasonable to write that kind of game in C#  - it doesn't say C# or PHP
He doesn't ever ask if he should write them in PHP - he simply states that others he has seen are in PHP.
Avatar of Yurich

ASKER

thanks guys,

does anyone have any sample of an online web-browser game written in C#?

and there is no much choice for me - I don't know PHP and don't think it will be wise of me to start learning it only in order to write a game.

cheers
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Yurich

ASKER

i don't think it's correct about C# option what you put there on all points: you need to install .net components only a server, which is not a problem; you don't need to use webservices unless you have to; and .net applications are supported absolutely by any browser as they're rendered as HTML.

cheers
Yeah your right Yurich, he may be talking about a C# activeX object, or an executable program, then the .NET framework would need to be installed.. but in a browser based game everything would be rendered by the browser.
Yes, I ment sending through your ActiveX object, same as you send your applet through by using Java.
Avatar of Yurich

ASKER

well, nobody exactly answered my question... I know that C# is a powerful language and I'm going to give it a go, but I expected more feedback...
Avatar of bangoker
bangoker

I think .Net in general (C#,VB,etc) is a great and powerful OO and Web (ASP.net) language, which you could use for your game. I would imagine most games out there are PHP-prone because A)PHP/Flash was popular way before .Net/Silverlight started to get as notorious as they are now, and B) because PHP is free. You can set up a linux/apache server, with out paying any fee,  and there's plenty of free tools to work with. .Net on the other hand would require you to have a (not free) Windows Server to run the ASP code, and the "good/powerful" tools come mostly from MS, for a cost.

Yes, there are the express editions, but I believe they wont give you license to produce commercial products..

Just my 2 cents
Avatar of Yurich

ASKER

Well, that's a part that confuses people. I'm going to host my game using some web-hosting company. As I need to run a windows service, I'll have to get a dedicated server, which will be more expensive, but other than that, it's not much different from having PHP (Apache) server. You just buy a "Microsoft/.NET" plan from a web-hosting company, which is usually 20-30% more expensive, but when you count like $5 vs $6 a month, it doesn't really matter. Than you request to make settings on the server for it to be compatible with .NET 1.0, 2.0, or 3.0 and that's it. No extra fees - I'm saying becuase I had a website before that was pure C#/.NET and I didn't have to do a lot more things then I'm doing for some of my PHP sites now. Setting a database is not much different for MS SQL than MySQL.