Browser-Based Game: Best Language?

Started by
19 comments, last by DareDeveloper 10 years ago

There are many Javascript tutorials around the internet because it is quite popular (Perhaps due to the flux of web developers flooding out of universites between 2008-2011). So I am sure you can find some quite easily via google.
The only additional tips I can offer is to be weary of w3schools which traditionally has been infamous for bad habits (though it might be better now).
You will also come across many examples pushing JQuery. I would keep well away from this because it is not standard Javascript and it is not always very interoperable with other libraries.

A site that does look quite useful is Mozilla's developer site. It doesn't look browser specific either which is obviously important.
https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Canvas_tutorial

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.
Advertisement
I recommend JavaScript with node for the server side. All you need is a text editor (notepad++, gedit, etc.).

As far as compatibility, you're OK. All modern browsers support canvas (2D context, not webGL) and JavaScript. The challenge is performance, screen size and input. Three of the four current versions of the popular browsers (Firefox, Chrome, Safari) perform pretty well on the desktop and mobile. Of course IE lags behind but is still OK for all but the most demanding of work, such as fluid Canvas animation.

Obviously the physical size of the screen and whether or not there is a keyboard or other physical input device attached will have a strong influence on how your game will be experienced on different platforms.
I also must disagree with Karsten about staying away from jQuery. Jquery is very well supported by current AND older browser versions going back to IE 8. If you want prior to IE 8 support that is available too by using the 1.9 branch of jQuery. Its API is the same as the 2.0 branch but with the cruft for crappy browsers left in. Keep in mind that using jQuery electors does incur overhead, so be sure to cache them and to profile when you suspect jQuery might be a performance issue. My experience is that in the few cases when jQuery is a bottleneck, caching selectors or direct DOM manipulation closes the gap. Use jQuery when it helps (95% of the time), and direct dom when it doesn't. Simple.

I find that google's own dart is a great language for large scale web applications and games. It is similar to java / c# in OOP concepts and compiles to native javascript that can be run on any up-to-date browser without plugins. Their website is http://www.dartlang.org if you want to read more about it.

Thanks for the input everyone!

I'm quite lost in terms of where I should start especially given the monstrous array of possibilities. For this reason, I'll stick to learning Javascript for now while I keep myself busy with the game documentation and mechanics break-down. I reckon working the concept down will be tedious --in the good sense, I hope-- enough that it'll keep me busy and away from any programming hurdle for a while.

Best of luck in RL to all,

Dialects

Doing a text based game in the browser might not be the best idea.

Doing text based games first is usually recommended because of the simplicity of writing a console applcation.

As I see it that does not translate to the browser, though.

It is possible to write game logic that modifies the Dom tree, changed the text in a div, takes values from input fields etc.

...

but the desired simplicity is gone. Having to manage those tasks adds complexity compared to graphical games with canvas.

I recommend starting with something other than web development. That will also give you an idea of how web development is different ...

and there are just so many concepts involved in web development that it might be a good idea not to look into that until later in your programming career ...

Given enough eyeballs, all mysteries are shallow.

MeAndVR


I recommend starting with something other than web development. That will also give you an idea of how web development is different ...
and there are just so many concepts involved in web development that it might be a good idea not to look into that until later in your programming career ...

I wholeheartedly respect and understand your point. Now that I have re-read my initial post, I might have sinned in using the reference to text-based game.

I'd like to add that I do not plan on following a programmer's career, at least not at present. The necessity to learn programming (or at least the very fundaments of it) is only a mean to allow for greater assertiveness when creating and contemplating the design of a game. This is not to say I won't take programming seriously --I just see it in a different perspective than someone willing to make a career out of it would at this point in time.

Still, I appreciate your feedback. All of the feedback at this point is relevant and much needed!

- Dialects

I must disagree with dare developer. A web based text game can be as simple or difficult as you want to make it. There is no reason why he cannot implement the entire text based game in a single HTML page with a single input field and button for input, and a single text area for output. The benefit is that this experience directly contributes to learning node when he wants to do more on the server side, and he's already got all the necessary tools: a browser and a text editor.

There is no reason why he cannot implement the entire text based game in a single HTML page with a single input field and button for input, and a single text area for output.

Yes, but still yo have to able to tell things apart, and it is extremely hard to do that.

HTML is a markup language ... what does that even mean?

JavaScript can be used for game logic ... what is JavaScript again (what type of language)? What else can be used like JavaScript (what directly, what indirectly)?

What is the difference between Java and JavaScript?

Why are people talking about Client / Server communication?

In short: yes it is scalable, but only for people who know a lot about web development.

The time might be better invested in just setting up development environments for different languages and not even going beyond "Hello World!" projects ... and reading up on those languages / types of languages (even/especially with Dialects' update in mind).

Doing a browser based game makes sense if you want to practice the skillset.

When you want to learn about game development in general ... better keep it more simple than that, because everything will be a blur until you know more about the components/technologies that are involved.

I'd like to add that I do not plan on following a programmer's career, at least not at present. The necessity to learn programming (or at least the very fundaments of it) is only a mean to allow for greater assertiveness when creating and contemplating the design of a game. This is not to say I won't take programming seriously --I just see it in a different perspective than someone willing to make a career out of it would at this point in time.

You would not be looking at the big picture if you zoom in on web development now. That big picture knowledge is something that might be really valuable for you as a game designer.

But sure, if you want to specialize already that is fine. I still would not start with building a skill ... better do the relevant research instead.

Then break the technologies down further and practice those with simple projects for hands on experience:

  • learn about HTML5, play with pure HTML for a while
  • add CSS files for a site, play with that for a while
  • Write simple JavaScript files ... understand the role that it plays
  • Bring everything together, maybe write a style switcher before you go for the game
Given enough eyeballs, all mysteries are shallow.

MeAndVR

I think you're making it out to be more difficult than it really is. Many people learn to program having their first language JavaScript and their first platform be the browser. Based on my perception of Dialects' intelligence, I don't think document.write(text); document.write("<br/>"); will be a major bump on the road for him.

Besides, if he is really that averse to HTML, you can write console apps with node. There is no requirement that every script run with node be a client server application. And he'll still be practicing JavaScript.

This topic is closed to new replies.

Advertisement