Which platform to develop web-based game in?
I'm thinking of writing a new web-based game, and wondered if anyone had any suggestions on which platform I should opt for.
The game will be 2D sprite based, but will need to maintain a decent fps rate (there'll probably be up to 20 things moving at once). It'll all be controlled via the mouse.
I use .NET daily, so Silverlight seems a natural choice for me, but I want to make sure as many people can play it as possible...
- Can Silverlight games be developed straight out of Visual Studio (I have VS 2008), or do I need additional software (and does it cost...)
- What limitations does Silverlight have in terms of .NET version (can I use .NET 3.5 for example?)
- What physics engines can I use?
- Would Flash be a better choice? Are there free development environments for it (that are any good)? (I don't care about learning curve)
- Is Java still an option?
So I just wanted some feedback on what's the best thing for me to use for a simple 2D web-based game.
EDIT:
can you provide more information? is this single-player/multi-player? what kind of genre? will there be a lot of classical UI involved (lots of forms with lots of button/checkboxes, datagrids etc.)? will there be a lot of ani开发者_如何学运维mation and effects?
- Single player game, with "attack waves" of enemies
- enemies are only thing that move, player just points and clicks
- no classic UI, just clicking on buttons (no lists / dropdowns etc)
- minimal animation and effects, only graphical requirements are movement of enemies (which will require little animation)
I'm also interested in web-based 2-d games. I personally favor silverlight because:
- I'm already familiar with c#/.net.
- It has a lot of capabilities, even if it's not as many as full-blown WPF. I hear that LINQ alone is awesome for games. Local storage may also be a plus. There is a rich selection of controls you can use for the gui portions of your games. Honestly, WPF loses to silverlight in terms of interesting controls.
- It's totally free. You need to download the silverlight toolkit for VS, but that's no issue.
One cool thing is that you can do full-screen displays. I also found it is fast enough (on my core2 duo laptop) to handle a decent amount of objects. The fact that silverlight is going to be a big part of winmobile 7 is also a good point (though we'll have to see how that turns out).
There are a number of silverlight games out there so you can see the possibilities.
- http://www.silverlightclub.com/
- http://silverlightgames.org/
- http://www.silverarcade.com/
I suppose the main negative is portability and making people install "yet another plugin". Flash obviously has the broadest user base, but if your game is decent enough, people probably won't mind installing the plug-in. It's a painless install.
In terms of physics engines, FarseerPhysics that TomTom mentioned is most popular.
There is one other thing that I thought was really cool and compelling: http://www.codeplex.com/silversprite. From the website:
Run XNA games without code changes in Silverlight 3. SpriteBatch based graphics only, no 3D. Since the game compiles into straight Silverlight code, it will run anywhere that Silverlight can. [emphasis added]
The XNA-in-Silverlight approach is potentially really good (especially for more complex games that you might want to try profiting from) because that also opens you up to Xbox with minimal porting effort. However, I don't have any experience in that, so I can't comment further.
Edit in response to the OP's edit:
Since your game sounds even more simple than I had imagined, if you don't mind the learning curve or potential difficulties with doing a pure HTML+CSS+Javascript approach (which may in fact not be so great), I'm going to say maybe that's the best route after all. That's because of portability.
That said, I'm lazy and don't care if a few people miss out on my game, so I'd just stick to silverlight. =P
If you want maximum playability do it with all HTML and javascript and don't even use canvas and then the game will work basically everywhere, including mobile. You can balance what extra work that might cause you against developing for Flash or Silverlight and having a very limited mobile audience. You can check out processing.js as well.
If you want to go the HTML + javascript way, you can take a look at processing.js. It's a Javascript port (by John Resig) of the Processing language.
Pros:
- Totally free.
- Easy syntax.
- Portability. No plugins.
Cons:
- Still under development, some Processing functions (like the 3D functions) aren't ported yet
Also, check out John Resig's tower defense game in Processing.js.
IMHO Java is still an option, in particular JavaFX (http://www.javafxgame.com might be a good starting point).
However, your experience with a language/technology is probably more important than the choice of platform, so you should choose .NET (given that none of the suggested alternatives stands out so far).
As stated by Benny, Silverlight is a great platform if you're already familiar with .NET, and most of the tooling you need is built into Visual Studio (VS2010 has a built-in designer but the current RC version doesn't support the upcoming Silverlight 4).
One cool feature of Silverlight is its ability to utilize the GPU. This should provide a nice performance boost. I don't know if Flash offers this.
The Silverlight runtime is very small (under 5MB). And you can easily enable out-of-browser support, so that your game may be launched from a desktop shortcut, for instance, without the need for launching the browser (and being online). Silverlight 4 adds the ability to use elevated privileges (this gives you access to the native network stack instead of the sandboxed browser stack). With SL4 you also gain webcam support, if that's important to your games.
Silverlight MAY need additional tooling for Visual Studio, but this is a free download. Basically 2008 was made before silverlight, so you need to download the tooling for it.
Silverlight runs on a limited version - read the documentation.
I would in geneeral advice to go .NEt 4.0, Silverlight 4.0, Visual Studio 2010 - those are aruond the corner and you wil ldevelop longer han a month anyway.
Java - no sorry, why. I mean, theoretically yes, but if you are a .NET person, you have more knowledge there, siverlight is XAML (WPF similar experience, always nice). Why should you giv all that up for using Java?
Flash - DAMN, NO ;) Seriously ;) You dont want to deal with that unless you have to.
Physics engine - no idea. Need to check. Not sure there is a lot for it. Did you google? http://www.codeplex.com/FarseerPhysics comes up first.
I think it is a good approach. Silverlight is a small download to start - so, I dont think you loose too many people by it. I would do it.
精彩评论