USING PANORAMAS AS BACKGROUNDS IN XP - SCROLLING PROBLEM (AND A TILEMAP PROGRAM YOU MAY FIND USEFUL)
Posts
Pages:
1
Im not so much as asking for help in this thread as I am giving it. I recently tried using a panorama in place of a tilemap background but I ran into a problem immeadiately and I feel it's a problem many people might experience so I decided to post the fix that I found.
The Problem
Collision tiles in the editor lined up fine with panorama tilemap at first however the moment the map scrolls they become misaligned. This causes problems when you are trying to use transparent tiles for collision.
The Solution
I looked through the game scripts and found the problem. Basically the misalignment is caused by the panorama being scrolled at a different rate than the normal tilemap that you make in the editor. This gives a nice effect for normal panoramas and gives the illusion of depth but when you want to use panoramas as your background, it causes problems. Thankfully this is easy to fix. In the Spriteset_Map script you will find the following lines:
# Update tilemap
@tilemap.ox = $game_map.display_x / 4
@tilemap.oy = $game_map.display_y / 4
@tilemap.update
# Update panorama plane
@panorama.ox = $game_map.display_x / 8
@panorama.oy = $game_map.display_y / 8
As you can see the panorama is scrolling at a different rate to the main tileset. In order to fix this we would simply change the eights to fours as so:
# Update tilemap
@tilemap.ox = $game_map.display_x / 4
@tilemap.oy = $game_map.display_y / 4
@tilemap.update
# Update panorama plane
@panorama.ox = $game_map.display_x / 4
@panorama.oy = $game_map.display_y / 4
And this fixes the problem. This is just a quick fix but it should work fine for most people. I'll probably post a more sophisticated method at some point in the future.
Tiled - A free, open source, cross platform tilemap editor
The reason I did all this is because I found a free, kickass little tile map editng application called 'Tiled'. This program let's you import multiple tilesets, divides them into tiles and allows you to make tilemaps out of them which can then be exported to images.
This is great form RMXP users as we can use the program to create tilemaps with far more layers than the usual 3 (or 4 if your creative) in RMXP. It also means you can easily mix multiple tilesets from RTP and others. I had this problem a while back when trying to use the RTP mining tracks in a cave level and ended up having to use photoshop to splice the tilesets together. The result was ok but i had issues with transparency due to the exporting as you can probably see yourself:

If you zoom in you'll see the windows are grainy and I couldn't use the normal 'track entering cave' tile as it looked wrong with screwed up transparency. I also was forced to use the event layer as a fourth tile layer in some places. Had I used tiled for this map, all of this hassle could have been avoided.It let's you make those kind of maps easily for example:

Thank you for reading, I only posted this topic as I felt it might help people with the same problem that I had. And if anyone is wondering about Tiled, its free, open source, cross platform and can be found here: http://www.mapeditor.org/2010/04/this-release-adds-lot-of-new.html#comments
Cheers.
The Problem
Collision tiles in the editor lined up fine with panorama tilemap at first however the moment the map scrolls they become misaligned. This causes problems when you are trying to use transparent tiles for collision.
The Solution
I looked through the game scripts and found the problem. Basically the misalignment is caused by the panorama being scrolled at a different rate than the normal tilemap that you make in the editor. This gives a nice effect for normal panoramas and gives the illusion of depth but when you want to use panoramas as your background, it causes problems. Thankfully this is easy to fix. In the Spriteset_Map script you will find the following lines:
# Update tilemap
@tilemap.ox = $game_map.display_x / 4
@tilemap.oy = $game_map.display_y / 4
@tilemap.update
# Update panorama plane
@panorama.ox = $game_map.display_x / 8
@panorama.oy = $game_map.display_y / 8
As you can see the panorama is scrolling at a different rate to the main tileset. In order to fix this we would simply change the eights to fours as so:
# Update tilemap
@tilemap.ox = $game_map.display_x / 4
@tilemap.oy = $game_map.display_y / 4
@tilemap.update
# Update panorama plane
@panorama.ox = $game_map.display_x / 4
@panorama.oy = $game_map.display_y / 4
And this fixes the problem. This is just a quick fix but it should work fine for most people. I'll probably post a more sophisticated method at some point in the future.
Tiled - A free, open source, cross platform tilemap editor
The reason I did all this is because I found a free, kickass little tile map editng application called 'Tiled'. This program let's you import multiple tilesets, divides them into tiles and allows you to make tilemaps out of them which can then be exported to images.
This is great form RMXP users as we can use the program to create tilemaps with far more layers than the usual 3 (or 4 if your creative) in RMXP. It also means you can easily mix multiple tilesets from RTP and others. I had this problem a while back when trying to use the RTP mining tracks in a cave level and ended up having to use photoshop to splice the tilesets together. The result was ok but i had issues with transparency due to the exporting as you can probably see yourself:

If you zoom in you'll see the windows are grainy and I couldn't use the normal 'track entering cave' tile as it looked wrong with screwed up transparency. I also was forced to use the event layer as a fourth tile layer in some places. Had I used tiled for this map, all of this hassle could have been avoided.It let's you make those kind of maps easily for example:

Thank you for reading, I only posted this topic as I felt it might help people with the same problem that I had. And if anyone is wondering about Tiled, its free, open source, cross platform and can be found here: http://www.mapeditor.org/2010/04/this-release-adds-lot-of-new.html#comments
Cheers.
Pages:
1














