Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×

Comment Re:"Getting into orbit" requires a big rocket. (Score 1) 282

If Musk gets his reusable rockets going, he should be able to lift enough fuel to fully refuel a rocket in orbit with its ground launch capacity of fuel, for about as much money as it costs to launch a disposable rocket now. That ought to scoot out to Mars quite promptly. Like Heinlein said once you're in orbit you're halfway to anywhere.

Submission + - Book Review: Core HTML5 2D Game Programming (corehtml5games.com)

eldavojohn writes: Core HTML5 2D Game Programming details a journey through creating Snail Bait in well defined steps. This simple two dimensional platform game works as a great starting point for anyone interested in making their very first game targeting many desktop and mobile platforms. This incremental process is expertly segmented into logical lessons with the only prerequisite being fluency in JavaScript. One of the most attractive aspects of this book is that the core concepts of this book don’t rely on some flavor of the week JavaScript library or framework.

author David Geary
pages 615 pages
publisher Prentice Hall
rating 9/10
reviewer eldavojohn
ISBN 9780133564242
summary An exercise in 2D game development and mechanics in HTML5 and JavaScript.

First, this book isn't for people who do not recognize HTML5 and JavaScript as a valid development platform for games. I know you’re out there, you can stop reading here and move on to the next article. This book isn't for you. If you have no programming experience this book is likely not for you either. This book dives into concepts faster than Geary’s last book on game development in Canvas. You should also be familiar with JavaScript if you want to effortlessly start on this book. Throughout the book, Geary utilizes object’s JavaScript prototypes to add functions, uses anonymous functions and refers to common programming patterns.

It is worth repeating that the implementation in this book does not rely on a framework or library that could change or go defunct. The game runs entirely on code covered in the book accessing W3C standard specifications like requestAnimationFrame(). As long as JavaScript interpreters don’t change core things like timing control, this book should be relevant to developers for years to come.

The reason this book gets a nine is it accomplishes everything it sets out to do and Geary does a great job dividing up task after incremental task of setting sprite sheets and backgrounds into motion. The reason it doesn't get a ten is that I was personally disappointed with the the author devoting little time to physics and their simulations.

The book is laid out to enable its use as two kinds of resources: cover to cover and chapter specific topics. Reading this straight through, there were only a few times where it felt like I was needlessly being reminded of where I had already read about tangential topics. On the plus side if you ever want to see how Snail Bait implemented something like sound, you need only spend time on the chapter devoted to sound sprites. One mild annoyance I had with the text was that the author seems to always refer to Snail Bait as “Snail Bait” which leads to a Ralph Wiggum-like aversion to pronouns or saying “the game” instead occasionally. It might only be me but it can become tiresome to read “Snail Bait” five or six times on the same page.

You can read a sample chapter here that shows how to implement sprite behaviors.

The first two chapters of the book focus on a set of basic guidelines to follow when doing game development in HTML5 and JavaScript — like keeping certain UI display elements in CSS instead of rendering them as paths or objects in the Canvas. Geary also covers the very absolute simplest concepts of how graphics are going to be displayed and how the background is going to move. He also spends time in Chapter Two showing how to best set up the development environment. It is demonstrated how shortening your cycle of deployment saves you tons of time and the author does a great job on letting you know what tools to use to debug throughout the whole text.

The third chapter delves into draw and rendering graphics in the canvas as well as introducing the reader to the game loop. It spends a good amount of time explaining the use of animation frame control in a browser to keep animations running smoothly. It also begins the auditing of frame rates so that the game can respond to and display things normalized at the rate the user is experiencing them. It also touches on how parallax can be employed to show things closer up moving faster than those further back in the background. This illusion of depth has long been popular and is even finding its way into scrolling on blogs and I wish that Geary would have spent more time on this perhaps in a later chapter but offer the reader more on how to do multiple levels of depth.

The next chapter tackles the core infrastructure of Snail Bait and discusses at length encapsulation of certain functionalities (instead of globals) in the source code as well as Snail Bait’s 2300 line prototype. It bothers me that one file is 2300 lines and I wish there was a better way to do this but as a learning tool, it works even if it is daunting to scroll through. The book adds some helpful pointers about how utterly confusing the “this” keyword can be in JavaScript. Chapter Four really sets the pace for the rest of the book by introducing the use of event listeners and illustrating how the game loop is going to continually be extrapolated.

