Game Development Community

Making tile maps with more than one layer

by Jemand den es nicht gibt · in Torque Game Builder · 09/13/2006 (7:58 am) · 6 replies

Hiya,

has anybody worked out a comfortable way to create tile maps with more than one layer? I really miss the onion skin, the way it is right now gets messy very quickly...

And another question.. has anybody tried to make a platformer where the player stays in the middle and you merely pan around your layers as the player moves? If you want to make parallax background it kind of feels the right way to do it as it is pretty hard to get the levels move correctly if the player moves around freely on a non-panning foreground and you have to get the panning of all other layers right while having them mounted to the camera.

#1
09/14/2006 (1:56 am)
Hey Oliver!

I can't answer your question regarding onion-skinning layers (though that would be *really* cool -- especially for making top-down or pseudo-isometric RPGs), but I thought I would comment on this part:

Quote:And another question.. has anybody tried to make a platformer where the player stays in the middle and you merely pan around your layers as the player moves?

I'm not *entirely* following your idea, but if I wanted to make a parallaxed platformer, I would set my game up very similar to the Mini Platformer Tutorial, and then manually move around the parallaxed background depending on how the player moved. I dunno' though -- that's just a thought.

--clint
#2
09/14/2006 (2:39 am)
I actually just got a parallax manager working in the platformer infrastructure we're developing. The player moves freely through the level and I've got things passing in front of and behind the player at different speeds (one level of depth in front, three levels behind, though it can support an unlimited number of depth levels). To give you some insight in the meantime before it's ready for the community, here's basically how it works...

Without going into too much detail, it's basically a ScriptObject with two SimSets on it: one for scrolers and one for t2dSceneObjectGroups. You can give it a target to follow (like the camera, for example), or you can manually set the base scroll speed. The parallax manager's update function is called from the scenegraph onUpdateScene callback and if there is a change in the target's position or the scroll speed it automatically updates all the objects appropriately. Right now there are two classes that work with it: ParallaxScroller for scrollers and ParallaxObjectGroup for scene object groups - they each have only initial callbacks to register themselves with the manager and a ScrollSpeed field to specify the ratio of movement when compared with the target or base scroll speed.

In the current implementation of the system a scroll speed of 1 means it tracks the camera exactly. A scroll speed between 1 and 0 appears to be at a depth behind the player's movement plane, and a negative scroll speed appears to be at a depth in front of the player's movement plane. A scroll speed of 0 would mean the object doesn't move (it will appear to stand still as the camera passes), though there would be no reason to set this because if the object doesn't need to scroll there's no reason to add it to the parallax manager in the first place.

Hopefully this gave you some insight into how to design a parallax system for TGB . If you have any questions feel free to ask.
#3
09/14/2006 (2:47 am)
Thanks for the quick reply, guys!

@Thomas: Thanks a lot for the insights... I think that will get me started! I think I will start making something similar next week for my upcoming game. :)


This community is great.
#4
09/14/2006 (6:52 am)
@Thomas: What is the scope of the "platformer infrastructure"?

I'm working on a commercial platform game with Michael Woerister, and we're considering making a code pack based on it. It includes not only a parallax system but game state management, a powerful entity system, player profiles, gamepad-ready menu system, control configuration management, AI framework, and a metric ton of other core functionality for any scrolling game (most of it integrated with the TGB editor).

So, I was curious if we should stop considering offering this as a potential product since it might all be built into TGB in the near future?

Thanks!
#5
09/14/2006 (10:15 am)
Thomas... is this a potential 1.1.2 feature?

If so (1) YAY!!!!, and (2) will the parallax manager have any effect on the zoom function? (Meaning backgrounds zoom slower, foregrounds zoom faster, and if set to 0, the background doesn't zoom at all.)
#6
09/16/2006 (7:39 pm)
@Thomas, excellent, thats EXACTLY what I was doing, and it looks really good (with 10 parallax backround). I feel flattered, since I'm pretty noob and must've done it almost all by myself ^^

Can't wait for the tuto, because I won't have do it myself in TDN xD