BooGame and Tile Studio

posted in Reminiscence
Published May 17, 2006
Advertisement
After hacking at it for about three hours, I finally got Tile Studio working quite nicely with BooGame. I used its code output feature to output script files which are then interpreted by BooGame during runtime. Here's a shot of BooGame's new ScrollDemo example:


Download Latest Build

If you download the latest build, you'll see that you use the arrow keys to move the screen around. The moving background gives a neat effect. Unfortunately I'm extremely puzzled with the animated water tiles at the bottom right of the map, I'll take a look at those later. Big thanks go to Scet on this one.

Although it might be only on my system, OpenGL misses a few pixels with the tiles. I'm not entirely sure how to fix that, but I'm sure I'll find something.

SourceForge seems like the best place to host BooGame, so I submitted a project submission form. I would host it on my own site, but SourceForge gives you a load of project management resources which are very nice for open source solutions. I should have everything moved over by next week. Until then, enjoy!

Random Interest


The Iceberg
Previous Entry Lack of Updates
0 likes 4 comments

Comments

Scet
What problem(s) are you having with the animated tiles?
May 17, 2006 05:31 PM
Rob Loach
I just don't understand how Tile Studio sets up the sequence data. Right now I think I have the sequences outputed to an animation, but I'm really not quite sure how it works to say how it displays in the tile data.
May 17, 2006 11:24 PM
Scet
Each sequence is just two arrays of the same length, the length being the number of frames. One is for the tile indices and the other for the frame rates. The tile indices work the same wall as the ones used for the map data, 0 is nothing and the others reference a tile in the sprite sheet. The "frame rate" array represetns how many frames each frame of the animation should be on screen, however frame based timing sucks so you might want to think up another method.

Here's some pseudo code(might explain things a little better)

int Length = 10; // animation is 10 frames long
int Indices[10];
int Rate[10];

int Count = 0;
int CurrentFrame = 0;


Render() // called once per frame
{
	if( Indices[CurrentFrame] != 0 )
	{
		DrawTile( Indices[CurrentFrame] - 1 ); 
	}
	Count++;
	if( Count >= Rate[CurrentFrame] )
	{
		Count = 0;
		CurrentFrame++;
		if( CurrentFrame >= Length )
		{
			CurrentFrame = 0;
		}
	}
	return;
}


Oh yeah, for sequences in maps like the water there. If you come across a tile number that's negative that means it a sequence. The sequence to draw is the positive version of that number. So something like this:

DrawSequence( Abs( MapData[y][x] ) - 1 );

Be sure that you're reading them into whatever array you have in the right order. The numbers Tile Studio uses reference the order it was output. So a map tile with the value of -1 represents the first sequence in the file.
May 18, 2006 06:32 PM
Rob Loach
Quote:
Abs( MapData[y][x] ) - 1
AHAH!! That's what I was missing!!! Thanks a lot!
May 19, 2006 12:31 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

Been a while!

1295 views

Hello XNA

1553 views

Pong!

1386 views

Busy * 2

1152 views
Advertisement