Saturday, February 13, 2016

Rope Swing Test Part 2 #indiedev

Well here we are again, this time I have a video of the finished Test product. It all works rather well (as good as I had hoped). Though you will see some anomalies in the video, but they all have a good logical reason to be there.


As you can see When I attach to the Rope some times I am rotated to the side. This is in fact because I take the Rope segments rotation and put it on the player. So these segments have a rotation that puts the player on his side. In fact all the segments apart from the very last one (which is the right way up) are rotated in a odd fashion.

We now have the Rope launching out from the player in the direction he is facing and IF there is an Anchor point detected it fires directly towards it,.Pretty nifty eh!

When the player jumps off the rope you can see that he will always correct his rotation in a lovely smooth way and land on his feet, just like a cat!

This completed this test App and I have passed along the whole project to my friend. I will now do support for him until he gets the parts hooked up into his game. I hope it is soon s this app gets me excited about all the Rope Swinging possibilities.

G'night
Da Voodoochief

Wednesday, February 10, 2016

New Flower to Grow #gamedev

Firstly I am sure you will see that I have put a HASHTAG into the title of this blog post. It seems simply writing about game development is not enough to attract an audience. I would like to attract an audience for all my blogging, and I selfishly believe that some people will even find some of my posts interesting, or enlightening or hopefully entertaining. Obviously if you are reading this you probably know my posts already. So I am trying something a little different. I have noticed that many of the blogs and twitter feeds I read always use such hashtags, so perhaps I need one as well. - I will update everyone with it's results at some point.

Now onto the meat of this post.

This is my new flower as drawn by Leilani.
Looks a bit of a mess doesn't it. Looks like I attacked it with a scalpel or some such sharp device. This is what the flower looks like now I have chopped it up into it's animating segments. I need to do this so I can do a couple of animations for Very Bunny Haha, that is to have it grow from a seed and also have it Dance once it has fully grown. You should recognize the dance when I have it done (shhh spoilers).


As you can see in the above image it is from the Unity Animation frame. This is all the segments and their properties opened up to show how much work it is to animate this lovely sunflower. I have all the usual Transform properties and I also have a spriterender property on the eyes and smile, so I can make them appear and disappear in the animation. Pretty neat eh!

I already have the growing animation, and if I knew how to make a Gif of it I would. But it isn't the most interesting animation, and I think in the game it will play out over 24 hours... so ot going to be fast eh!!

I love this part of using Unity. It is using a tool to do the job that would be hard for me (heck I am a programmer really) in any other way. It is also provided for Free right there in their editor. Lovely eh.

I will get a video of the plants growing at some point from the game, but that is likely a few weeks away.

Well I am done, need some kip,
G'night
Da Voodoochief

Finger Helper Redo and Button Text

I have two things to mention today.

1.The Finger Help that I use to show people points of interest when they are new to the game has not been great. I couldn't quite put my finger on what was wrong, though each time I wanted to set and use a Finger Help I found I had issues.

There were several reasons for my having issues I now realize. One was that I could only have one Finger helper, and I simply moved that around, which caused me annoyances when trying to use it in multiple places. The second reason is that I really didn't like the way the code felt.. the class was dependent on another class creating it and yet then it was permanent etc.

I solved all my issues today though after a discussion with my daughter. It brought home the fact that I NEEDED to be able to display multiple Finger Helpers. This was then a catalyst to rewriting the code and making everything feel so much better. Now I can have this:-

As you can see in the Image above. I now have in this situation two helpers and I actually have a third just off the left side of the screen. This is very early on in the game and they al point out how you can leave this scene and get into another one. Great stuff. The code is not only cleaner, but also smaller and much more object oriented. Double Win I say.

2. Button Text
Now I have an issue currently with my buttons. Weird thing to say I reckon but let me show you the buttons I have from my Inventory overlay.
Now I placed them next to each other as the rest of the screen does not play an important role in this issue. What you can see however with these buttons is that the Cancel and Use both butt up against the right side of the button background. The button help (A and B) images are simply placed on top. That is why the Text is right side justified. I really need to leave a small border so the text does not butt up against the side, but I cannot figure a way to do that. If this was the left side then I could simply add a space into the text string. On the right side the Unity system simply ignores it. I added a '.' and that was alright, except now there is a period there, bah!

