Saturday, July 26, 2014

The Rise of Dagon: Week of July 26 Update

This week I initially had decided I would dedicate to learning rather than trying to focus on getting a feature in and allocating enough time to actually get some learning done and potentially failing at a both..

So I did some research and found I was in a particularly odd spot in that I wasn't sure what level of learning resources I really needed? I was specifically interested in learning more about the very specifics of Unity 3D development and it was hard for me to self-evaluate if I'm a 'beginner' or sliding into 'intermediate' area when it comes to Unity 3D specifically.

I do know I'm constantly confuzzled by the way Unity 3D does things, its component oriented approach doesn't always make sense to me.

Having to type things like :

"messageSystem = FindObjectOfType(typeof(MessageSystem)) as MessageSystem; "

Constantly throws me off.

I want to type:

"MessageSystem messageSystem  = new MessageSystem;"

But again dealing with Unity's component system throws me off. And I'm never quite sure that I'm doing things right or just using a shoe-horn approach to get the functionality I want rather than doing things properly in Unity 3D!

So I decided to start with a beginner book - there's a lot of value in learning the basics, and learning them well!

After some checking around I settled on Unity 4.x Game Development by Example Begginer's Guide

I've wanted to try some of Pakt publishing's title's and I was able to get the Kindle version on Amazon at a very nice price.

I did the first six chapters this week and here are my thoughts on the book so far:

