[STEEM ROGUE LIKE]: Developing a Rogue Like using Unity and Free Assets [006]

in #freeroguelike6 years ago

In this post we will begin creating the object to contain the characters. We finished setting up the scripts so we can easily build terrain and maps in the future in the previous post [005]. This tutorial series began with post [001].

Preparing For Characters

In the previous post I mentioned we were going to move onto setting things up to handle characters. If you look at the Art folder you will notice there are many different folders to make these Dungeon Crawl CC0 characters customizable.

We want to support that.

Those are the base characters which I'll call Body in our game. They have no clothing, hair, etc. All the other folders consist of components that can be layered on top of or behind these base bodies.

For this reason we need to setup a prefab that has place holders for all of these body parts much like the ones we did for terrain.

Create and Empty object at position 0,0,0 and rename it CharacterPrefab.

Create another empty object under that prefab.

Click Add Component.

Click on Rendering.

Click on Sprite Renderer.

Right click on GameObject and Duplicate.

Repeat that process 11 more times.

Let's rename those from top to bottom as follows.

We will want to set the sorting order for each sprite renderer. Here are my initial settings for each.

Assign some sprites to the various slots if you want to see what it looks like.

Drag it to the Prefabs folder.

Open up the RLSprites script in Visual Studio. We need to add some things to it.

We add places to store these specific sprites. We also add a new string array for Character Type Definition, and Item Type Generation.

We'll define some character specific things on the character.

Items will enable us to specify what sprite an item should use if it is equipped.

We also add a CharacterPrefab object section.

Save that and rebuild it

We will define those in a later post.

What do these layers look like


I'll start with a base humanm figure.

We now will add some hair.

Then a beard.

Then the torso.

Hmmm... notice part of the hair and beard are obscured by the torso armor. We want it on top. Change the following sorting orders.

Hair 5, Beard 5, Helmet 6, and Helmet2 7.

Add boots.

Add Cloak.

Add Wings.

Add Gloves.

Add HandRight.

Add HandLeft.

Add Helmet.

Add Helmet2 (NOTE: This was created so horns and things of that nature could poke through helmets if desired).

Add Trousers.


That concludes this specific post.

If you like these tutorials and would like me to continue them please consider an up vote. Thank you.

Sort:  

I just finished a few posts, covering some noteworthy game titles released in certain years and I'd love to see how this turn out (what is the inspiration behind it)! You mind if reference your game creating posts in my blog from time to time?

I don't mind if you reference them, but not copy/paste them. Inspiration was simply something I thought about doing almost two years ago when I was making some other tutorials and I just now got back around to it.

It would be fun to do something like this in unreal 4.

Someone else can do unreal 4 if they want. I don't have time to learn a new engine plus I own tens of thousands of dollars of assets for Unity so that is where I focus. Hell I can even do it all with visual scripting since I own Bolt. In this particular example I intend to use completely free materials though. Since I am using the Dungeon Crawl CC0 sprites that I walk people through downloading in the first post, I don't see why people couldn't use Unreal 4 instead if they wanted to. :)

You really know a lot that many of us are unknown

Congratulations @dwinblood! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You published 4 posts in one day

Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

Coin Marketplace

STEEM 0.26
TRX 0.11
JST 0.033
BTC 63868.85
ETH 3063.91
USDT 1.00
SBD 4.10