Sunday, April 25, 2010

PyGridz: make your own games

I have renamed my games program "PyGridz" (it used to be called Pyxelation). All game objects and the rooms they occupy are composed of rectangular tiles (tiles are usually square). Whenever a player enters a room without any other players in it, that player's shape, the room's shape if it's not rectangular, and the shapes of all objects in that room are loaded into the game server's main memory (RAM). A shape is a 2-dimensional array of 8-byte values (each array element corresponds to one of the tiles the shape covers). Each 8-byte value is composed of 4 16-bit values. Each of those 4 values represents a north, south, east, or west pixel count, and those 4 values are used in collision detection (the game server is responsible for collision detection). The positions of all game objects are confined to grid intersections, or to an imaginary line joining two adjacent grid intersections. Each tile making up a player or game object may include a transparent bitmap, which resides in the players' local RAM, not the game server's RAM.

The missile object is a special case. Missiles are usually round in shape (they may include a transparent bitmap), and are not confined to grid lines. Collision detection involving missiles is handled on the client computers, not on the game server.

The "Py" in PyGridz refers to the Python programming language. PyGridz is implemented in Python, and game designers use Python as their scripting language. Non-programmers can create simple drag-and-drop games, and programmers can add functionality to those games.


Today I plan to work on designing PyGridz. It's raining today. On Friday I went for a 30-minute walk, something I should do more often. Before writing this post, I had a PyGridz brainwave: the game server has multiple switches. When a client event needs to be controlled by a switch, it passes the switch no. to the game server. If the switch is off, it is turned on. If the switch is already on, the events downloaded to the clients are preempted (the preempted flag is true). Eventually the switch is turned off when it is no longer needed.

On Friday afternoon I emailed 10 people I know, asking them to vote for their favourite name: PyGridz or Pyxelation. So far no one has voted. I'm going to lie on the couch, with my clipboard and PyGridz notes, and mull over my next PyGridz design move. I'll probably have 2 frozen toasted waffles for lunch, and then a 2nd cup of coffee. So let me spellcheck and publish this post, and then I'm off to the couch. That's all for now, dear blog readers.

No comments:

Post a Comment