[web] browser based strategy game - fastest way?

Started by
7 comments, last by CryptoQuick 14 years, 5 months ago
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]
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.
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, ... )
I recommend &#106avascript:

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 &#106avascript. 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.<br><br>3. Powerful<br>Check out the physics engine example below. Another good example is http://scripty2.com/demos/cards/, which is &#111;nly 70 lines of code.<br><br>4. Canvas<br>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.<br><br>5. Client-side Database Storage<br>Safari has a &#106avascript client-side database so you no longer have to fetch information from the server. This can be useful for &#111;ne 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.<br><br><br>Apart from the above libraries, a few other resources:<br>Physics Engine: http://box2d-js.sourceforge.net/index2.html<br>Vector and matrix math: http://sylvester.jcoglan.com/<br>Animation framework: http://mir.aculo.us/2009/11/07/a-50-lines-of-code-&#106avascript-animation-framework-say-hello-to-emile/<br>Ajaxian.com has some articles that relate to game development<br><br>I'm working &#111;n a small &#106avascript isometric game engine and I haven't had any major hindrances so far in its development.
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 &#106avascript 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 &#106avascript reference</a> - you'll find it very useful.<br>You might also find some of the libraries for &#106avascript (including what's been mentioned in this thread already) useful.<br><br>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 &#106avascript again if you take a liking to it - among many other possible avenues. &#79;ne 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.
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.
Thanks for replies, I will look at flash, or I will stay with &#106avascript 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, &#106avascript] or [flash] &lt;---> [php] &lt;---> [mysql] &lt;---> [c++ server]<br><br>What do you think about this?
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. :)
"Game Programming" in an of itself does not exist. We learn to program and then use that knowledge to make games.
I agree with savagebeastx that &#106avascript 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.
------------------------http://www.openfrag.org/

This topic is closed to new replies.

Advertisement