The next three chapters cover the use of loading screens, sprites and their behaviors. Snail Bait uses all its graphics from an open source game (Replica Island). But if you were to design your own graphics for your game, these chapters do a great job of showing how to construct sprite sheets and how to use tools to construct metadata in the code so that the sprites are usable by the sprite artists. Using the flyweight pattern, Geary sets the stage for more complex behaviors and actions to come in the following chapters.

The next three chapters cover time, stopwatches and their effects on motions and behaviors within the game. The author starts and works from linear motion to non-linear motion and then using transducer functions to affect the time system. The game now has bouncing coins, a jumping player and Geary does a good job of showing the reader how to emulate behaviors in the code.

Naturally what follows next is collision detection and gravity. The collision detection strategies were adequate but I wish that there was more depth at least referenced in the text. This isn't a simple problem and I did like how Geary referenced back to chapter two’s profile and showed how collision detection performance as you implement and refine and optimize your algorithm. The nice thing about this book is that it often tackles problems with a general solution in the code (runner/sprite collision) and then provides the edge case solutions.

In the fourteenth chapter, the author tackles something that has long been a plague in HTML5 games: sound and music. The author doesn't sugarcoat this citing the long history of problems the vendors have had trying to support this in browsers. There’s a great explanation of how to create and handle “sound sprites” (similar to sprite sheets) so that there is only one download for background music and one download for audio sprites.

Next Geary covers the problem of multiple viewport sizes with a focus on mobile devices. Of course this is one of the biggest issues with mobile gaming today. The chapter is lengthy and deals with the many intricacies of scaling, sizing and touch events. This chapter is long but the highly detailed support of multiple platforms and resolutions is a justified discussion point.

In sixteen, the reader gets a treatment of utilizing sprites and their artists to simulate sparks and smoking holes. The book calls this chapter “particle systems” but I don’t think that’s a very good title as the code isn't actually dealing with things at the particle level. Instead this chapter focuses on using sprites to simulate those behaviors via animation. This is completely necessary on a computation inexpensive platform but it is misleading to call these particle systems.

Now that the game looks and functions appropriately, the book covers UI elements like player scores and player lives. The auditing of these metrics are covered in the code as well as warnings when the game begins to run to slowly. It also covers the ‘edge’ condition of winning in the game and the routine that is followed when the user wins the game.

