November 25, 2006

Months passed...

Hm, so much time passed since last post. I have too much work and can't find free time for the project. But I can say that the project isn't abandoned, only paused unless I can find some free time to work on it...

October 02, 2006

Game area, the screen, the world map

Hello again,

It's time to speak about the game screen (room).

As I decided all rooms will be built up by 2x2 tiles. To conserve memory (again...), I decided to I won't use the whole screen, only a portion of it. My idea was a 40x20 chars large area, in addition of a "information panel" at the bottom of the screen, 40x5 sized, and with another charset. But I didn't like the 40x20 sized area, it seemed to wide and flat. I changed its size to 36x20, saving 20 bytes per room. This way each room will contain 18 * 10 = 180 tiles. In addition, I have to store the datas of enemies also, like this:
  • which sprite graphic
  • sprite color
  • starting position on screen
  • which direction it starts to move first
  • how long its path length
  • movement speed
Let you allow me to explain these attributes with the help of another image:


What can we see? A room with some walls and platfoms, and two enemies with different colors. The blue one will start moving down appr. 12 characters then will turn back. The other will go left first 23 characters and turns back (its path length is 23). BTW this is a bad example, as you see they cross eachothers' path which I have to avoid in future room planning :)

Now how can I arrange these rooms to create a world?

I could store some more datas about all screens, for example:
  • if player goes out of screen at upper side, which room he gets
  • if player goes out of screen at right side, which room he gets
  • and so on...
This is acceptable, only 4 extra bytes (the 4 directions player can leave a room) per room.

There is another way (and more) I may choose: take a paper with grid on it, and write numbers in the cells. That's all. I declare an array, hmm, 16x16 in size, I put a room number into cells, and voilá! I don't have to define where can I go from this room, etc. If I go right side of room and there's no wall which could block my way, I just look in world map which room is right from actual room. It needs less code to manage in Plus/4, and easier to implement its editor on the PC. Am I lazy?

A small worldmap, just as a sample:

It's a 3x2 world, with five rooms, first row: 1-2-3, last row: 0-4-5. From room 2 I can go to 1 and 3 and 4. It's not defined, but there's no any objects which block your way.


Next time I try to explain how tile graphics banking work... See ya soon!

More technical details about sprites

I though about the sprites. Each will be 16x16 pixels large, which means 2x2 chars in screen. To start the "sprite system" I decided there can be 6 enemies on screen (so we can make really hard and irritating screens) and each sprite on screen has its own color. There will be lots of sprites so I won't store all onscreen sprites and all animation frames in the charset, I dedicate some chars to each sprite and will copy the graphic data in every frame.

Remember:
  • I want to implement the movement by pixels not by chars
  • Each sprite can move up/down or left/right, no diagonal movement.
These requirements result that each sprite takes 6 chars away from the 256 chars. The horizontally moved sprite takes 3x2, the vertically one takes 2x3 characters. I had to set up a buffer where I render all 6 sprites animations including the movement. To conserve memory I decided all sprites has only 4 animation frames and all sprites move by 2 pixels. My English skill is poor so I put some pictures here instead of talking more:

A vertically moving object:


A horizontally moving object:


I saved 6 * 6 character places for all the enemy sprites. Cool, only 36 characters and I have 6 sprites on screen moved by 2 pixels.

For the player sprite, i have to use 3x3 characters, because the player can move freely on the screen so i recompute only the horizontal movement of the player's sprite and i'll use it to draw it in different y locations per char to simulate the vertical movement. It has some disadvantage: I use the 4 frames to simulate the horizontal movement, that means that when the player moves left or right, it animates, but in case of up/down it can't animate. But this "problem" appears only when you climb up or down. When you jump up/down (not diagonal), it's normal that you don't walk in the air.

Another major issue is the overlapped enemy/player or enemy/enemy or enemy/tile or player/tile. To gain speed (more exactly: not to loose) I decided that enemy sprites won't mask the background with sprite datas. If I plan the screen carefully, I can avoid that enemies cross others' way, or move into a wall, etc. This results that the enemy sprites don't need to restore the screen area when move away, only clear their previous position. But the player sprite will mask the game area, like ladders, background elements (which are only decors).

Wish list, limitations, decisions

Here again...

The first question in my head was what do i wanna implement into my game...
  • A controlable player which can walk left and right, jump, fall
  • Baddies which move on their fixed two directional way (up/down, left/right)
  • Items to collect
  • Tons of nice colorful graphics
  • Animation for not only the player and enemies but for the whole screen if i want
  • Music. I don't want to hear sound FX. A cool music that's I want!
  • Lots of screens to discover
  • The whole game must fit into one file. I don't want loading times.
  • All moving objects (player and enemies) move by pixels not by character.
  • Relatively precise collision detection
The primary limitation is the 64 kilobyte memory... I have to make space for sprite animations, worldmap and screen data, music, titlescreen and so on...

The decisions made so far:
  • all sprites will be 16x16 pixels large. This way more sprite animations fit in memory, and i can move 1-2 more baddies on screen in the same time.
  • The screen will built up from 2x2 char tiles. This way I save lots of memory, but i have to make a tileset...
  • I set up tile graphics banks. Another limitation is that Plussy can display only 256 different chars (now forget IRQ, etc. :). But I want more graphics and that can't fit into a few chars (100-200 chars). So this is my idea: I divided the tile charset into banks and I can change these graphics banks in each screen. The animations also will follow this way.
  • My 256 chars must have to contain these: a complete ABC, the numbers, some ! and ? signs, animated tilechars, lots of tilechars (later i call them "static"), 9 chars for the player sprite, and lots of chars for enemy sprites. I could spare some space if I cut out the A-Z letters from the charset, but I want to make a title screen also and I want to show not only text on this screen but some random ingame screen behind its text (still just an idea).
  • I decided that the collectable items graphics will be stored in screen tile graphics area.
  • Each tile has its own 4 color so I really can draw nice colorful screens :)
  • I want to make ladders, walls, background (passable screen element), water (or lava, spikes, anything that hurts if you touch it)
  • I didn't decide how large memory area I save for the music. If I want SID i need ~4Kb, for TED it can be less... I prefer TED music, but there's no useable TED music editors (at least I couldn't find any) which fit my requirements, only "write-your-music-with-assembler-and-compile". Too bad.

Everything has a beginning...

Hi There,

Do you like Commodore Plus/4? Do you like the platform games like Monty on the Run, Auf Wiedersehen Monty and similars? Ever wanna create a platform game for your Plussy? If yes, this blog is for you!

Many years ago i decided i will create a platform game for this old machine, the Plussy. This idea didn't come into reality for years. A few months ago i decided i start to make it. My idea evolved into a "larger" project. I don't make a platform game only but i will develop a "platform game creator" for the PC and a "driver" for the Plussy. So it will become (i hope) a fully data-driver game and you just replace the datablock with your one and voilá, you got a brand new platform game.

What is the "platform" game genre? When you control a guy and you can go left and right and jump and climb ladders and fall into the deep, during your travel you have to collect various items and avoid the baddies. It's a peaceful game, you won't kill anything.

So this is my goal: a PC software to produce the datafile and a Plussy software which plays this datafile. After completing these, lets create a nice game for the Plus/4 community!

I started this blog too late (some months later after project start), so i have to post some more to reach the current state of my project... Wait for more :)
There are several reasons why i write this blog:
  • to inform you about my project,
  • some day lots of platform games born with help of this project,
  • it's a self-inspiration 'coz I'm a really lazy and sometimes I lose my interest about my projects :/ But there's a stress if the whole world watches my work...
Back soon...