torsdag den 31. december 2015

Animation Events

One of the things I wanted to add in my game was stuff like particles whenever the characters feet hit the snow, and arrows firing at a cetain point in an animation.
Now, originally I would have maybe attached a collider to the foot of the character, and when that hit the ground-plane a particle effect could be created - alternatively, a complex timer-system could be set up.

Researching this, I found that inside the Animation editor is a button which allows you to call a function of the script of the object which holds the animation: This way, I had merely to create the function and set this so called Animation Event when the foot of the character was at its lowest:

The animation events can be seen as the red circles on the top bar.

This is immensely useful (and cool), and I can't wait to apply it to all sorts of things - a gun-firing animation, throwing an object and so forth.
For now, while it's hard to see from an image, the particle effect in this particular gamemode looks like this (its the white thing at the characters feet):

Twitter and unity

A crucial aspect of indie-game developing is simply getting noticed. To that end, I wanted to include buttons to post to facebook and Twitter for example, so if someone liked the game they could tell their friends about it.

I had no idea how to go about it, but I found a very helpful tutorial here: http://unity3dtrenches.blogspot.dk/2014/02/unity-3d-how-to-post-to-twitter-from.html

Essentially, when you click the twitter button when the game is over, it invokes a link with a String directly from unity; I create a string using Unity's ToString() function along with the points of the player, and simply use the following code:


function ShareToTwitter (textToDisplay : String)
{
Application.OpenURL(TWITTER_ADDRESS +
            "?text=" + WWW.EscapeURL(textToDisplay) +
            "&lang=" + WWW.EscapeURL(TWEET_LANGUAGE));
}

with ShareToTwitter being the message along with a link to our game studio facebook page (https://www.facebook.com/sundogstudios)

Game Scene, GUI and particles

Here is an image of the game-scene from my game Jingle Hells in which the previous painting is used - the player catches naughty children and the children then hack out a creature from the glacier.



I included this image to show off the GUI, the animated children and the particle snow effects.
Now, this game was made in Unity, and usually, when wanting to have particles on top of a flat drawing, I would take a Quad and just add the image as a texture or Sprite, then scale it to fit the screen. However, this is probably that bad way of going about that, as I believe you cant be totally sure if it scales or is displayed properly. The right way of going about it, when the background is a flat 2D image, is to use GUITexture to display it, and it will always be displayed totally perpendicular to the screen.
Now, GUITexture is always at the very front of the image - you can, as is the case with the children and the Back button above, increase or decrease that certain objects z-value, and it will be displayed in front of- or behind whatever you want. However, this trick does not work with the Particle system, so in order to display this in front of the background, I had to add the particles to their own layer, create a second camera which would only view the particles and was set to depth only, remove the GUI layer from particle camera and give it a different depth value than the original - quite complex, but it was a great relief when it started working!


Mountains again

The mountains I ended up using (while not necessarily done) for my gameproject look like the following:


It's a bit blue right here, but I think there are some nice shapes in there. It ended up being a mishmash of techniques from Bob Ross, the Alphonso Dunn technique I linked to earlier, a little bit of Draw with Jazza (https://www.youtube.com/user/DrawWithJazza) and some from FZDSchool (https://www.youtube.com/user/FZDSCHOOL/videos) - in the end, it was done really quickly because I didnt have time, but it looks pretty good I think - I am extremely unfamiliar with using brushes for textures and the like, but this time I just increased/decreased the size on the brush I was using to paint with anyway, and tapped it in with my mouse before erasing some of it.

I used the same technique on the following painting; by far the largest part of it was done using Feng Zhu's method of painting everything on one layer, and it was actually quite a pleasant experience. However, when getting the picture ready for my game scene, I ended up using some layers so as not to screw anything up; First picture is purely FZ, second part has the texture from the brush and the layers.




I had immense issues with painting the glacier to the left - I looked at reference images and tutorials, but getting that 'ice'-feeling with translucency and wet edges and so forth was really difficult. In the end, adding the white cracks really helped a lot I think

fredag den 11. december 2015

Schoolwork # ? - Mountain

Behind on a lot of posts - have got a lot planned, but havent gotten around to actually doing any.

I am working on trying to figure out how to draw a mountain, and it is proving really tricky actually.
I have done a bit for some games I have done in the past, but I was always just winging it untill I was satisfied, and that is kind of a bothersome process. I spotted some great, simple-looking ones in the new promo for Blizzards Hearthstone game, and so I wanted to try my hand at drawing them.

Picture can be found here:
http://bnetcmsus-a.akamaihd.net/cms/blog_header/zk/ZKCH8U1GKZEI1449535411171.jpg

I tried figuring out how to do it just by hunch



but was really satisfied - going back to it, the one on the left holds a bit of promise, but I think the shape is wrong. I watched tutorials on youtube, more specifically by Alphonso Dunn (https://www.youtube.com/watch?v=jij8NTSJ10I), and so tried to draw the shape and shadows of the mountain before applying colour:



but I thought that almost looked worse. I gave it one last shot before moving on to other things, drawing the whole mountain from the start complete with how shadows and light would fall, and it turned out OK, but it is kind of charmless

:

I will keep on trying to get it right and will post results.

Happy Friday!

Edit:

I tried a quick 5 minute mountain inspired by how Bob Ross paints, and ironically, this turned out the best I thought. I did it without pen pressure because the driver went bonkers, so it would look even better normally. Perhaps there is potential here, but I think I'd prefer a less gung-ho approach.

mandag den 9. november 2015

Schoolwork #2.5

Just throwing in a bit of the models here - made it in Maya, took a square and added divisions, then used sculpt geometry. Probably the sort of thing you could use Zbrush for, but I have no experience with that, and no time to do it.
Cut the model in half and modeled the horn via extrusions along a curve, and then I copied it.


It ended up looking rather decent - obviously I would rather it was a complete statue complete with ominous stony robes a la  these guys: http://img2.wikia.nocookie.net/__cb20131119155908/wow/hu/images/9/93/Wow_wallpaper_dark_portal_by_goodbadboy-d5fkk27.jpg

but have not the know-how. Or time.

sorry...