• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Tvj

Browser-Based Game: Best Language?

20 posts in this topic

Hi,

 

Although very naively, I have been contemplating finally getting a go at creating/idealising (the two are very distinct!) a game. Amidst such event, I stumbled upon a technical question in need of answer. What's the best language to code a 2D/Text-Based browser-based game on? The question itself may be lacking in depth so I'll list a few game references:

 

- Rail Nation | Travian Games

- OGame | Gameforge

- Brain StormGenia

 

Perhaps this is a good enough draft?

 

 

Thanks in advance,

Dialects

0

Share this post


Link to post
Share on other sites
In the browser itself, barring plugins, you're pretty well limited to JavaScript. There are other languages you can use which can be compiled to JavaScript, but you can't escape the semantics of JS, so any such language is more or less syntactic sugar. They may add some static analysis, but my experience with TypeScript and CoffeeScript has been they are not worth the trouble.

For the server your choices are far more vast. Most contemporary languages have a web app stack (rails, grails, django, flask, ASP.NET MVC, sails, meteor...) that will help keep things organized and prevent you from rebuilding the wheel.

If you are new to programming or have absolutely no bias I'd go with Node.js along with one of the popular full stack frameworks like express or sails. This way you need only learn one language, and there's a chance you could share some code on the client and server side, though this usually is a minimal amount.
1

Share this post


Link to post
Share on other sites

Only JavaScript? I usually see JavaScript, Java, or HTML5 mentioned for browser game development, but I've not done a browser game so I don't know if those are viable options too or not.

Edited by BHXSpecter
1

Share this post


Link to post
Share on other sites

smr

- Thanks for your kind and elaborate post. Given my zero experience with coding, should I go straight to JavaScript or would you recommend getting in touch with another language prior to Js? 

 

BHXSpecter

- I am aware of the difference between Java and Javascript. Not entirely sure what the difference(s) is/are -- just aware that they're different. Are you saying HTML & CSS comes to play when coding a browser-based game, too?

 

HyperV

- Haxe being? Apologies. I'm not much a connoisseur at this point.

 

Edit: Just did a bit of research. By Haxe you mean http://haxe.org/ ? What are the advantages in using Haxe over hard-coding it by scratch and what's the learning curve of the language?

 

 

Thanks in advance,

Dialects

Edited by Dialects
0

Share this post


Link to post
Share on other sites

It depends on what is your intended audience. The most obvious solution would be JavaScript because the user won't need any additional plugins. But you should take into account that supporting JS on a wide range of clients is quite hard (especially if you look at Internet Explorer and mobile browsers). The compatibility is not much of a pain if you will use something like Flash (ActionScript), Java Applets (Java) or Unitiy3D (C#) but then the user would need to have the respective plugin installed and also the mobile experience would be limited or non existing.

 

Update:

 

Just for reference here are two libraries that I would recommend:

 

Phaser (JavaScrip/HTML5) - it's a game library for HTML5 games so will only work on new browsers that support Canvas or WebGL. This also has awesome compatibility and  performance on mobile.

CitrusEngine (ActionScript 3) - It is actually a bundle of libraries that help you quickly get games working in either 2D or 3D and also takes the advantage of Stage3D technology (GPU acceleration). This will do fine for desktop browsers (even older ones) that have Flash Plugin installed and you can also publish the game for mobile environment (Android, iOS etc) using the AIR technology with minimum to no modification to the code.

Edited by ram64
1

Share this post


Link to post
Share on other sites

Thanks for your elaborate reply, ram64.

 

You do raise a pertinent question -- what's my target audience? Albeit not much thought has been given to this yet it is somewhat safe to assume having a platform that is compatible with computers & mobiles is the way forward. 2D/Text-Based Strategy tends to gather interest from an adult-keen audience so I'll assume this to be my target audience to begin with.

 

I would like to ask for a bit more of detailed information when it comes to code languages. What are its pros and cons? So far these have been suggested:

 

- Javascript

- Node.js (which I suppose is a derivation of Js?)

- Java

- HTML 5

- Haxe

