10 Replies - 2294 Views - Last Post: 13 January 2009 - 09:21 PM Rate Topic: -----

#1 Exelius  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 07-January 09

Question about starting a Web Based Game

Posted 07 January 2009 - 07:27 PM

Hi,

I'm new here to the forums and am really liking this site for some good info, however I haven't found an answer yet to my question.

A little background first, I'm 35 and the last language I worked with was PASCAL. Along time ago lol. I'm currently learning C# and am learning it just fine so far. I am by no means ready to tackle a major project however I learn very fast and feel I may be ready for a bigger project in a couple-few months.

I am thinking of making a web based game sometime this year and want to get my ducks in a row on what I need to get under my belt before starting. I want to do it in C# of course, however my question is what else do I need to learn to implement it on the web(ex. php,silverlight,etc.). I don't know what other things I need to integrate it or can I do all of that in C#?

I am wanting to do a web based game based on a space empire theme, kinda like an Astro empires/Ferion/OGame type game but a little different of course. All 2d with still graphics for buildings planets and such. All of the usual things like logins, security, paypal, forums, the whole nine yards.

So, what do you guys think my learning path should be for this type of deal.

Thanks so much

Is This A Good Question/Topic? 0
  • +

Replies To: Question about starting a Web Based Game

#2 BetaWar  Icon User is offline

  • #include "soul.h"
  • member icon

Reputation: 1148
  • View blog
  • Posts: 7,148
  • Joined: 07-September 06

Re: Question about starting a Web Based Game

Posted 07 January 2009 - 07:48 PM

I believe you may be able to do all the back-end stuff with C#, but I am positive that you can do it with PHP (just in case I am corrected).

Basically, you will need to have some client-side thing (based on if you want it to be turn based or real-time will decide if you change the technology used to make it).

For real-time, Flash, or silverlight, or an Applet of some sort is required, which will open a socket connection with the server so that it can be in constant communication.

If you want to make a turn-based game, you could potentially just use Ajax or HTML to make it.

Hope that makes sense.
Was This Post Helpful? 0
  • +
  • -

#3 Core  Icon User is offline

  • using System.Linq;
  • member icon

Reputation: 774
  • View blog
  • Posts: 5,097
  • Joined: 08-December 08

Re: Question about starting a Web Based Game

Posted 07 January 2009 - 08:03 PM

Just to mention that the front-end also can be developed in C# (ASP.NET).
Was This Post Helpful? 0
  • +
  • -

#4 Exelius  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 07-January 09

Re: Question about starting a Web Based Game

Posted 07 January 2009 - 08:10 PM

Thanks both of you for the info. I think it will be either tick based or maybe like turns move at the top of the hour(not sure what thats called). I looked a little into ASP.NET so basically I could do it all with C# and ASP? That would be great if so.

Thanks Again
Was This Post Helpful? 0
  • +
  • -

#5 Core  Icon User is offline

  • using System.Linq;
  • member icon

Reputation: 774
  • View blog
  • Posts: 5,097
  • Joined: 08-December 08

Re: Question about starting a Web Based Game

Posted 07 January 2009 - 08:14 PM

Yes, you can do it all in ASP.NET using C# (plus, add the features of Silverlight, of course if you use it).
Was This Post Helpful? 0
  • +
  • -

#6 Exelius  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 07-January 09

Re: Question about starting a Web Based Game

Posted 07 January 2009 - 08:43 PM

Sounds good Ill get to work.

Thanks so much for all the help
Was This Post Helpful? 0
  • +
  • -

#7 matthew180  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 51
  • View blog
  • Posts: 202
  • Joined: 07-January 09

Re: Question about starting a Web Based Game

Posted 08 January 2009 - 12:32 PM

IMHO for the server side you should use PHP and PostgreSQL (or MySQL if you must...). For the client, you already decided to make it browser-based, no? So your client side "coding" (as it were - scripting really) would be HTML, CSS, and possibly Javascript if you are going to use the XMLHttpRequest (AJAX) to pull data and do page updates without a refresh.

<rant>
Flash is helping to promote the continued mutilation of a browser and HTML, thus it is evil. ;) HTML was never designed to do what can be done in a browser (thus the need to 10 million plug-ins) and what should really happen (what should have happened 9 years ago) is a new browser developed that is designed to provide the features being hacked in to the browser.

