Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411512 Posts in 69376 Topics- by 58430 Members - Latest Member: Jesse Webb

April 26, 2024, 09:14:37 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperDesignA Newbie's Questions On 3D Tilemap World Constuction
Pages: [1]
Print
Author Topic: A Newbie's Questions On 3D Tilemap World Constuction  (Read 1901 times)
Shipright
Level 0
***


View Profile
« on: July 17, 2016, 02:45:17 PM »

Hey guys.

First up I am a beginner. I have participated in the art section of the forum for over a year but but have only been trying to implement any of it for a couple of months. To this end I have been devouring Unity video tutorials every evening. I feel like I am learning a lot but this topic is something I have not yet found my feet in.

So, what am I trying to build? I want to make an action RPG. I want it to be in a 3D world with 2D sprites for units and objects in the vein of Legend of Dungeon (or The Deer God graphically, though not game play wise). Its not a dungeon crawler but rather a wilderness setting so I want the player and units to have free movement on the world plane not restricted to tile grid hopping. The tiling is for terrain graphics and for dividing the world for mechanics like building and resouce placement (building is 2x2, has to be snapped to whole tiles. Each tile has attributes so if you "dig" on it you get one dirt, and so forth). Pixel art is the art medium and this project is broadly to serve as a showcase for my work, some of which is in the art section of this forum. Third person perspective, isometricish in camera angles.

So to this end I need a world to put all this art into. So far I have relied heavily on this tutorial series to get my feet wet:





It was very educational and I feel I learned a lot. It moves into procedural generated levels, however, and I am looking more to "paint" my tiles onto a map layer. I have nothing against procedural generated stuff, I just feel that's beyond my skills at the moment. 

So, the questions:

1.) Regarding setting up the actual world, the above tutorial went about it by creating a single plane and then manually dividing it by script so that the mesh could be used to designate tiles on that plane. The benefit seems obvious in that its one object to render, but what I can't see is how you would assign individual tile graphics to a designated area let alone how to make a tile interactive given they are all part of a single object. Is this method appropriate for what I want?

2.) The other method that seems obvious is to just have an individual game object for each tile in the game. Seems simple enough, texture each tile individually and you can make any tile as interactive as you want via scripts. Keep the workload down with prefabs. However, this seems like it would get out of control very quickly with thousands and thousands of tile objects and associated components for just a smallish map. Am I missing something here?

I have more questions but these two are the crux of getting started I feel. Do either of the above approximate how I should be approaching this?

Also, I am looking into Unity assets so if you know any that might fit the task please let me know. I have been looking at Tilepro but I don't want to drop $50 until I at least know where to start.

Thanks guys, I appreciate any help or a point in the right direction!
Logged
Shipright
Level 0
***


View Profile
« Reply #1 on: July 18, 2016, 10:21:13 AM »

Hmmm, maybe a more simple question?

Provided I go for 1 for 1 object to tile, would that feasible system resource and project organization wise? We would be talking thousands of objects.
Logged
darkhog
Level 7
**


Dragon Agent


View Profile
« Reply #2 on: July 18, 2016, 10:27:13 AM »

#2 seems to be the way to go, unless you're developing for mobile. This asset will help you cull out invisible stuff so it will run fast as well.

Of course you'd also need to make your own level editor since Unity doesn't have anything pertaining to 3D tilemaps yet (if they'll make that hackweek thing work, there may be such thing in future), but that shouldn't be too hard to do. You could even make it part of the game and load levels at runtime to make it moddable.
Logged


Be a computer virus!


I cannot C well, so I stick with simpler languages.

There are no impossible things, there is only lack of skill.
dxman
Level 0
**


View Profile
« Reply #3 on: July 21, 2016, 06:52:45 AM »

Separate objects per tile is probably the simplest way to learn, but I agree that it can quickly get out of hand. If you're looking for other options, here are two:

-Here's a series of tutorials on drawing isometric maps. It uses XNA, not Unity, so it would take a bit of translation, but at least they're both C#. Part 7 deals with tile picking.

http://www.xnaresources.com/default.asp?page=TUTORIALS

-Or, you could construct a matrix that you apply to the world coordinates, resulting in the corresponding tile coordinates, and vice versa. The following link gives the basic concept, but since you're in Unity, you can accomplish the same thing using its Matrix4x4 class. This is the option I'm going with for the isometric game I'm working on.

http://www.alcove-games.com/advanced-tutorials/isometric-tile-picking/

Either of these options should be possible to expand to multiple layers by retrieving all the layers contacted by the raycast and accounting for any offset you apply to the upper layers.
« Last Edit: July 21, 2016, 07:11:45 AM by dxman » Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic