Irregular Tile Shapes
by Bryant Schaper · in Torque Game Builder · 04/15/2006 (8:18 pm) · 8 replies
I am interested in making a game similar to Europa Univeralis and such. They have a top view of Europe/Asia/Africa and break the world in their smaller pricipalities, I have been looking at how to do this with T2D but am not sure where to start?
The layout of most of these style games are very similar, they provide a world map, and you interact with the territories, and the units or buildings. I think I can just place the units and buildings in a defined position in each territory on a seperate layer, but how would I handle the territories themselves. It would be nice to be able to click anywhere except on units/buildings in the territory to bring up the territory info.
The layout of most of these style games are very similar, they provide a world map, and you interact with the territories, and the units or buildings. I think I can just place the units and buildings in a defined position in each territory on a seperate layer, but how would I handle the territories themselves. It would be nice to be able to click anywhere except on units/buildings in the territory to bring up the territory info.
#2
If I were going to create smaller version of each territory, I could piece them together like a giant puzzle.
T2D should support this, I am not concerned about collisions with the territories, just so they match up. I'll have play with only a small number of territories to get the feel. If I can do it with 5, I should be able to do it with 105.
04/17/2006 (11:19 pm)
Thanks, I was thinking I was going crazy with the T2D to figure this out. I think I see what your saying, but without providing a coordinate system for every point it seems hard.If I were going to create smaller version of each territory, I could piece them together like a giant puzzle.
T2D should support this, I am not concerned about collisions with the territories, just so they match up. I'll have play with only a small number of territories to get the feel. If I can do it with 5, I should be able to do it with 105.
#3
06/10/2006 (4:31 pm)
You could just line them up in the map editor and load the level.
#4
06/11/2006 (11:06 am)
I would use a sprite for each territory, having them all fit together when placed on the screen so they appear as a single map. Then you can define collision polygons based on their shapes to know when the mouse is over each one. Use .setBlendColour() to darken/brighten/color them as the mouse hovers over each one. It's basically a kind of simple GUI system.
#5
If you have concave shapes, you'll need to mount multiple objects to the sprite in different places in order to cover the shape properly. Or get creative with the art and have convex shaped territories :)
06/11/2006 (11:57 am)
But only if your maps are convex :)If you have concave shapes, you'll need to mount multiple objects to the sprite in different places in order to cover the shape properly. Or get creative with the art and have convex shaped territories :)
#6
06/12/2006 (7:55 am)
Good point, Philip.
#7
I thought using square shapes for the territories, and then placing the actual map of the terrirtory in the square. I could then use layers and have the collision occur at the top most layer and assume this the right map location.
I have yet to program this, but it seems to complex of a solution for something so simple. Plus, I just feel something stupid will happen when I try.
06/12/2006 (8:54 am)
I had thought the same thing, and the convex/concave issue came up.I thought using square shapes for the territories, and then placing the actual map of the terrirtory in the square. I could then use layers and have the collision occur at the top most layer and assume this the right map location.
I have yet to program this, but it seems to complex of a solution for something so simple. Plus, I just feel something stupid will happen when I try.
#8
Just get a picture/png of the complete map exactly how you want it, create it as either a background or staticsprite that fills the entire camera. Then just put an invisible square staticsprite in the middle of each one. THAT is what you really click on to select it or whatever. You cant just click anywhere, you have to click in the middle, but if its consistently like that for every territory it shouldnt be a problem, plus if you want you can make the sprite have the name of the territory on it, then its intuitive, you click on the name. And instead of highlighting the whole territory to show it can be clicked on, just change the mouse pointer to a hand or something to show the text is a button, or put some little particle effect around the mouse pointer.
You could definitely do the text/buttons with GUI items instead of staticsprites but since I know nothing about GUI I cant tell you how to do that =D
Thats how id do it!
06/18/2006 (12:24 pm)
Heres a simple way to do this.Just get a picture/png of the complete map exactly how you want it, create it as either a background or staticsprite that fills the entire camera. Then just put an invisible square staticsprite in the middle of each one. THAT is what you really click on to select it or whatever. You cant just click anywhere, you have to click in the middle, but if its consistently like that for every territory it shouldnt be a problem, plus if you want you can make the sprite have the name of the territory on it, then its intuitive, you click on the name. And instead of highlighting the whole territory to show it can be clicked on, just change the mouse pointer to a hand or something to show the text is a button, or put some little particle effect around the mouse pointer.
You could definitely do the text/buttons with GUI items instead of staticsprites but since I know nothing about GUI I cant tell you how to do that =D
Thats how id do it!
Torque Owner Paul Fountain
I'm just a beginner with T2D, but I'm going to venture a guess that you would want to use one big graphic that shows all of the territories. Then you would want smaller individual graphics for each territory, in a slightly different color. Then when you rolled the mouse over a territory, you would swap out the individual graphic for that territory so it "lights up". The specifics of how to accomplish it are beyond my skills at this point .. but these forums and TDN probably have all the info you need.