Game Development Reference
In-Depth Information
References to possible special-effect animation objects that may be occurring for the player.
When an object exists here, it receives a call from the global tick() function with the amount of
time that elapsed to update its animation state.
An optional reference to an AI object that's responsible for the decision making of a computerised
player
var world (main.js) : This object is responsible for the grid mesh and its state. A reference from
this object to the processed model in the resources repository defines the mesh that the current
game play occurs on. The grid mesh object remains constant throughout the game and an additional
“live map” is maintained beside it. Most aspects of the mechanics of the game rely heavily on this
map. It keeps track of where a wall erects and where a bonus objects rotates, and it ultimately
decides the fate of who loses and who wins the game by detecting crashes between players and
walls.
The map contains a state variable for every vertex of the grid. A vertex can be in one of the following
states:
Free : The vertex is free to be moved onto by a player.
Occupied by a player's bike : The movement procedure of the player maintains which are the
next and previous vertices the player occupies (A and B). This information is used to detect bike-
to-bike collisions where two bikes crash into one another and die.
Occupied by a player's wall : Left behind the bike, a player that bumps into one crashes and
dies. A few seconds after the player's death, its own wall vanishes and the vertices occupied by it
become free.
Occupied by a bonus object : A bonus object occupies a small circle of five adjacent vertices on
the map. A player that bumps into either of them “eats” the bonus and the bonus vanishes.
A human player avoids collisions with walls and other bikes by looking at the rendered frames and making
split-second decisions to turn the bike. A computerized player, however, does not have the luxury of a
visual cortex; so instead, it uses the map information to “see” what's going on on the grid. The map
information is used by the AI module to avoid collisions with walls, plan its steps going forward, and
perform rudimentary attempts at winning the game.
Automatic players of the 2D lightcycle game have been a hot topic for research and online programming
competitions. The so-called “intelligence” implemented in the computerized player of CycleBlob is
extremely simple and not all that intelligent in comparison to how sophisticated these players can get. Still,
among the most common feedback comments that I get for the game is that the AI is too hard to beat.
Perhaps it is the added complexity of the game mechanics that make the AI players appear smarter than
they are.
Conclusion
Like many personal projects online, CycleBlob is a work in progress. Occasionally, I take a weekend to
add a few more features and tune the code for greater performance or to review recent requests from
users. Some of the things that I hope to be able to work on in the near future include:
 
Search WWH ::




Custom Search