Pros:
- The book is written in a very witty style that keeps it from being too try.
- The author seems to have a solid handle on what challenges beginners will have like taking on projects that are too large, and does a good job attempting to demonstrate why those are a bad idea; and gives good suggestions on how to create a manageable project.
- The code examples seem to work (hey its worth noting; in some books they don't!)
- It really does approach from the base line for the beginner.

Cons
- It claims to have Javascript and C# , which it sort of does - but if you want the C# examples you have to go to the end of the chapter.  Which makes the read very disjointed.  I'm not interested in Javascript for Unity 3D at all so this is a really irritating factor.
- The book really is very basic ; I think it really is for the true beginner. As someone who is approaching intermediate I'm beginning to feel that the book may not have a lot to offer me.

I would definitely recommend the book to a beginner interested in using Javascript in Unity 3D.  If you were interested in C# and have the patience to scroll back and forth for C# I would still say its a good book.

Finally I do in fact have a development update! After doing 6 chapters in the book I took a break and put in LERP movement for the player.  Previously the player used to 'snap' forward to the new position, but by using a LERP between the two positions the now move forward smoothly which both looks nicer in general and gives the perception of 'moving' a lot more than just snapping forward.

I made a quick video to show it off here:
Thanks for reading, see you next week!

Sunday, July 20, 2014

The Rise of Dagon Update Week of 7/19/2014

Greetings folks, hope you had a great week!

This week I focused on trying to get combat in for just one enemy and one player.  Eventually of course I'll have to handle the 4 players and as many enemies that might be able to be in the immediate vicinity around you - but I like to take things one step at a time to avoid over-confusing myself.

I created a basic enum for player and monster states in the behavior classes for the player and in this case the melee skeleton we'll be testing and then made sure that they were able to pass back and forth some variables to let each other know its the other ones turn.

I also created a really simple messaging system to print out on the screen some basic info about the combat as for now I didn't want to get into programming out the buttons dimming when its on cool down , and then worrying about a global cooldown timer and such.

Right now its purely turn based. You go, monster goes, you go monster goes -- until someone is dead.

And here's a quick video to show it off:



Speaking of not wanting to work on the gui elements .. I really am doing my best to wait for Unity 3D 4.6 release until doing very much UI work. I did make some player bars (as you can see from the video) but this is all band-aid stuff until I get my hands on the new tools!

I do not want to go through writing a character creation screen, level up screen, inventory management, merchant buy/sell screen's etc and then have to refactor it all in 2 months (or less??) when the new UI system comes out.

That's pretty easy to leave for now as there is just such a mountain of work that needs to be done -- the UI only has to work the tiny bit that requires for me to move forward with the core gameplay right now. Also the level editor I want to write really needs to wait for the new UI also. I could certainly make some progress on it as its not as important as the player's UI ; but honestly I'm going to be using it  A LOT. I'd rather have nice tools to use rather than kludgey ones!

 Hopefully Unity will not drop the ball and make it take a year though -- obviously any kind of delay of that magnitude and I will have to "roll my own" or buy a solution from the asset store.

I've started to become pretty overall unsatisfied with most Unity asset store purchases that aren't actually 3D models though ..around 80% of the asset's I have are cumbersome to integrate and do not work the way I would like to. Usually after I get too far into integrating it I realize its not worth the work and take it back out and write my own stuff.

I think the only thing that's been a flat out win so far is the Sonic Ether Natural Bloom asset.  I don't plan on stopping to buy assets ; I have actually learned things by buying them -- like what not to do sometimes!  Also they've given me ideas about how I might like to approach something as it gave me insight how the other person did it.  So I don't think assets are useless or anything, but I do find myself not using them that often.

Finally if you've got a really keen eye you may notice I've tweaked the tone mapping on the camera again.

Previously I was using an 'adaptive' tone mapping script which is like in Half-Life (or other more modern games) where at first when you go in a bright area its "too bright" and then it would 'tone down' after x seconds.

I ended up feeling that was just too much for this style of RPG and now I swapped to a "photographic" tone mapping.  One side effect of that is the photographic one seems to have a better white/dark level in it so I'm a tiny bit happier with the lighting levels in general.  I reserve the right to tweak it a dozen more times .. especially if I can pick up Unity 5 and do the phyiscally based shaders!

Thanks for checking in. See you next week!

Saturday, July 12, 2014

The Rise of Dagon: Week of 7/12/14

This week was a nice recovery from the previous week where I was blocked for almost the full week with a Unity 3D / Monodevelop bug where breakpoints did not work.

Thankfully +Carl Pinder had the winning reply which solved the problem:

"This is going to sound like a superstitious practice, but it does work. 1) Add some garbage text to your file, e.g. "asdasdasd". 2) Save the file and switch to Unity. 3) Unity will promptly error the compilation of your code. 4) Undo the garbage text and save. 4) Switch to Unity and breakpoints will magically work again."

So here's a big 'thank you' to +Carl Pinder !  It's great when a community can help get you through things like this.

So afterwards I was able to take another step forward linking the prefab logic with the game logic layer and we have here a screenshot demonstrating the properties of the wall being passable or not in the debug output:




Also I'm going to provide a zoom in detail image; another feature I started on is a baseline character and class system to go along with the UI elements I have previously shown.

At this time I'm hard coding a Warrior, Mage, Rogue, and Healer. 

(While I'm sure we'll have some variant of these classes in the final game the names may change.)

So if you check the detail you can see that I've instantiated each of the 4 GUI HUD bars to one of the 4 classes and printed at text object above it to show which class it is for now.



Eventually I'll make it so mana bar's dont show for non-magic using classes as well as other tweaks so that your HUD bar for each character has some custom elements that are needed for the repsective class. For instance I'm really interested in improving the way that caster classes interface in these kind of games!

Finally after having gotten the above two things done I spent some time refactoring some of the Level Logic to make it better organized and maybe a little bit more performant (especially for the way Unity / C# work).

Unfortunately I ran in to a snag, I was trying to add some items to  List which is part of the collections available in C# but it didn't appear to be working. Furthermore as I attempted to type "List" the intellisense (or whatever the autocompletion feature is called in Monodevelop) kicked in and tried to tell me I should use an IList or a ArrayList.   

The snag ended up being that I trusted Monodevelop that this was actually right ; that those were the collections that were available in Unity 3D and that I couldn't actually use a List!

So I continued trying to implement my feature; not having it work and having other minor issues I left it overnight and the next day was relating my experience to one of my co-workers who immediately perked up and said "OH YEAH!" That happened to me too!

Then he related "You just have to add 'using System.Collections.Generic' to do that!".

Then we both proceeded to be very dissatisfied as learners of Unity 3D how Monodevelop doesn't do the same thing that Visual Studio or Eclipse IDE's can do!

Now of course I know better; but as someone who is learning having a Intellisense style feature that helps you bring in the proper imports and check your syntax (properly) is really useful to lowering your learning curve.  Obviously it cost me one evening of grief to get over that -- but even knowing it is there I'm sure I will have a little bit more learning curve ahead of me now that I know Monodevelop does not have my back here!

That's it for this week. Thanks for reading!



Monday, July 7, 2014

The Rise of Dagon Week of July 5th - AKA Unity + Monodevelop breakpoints are killing me!

This week's development update post is a few days late and a little bit melodramatic but its where I am at -so that's what you get for reading!

To be honest due to the holiday and house hunting last week I was only able to do much work on the previous weekend but even that time was madly dominated by Unity / Monodevelop problem where breakpoints show as dimmed out and can not be hit (see screenshot)

I've had this problem several times before and done a lot of googling on it.  Usually I can fix it by copying in a fresh copy of the glibsharpglue-2.dll file in the Monodevelop folder however this time its not working for me.

I've done everything I can find so far that worked previously (including complete removal  / reinstall of Unity 3D) and no luck.

This is pretty critical for me. I am new to Unity and trying to tie my level logic in to the way Unity works with its component based object system and its all new to me -- I need to be able to see what the hell is going on in a debugger otherwise I'm blindly stumbling around here just trying things at random and not getting anywhere!

So my project has been blocked for over a week now. I just spent another evening of my available time to try and get this working with no good result.

I've been able to debug in Unity 3D quite frequently in the past; and had this problems a few times and gotten it resolved usually within 1 day. Getting blocked without debug capability for over a week has got me frustrated to the point where its really hard to bring myself to touch the project right now so I'm going to give myself some breathing room for a few days and then try to re-approach is fresh once I cool down.