I am not sure what to do about this at all, so I will just have to leave it till I learn more or have an epiphany.

G'night all,
Da Voodoochief

Friday, February 5, 2016

Jump on Rope and Swing, Jump off with Momentum


Here is what I have been working on for me mate. So far I have the Dude attaching to the pre-animated Rope and jumping off.

When jumping off it is important to retain some of the Ropes velocity from the position that you are attached to the rope and its swing. This was a bit tricky as the rope being an animation meant I did not have any velocities to simply inherit. So what I did was to record the last 4 frames positions of the attached segment are. I then deduct them from the current position and then average them. This gives me a curve and not too sharp a set o velocities to inherit. As you see in the video it works rather well eh :) (yeah, I am pleased with this one).

Lastly when I was jumping off the Dude was rotated on his back or front and simply landed that way. This meant I had to adjust this, as he should really land on his feet. To achieve this I record the rotation when I get onto the Rope. Then I used this Rotation as the Target, and the current Rotation to Slerp with. As you can see in the video it looks like a great acrobatic jump and landing. It worked out well I reckon.

Next up is throwing the Rope out to find the Anchor.. or not.

G'night,
Da Voodoochief

Thursday, February 4, 2016

Side Project - Rope Swing

One of my mates has been working on an AWESOME logo for Very Bunny Haha (to be revealed soon).

As a way to pay him I am working on some code for him. This is my side project now and to be honest I am rather enjoying it. I am having to learn a bunch of new stuff as I have yet to do any 3D work in Unity. Of course all my 2D experience will stand me in good stead as the same principles apply only in an extra dimension. Yeah I have a lot of previous 3D programming experience doing other games).

So that image shows what I have knocked up so far. The Rope that I have attached to the Anchor sphere does an animated swing. Of course this would all be very different if the 3D hinge joint physics worked in Unity, bah!

Ok, onto this project again. I have two pink platforms that the dude is standing on, the idea is that I am going to attach myself to the swinging Rope and swing with it... then jump off when I desire and impart some velocity from the swing to my Dude.

This is going to be fun :)

G'night
Da Voodoochief

Tuesday, February 2, 2016

Improving Code because of bugs

So here I am fixing bugs when I realize when testing that I have a major bug. This one happens when you drop a quest.

You see some quests give you an item to deliver, such as a Note to deliver to Aaron from the Mayor. Now this quest had some special code to give you the Note in your inventory when you pick up the quest. It also has some unique code to handle removing the item from your inventory when you complete the quest.

The bug was that when I chose to Drop the quest this did not have any special code to remove the item. So I was left with the item in my inventory... then if I picked up the quest again I would end up with Multiple of the quest items.

When I was looking over the quest code I realized that I already have a lot of Unique code to handle all these quests that include items. hmm, perhaps there is a better way?

YES, there is a better way. I can include the Quest item in the Quest setup data. Perfect I reckon. I can just use a standard bit of code to handle the giving and removal of the quest itmes into your inventory. Then if you drop the quest the same code can easily tell there is a Quest item associated with the quest and remove that.

Well I did it, and it works GREAT!  This is one of those times where finding a bug allowed me to remove a whole bunch of code and write a much better set of code instead.

G'night,
Da Voodoochief

Monday, February 1, 2016

Bakery Update in VBHh

Leilani has been busy and finally got those darned Cake counters created (try saying that 3 times fast!). They were a bit of trouble to create, but I think well worth the trouble. A good addition to Very Bunny Haha.


As you can see the new display cabinets with more orderly cakes (compared to me previous test cakes all over the screen) is a huge improvement to this scene. I am there on the left side about to head over to Diana to buy a Pie (I need it for a quest you see).

This screen also shows off the other element I mentioned in my previous post about the Bakery. That is the random chance that a cake (cookie etc) will be destroyed upon creation. As I can set each individual items percentage in the editor it makes it easy to make more plentiful items have a higher percentage, and rarer items (such as the Massive cakes) have lower chances of not being there. This really makes the scene feel more alive when you go in a few times and see the variation.

We have the backdrop to do something with, and Leilani has several ideas for that (which is good as I have none). Then I am wondering just what kind of Music goes into a scene like this one ? Hmmm, bakery music is not a class of music if I am correct..... research needed on that score I think (pun intended!).

Have a great day,
Da Voodoochief