The next chapter introduces the concept of a developer backdoor so that the reader can manually speed up or slow down the game while playing it or even test special cases of the runner sprite interacting with other elements. It’s a useful trick for debugging and playing around but does devote a lot of time to the specialized UI like the speed slider and other things that won’t (or rather shouldn't) be seen by a common player.

Chapter nineteen really felt out of place and very inadequate on important details. It’s a blind rush through using node.js and socket.io to implement server side high scores. The way it’s implemented would make it trivial for someone to submit a high score of MAX_INT or whatever to the server. The metrics reporting is done in a manner that (in my opinion) breaks from long established logging structure one would be familiar with. While it covers important things to record from your users in order to tweak your game, the inadequacy of discussions about shortcomings makes it feel out of place in this text. It's a topic of great depth and I have no problem with an author touching on something briefly in one chapter — this chapter does lack the warnings and caveats found in other chapters though.

Contrary to the previous chapter, the final chapter is a fast application of the entire book’s principles applied to a new game (Bodega’s Revenge). Geary gives a final run through showing how the lengthy prior discussions quickly translate to a new set of sprite sheets and game rules. If this book is ever expanded, I think it would be great to include additional chapters like this although I would pick a more distinct and popular two dimensional game format like a tower defense game or a bejeweled knockoff.

Overall, Core HTML5 2D Game Programming is a great book for a JavaScript developer looking to dabble in game development. You can purchase Core HTML5 2D Game Programming from barnesandnoble.com. Slashdot welcomes readers' book reviews (sci-fi included) — to see your own review here, read the book review guidelines, then visit the submission page. If you'd like to see what books we have available from our review library please let us know.

Comment Anecdote, completely non-scientific (Score 2) 198

We started our youngest two on computers at 12 months. They moved on to tablets not long after. They were reading at a sixth grade level before preschool. Our very youngest has been accepted to and attending a school for the gifted, as she reads at a college level now and is also good at math. She publishes how-to articles online and is working on a serial drama in the fan-fiction genre that has fans among her peers - without prompting or assistance. She's eight. She lies on the forms to get around the TOS. She has gotten her older brother interested in authorship as well. Their littler nephew was showing me the other day how to modify the network settings on my Android tablet to join his Minecraft server. He is six.

Comment Re:Newer apps expect beefier hardware (Score 2) 458

The reason I chose that particular model is that is when the platform became "good enough" for general purpose computing. More is always better but this is the level of sufficiency necessary for ubiquity. Now the price has moved within reach for almost everybody, so ubiquitous it will be. People with premium needs will buy premium products, but folks who can only afford these will be delighted and amazed. The software available for them is more than enough already, and growing every day. The next issue is global connectivity, and that is being worked on.

Comment Re:Now using TOR after WH threats to invade homes (Score 1) 282

Name calling is not shunning or shaming. It is attaching the person and not the argument and therefore has no place on civil discourse.

By the way, now that I re-read this during a spare moment and once again think about it, I can again respond to you in what I hope to be a worthy way, yet this time focus on a different dimension of the thing at hand.

I would ask you to consider, simply, this other and possibly alien point of view: the "name-calling" types are simply enacting the lower (or if you like, "gutter") form of an idea that is nonetheless technically true. The name-callers are merely those who recognize this but also have a need to make you look worse in order that they know better, or otherwise focus on what they think is wrong with you, with little or no serious constructive suggestion concerning what precisely is wrong with your view and how better to regard the situation. Liike the thinking individuals, they see what the problem is; otherwise, they lack the clarity and objectivity to identify the problem and suggest a sensible solution. By contrast, they're simply bitching. But even those people are correctly identifying that somethng is amiss. They're just the least clever and easiest to ridicule among those who all arrive at the same conclusion.

Comment Re:usb vga dongle ? (Score 1) 64

If it is supported, YES.

There are 2 drivers that work with USB to VGA dongles. One is the SISVGA driver, the other is the DisplayLink driver.

This provides a simple framebuffer device to the system that can drive a VGA monitor. You need to custom build your openwrt image to have it turned on though, and to enable the main system console to run on the virtual console hosted by the framebuffer device (And NOT on the physical serial port usually inside most routers.)

Here's a blog detailing the process for getting the displaylink driver working.

Putting a USB2 hub on the lonely USB2.0 port on the back, putting a keyboard, mouse, and USB2VGA dongle on, you can directly hack away on the router. Even without the keyboard and mouse, the framebuffer device can be used to display data about the current status of the router in real time, and other fun things.

Comment Re:Manual config (Score 1) 64

The WRT54G was one of the first consumer routers where the maker "Fucked up", and used FOSS software without a license, and then had to release the source code.

As a consequence, it was one of the first devices to attract major community attention, even with all its warts.

Later versions of the device were so horribly underpowered compared to the original hardware release that they just arent worth any effort. Compared to more recent SoC based home routers, they are garbage. (TINY system flash size, abysmally slow CPU. TINY system RAM, etc.)

When shopping for a consumer router, I look for one that is listed in the OpenWRT support list, with the best intersection of price and hardware inside.

Simply because it has a 50$ pricetag does not mean it is the best router. It just means that the manufacturer has set a 50$ MSRP.

Personally, I think one of those tiny "Fitlet" miniPCs that were mentioned earlier this month would make a great home router. They have a mini PCIe slot inside them, have an actual DIMM slot, and a few other perks. Sadly, I cant seem to find a price or retailer.

Comment Re:Manual config (Score 1) 64

Yeah-- I was meaning "good for the price"

A home router is little more than a SoC these days. Does not have the robustness that an actual dedicated computer has. What it DOES have is low energy draw, small physical footprint, and "Good for the price" hardware.

Getting some quality software in there, and a little cooling, they can work quite well even under pretty heavy loads. They just aren't data center grade.

They ARE getting some pretty powerful SoC in them though in recent offerings. Some are up to 1.2ghz ARM platforms now. Probably a side effect of the android phone market.

My old WNDR3400 I use for fun projects just has a 400mhz MIPS (Little endian) SoC though. Has a USB2.0 port, which makes it a fun thing to play with all the same though. (It's BARELY enough to put a compatible USBVGA dongle on, and some USB permanent storage.)

Slashdot Top Deals

Suggest you just sit there and wait till life gets easier.

Working...