Showing posts with label UnrealScript. Show all posts
Showing posts with label UnrealScript. Show all posts

Monday, April 15, 2013

Book Review: UnrealScript Game Programming Cookbook

tl;dr: Solid book for beginners. I'm not happy with the fact that a lot of the 'recipes' use derived UT classes instead of the base UDK engine. Covers a lot of important information at the beginning, sets you on the right track to avoid confusion down the road. Chooses to explain silly Canvas for GUI instead of Scaleform. Good explanations, poor editing (has some typos in code blocks). I wish I had this book when I started my senior project.

The Actual Review

A couple weeks ago, someone from Packt Publishing asked me to take a look at one of their newer UnrealScript books. I haven't worked with UnrealScript or UDK for about a year now, but the memory of the frustration and lack of documentation is still fresh in my mind, so I was happy to take a peek.

Overall, I kind of wish I'd had this book back in the summer of 2011, when I was first trying to wrap my head around UDK development for my senior project. The book itself isn't a fantastic cure-all for the tribulations one will inevitably face when working with UDK, but the first chunk of the book would definitely have clarified a lot and set me on the right path. Early on, it tackles the subjects of IDEs and script references (like UnCodeX and the Dungeon Defenders Development Kit; I'd used UnCodeX extensively, but I wish I'd known about DDDK). Then it goes on to tackle prefabs and archetypes, and then walks the reader through the creation of a fairly flexible camera system. All of this information is delivered fairly painlessly with plenty of explanation.

For my purposes, that's where the usefulness of this book ends. That's not really a criticism, mind you, I think that so far the book has managed to deliver enough for me to consider it a valuable asset for anyone getting into programming for UDK. After this point, the book delves into more specific topics, most of which float atop the Unreal FPS model. The chapter on AI is probably useful, but the rest seems to deviate a fair bit from the needs of someone using UDK to create a game that strays from the standard Unreal Tournament formula. Unfortunate, because that's the area that has the greatest need for reference and documentation.

Actually, I lied - kind of. The GUI section (Chapter 7) is probably rather useful, though the author chose to go the route of Canvas instead of Scaleform. Somewhat understandable, since at least one can assume that the reader will have what they need to work with Canvas, but not necessarily have access to Adobe Flash (or knowledge of ActionScript for that matter). If you're looking to make a GUI that looks remotely professional though, definitely look into Scaleform somewhere else.

In a few instances, I did notice the wording used to be poorly structured, though for the most part it was fairly easy to understand. I also noticed several typos, mostly in the code itself - something that is definitely harder to forgive, as it can easily confuse a reader into making numerous mistakes. I could pick up on them fairly easily, but I feel that such typos could trip up beginners.

If you're just starting to get into UDK and want to start digging at the surface of the world of complexity that lies beneath the hood, I would definitely recommend the UnrealScript Game Programming Cookbook, even if only for the first three chapters. It definitely sets you on the right path and saves you a lot of confusion down the road.

Sunday, February 19, 2012

Replication of Variables in UDK

I will try to make this as brief as possible. If you're interested in something with a little more depth, I strongly recommend you read through Replicating a Flashlight's State; it isn't very long either, and probably makes my post obsolete, but I felt like presenting my understanding on the matter.

Networking in UDK

Alright, here goes. My first somewhat educational post, and I declare that it shall be on the illusive topic of networking. This will primarily cover the basic issues of creating a server, connecting to that server and also creating a combination between a client and a server. But first, an introduction to the concept of a client and a server.

Thursday, February 2, 2012

UDK, TextureRenderTarget2D, SetExternalTexture() and Scaleform 4

May 18th, 2012 Edit: It appears that the May 2012 release of UDK fixes this issue (reference). Thanks to Steven Webster for letting me know!

Punch UDK in its stupid face!

Perhaps I'm not being clear enough. So a couple weeks ago, I decided to build the user interface for my Senior Project (a UDK based game) using Scaleform 4, a recent addition to Unreal. Up until the November 2011 release, UDK only supported Scaleform 3, which in turn only allowed developers to use ActionScript 2.0 when creating interfaces in Flash. The last time I touched ActionScript 2.0 was when I was in the eleventh grade. I think I made a pong game. So obviously, I was pleased to hear that I could use AS3, which I had learned to a reasonable extent only a few years ago.

Bad move.

Since then, I've been running into issue after issue, and it was really my own fault. I shouldn't have expected such fresh features to be well supported. A lot of major elements are quite broken. For the most part, there have been solid workarounds, but now I've run into something that I cannot avoid.

I've been trying to incorporate a preview window for 3D components for things like the inventory screen, where clicking on an item would load up a rotating view of the object. I found out how to do this, in theory - it involves taking what is essentially a camera (SceneCapture2DActor) and having it render directly to a texture (TextureRenderTarget2D). Then, SetExternalTexture() is used to replace an image texture in the Scaleform UI at runtime. Effectively, you are given a sneak-peak at something rendered from off screen. The technique relies heavily on the notion of dynamic textures, which can be used to create computer screens, water reflections, etc. (Check out these links for more information on Rendering to Texture and Swapping Render Targets into Scaleform UIs).

Unfortunately, where the plan fell through was at the very end - SetExternalTexture(), unfortunately, causes the whole program to crash when used with a TextureRenderTarget2D. I found some complaints about this on the Epic forums, but unfortunately it doesn't seem to be high on the list of priorities. People have been complaining about it since early December at least, and to my dismay, the January 2012 release (which came out today, or very recently) has the same problem.

So, I've decided to bite the bullet and revert to the October 2011 release of UDK, and switch out in favour of AS2. I'm really frustrated, but since I'm more familiar now with a lot of the processes and issues, I should hopefully be able to redo the work I did in the past couple of weeks in much less time. Unfortunately, I have a meeting with my Senior Project advisor on Friday, and I will definitely be falling short of my biweekly goals. Gat dangit.