Monthly Archives: March 2015

The ladders are done! You can now easily turn any building into a climbable level by adding a “climbable” component to it, then attaching as many ladders of an appropriate size as you need. It works pretty well I think. Later on I’ll add in a few alternatives to ladders, but now that the mechanics are in place it’s easy enough to change the aesthetics. I had some issues at first, where I couldn’t mark a building as both on a different level and an obstacle, leading to characters climbing up ladders then walking through walls, but thankfully that’s been fixed. There’s still an outstanding issue if you want to undo your “climbing” movement action, which leads to characters walking around several metres off the ground. I’ve got a couple of ideas how to fix that though.

The camera now moves to your new position when you’ve confirmed your movement action. That wasn’t as straightforward as I would’ve liked… What I wanted to do was pass a reference to the single camera object used by all the scripts that need it, but instead I have to find the camera from within each GameObject’s script. I’m going to revisit this later to see if I can tidy it up. Another cosmetic issue is that the camera just snaps straight to a new position, which doesn’t look or feel very nice. I want to make it a lot smoother as it pans between the two points, so you that can get a feel for where they are compared to the rest of the map. I’d like to do the same thing to the character movement, but that’s going to wait until I have nicer character models.

As well as the things mentioned above, I also want to fix something that’s been bugging me for a few weeks. The circle I draw around characters to show far they can move isn’t displaying correctly. It’s only expanding out to cover 3/4 of the distance it should, and is it’s driven by the same calculations that decides how far you can move… So there’s a minor bug somewhere that needs worming out. I also want to get a couple of UI buttons in place to help move the camera about. Right now you can move and rotate it to your heart’s content, but it only moves to another levels when it’s following a character moving to that same level. Should be too hard to do, and will make it easier to look around later. I also want to get the Visual Studio Tools for Unity working as the debugging feature alone will be life saver. After all that’s finished, I can finally get started on combat. Ranged attacks will be first, as I want to think about how to make melee attacks more interesting.

Finally, I’ve started using Trello to help me to keep track of what tasks I’m working on, having left to do, etc. Previously I was using lists within Evernote, and while that’s a great tool for a lot of things, it wasn’t working exceptionally well as a task list which changed every couple of weeks. I’ve also made my Trello board public in case anyone’s interested, mainly because it’s so easy to do.

A whole week late with this one. Going to have to try not to make it a habit… The last few weeks haven’t been the most productive, but I’ve made some progress at least.

After emailing James Schell, author of Art of Games Design to ask him about the 2nd edition of his book, it turns out that it’s already been released but linked poorly by Amazon. This seems to have been fixed now, and so I finally picked up the book. Then I returned it. It turns out that the 2nd edition isn’t a regular Kindle book readable on a standard Kindle or the Amazon web reader, but a “Print Replica” which can only be read by installing the Amazon Kindle app on your PC, Phone, or Tablet. Not really what I wanted, and it’s not helped when the app is just a bad PDF reader. It’s not what I planned on doing, but I guess I’ll be buying the physical book instead.

I did get the camera controls working, so now you it focuses on a character when they’re selected, and lets you move from that point and rotate the view as necessary. Took me a while to figure out how to get stop it from colliding with objects though, thanks to Unity liking to do similar things in different ways. When Raycasting, you provide a list of layers to ignore collisions with in the form of a binary mask. So to avoid layers 4 and 7 you’d give a value which evaluates to 1001 0000, but when you want to tell an object to not collide with other objects in certain layers, you have to pass in the layer number in a call (so just 4 and 7). Both methods are fine (although I prefer the Binary mask), but when it’s different it just gets confusing. It also forces you to set up 2 sets of constants to point to the same layers. Using Unity to make games is starting to become a bit of a love/hate relationship.

Moving characters between layers is proving much trickier. Right now when someone tries to climb a ladder they shoot off into orbit, instead of stopping at the top of the ladder, so that needs some tweaking. The problem I’m having is that I’m trying to make something fairly modular, so I have a climbable surface that I can attach to any object with little other work needed. Figuring out the logic to get that to happen without unexpected effects such as launching characters into space, or moving them to the top of another ladder connected to the same building is proving a bit tricky. As I’ve said before, movement between multiple levels is key to getting the feel of this game right, so it’s vital that it works before I start focusing on the other areas.

I completed the scripting tutorial on Digital Tutors, and while the majority of it was irrelevant as I thought, the bits it did teach me were really useful. For some reason I never considered attaching another GameObject via the Unity interface as an option, which will do a lot to clean up my code. It also taught me a much nicer way to pass data to and from different GameObjects, which is going to greatly simply things later on. I think for now I’m done with tutorials, as I need to focus more on learning the Unity API and just getting things working. I will continue to read through the Art of Game Design though, when it arrives.

Another point that’s worth mentioning is that Unity 5 was just released, and a couple of other big engines will now be free to use too. For now there’s no reason for me to upgrade to Unity 5, as while it does have some nice new features I won’t be using any of them for some time, and I’d have a lot of cleaning up to handle how things have changed. Moving to another engine entirely doesn’t seem like a wise move either, as it would just mean repeating the past 2 months again with a different engine, and that could happen again and again as the flavour of the month changes over time. I’m going to stick with Unity 4.6 for the time being. Later on, when things are a little more stable, I might look into it.