Jump to content
  • Advertisement
Sign in to follow this  
Krzych

[web] browser based strategy game - fastest way?

This topic is 3285 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I'd like to ask you what's the fastest way to build browser based strategy game. I take into account some technologies, but if you now others, let me know :) My solutions: - raw php && mysql - simply, it's not fast - php based framework - php generally isn't the best language for big productions, it's hard to keep everything not messed up - python framework web2py - I looked at it and it can be one of best solutions, but I think that is not very good for games, it was designed for fast developing web services - silverlight - I looked on "Getting started" and I was scared - lots of tools, plugins (maybe it's advantage?) until first program, but the main disadvantage is only windows supported and it has to be fitted with server based job, but it can be written for example in c++ (c++ does job only on database) - flash - main disadvantage -> adobe tools are expensive (do you know some GOOD alternatives?) - ??? If you have some good ideas for fast (at least it can be comfortable - and should be) browser game development, feel free to discuss. Chris [Edited by - Krzych on November 4, 2009 11:31:50 PM]

Share this post


Link to post
Share on other sites
Advertisement
What do you mean by "fast"?

e.g.
* Faster development time -- less effort to make the game.
* Faster game-play / better performance -- can have a more "real-time" feel to it.

Share this post


Link to post
Share on other sites
I should say it clear, by 'fast' I mean fast and easy development (fast writing of code, compact and nice language, nice editors, comfortable programming enviroment, ... )

Share this post


Link to post
Share on other sites
I recommend javascript:

1. Well supported/no plug-ins
If you build your game on a library like prototype, jquery, yui, mootools or others, it will run smoothly in most modern browsers without too much hassle.

2. Easy to learn, free and excellent development tools
There are plenty of resources available for learning javascript. w3schools.com and sitepoint.com are two good references. Development tools have come along way in the last few years. I recommend using the Firebug extension for Firefox or the Safari Web Inspector.

3. Powerful
Check out the physics engine example below. Another good example is http://scripty2.com/demos/cards/, which is only 70 lines of code.

4. Canvas
Allows for 2d vector and image manipulation. You don't have to worry about the dom or cross-browser issues. I believe the new firefox has support for 3d.

5. Client-side Database Storage
Safari has a javascript client-side database so you no longer have to fetch information from the server. This can be useful for one player games or games whether initially a lot of data needed to start a game. I'm not too sure about support in other browsers though.


Apart from the above libraries, a few other resources:
Physics Engine: http://box2d-js.sourceforge.net/index2.html
Vector and matrix math: http://sylvester.jcoglan.com/
Animation framework: http://mir.aculo.us/2009/11/07/a-50-lines-of-code-javascript-animation-framework-say-hello-to-emile/
Ajaxian.com has some articles that relate to game development

I'm working on a small javascript isometric game engine and I haven't had any major hindrances so far in its development.

Share this post


Link to post
Share on other sites
The big question to me is, what's a "strategy game"? Text-based Strategy? Turn-based grid/isometric? RTS? Puzzle/Strategy? Unless I'm overlooking a straight and specific genre known as "Strategy", I could probably rattle off more genres that use the term.

Flowing from that question, you've mentioned a mix of client- and server-side technologies. So overall, the question seems non-receivable to me.

A few project-agnostic web things:

I'd really push javascript on the client-side, unless you want something really specific that Browser JS can't/isn't allowed to provide. It is a good language, and unlike Flash, Java Applets, Silverlight et al, its web integration is first-class. Read Mozilla Developer Center's reintroduction, and bookmark MDC's javascript reference - you'll find it very useful.
You might also find some of the libraries for javascript (including what's been mentioned in this thread already) useful.

You have a lot of choice server-side, including the "big three" (PHP, Java, .NET), Python, Perl, C++ if you're prepared to go to the trouble, and even javascript again if you take a liking to it - among many other possible avenues. One of the big three might be your best bet purely for the wealth of documentation and support out there for them, but I can't imagine Python not being good for (non-high-end) games.

Share this post


Link to post
Share on other sites
Do I know an alternative to Adobe's flash tools? Sure I do.

All you have to do is download the Flex 3 SDK, and FlashDevelop. This will allow you to develop and code your very own flash games without using the Flash IDE, and without paying Adobe any money at all. FlashDevelop isn't actually necessary, the key component here is the Flex 3 SDK. Adobe offers the Flex 3 SDK on their site, it is part of their open-source initiative. FlashDevelop is an programming IDE optimized for use with Actionscript 3.0. It is available on Windows, and makes programming for Flash much easier.

If you are interested in game engines for Flash, you can try out Flixel, or the Pushbutton Engine. Flixel is pretty much pure AS3, while the Pushbutton Engine is a mixture of AS3 and XML scripting. Flixel is designed with more platforming / action games in mind. Pushbutton might be more adaptable to designing a strategy game.

Share this post


Link to post
Share on other sites
Thanks for replies, I will look at flash, or I will stay with javascript and ajax. Now the question is what's good for the server side? I thought of php showing data and gathering them from database and c++ server doing all game simulation and writing it to database, something like this:

user <---> [ajax, javascript] or [flash] <---> [php] <---> [mysql] <---> [c++ server]

What do you think about this?

Share this post


Link to post
Share on other sites
Quote:
- silverlight - I looked on "Getting started" and I was scared - lots of tools, plugins (maybe it's advantage?) until first program, but the main disadvantage is only windows supported and it has to be fitted with server based job, but it can be written for example in c++ (c++ does job only on database)


Just thought I'd clear a few things up in this statement for you.

Quote:
is only windows supported

Are you meaning as far as the development environment is concerned? Because Silverlight itself will run on PC and Mac in multiple browsers and, in a limited capacity, on Linux as well with Moonlight.

Quote:
it has to be fitted with server based job

I'm not sure what exactly you mean here?

Quote:
but it can be written for example in c++ (c++ does job only on database)

Not sure what you mean here, exactly. Silverlight itself is largely coded in C# and has the ability to use traditional webservice, WCF services (though, only with certain protocols), as well as using sockets (which would give you the ability to build your server using whatever technology you like)

Anyway, not saying that its the only option by any means, just the one I personally recommend and thought I'd clear some thing up. :)

Share this post


Link to post
Share on other sites
I agree with savagebeastx that javascript is a very good alternative to Flash, and in fact, in some ways, is superior. There are many open source libraries, but I never use them since JS is so easy to use that just writing your own tools is fast and easy. You may wish to use a library that lets you animate certain values, however, as I've often had trouble with this.

Canvas 2D is a great way to go for an 2D/isometric engine. You can load up a sprite sheet, use the drawImage method's extended arguments, and it's very simple to script this for tile-based graphics.

The best resource I've used to break into Canvas 2D is this:
http://dev.opera.com/articles/view/html-5-canvas-the-basics/

Two other great resources are:
https://developer.mozilla.org/en/Canvas_tutorial
http://blog.nihilogic.dk/2009/02/html5-canvas-cheat-sheet.html

Breaking into WebGL or O3D is much harder, cross-browser compatibility is limited (for WebGL it's only supported on Developer builds; WebKit Nightlies, Minefield, and Dev Channel Chrome), and the spec's not even officially out yet, so you have to work offa OpenGL ES 2.0, plus, your math's all done in JS. It's not a fast way to do this sorta work.

On the whole, I've had very good experiences working with JS and HTML5 client-side graphics, and would definitely recommend it.

Also, you may wish to look into Google App Engine for your backend, and see if it fits your needs. You can write in Java or Python, and take advantage of Google's BigTable.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!