- Action Script (I've had some introduction to AS3 in the past!)

- C# (Unity 3D)

 

 

A hands-on look at the cons and pros of these would help me greatly in understanding which may be the best pick. Take into consideration:

 

- It's a browser-based game.

- Mobile-compatible is an option but not necessary.

- It takes on several aspects of the games I've mentioned before (Rail Nation being the biggest in terms of GUI, Dynamics, Animations, Game Mechanics, etc)

- I'm new to mostly all of the above mentioned languages. I have very little knowledge of Action Script 3.0.1, Python 3 & rudimentarily, HTML5 & CSS 3.

 

 

If there's anything else you'd like to know, ask away. I might not be providing the full-extent of information you'd expect out of lack of knowledge.

 

 

Thanks in advance,

Dialects

0

Share this post


Link to post
Share on other sites

There is currently a catch with the following technologies:

 

Java

C# (Unity 3D)

C# (Silverlight)

AS3 (Flash)

 

They require your users to have a plugin (of the correct version) installed. This also means that your software will only work in specific browsers on a limited number of operating systems (that supports the plugin). Tablets in particular will not load them in their web browsers.

Plugins are a legacy technology that are slowly and surely moving over to Javascript / asm.js. Unity is making good progress at porting their plugin to pure Javascript via Emscripten, Unreal engine has done the same. Adobe have also stated that they are going to be migrating their tools and language over to HTML5. Unfortunately none of these are quite ready yet.

 

So instead, since you are starting from scratch anyway, I recommend the following choices.

 

Javascript (+ Canvas) - For 2D web games

Javascript (+ WebGL) - For 3D web games (perhaps using three.js to help)

HaXe / Typescript etc. export to JS too so these kind of things might suffice if you really dislike Javascript.

 

If you or anyone else in your team is interested in getting into programming in a big way, then this opens you guys up to Emscripten (C++ -> Javascript compiler) which is becoming very popular now with larger companies and native developers but also allows you to utilize a massive back catalogue of traditional C and C++ libraries to help you develop your game (rather than reinvent the wheel).

Edited by Karsten_
1

Share this post


Link to post
Share on other sites


I would like to ask for a bit more of detailed information when it comes to code languages. What are its pros and cons? So far these have been suggested:
 
- Javascript
- Node.js (which I suppose is a derivation of Js?)
- Java
- HTML 5
- Haxe
- Action Script (I've had some introduction to AS3 in the past!)
- C# (Unity 3D)

 

JavaScript will be available on most of the browsers (mobile and desktops) but you have to take into account the implementation of JS engines in each of those browsers (or for which browser you want to support). This would be the language of choice for a 2D/Text game if the graphical part is not that advanced.

 

Node.js is a server side environment which uses JavaScript. This would be used for the back end of a game or an application (scoring system, server logic etc) in case you want a back end to your game. 

 

Java is a powerful choice but the learning curve is quite steep. 

 

HTML5 is actually the current/next standard of HTML and is just the markup. A game written in HTML5 would still need JavaScript to function. When stating that you are using HTML5 for games you actually are saying that you are using a combination of HTML5 (markup and Canvas tag), CSS3 (styling) and JavaScript (for logic and interactivity). 

 

 

ActionScript is the programming language used in Flash. Most of the online games were and are still done in Flash but as HTML5 standard is refined more and more devs abandon Flash and AS for HTML5 and JS. But again, this really depends on your audience and on your type of game.

 

I have not used Unity before but as far as I understand it's a good solution for games (mostly 3D but recently I think they released some updates for 2D games). In my opinion this would be too powerful for a simple 2D text game.

 

As for HAXE I never used it but I think it's some kind of language that you can compile to other programming platforms (ActionScript, Java etc). Can't give you too much detail as I have no experience with it but you can read on the official site http://haxe.org/.

 

 

Also you should mention what's your overall programming experience. If you have no experience with browser games I would suggest just picking JavaScript and get on this path (as your game seems fit for it). You could also try TypeScript (which compiles to JavaScript) if you want type control and other goodies in JavaScript. 

2

Share this post


Link to post
Share on other sites

So instead, since you are starting from scratch anyway, I recommend the following choices.

 

Javascript (+ Canvas) - For 2D web games

Javascript (+ WebGL) - For 3D web games (perhaps using three.js to help)

HaXe / Typescript etc. export to JS too so these kind of things might suffice if you really dislike Javascript.

 

This, I suppose, nails my concerns summarily.

 

It is not that I do not like Javascript. I am not familiar with either Javascript nor HaXe which is why I asked assistance in understanding what the main differences and applications between the two are. HaXe may look like an easy starting-point though given that it exports and is based on JS (correct me if I'm wrong!) I might be better off understanding the core principle of the language itself before I start using applicants and derivations thereof.

 

I currently do not have a team. It may be slightly naive of me to think I'll find one or two willing candidates. No payments are being offered as is and although the prospects may be high (at least to myself -- I've been a vivid gamer for quite some time. The idea I have for the game is enthusiastic to me. That's the ground my hypothesis is sitting on, I suppose!) I can still not guarantee that those involved will be paid during development stage.

 

I come from a Design background w/ predominance in Art Direction. If anything, it makes it easier for me to understand methodically how a concept goes from being an idea to becoming a representation of that idea. I'll possibly venture myself in running the two tasks simultaneously: Working the concept up & learning Javascript.

 

I'd like to deeply thank everyone who has commented. You've all been very helpful! To conclude it all, can you guys direct me to some Javascript tutoring/books/videos? I have seen tids and bits of information pertaining Javascript at Gamedev. I've also registered at Codecademy and have started the Javascript Learning Program. Is there more I should be doing?

 

 

Kind regards,

Dialects

0

Share this post


Link to post
Share on other sites

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

Edited by Karsten_
1

Share this post


Link to post
Share on other sites
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.
1

Share this post


Link to post
Share on other sites
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.
1

Share this post


Link to post
Share on other sites

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.

1

Share this post


Link to post
Share on other sites

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

1

Share this post


Link to post
Share on other sites

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

Edited by Dialects
0

Share this post


Link to post
Share on other sites
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.
0

Share this post


Link to post
Share on other sites

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
Edited by DareDeveloper
2

Share this post


Link to post
Share on other sites
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.
0

Share this post


Link to post
Share on other sites

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.

I know what you mean ... but I think that you have a wrong impression because you learned about HTML and CSS incrementally over time.

For people who have been following HTML it might be trivial.

 

But after that quote ...:

I'm quite lost in terms of where I should start especially given the monstrous array of possibilities.

 

... I thought it made sense to point out that for developing with those high level techologies you should read up on the "what happened so fars ..." and break the research aspect of learning down even more.

Edited by DareDeveloper
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0