Tuesday, May 29, 2018

Chaos

First things first, I got a menu to pop up when you click on an item and the ribbons animate when you hover over them. Haven't done anything to make the selected ribbon more noticeable yet.


And then... chaos. You see, a friend had recently played Don't Starve over the weekend, and I was very interested in how the game's camera works. It's like 2.5D. It has a parallax effect. In all my previous versions, Ponyland is stationary; nothing moves because it's all done with an orthographic camera. I really wanted to try this parallax effect and... everything is a mess now!

The pony has been sentenced to the warped dimension:


Good-bye, cruel world...



So, what has to be done in order to achieve a 2D parallax effect is to change the camera from orthographic to perspective. But alas... this creates a lot of problems. Things are no longer just 2D. Life is no longer simple. They must now be 3D. My sprites and artwork are fine, but all the components and tricks I used to sort and order my sprites had to be changed or modified. Now instead of using 2D colliders for things like clicking on interactive objects and sprite transparencies, I must use 3D colliders. Every asset needs to be updated. That's not all though, now my raycasts need to be converted and done in a different way.

My fancy golden crosshair marker is being wonky. My dropped fruits are now stuck halfway through the ground... I need to figure that one out. Oh, and the way the parallax is done is by rotating all the sprites 45 degrees, and the camera 45 degrees as well. It's very strange to work with the 3D colliders when everything is rotated 45 degrees. It's not a thing I can eyeball, I need to test out the position of every collider in order to make sure it's working well. See Stella's cottage with 3D colliders:




I've made a branch in my version control for this parallax effect stuff, so nothing is horribly mutated from my last post to the point where I can't get it back. This 2.5D/3D work would open the door to a lot of cool things. Like... uh... this ball:



And then I made it into an eyeball. Get it?! Ahahahahaha.

But seriously, I would be able to use all three axes now. In 2D mode, I used only X and Y. In 2.5D mode, I use X as my X, but Z as my "Y" which is a little strange, but now my Y can actually be used for things like height. Woah, I wonder if I can have clouds and floating platforms? The possibilities... I haven't thought of all of them yet. But I'd be able to have towers and bridges and other cool things! Gravity actually works now too. The pony can fall off colliders.

Here's a final shot of the parallax effect.


Sunday, May 20, 2018

More inventory advances

Whew!


As you can see, stacks now work. Tool tip hovering now works. When you modify the inventory it automatically updates.


And you can drag the inventory around! You can also switch tabs but I didn't show that. So all 80 item slots should be fully functional.

Next up:
  • Menu pops up when you click on an object
  • Drag around items to move them between tabs or in another slot
  • Animate the tabs when you hover over them, and make it better known which tab you're on

Thursday, May 17, 2018

Inventory has evolved beyond the debug logs!

The inventory has evolved past just listing all items that you picked up in the Unity debug logs, into a graphical interface that actually shows you what you picked up!


Tada! Stacks don't work yet, it's very basic. A function runs and updates your inventory's icons every time you click the inventory bag icon. The close button works, and the inventory bag icon reopens it. The ribbons will be for more inventory slots, so you'll have a total of 16 * 5 = 80 inventory slots.

Turns out I need to put all my icons in my Resources folder, I was trying to be clever with my Item Editor and keep them in the same path as my Sprites folder. Unfortunately didn't turn out to work. I think it's a waste of space to have both sprites and icons look the same, so I'm debating creating vector sprites for all items that can go in your inventory. It'd make them match the inventory better.

Inventory specific goals:
  • Make stacks work
  • Make the tabs work
  • Animate the tab ribbons when hovering
  • Allow items in inventory to be clicked on for a menu that allows you to remove/use them
  • Make the bag better, make it so that when you pick up stuff while the inventory is open, it updates it right away

 Also here are some other interfaces, for the quests and notifications, that aren't in the game yet.



Friday, May 11, 2018

Player Manager has started to blossom, and some UI icons

I got the Player Manager to start working. It will spawn a pony and set up all the references correctly. This is the first step towards having the same pony when you go in between scenes.

I've started working on some prettier UI stuff, starting with some icons for the GUI. Inventory, notifications, quests, and settings icons. Here's a picture of my UI workspace in Illustrator. The dialogue/chat bubbles have been done for a while, I just haven't had a reason to use them yet. NPC dialogue and chat functionality is far into the future.


The final placement of the inventory, notification, quest, and settings buttons will probably be to the bottom right. I just liked having them to the left while working on them.

I think next I should work on a nice looking inventory interface, or at least make a placeholder one. And then start seeing if I can make it generate the icons for the items you have in there. Right now if you hit inventory it lists all the items in your inventory, or that your inventory is empty if there's nothing in there. So it works, it's just all in the debug logs.

Wednesday, May 9, 2018

Minor tweaks for various things

I did a bunch of fairly uneventful things. They're actually pretty cool... to me. But nothing worth a screenshot.

I fixed the movement target reticle so that if you drag your mouse it'll drag with it. And it used to pop up an additional time after you'd already have reached your desired location. It doesn't do that anymore.

The I had a bit of script in the player movement that determined if your player was stuck behind something and so you can't get to your desired location and it would stop moving. But it worked off of how long it had taken you to get to a place. So you could be walking for a very far distance and it would consider you stuck because you hadn't reached your destination yet. It was a fairly easy fix, I just added a velocity check. Now it works well regardless of how far you're walking.

Last but not least, I did get the items XML in the game! This is very exciting. It was weird, since you have to work with the Item Editor and some .dll file in conjunction with Unity. But I got it in, and then changed all the items in Unity to reference the item XML item ID and it's working well! I also harnessed the power of enums for the wearable items slots, which makes it so much better than using an array of booleans for each wearable item slot, when I get to wearable items eventually.

Monday, May 7, 2018

Enhanced object transparency and hair!

Hello! Long time no post. I've been busy. Just booted up the project today, hoping to work on some items XML stuff, when I got distracted by the object transparency. I had originally made it work only halfway. See, if you were behind multiple objects, it would only make one transparent. Not really helpful there. So I changed it today so that being behind multiple objects will make them all transparent.


And I've been quietly modeling some hairstyles. Hair is difficult to model nicely. Trying to make something that's many thin shapes into one giant shape that still flows nicely. Need more practice.


Left hairstyle was based on a pony I made for a Flash dress-up game called Penny the Pony. Translating from 2D to 3D is always a pain. Now you have to make things look good from multiple angles on a 3D surface instead of only one dimension on a 2D surface.

My goals remain the same - work on interiors, (I've got a sketch of Stella's interior done) work on the items XML, work on a nice inventory interface, maybe get these hairstyles in the game so my pony is no longer bald... there's so many things I could possibly work on I don't think I should list all of them. So many!