And Silverlight, ugh, that is simply Micro$oft trying to come up with their own version of Flash, just like .NET is their rebuttal to Java. Yet *another* plug-in to install and another proprietary format to make exceptions for.
</rant>

Sorry about that.

As for web-based applications, they are an exercise in security. You will spend more time trying to keep your game from being cheated, cracked, compromised, cross-site scripted, SQL injected, etc. than actually working on the game. A browser is probably the worse platform for application development (damn, I'm ranting again) ever devised. Between session state and security, you will have to find time to code your game.

When it comes to any browser based application, what you don't know can cost you control of your server or loss of your data.

Wow, this post comes across rather negative, but that's is not the intent. I'm only trying to stress the importance of the security problems with the platform, on top of all the mumble-jumble of different implementations (versions of browsers, plug-ins, etc.) that make developing a web-based app the biggest pain in the a@@ in the world.

I hope this helps in some way.

Matthew
Was This Post Helpful? 0
  • +
  • -

#8 Exelius  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 07-January 09

Re: Question about starting a Web Based Game

Posted 08 January 2009 - 06:22 PM

Thanks Matthew, I appreciate the good info. That being said I was kinda thinking in the back of my head that the security part might be trouble for me at first. So, you only helped me to see what I was kinda thinking. So would a downloaded client be alot better off/easier/harder to code without the web infrastructure? Can you give me some more indepth thought about how better in this intwernet environment to do a first game? I'm pretty committed to C# as I'm newer to programming. What about like a gaming client type like Web Space Alliance has? Give me some thoughts :)

Thanks Guys
Was This Post Helpful? 0
  • +
  • -

#10 matthew180  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 51
  • View blog
  • Posts: 202
  • Joined: 07-January 09

Re: Question about starting a Web Based Game

Posted 08 January 2009 - 11:24 PM

Hmm... I've been thinking and messing with a lot of solutions, some related to gaming, others more desktop apps or web apps. There are some things I'm too stubborn to use or try (like .NET), so I'll try to remain as unbiased as possible and explain my reasons.

(I know I'll probably get some flame for my comments, but remember, they are just my opinions from my point of view. I'm not interested in starting any kind of OO vs. Procedural or language wars.)

Don't use .NET for a game (or even an app). Reasons:

1. The biggest reason is that Micro$oft made this .NET monster, shoved it down the throat of all Windows developers, but refused to make the runtime part of Windows (i.e. it is an optional install, even in Vista I believe!) So, if you make a .NET app, you have to include the freaking runtime as part of your download, which instantly bloats it by 20MB+. Initially there was a lot of push-back from users to install .NET, and if you really want to get your program into people's hands, you will *have* to include the runtime. Ugh.

2. .NET is just Microsoft's response to Java, even to the point of installing each new update as a totally separate install!?!? WTF is that all about? That drives me absolutely crazy and I get just as riled up over Java as I do about .NET.

3. I don't trust .NET. I like to know what my code is doing and why. I don't need managed memory or wizards to write code for me that I'm just going to change anyway. Also, I'm not to keen about OO so personally I like to stick with regular old C.

4. Anything you need for .NET that you didn't (or can't) write will cost you double what that same component would cost for a non .NET version. I have a friend who writes a business software package and the .NET controls he bought were thousands of dollars.

Don't use Java. Reasons:

1. Every Java app I have ever run has this mushy feel about it. It is hard to explain, but they just don't feel quite right.

2. Java is OO and I prefer not to use OO languages. I really don't have many other reasons. However, you still have the runtime issues like .NET, and the end user has to have version xyz or greater.


For anything server side I would have to recommend a Unix platform (I prefer FreeBSD). For the server-side code, depending on your load requirements and speed of execution, use either PHP or C.

For a database, PostgreSQL. Again just my preference; Like Java and .NET, I'm not really fond of MySQL either. I think the main reason is all the OO, Java, and MySQL zealots trying to cram that stuff down your throat and claim those are the miracle tools for all time. Besides, PostgreSQL is better and faster than MySQL, and easier to set up and maintain as well (now there is a statement just asking for trouble :) )

If you really want a fast server-side (or client side) database, check out the Berkeley DB (recently purchased by Oracle). If your game is not commercial you can use it for free, otherwise you will have to license it (but the cost is not too bad, I think).

