Good platform for mostly-text-driven browser games?

Started by
7 comments, last by RLS0812 9 years, 11 months ago

As a bit of background, I've been programming in various languages for years and years, but I've pretty much stayed completely out of the browser space since HTML 3 in high school, and out of the web space except for some Java Web Services at my last job. I know HTML 5 is all the rage, but with my antiquated experience I can't really understand why, since to my knowledge it's just a presentation language.

I want to make a menu/text-driven RPG, nothing fancy like WebGL or the like, and the browser space seems like a good way to do it since these requirements pretty much scream HTML. What's a good, flexible engine and/or environment for developing these sorts of things? Not knowing anything about this stuff, I've been looking into frameworks like Django (because I like python, and absolutely despise JavaScript). However, that doesn't really seem to be the right direction.

So yeah, uh... Anyone have any tech suggestions or at least can lead me in the right direction?

Advertisement

JavaScript is what makes "HTML5" so flexible.

As far as text game engines, you may want to build your own, since all frame works I know of focus on 2d and 3d environments, and contain a lot of "fluff" that is unnecessary in "1D" games.

THIS GOOGLE SEARCH may help you on your way.

I cannot remember the books I've read any more than the meals I have eaten; even so, they have made me.

~ Ralph Waldo Emerson

If the game is entirely client-side Pyjs is probably sufficient for your needs. It is a Python-to-Javascript compiler and widget framework.

A simple database connection for saving games/stats online shouldn't be too hard, but anything more complex like multiplayer interaction you will certainly want a full server-side framework like Django.

If the game is entirely client-side Pyjs is probably sufficient for your needs. It is a Python-to-Javascript compiler and widget framework.

A simple database connection for saving games/stats online shouldn't be too hard, but anything more complex like multiplayer interaction you will certainly want a full server-side framework like Django.

I know this is somewhat of a faux pas, but I don't really know what I want to make in terms of game design. Would converting from a multiplayer to a single player game be reasonable on something with one of those kinds of Web Frameworks, or are you basically all-in?

What features of your game do you expect to be handled by a framework? (What I'm getting at is, do you really need one?)

Why do you despise Javascript? There's a beautiful language hidden inside it, and if you want to do anything in a browser, while avoiding JS, you're going to have a problem. Do you know any of the of the Javascript-flavored languages that compile into Javascript? Dart and Coffeescript would be the best examples of those.

If it is mostly text driven, can you get away with the occasional post or perhaps AJAX? If that is the case then I recommend the following (you have probably already considered PHP).

  • PHP - Personally not a fan, but it is the common language of the web so there is loads of reusable code
  • Wt - Allows you to write your software in C++ and it provides the rest of the web systems required to run the page (kinda similar to how ASP.NET works) www.webtoolkit.eu

If you would like the game to be more dynamic then running it on the player's web browser is the only choice. For this you will ultimately need to use Javascript but you will not necessarily need to code directly in Javascript.

  • Javascript - If done correctly (none of that JQuery stuff), can be kept clean and succinct. If you structure it in a very "C" like way (procedural with "structs") then it is actually suprisingly pleasant to use.
  • C++ with Emscripten - This open-source Mozilla sponsored technology is awesome. You can write your code in standard C or C++ (with useful libraries such as SDL, libGL, libPng etc..) and the compiler converts your code to Javascript ready for a browser.

Of course a few other choices include browser "plugins" such as the Flash plugin or Unity plugin. These are dying technologies but might tide you over until Flash migrates entirely to running in Javascript and Unity migrates entirely to running in Javascript (also via Emscripten).

http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.


What features of your game do you expect to be handled by a framework? (What I'm getting at is, do you really need one?)

Well, that's the clincher -- I don't know if/when I do.

I don't really have a direct vision of what I want to make, but rather a big jumble of ideas. I'm after a sort of toybox I can mess around in. That goes anywhere from SP to MP, and I asked that in response to Hollower who said for MP I'd need a framework of some sort. I don't want to be completely committed to a specific scale. I'm pretty much a total novice to this space, so sorry if my questions look stupid.


Why do you despise Javascript? There's a beautiful language hidden inside it, and if you want to do anything in a browser, while avoiding JS, you're going to have a problem. Do you know any of the of the Javascript-flavored languages that compile into Javascript? Dart and Coffeescript would be the best examples of those.

From what JS experience I've had (not THAT much, mind you), the language just seems overly verbose. It's hard to read code when everything looks like "document.getelementById(someId).addEventListener('click', foo, false);" It's possible that there's a magical world that opens up when I have more experience, but that's the sort of code I typically had to write when I used javascript, and it's a bit headache inducing. Like you said though, it seems like I'll either have to just get over it or check out one of the code generation things, of which there's a boatload at least.


If it is mostly text driven, can you get away with the occasional post or perhaps AJAX? If that is the case then I recommend the following (you have probably already considered PHP).
PHP - Personally not a fan, but it is the common language of the web so there is loads of reusable code
Wt - Allows you to write your software in C++ and it provides the rest of the web systems required to run the page (kinda similar to how ASP.NET works) www.webtoolkit.eu

Yeah, thanks for the advice, I think I want something slightly more dynamic than that. Even if it is just text and tables, things like animations for the menu would be nice.

Seems to me like I should just start writing something in JS or some alternative and try to leave some room to "scale up" to a server-side complement if need be. It's going to be a bit weird trying to do that when I don't know what I'm doing, but "meh". It's not like I can sit around not doing anything at all either. Thanks for the advice, guys.

I don't really have a direct vision of what I want to make, but rather a big jumble of ideas. I'm after a sort of toybox I can mess around in. That goes anywhere from SP to MP, and I asked that in response to Hollower who said for MP I'd need a framework of some sort. I don't want to be completely committed to a specific scale. I'm pretty much a total novice to this space, so sorry if my questions look stupid.

I worded that clumsily. I didn't mean to make it sound like you must choose one or the other. You will have client and server code anyway but there are, basically, two ways you can serve a web based game.

  • Browser connects to a web page and downloads all of the game in the form of html, css, js, etc. and then the player plays the game in his browser but "offline" with no further communication with the server. This is fairly straightforward and the web server can be simple since all it is doing is serving the requested files. The player can also "cheat" if they want since they have all the game logic code.

  • Browser connects to a web page and downloads a client (also html, css, js, etc.) which just contains code for displaying the game and communicating with the server. As the player interacts with the client-side page it sends commands to and receives updates from the server. This keeps the game logic on the server, makes cheating difficult, and potentially allows multiple players to interact with each other at the same time. The reason I recommend using a more mature framework in this case is so you can focus on the game rather than writing both a game and a web server.

It is possible to write client with Pyjs and server with a Python web framework. This page shows examples how to do AJAX communication between the two. Ultimately, theres a bazillion different ways to do it in a multitude of languages. Obviously, standard advice: start small and play around with simplistic samples before diving into writing a bunch of code you don't know how to connect together.

Seems to me like I should just start writing something in JS or some alternative and try to leave some room to "scale up" to a server-side complement if need be. It's going to be a bit weird trying to do that when I don't know what I'm doing, but "meh". It's not like I can sit around not doing anything at all either. Thanks for the advice, guys.

.

It is always a good idea to get some ideas down on paper, iron out what you want, and than start to code.

Attempting to go into a project with no clear goal in mind can lead to headaches down the road, especially when attempting to retrofit new code blocks .

I cannot remember the books I've read any more than the meals I have eaten; even so, they have made me.

~ Ralph Waldo Emerson

This topic is closed to new replies.

Advertisement