Skip to main content

Posts

Back to Unity

After playing with Unreal Engine, it is time to get back to my work with Unity3D. Had a couple of projects abandoned and decided to make a little offensive on issues that I thought  did not know how to solve, but seems that I had some extra power up hidden somewhere.

I am glad to say that at last I implemented the foundation of weapon reloading. Just the foundations, but at least it is there. I need some more work on the inventory system, to unify duplicated code, and additional checkings like if the right caliber exists, which then will lead to other issues like same caliber/different damage type ammo.

Also I added some more info to trade window, but still have to implement item comparison, same as in player inventory window. I implemented another basic quest, which in turn, required to deal with an old pending issue: events, like NPC dying.  My first approach was correct, but the implementation was totally wrong. Adding this quest needed some additions to dialog system, now it can …
Recent posts

My first blueprint

A couple of days ago I managed to make my first working Blueprint script. Well, it is not finished, because I took the wrong approach, but at least I found how to handle input and react to key press/release events. Not too difficult, it just takes some time to watch the official tutorials.

In the end,  a Blueprint class and a C++ class are almost the same. You can put together some components and code, that's all. Blueprint tries to help by being context sensitive and it is supposed to allow quick prototyping, if you are an expert, of course.

One of the problems I found, besides my lack of patience, was that unlike Unity3D, where you start a project from scratch, Unreal Engine tries to provide you some base template to start. That requires changing some stuff in the GameMode class if you want to change how the camera is managed, for example. It is possible to avoid using the game framework, but I'm still far from that skill level.

So, I'm quite pleased with my progress, b…

Some fixes to AI

The prototype is under a storm of changes lately. Yesterday I spent some time trying to figure out the origin of some bugs in the AI code. Lot of time actually, because I lost one hour looking at the wrong line. But now, after moving some code to the Awake() function, and unifying some initializations that were repeated, I fixed a lot of weird errors I had. Also, I found some logical errors, preventing the NPC from properly getting into weapon's range.

Today I plan to implement separate functions to deal with each combat mode, to unclutter the Combat state. Also, I have to study the new Pluggable AI videos posted in Unity's Youtube channel. Maybe I can get some ideas to implement some way to differentiate the AI for each NPC.

The other bunch of changes deal with the process of building character mesh and equip/unequip items like armors. Currently it is a hughe mess with weird problems like incomplete characters, or complete ones that become incomplete if I close and the open …

Fixing old mistakes

This weekend I made another offensive to my item equip code. It depends on the mesh assembly code, which deals with building a model from several meshes, if they share the same skeleton. To be equipped, the  item must have the same skeleton too, of course, and the widely (and only) documented method is to copy the bone info from the base skeleton to the other meshes. Simple items like weapons does not need this, as they can be attached to a bone and that's all.

But my first approach had major flaws. It required a list of prefabs that were assembled into a a model and then to a list of GameObjects, the NPCs were not visible in the map, and just recently found that destroying the switched part left me without the original part to restore it when the item was removed.

So, I sat and put my brain in afterburner mode. It didn't worked... until yesterday, when at last I figured out how to get rid of the lists of original prefabs, the resulting GameObjects, etc, and put that in a si…

First quest

Yesterday I managed to implement the first quest of the prototype, and a couple of hours later, the second. I can't say I have a proper quest system (if such thing exists), it depends on loosely related stuff.

The first quest implement involves recovering an stolen item, which requires fighting some weird guys. It is like an introduction to combat. The guy drops the stolen item, or more precise, you get it from his corpse. When you talk to the quest NPC, if you have the item with you, a new option appears in the dialog that allows to deliver the item, receive XP and set the quest as completed.

The second quest is to talk with a guy to receive another quest, the one that triggers the main storyline of the game. Pretty easy. And now that I mention the storyline, I made some work on it this weekend.

The key word when writing the plot for an open world is branching, which is easier to say, but not that easy to achieve. It means that almost every quest or NPC should be the entry point…

Mi novel available in Amazon

In case you are proficient enough in spanish, or at least, enough to read, I remind you that I keep a blog in that language too. Also, I'm happy to announce that my  book is already available in Amazon.


I put a lot of effort to make this my best book, and as usual, I ended up not quite sure about if I made it. Probably the next will be better.

The best tutorial to implement a node based editor

I had lost all hope to find a good tutorial on creating a node based editor in Unity for my dialogs. Something like Mecanim, with squares and connections. So, it waslike a shoot in the dark when I made the same search again a week ago. And guess what, I found this.

I spend the friday night following it and got a small prototype working. Not just that, I also know how to customize it and add stuff. The bad news are that I forgot most of the little I knew about old Unity UI system.

This is the best tutorial I have found about this: simple and effective.