Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I know object oriented PHP and Java, and I can code Javascript fairly well at the moment.
However for the life of me I'm not sure how Google's made a game in JavaScript.
It seems to be compressed (the code) so I can't really see what's going on.
I thought javascript it was only single threaded too, making game development even harder.
I've seen the GWT, but I thought that was more for designing interfaces, I didn't really see any game development in there. If someone could direct me to some sort of toolkit, or open my eyes to how people are coding games in Javascript, I sure would appreciate it!
Google (if you are thinking of the pacman game), used HTML5's new feature which supports a kind of 'threading' called WebWorkers. You can also use timeouts and such to pretend to be using threads, though in reality they aren't.
Writing a game in Javascript is similar to how you would do it in C. Or rather, messy C with most things in one file. You have to just define all your components in the one javascript file (or multiple if you are using WebWorkers) and press your go button. Graphics are largely done with HTML5's canvas 2d element or if you are really on edge, the canvas 3d WebGL system which isn't really supported properly in all modern browsers yet.
In fact, you can make a game simply by setting up one big Canvas 100% width and height, and then program your entire system in that javascript file, ignoring the fact that you are on the web (if you please). Most usual drawing, threading, database, networking, etc... standard game 'features' are already built in to the latest HTML 5 spec.
This SO question on a javascript games framework should help and google turned up gameQuery and GameJS...that should at least provide some insight into what's being done.
This site also has a gallery of javascript based games...
It's really hard to make complicated game in Javascript now, mostly because of browsers incompatibility. But google guys made port of quake 2 to Javascript with GWT.
To make your own game you can use HTML5 canvas or better vector graphic (VML for IEs and SVG for others) maybe with raphael.js library as abstraction layer. Also you can use some physics engine like Box2DJS
3D Javascript game is not an option now, because WebGL is under development.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
At work, I am developing this "mystery"-type (2D) game where users go around rooms/location, tap on objects (objects/items/people) and get some form of feedback like a message, a chat (think RPG chat) or finding some item.
Technology used currently
Currently its developed using pure HTML/CSS, where everything is a div. Animations uses CSS3 Animations or jQuery ones depending on suitability. Chats implemented using simple buttons (on click, depending on reply do something). There is panning of the game stage involved - the viewable area is smaller than the actual game stage. So users will drag the stage around by tapping and drag.
The problem
Details here are not really important ... you may want to just scan through this section if you prefer
The most problematic part with this is performance. On a mobile device, its terribly jerky for a simple 2D game like this. Taps are not really responsive, sometimes requires more taps to register. We already tried to use CSS animations and transforms where possible.
The 2nd problem is debugging. Since this game is played on the client's app, which embeds own game in an in app browser/webview. Debugging is made more complicated (no Chrome usb/remote debugging, currently we use Firebug Lite - which is a pain and lacking in features ...). Performance also suffers further. There seem to be weird bugs also like jQuery animation callbacks running at the wrong time. Views scrolling unexpectedly. Sometimes the tap area of the objects are off the actual object - when the user pans the stage, the graphics move as expected, but the tap area is off the object - eg. tapping on the right of an object triggers it, but not tapping on the object (this happens on some devices of a particular brand)
Any recommendations?
For such a type of game, is a game engine suitable? Which one? Most I see are more for more complex games and maybe overkill to include.
Might using HTML5 canvas solve my graphical performance issues? Another game was developed using ImpactJS, its of a different kind, and the performance is considered ok. But with this chat and tap (to interact) based game, I wonder if such a large framework is actually required.
The problem with the taps is that phones handle clicks different than touches: for each click there is a delay (300ms, if I'm not mistaken) during which it waits to see if the user performs a double-click. That's usually where most of the sluggishness on the mobile devices comes from.
You never described which part exactly is causing the game to perform badly. If you have tons of elements on screen, each with their own CSS (and especially CSS like shadows, animations...) it will likely slow your game down.
Using canvas (and dropping jQuery to squeeze out maximum performance from the app) might be a good idea here. Without any huge frameworks/engines. Using canvas will also help you with the issues you described under debugging - while you won't be able to inspect every element on canvas, things like displaced objects/click areas won't be happening as everything (except chat - I strongly suggest you don't render text on canvas because it's very slow) is located in a single element and all the layering will happen on the canvas itself, not CSS.
But don't forget: while a well-designed canvas app might definitely outperform what you currently have, it can also perform worse if done badly.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
So I have been having lots of fun playing with SIMILE Timeline, but unfortunately, it appears to be all but abandoned (most recently closed ticket May 2009) and riddled with memory leaks, especially when you are dynamically loading and unloading events (which is especially true in my case).
I am a novice in JavaScript, so debugging these leaks is going to be more than a little complicated. Before I dive head-first into fixing a problem in a language I don't understand or a codebase I have never looked at, I want to know if there is anything out there that compares to the feature-set that I can get with Timeline:
Multiple events on one band
instead of having 10, 100, 1000 rows of data, use the space available to fit multiple events on one line when possible
Scrollable
CSS styling down to the specific event
I can specify a specific icon, font, etc., for each event if I need to. This is great for highlighting error events or interesting events
filtering/searching/highlighting
highlighting a band of time or point in time
This would be a vertical band that shows a 'now' moment, or a band that covers a time period's start and end time
I know that alot of these features can probably be put into things such as Flot or HighCharts, but these things were next to free for me to use in Timeline, so I'm weighing the cost/benefit of whether it is easier to fix a memory leak or roll out 3 - 4 features on some library that doesn't have it. My gut says "fix the leak, it's easier", but I would like to know if anyone can show me something that might be 90% of the way there with a low barrier of entry to getting that other 10%.
Maybe you can use the Timeline from the (open source) CHAP Links Library, developed by Almende.
http://almende.github.com/chap-links-library/timeline.html
Have a look at the examples to see what you can do with the Timeline. It is quite flexible, you can choose your create your own layout and use your own CSS/HTML in each individual event.
Check out Timeglider (see http://timeglider.com/jquery/) which is an open source (MIT), JavaScript (uses jQuery) scrolling timeline under active development. It meets your first 4 requirements I believe but I am unclear about the specifics of your 5th requirement. I have only done some simple experiments with Timeglider and don't know it very well but maybe this is a potential solution for you.
We needed the Simile Timeline at Lab 21k so we took the source code, cleaned it up and published it using bower. So you don't need an alternative anymore.
https://github.com/Lab21k/standalone-timeline/
The Timeline project is very much alive, they just don't use Google Code anymore. The Simile widgets are now hosted on a dedicated homepage, here is the homepage and documentation of Timeline. Keep in mind that the links on the page are not consistent, many pages still link to the outdated wikis on Google Code and the mit.edu wiki pages. Keep that in mind when checking the wiki.
There is also an active mailing list on Google Groups.
This is probably the best one around right now:
http://timeline.verite.co/
I'm actually working with the Simile Timeline in a project of my called Event Viewpoint. I've fixed quite a lot of bugs and enhanced it with many contributions that I have found online including images for the event, a zoom bar, and some additional events.
It is a brilliant piece of work just needs someone to take the time to update it and make it more current. That is currently out of scope for my project, but if I have time in the next year or so I will start to enhance it.
It would really be great if people could revive the project, add touch events and so on.
If someone needs the source I am willing to provide it.
They’re still very active. David Karger makes frequent updates. Now they have the version 3.0.
You can find reference documentation here:
http://simile-widgets.org/wiki/Reference_Documentation_for_Exhibit.
The code is here: https://github.com/simile-widgets/exhibit
I don't know exactly what you want, but i'm working on this jquery plugin that it's being used in a website with dynamically managed events.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
We are looking for a nice javascript-based library for a web charting application we have been asked to do. The charts will be accessible and should actually be nice to interact with via mobile devices (iOS, Android, and the like). The user will be able to drill-down into some datasets, so the snappier (both processing graphics and loading data) and the more interactive, the better.
Nowadays, there are countless options out there, and many aspects to look at. Based on my research, I have put together the following list. Apologies beforehand for any mistake, it is not intended to be 100% complete or accurate.. but I think that still useful:
https://spreadsheets.google.com/pub?key=0As7T_22rXSbtdF9YeklwcUVXSEdwQnN0a0FvcWpoU2c&output=html
What is your opinion? Do you have any experiences in such kind of application? Maybe some candidate I am missing?
We are narrowing down the choice, but I am still not sure as for what choice is the best bet. Some questions that pop-up in my mind:
Different ways of rendering the chart (SVG/VML versus HTML 5 canvas). Which one is more suited to browsers in mobile devices? Which one is more suited to user interaction?
Making it look good. Which libraries allow to easily tweak appearance? Is CSS really powerful for this?
You missed out Sencha Touch
first of all, if mobile support is a must-have for you, discard SVG as a solution. It's not widespread supported. Canvas in the other hand, is not supported by old versions of IE, but can be simulated via VML with the exCanvas.js library.
About making it looking good, CSS has nothing to do with these libraries. CSS affects DOM elements, and canvas content is binary data. Canvas is, as the word says, a blank canvas for you to draw in via a Javascript API. Once you draw a line in a canvas element, that information is just pixels in the canvas.
BTW, is a good list the one you collected, and I'm pretty sure it's quite complete. The only intruder in it is Dundas. First of all, is a .Net library, and generates the charts in the server. Second, is deprecated. Dundas is no longer selling components, they're totally engaged with their dashboards solution.
Hope I'd help.
I've chosen Flot for several projects now and it has worked well. It's well documented with lots of examples, configurable, looks great, and is extensible. It is dependent on jQuery.
You might also want to add dhtmlxChart to your list.
It's a Canvas based JavaScript charting library that supports different chart types: line, pie, area, bar, radar, etc. dhtmlxChart is distributed under GPL v2 (commercial license is needed to use it in a proprietary project).
(Disclaimer: I work for DHTMLX)
I know this is an old question, but we had to do a similar research recently.
We focused our study on mobile charting libraries (Android and iOS, native or hybrid -with Cordova-) supporting line / area charts. All the information has been gathered from the websites of the respective chart libraries and no personal test has been made (yet).
Here's the result:
https://goo.gl/0tVC6a
I hope it helps.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Anyone have experience with game development using javascript and the html5 canvas element?
So far I have found two libraries, are either of these worth using?
http://tommysmind.com/ (XNA Port)
http://gamequery.onaluf.org/ (jquery plugin)
Does anyone have any other resources?
You can also use Lime JS - very promising HTML5 game developement framework.
http://www.limejs.com
A bit late to this ;-) but here are some current or emerging frameworks
Aves http://www.dextrose.com/en/projects/aves-engine
Akihabara http://www.kesiev.com/akihabara/
Rokcet Pack http://rocketpack.fi/
Effect Games http://www.effectgames.com/effect/
these are probably overkill for the kind of games you're mostly referring to.
Also, take a look at Sencha Touch
http://www.sencha.com/
There's a very slick solataire example here
http://touchsolitaire.mobi/app/
HTH
impact js looks really cool, http://impactjs.com/ but it has $99 price tag :( But it comes with an awesome level editor so it might be worth the price.
For basic 2d games i would use either impact or Crafty
Crafty is open source, but impact has a cool level editor.
All the others that i have tested are either lacking in some areas or too expensive. Aves and Rocket has been bought by Zynga and Disney.
Have a look at Processing.js. Maybe you can use it for 2D drawing and user interaction.
You can use for example this one port http://cocos2d-javascript.org/ for game dev.
Another library you could look at is google forplay. While not a true javascript/html5 library it compiles to javascript from java much in a way like GWT.
I have not built a game engine but rather a classic game in its near-entirety, plus a few simple animations, into my Tetris clone.
Its most important feature in my opinion is the effectiveness of the multitouch control scheme when you load up the page in iOS or Android. The idea is for it to be intuitive enough that I shouldn't have to show instructions for the user to figure out how to play it.
Try our HTML5 game engine, Construct 2 (http://www.scirra.com). We have an extensive free edition available so you can play around with it!
It's an event based system which means you don't need to know programming to get going in it. However it is extendable with our Javascript SDK so anyone can write their own plugins to extend it's functionality.
A few great games have started to pop up on our arcade now as proof that it works well!
http://www.scirra.com/arcade
I have personal experience of developing a HTML 5 browser game with Dead Earth! I found that I did not need to use any specific libaries other than JQuery along with a few Jquery plugins.
I used the Canvas and the Audio elements in Dead Earth. But I did not create any fancy 3D graphics I only drew shapes and images, colouring said shapes, drew lines etc.
I imagine if you are doing something more complicated than this you may need a library otherwise why make your app more bloated than it needs to be?
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
Several frameworks for writing web-based desktop-like applications have recently appeared. E.g. SproutCore and Cappuccino. Do you have any experience using them? What's your impression? Did I miss some other framework?
I've seen related questions on StackOverflow, but they generate mostly standard answers like "use jQuery or MochiKit or MooTools or Dojo or YUI". While some people give non-standard answers, they seem to have little experience using this frameworks.
Can anyone share real experience developing destop-like apps for the browser?
To my point of view, Cappuccino is an example of what NOT to do. They implemented another language on top of JavaScript, which already bring slowliness while browser developer are already fighting hard against, and, what is worst, they don't rely at all on the browser widget, breaking all the user navigation experience. For example, they implemented their own scrollbar, with the main drawback that using mouse wheel won't work anymore!
I really prefer ExtJS's approach which give you rich widgets while keeping the UI as close as possible from the browser.
Due to the speed issues these high-level frameworks cause for many larger (as in: non-trivial) applications, we only use plain jQuery. In our tests, all high-level frameworks broke down in situations where there are many draggable objects or many drop targets, and in situation where long lists (with >1000 entries) were shown on screen.
Part of this is due to issues with IE6 and IE7 (where performance suddenly starts to deteriorate dramatically after DOM trees reach a certain complexity), but part is due to the overhead these frameworks generate.
So I would not recommend any of the high-level frameworks. My recommendation would be to use jQuery and work with the DOM directly.
Some tips to improve performance:
Where possibly, render HTML on the
server.
Keep the HTML as simple as
possible.
Avoid having many elements
in the DOM tree.
Avoid recursive
table structure (IE suddenly stops
showing them after relatively few
levels of nesting).
Remove invisible
elements from the DOM tree.
Remove
things from the DOM tree before
changing them and then re-insert
them, rather than changing them
while they're in the tree.
I also, as gizmo, recommend EXT JS. Their license has changed and it may not work for all, but it's still a good choice if you want to do stuff like a desktop.
Here's their example page for a desktop environment: http://extjs.com/deploy/dev/examples/desktop/desktop.html
Apple is demonstrating that sproutcore does work, although it's hard to estimate how well it works. Currently I build web apps with a home-grown set of libraries, duplicating a set of functionality from our windows software suite (but adapted to a web interface). Up to now I've avoided frameworks particularly for the reason that I didn't want the bloat. The problem with this approach is that I waste an inordinate amount of time duplicating functionality that's already in the frameworks, and I feel that over time I'm going to approximate towards something that resembles these frameworks.
Because of this I've been experimenting with implementing a web app in extjs, and it was a surprisingly nice experience. The performance is excellent, and ease of development is quite high because their component set is good for actually building apps, not just for fancy demos (a common problem in web toolkits). I would definitely recommend it if you are interested in building desktop-like web apps.
The problem of scaling it up obviously still applies, but honestly, I feel that it's better to use a toolkit in situations where scale is not that important, and to fallback to basic javascript only where you need to (premature optimization being the root of all evil). Extjs can layer on top of prototype or jquery, so this approach is definitely workable. Avoiding too much content in the DOM is usually an approach of loading and unloading on-demand. For example, there's a third party extension to the extjs grid class that allows scrolling through a million row dataset by being clever about loading and unloading data.
You might consider using GWT-Ext (uses Ext underneath) might be a very clean solution if you're going to use Java.
I like qooxdoo, although it takes the OOP approach of JS rather than the prototypal it is a solid framework and has a lot of features.
I don't have any experience with SproutCore or Capuccino. But have made attempts to use Dojo on top of Django for this kind of work. Can only tell you it's slow and buggy.
extjs might be of help. http://dev.extjs.com/deploy/dev/examples/