For the client, like I ranted previously, I can't recommend a browser or any of the plug-in solutions. I've been writing web-based apps since 1998 and I'm trying to run away from that kind of development as fast as I can. It sucks. You can literally waste *hours* of time trying to get a page to look the same in FireFox and IE, not to mention any of the other browsers people might be trying to use. That is just the tip of the iceberg, but I won't go down that road right now. Trust me, that kind of development is a pain in the ass, takes a long time to truly understand all the security ramifications (which constantly change), and can cause a lot of frustration.

You have to wear a lot of hats too. You have to set up your server (system admin), and your database (DBA), harden the server to attack (specialized system admin), design the code (developer), write the code (programmer), test (grunt), build a product website and advertise (marketing), get set up to accept payments (accounting), and help customers (customer support). If you are not a jack of all trades then you have even more to learn, or you will have to pay someone to do any / all of the above.

Whops, that got a little off topic - sorry. ;)

I think we are now getting to the client side. For a game I would recommend any of these:

C with SDL
C with G3D (OpenGL game)
C with Allegro
PureBasic
BlitzBasic
Torque Game Builder

The two BASIC solutions are compiled and both generated very fast programs with *no* runtime requirements other than Windows itself. PureBasic is written in assembly and compiles into assembly that is assembled with FASM. The code is *very* small and *very* fast. Blitz has a larger developer and user base. Either will make game development fast and actually fun. I messed with just about every language (even Java) while searching for a good game development environment, and both PureBasic and Blitz were excellent (and did I mention fun?)

SDL and Allegro will help a lot with the networking stuff, as will TGB. If you are not strong with socket programming and TCP/IP (and security), then you will probably want to use something that offers specific support for client / server games. As for me, I'd roll my own because I like to learn how that stuff works, I have enough knowledge to pull it off, and I don't trust a lot of code out there (I've seen too much bad code, and the Internet is getting a lot worse as far as hostility and attacks go).

I also like to get into the nitty-gritty low level stuff, so doing it all is part of the challenge for me. My first language was BASIC, my second was assembly. Other people (like my friend who is more successful from the standpoint of writing software and actually making a one-man small business of it) are happy to use other people's libs, dll's, and components, plug them together, package it up and sell it. So a lot of the decisions will have to come from your reasons and end goals.

IMHO, since you are getting back into this after some time, and you seem to want to use .NET, I would skip the client / server game and just make something stand alone. Or, drop the fancy client requirement and make a turn-based browser game using only HTML, CSS, and maybe some Javascript. Get a simple but *complete* game or two under your belt, learn your tools and the environment, and then take on the big idea. By "complete", I mean a game complete with high score table, credits, docs, website, installer, everything. It is a lot of work and some of it sucks, but a lot of it is fun and the feedback from people playing your game is gratifying.

If you are going to go hard core right out the door, then do this:

1. Make a design spec. DON'T SKIP THIS STEP (even for simple games or projects). You have to know what you are doing. Write down the goals, features, game play, etc.. You should have a clear idea about what the program is going to do and how.

2. Find a development environment (libs, languages, etc.) that will give you the parts of the the program that you will need, but that you cannot (or do not want to) write yourself.

Oh, something else I just thought of. Using a web browser vs. your own program that uses TCP/IP - go with your own client! You can still connect to a web server and take advantage of a server-side language like PHP. Nothing says that a web server has to send back HTML (which you don't want to try an parse).

Matthew
Was This Post Helpful? 1

#11 Exelius  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 07-January 09

Re: Question about starting a Web Based Game

Posted 13 January 2009 - 08:53 PM

Thanks Matthew for the good info.
I think I'm going to start out with a smaller nonweb game to get my feet wet, then look into sometihng more elaborate. Maybe some kind of small windows game or something.

Thanks All
Was This Post Helpful? 0
  • +
  • -

#12 girasquid  Icon User is offline

  • Barbarbar
  • member icon

Reputation: 108
  • View blog
  • Posts: 1,825
  • Joined: 03-October 06

Re: Question about starting a Web Based Game

Posted 13 January 2009 - 09:21 PM

It looks like I came a bit late to this discussion - but if you decide to build a web-based game, you can find tutorials on how to get up and running with a basic RPG here - in Perl, PHP, and Ruby on Rails.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1