Hello Guest

Author Topic: [Solved] Confusion Concerning What 2D Toolkit Brings To The Table.  (Read 4348 times)

brianjenkins94

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Hello again, to that one guy who seems to be answering all the support questions,

I have a rather vague, amateur question to ask, as I am one of those "developers" biting of more than they can chew.

My childhood dream has always been to make the next best RTS modeled after WarCraft 2, an orthographic, top down, simple sprite-based game, and until Unity came around I never seemed to have the ability to bring that dream to fruition. Now that I can, and now that I'm equipped with both Unity and the highly acclaimed 2D toolkit, I've been dabbling and rejoicing in my minor successes -- so I must ask for for you to indulge me for the moment, as apart from a decent foundation in C# and Javascript, I am certainly a beginner.

My question lies in the overall ideal structure of a 2D RTS. Dabbling with Unity I've been able to create a plane the size of the release target resolution, and a camera that is directed perfectly at it. With the addition of 2D toolkit, I have been able to make a 32bit grid of terrain sprites to serve as the backdrop, with the intentions of creating the UI in between the camera and the tilemap. Here's where I hit a wall. I understand how to go about creating objects in 3D space in order to give them each their own attributes and functions, but as far as a tilemap goes, I am uncertain.

My question is what would be the best way to go about implementing an interactive set of sprites in a way that also allows me to treat them as independent objects. Should I simply create the individual sprites to move around in free space? Should I continue to use a tilemap? Is there a way to place objects on a tilemap and to be able to assign them properties and scripts, as you would in 3D?

Hopefully you understand my confusion, but I would imagine a well thought out answer from an expert would certainly put my back on track.

My apologies if I seem entirely too underequipped to take on such a project, bare with me.

 - Brian Jenkins
« Last Edit: June 14, 2013, 02:03:06 pm by brianjenkins94 »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Confusion Concerning What 2D Toolkit Brings To The Table.
« Reply #1 on: June 14, 2013, 11:45:42 am »
How I'd start with something like this:

0. Use an ortho camera to start, don't attempt this with a perspective camera. The camera wants to look straight down.
1. Use the tilemap for the background "terrain". Rotate the tilemap object (not the render data object) so it lays flat on the ground (XZ plane). Rotation = (90, 0, 0)
2. Create sprites for placeable objects, trees, etc. Place these manually as individual sprites in front of the tilemap. Make sure you have the appropriate colliders for these. These will be static for the most part - they could be animated visually, but that doesn't change how its configured. You will need to rotate these in the same way as the ground in #1.
3. Units, etc. will be the same as #2 above, but you attach your custom coded behaviour to them and have them move around the world.

ps. the reason for recommending straight down, is simply that you can use the Unity character controler for some basic movement. Ultimately you'll probably have to code this up yourself, but this might give you a good start.

brianjenkins94

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Confusion Concerning What 2D Toolkit Brings To The Table.
« Reply #2 on: June 14, 2013, 02:02:26 pm »
That's exactly what I was looking for. Thanks so much!