Saturday, August 9, 2014

The Rise of Dagon: Week of August 9th 2014

As mentioned in last week's update I had been doing some cleanup from designing the logic for levels so that I could finally tie together a level's logic with its physical attributes.

The first thing I decided to go with was to tie the players movement to the physical aspect of the level. What you did not realize previously (because I never showed it) was that if you attempted to move through a wall -- well you would move through the wall!

I was always careful in my video's to not move through walls -- simply because it would be odd for the viewer to understand what exactly was going on if I had done that!

Tying the logic to the physical structure was actually a two part task:


  1. When actually constructing the level from prefabs make sure to mark the appropriate data so the player can actually use it.
  2. Create code for when the player attempts to move to check the square that is the destination to see if it can be moved to and allow/disallow as appropriate.


To do this I decided to pick up a bit of code I had used before to create a dungeon room out of prefabs.  For each type of prefab I made a method that not only lays down the appropriate type of floor, ceiling, and walls but it also tells the "logicChunksArray" if it is passable by the player, and if each wall is playerapassable or not for instance.

So as I did that in steps I have a little in-progress screenshot here showing that I had the outer walls, but no corners, or center squares yet:



 This went fairly well but it was a little bit messy and I now have a method for each type of  grid you can have like so:

When you look at all of these combined they call out to be refactored as there is a lot of similar code going on but right now I was just happy to get it working!

Eventually what really needs to happen instead of having methods like this to construct very particular types of a square grid is I need to have an actual level format that just constructs exactly what needs to be in each square but for now this was a fairly quick and dirty implementation that takes me another step towards reaching functionality goals that I have.

This coming week I intend to continue working on logic related tasks -- I haven't actually decided what specific sub-task I'm going to tackle yet honestly I just finished up this work last night that I'm showing off today and need to pick through what looks like the most attainable bit of work I can take on for the coming week.

See you next week!

Saturday, August 2, 2014

The Rise of Dagon: Weekly update August 2, 2014

Greetings!

This week's update is progress on the level format, level logic and the inevitable collision of the two.

As previously mentioned I've made preliminary efforts at laying down levels in code which worked out quite well.

I also mentioned working on level logic ; the bit that ties the things you can see, to what you are allowed to do.

Those items are coming very close to meeting in the middle now however I found that I actually had quite a bit of a mess as I had been slapping things together in a way that was taken from the 'just get things working' angle and now that it was time to stitch them together it was just obviously a bit too messy to work with.

I don't believe in over-optimizing at the beginning but I also know a mess when I see it! So I spent a good bit of time this week condensing the code from about 10 classes in to 3-4 classes and eliminating several class members from the primary logical class as they ended up being redundant as I saw how things were cleaning up.

Here's a quick screenshot of a mostly optimized  bit of logic inserted in to an array:


I was in fact still working on it, I had some public variables that ended up private later and the getter/setter properties are all that you can see for most of them now when you inspect it.

So starting Friday I have been doing testing where I use my current level code to insert a bit of the logic, and then I have a gameobject that I click on that prints out in a debug statement if the logic matches what it should be.  

The tests have gone well so this coming week I will begin integrating the level construction  with the level logic!

This task is complex enough I expect it to take more than a week, and I am very much wondering if its time to write a first pass file format for this or not? I would prefer to wait longer because I'm sure the format is going to change as I explore more .. but at some point I'm just going to need it! In any case I'm attempting to delay that decision until it becomes clear that its needed to proceed.

Thanks for reading, see you next week!

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.


Saturday, June 28, 2014

The Rise of Dagon: Week of 6/28 Update

This update encompasses the weeks of 6/28 and 6/21 due to the previous week I skipped my update because my day job required overtime work.  We shipped a major version release and I had to work extra to help ship the release -- including the full weekend!

I did get a few small things done during that previous week but felt it would be better to combine that smaller amount of work in with this weeks update for a nicer full update.

So the first thing I did was work on Substance related textures for the level design aspect of the game.

I was able figure out run-time controls for the Substance textures! This is a super cool feature where  in the level editor you can change the appearance of the level's textures depending on the parameters I expose in the substance designer.

Things like the color, the specular level, the tiling of the x/y of the texture, or even more interesting effects like the 'dirt' level of the texture.

In this short video I am demoing a toggle button of the dirt level of the texture; toggling between a 'clean' texture and a 'dirty' texture as one potential parameter as well as the new dialogue system (discussed further below).