Rather new to the website and wanted to take a minute to ask a few questions.
Currently in my free time, I am rewriting the game "The Legend of Zelda: The Minish Cap" using only the allegro library. This has proven to be interesting. You quickly realize the limitations and advantages.
Now on to my questions:
Has anyone thought of or seen a collision routine that is based on a tile engine? For instance:
// Pertaining to the map
int map[10][16] =
{{ 1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 0, 0, 0, 0, 0, 0}...
// Pertaining to collision
int collide[20][32] =
{{ 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0...
Where 1 would equal collision, 0 would equal a non-colliding square.
Pixel perfect collision isn't really something that I have to be aware of in a project like this. For instance, Nintendo uses 16x16 tilesets and 8x8 collision squares in The Minish Cap.
Question 2:
I coded an animation routine from scratch when starting this project that simulates the routine used in the actual game quite well, however, would anyone recommend other animation routines? Examples welcomed.
Question 3:
I am completely new to the Allegro Library as well as the development of video games. My basic goal in this project is to learn. For instance:
Nintendo's Game Boy Advance has a screen size of 240x160 pixels. The Minish Mask uses maps that are 1024x1024, 512x1024.. (many different sizes) with 256x256 loaded into memory at a time which brings me to my question. What is the best way to implement scrolling maps?
Question 4:
Obviously a lot goes into something like this. Most people outside of the C/C++ (or any other programming) language have no idea how long and tedious it can be to code a program of any kind, much less a game. The hours of debugging alone are enough to make you want to jump from a building. So my final question is what type of conventions do you commonly use when designing a game to make the flow of the design move at a steady pace?
Thanks for taking the time to read this.
Question 4: Hm, Not sure I totally get what you want.. I know some tools and method to use to debug, ie: gdb, electric fence, dmalloc, valgrind, ddd, printf, etc.
And now for something completely different: When I first read your name, I saw "Cleese", then I saw your first name started with a J And I was like "OMG its John Cleese!"
1) Err... the collision map is larger than the map itself?
2) Increase an animation counter each logic cycle. When this is over a specified threshold, go to the next frame. Or what did you mean?
</li>
/* basic tile engine thingy */ BITMAP *tile[MAX_TILES]; /* array of tile bitmaps */ int map[MAP_YSIZE][MAP_XSIZE]; int camx, camy; /* current camera x and y position, in pixels */ int x, y, offsetx, offsety; /* calculate an offset to draw the tiles with, so we can scroll by increments < 1 tile large */ offsetx = camx%TILESIZE; /* (= camx mod TILESIZE) */ offsety = camy%TILESIZE; for (y = 0; y < SCREEN_H/TILESIZE + 1; y++) for (x = 0; x < SCREEN_W/TILESIZE + 1; x++) draw_sprite(screenbuffer, tile[map[camy/tilesize + y][camx/tilesize + x]], x*TILESIZE - offsetx, y*TILESIZE - offsety);
Actually, the collision map is the same size as the tile map, it's just drawn in 16x16 pixels where the tile map is 32x32 pixels. When doing the layering, this allows for the sprite character to appear to be standing directly against a wall by actually putting the sprite 16 pixels on to the tile.
And thank you very much. As I stated earlier, this is my first attempt at doing such a thing and where it seems to be logical to follow the method described, I was unsure if it was considered common practice.
Ah, my bad. Didn't read your original post closely enough
On a side note:
While reverse eng.... err... playing around with The Minish Cap, I found something interesting. If you take 0x02002af4 and apply the value 16 to it, you will be equipped with a magic wand that is not located in the game. It's a debug wand that allows you to change the tiles. Use it from the beginning of your game to access nearly the entire world map before ever entering Hyrule Town.
Call me illiterate, but what Zelda is this? I don't think I've ever heard of this one... enlighten me!
Thought I would show an example of the engine I am coding to simulate this game. Comments and suggestions on how to improve it welcomed.
This is a simple test that walks the main character around the screen.
Smooth scrolling has been implemented and collision detection has begun. Included is the compiled executable, one created using Dev-C++, the other using Microsoft Visual Studio 6.