Balthazar wrote:What we did, was create a camera class that does the math as to where the top left of the screen should be in regards to the map (we had a 1024x768 res and maps that were double that). It also took into account whether or not you were near a wall, so it wouldn't start drawing the "outside" of the level (most of the levels were a box style).
I think that if we implement some camera code, we can still draw from the top left, and still have the character centred.
That sounds like a good idea to me because then we won't have to make sure that maps are sufficiently large so the 'outside' doesn't get drawn.
Now then, I wrote some code today to test what resolutions and pixel tile sizes would look right. The sprites I took from other games and scaled them to fit the appropriate tile set. The tiles I made myself because I needed something to test out this code, so don't expect the map to be beautiful. I don't feel like taking 12 different screenshots, so here is the code and images you can use to see it for yourself.
http://expert.ics.purdue.edu/~olsent/al ... oa_map.cpp
(the next images should go in subdirectory: img/tile)
http://expert.ics.purdue.edu/~olsent/al ... les.tar.gz
(the next set of images should go in subdirectory: img/sprite)
http://expert.ics.purdue.edu/~olsent/al ... tes.tar.gz
To compile and run the code:
Code: Select all
g++ hoa_map.cpp -o map_test `sdl-config --cflags --libs` -lSDL_image
./map_test
You will of course, need to have the SDL libraries installed to get the code to compile. The code is not commented because it is just a test case to see what res's would look good. Make sure you put the images in the right folders and don't rename them. Otherwise you will get a seg fault
Basically this code selects a random tile from a choice of 3 and draws a map. Then it takes 6 sprite images and places them somewhere on the map. It does this for multiple resolutions and pixel tile sizes. You will see 12 fullscreen images that cycle through in the following manner:
640x480 resolution, 32x32 pixels
640x480 resolution, 64x64 pixels
640x480 resolution, 80x80 pixels
800x600 resolution, 32x32 pixels
800x600 resolution, 64x64 pixels
800x600 resolution, 80x80 pixels
1024x768 resolution, 32x32 pixels
1024x768 resolution, 64x64 pixels
1024x768 resolution, 80x80 pixels
1200x1024 resolution, 32x32 pixels
1200x1024 resolution, 64x64 pixels
1200x1024 resolution, 80x80 pixels
After observing these screens I came to the following conclusions:
- 640x480 resolution is just too low to make things look nice.
- 80x80 pixel size is too large.
- 64x64 pixels are too large except for the 1200x1024 resolution
I think my favorite is 1024x768 resolution with 32x32 pixel tiles. 800x600 works with 32x32 tiles too, but at 1200x1024 things start to look a little small. I'm thinking of trying out 48x48 pixel tiles too, but I dunno. Tell me what you guys think about resolutions and tile squares and stuff.
On one last comment, I was playing around with the GIMP earlier and made a fireball explosion image. I built it using 3 frames so it can hopefully be animated well. I won't be butt hurt if you guys think it sucks and don't want to include it in the game, but I at least have impressed myself with it
