Computing
Yet another trouvaille thanks to Robert Yang:
Valve's Elan Ruskin's GDC talk about AI-driven dynamic dialogue, used, for example, in Left4Dead.
Instead of opting for dialogue trees, that, as I well know, get out of hand very quickly, they go for lines of dialogue that are getting triggered upon environment variables. When certain conditions are met, the story continues, things happen.
The presentations goes into much detail on how the actual system works, how the actual lines are picked, how the data is stored and retrieved as well as how artists/writers are working with the system. I must admit, I only skimmed the lengthy PDF, but it definitely looks worth checking out.
Eventually, I might implement it in ID: Me, You (and everybody else), and probably do a test version in an earlier game (master thesis, maybe? Implement context-relevant barks to cheer on the players?).
It took five years. Only five years, that is, for people to change their expectations of how displays are supposed to work.
Case in point: at the Scientifica, our booth had several slideshows running on iMacs – obviously without any keyboards or mice around to interact with. So far, so normal. But then, something funny happened.
People would stand in front of those iMacs and then … touch the screen. Five years after the first iPhone has been introduced, and people are now expecting displays to be touch-sensitive. It wouldn't matter how old they were: children did it, but seniors, too.
Now you would think that people would realise soon enough that this was just an iMac, with no touch screen abilities.But because the slideshow was still running, they kept on pushing things on the screen, repeatedly, for surprisingly long periods of time. Why would they do that?
I assume that not all of those visitors are necessarily familiar with a tablet or smartphone device. In Switzerland, another touch device is even more ubiquitous: the ticket vending machines at the train stations. The touch screen of those devices is notoriously unreliable, often requiring several attempts until the input gets registered. What follows is that most people are actually used to non-responsive touch devices, and they know what they have to do in that case: try again.
Which leads to this observation I made at our booth: People would approach an iMac with the slideshow running. They would touch the screen. Nothing happened. They would wait a moment, then try again, touching the screen again.
That's gonna be a short post, because all you need to know is over on Robert's1 blog:
Say you're making a Unity game that takes place in a large landscape dotted with windmills, and some of these windmills have tunnels that lead underground. But in Unity, the terrain collider is generated from heightmap data: it's essentially one giant bumpy plane. You can't punch holes in it.
Can we hack it to achieve the same result? Yep. Here's one way, there are two parts to it:
- Hiding a piece of terrain geometry with a "depth mask" shader.
- Disabling the collider so the player (or whatever) can pass through the hole, but collides with terrain other times.
If you need more detail,
please head over to Robert's blog, where everything is explained. Just had to get that out there, because it seems like something other people might find useful.
-
Who's talk at GDC Europe I did miss because I chickened out and didn't go … meh. ↩
Actually, this is quite old and Janina told me about it a long time ago, but it remained in my little box of ideas that still need to be processed.
So, Disney actually produced an iPad game for their Cars franchise – using actual toy cars, that can be dragged over the iPad screen, controlling the game.
Probably best to have a look at it:
What's interesting is the fact that the idea is not entirely new. Infocom had a similar concept named feelies, packing physical artefacts with their video games, some of them even necessary to solve the puzzles, acting as a sort of copy protection.
What fascinates me is the combination of a video game and a physical artefact. Not necessarily just a special controller, like Guitar Hero and co., but actual objects that are relevant to gameplay in some other way. I haven't exactly have an idea how to pull it off right now, but it is an idea I'd like to explore further.
And as long as we're at the lists for game design students, this one might come in handy as well: A list of 20 game design blogs that students will love:
As video games continue to rise in popularity, game designers are being asked to create even more challenging and satisfying user experiences. Game design students are looking for information on the latest tips, tricks and techniques to help you take your games to the next level. Fortunately, there are several high-quality game design blogs to help guide your studies, skill development and provide you with the latest trends in the field.
Of the many game design blogs in cyberspace, we selected 20 that we think you’ll find useful now and long after you earn a game design degree.
I would, however, add three other blogs worth checking out:
- The Border House Blog: Yes, it has a clearly feminist twang, and don't always agree with them. But the point is: this blog keeps on reminding you that there are female, gay and lesbian players out there that do not constantly have to be reminded of their non-mainstream existence just because you, the game designer, once again designed the game to fit the wet dreams of a heterosexual 13-year old male …
- Robert Yang: Game Designer at the Parsons University in New York – provides thoughtful analysis of games, level design and general out-of-the-box-thinking.
- Terra Nova: This clearly goes into the realm of game studies – as such, the articles are usually rather long and contain convoluted words. Never fear!
Living by the numbers – why yes, that's something I do and find quite fascinating. I love RescueTime and Google Analytics.
So it's no wonder I find Nothing's Time Tracker and Office Dashboard such an awesome idea.
Everyone continuously tracks the tasks they’re working on and thus generates his own stream of project Tracs, and there’s also a “team stream” running on a monitor in Twitter-like manner.
Project time tracking was now not only to be done as info to the project manager, but as statement of one’s own efforts. This new significance boosted meaning and quality of the Tracs. With that there is a much clearer picture of how different types of projects – and also for different sorts of clients – work.
The stream of Tracs is another knowledge tool that leads to many exchanges like “You’re having trouble with this? Maybe I can help.” or “Interesting stuff you do!“. Our latest “meta tool” therefore impacted positively on the internal communication culture: It was fun to add to the information stream with events and have an exchange in real-time. It repeatedly prevented task redundancies and helps tapping existing knowledge instead of creating it from scratch.
It functions similar to Twitter by keeping everyone in the loop.
This made me LOL:
Munster has also assembled a chart indicating that there are, on average, 79 days between an iOS software event and the iPhone hardware announcement and 99 days between the iOS software event and the actual ship date of the new iPhone. According to those averages, based on the likelihood of iOS 5 being revealed on June 6 (at WWDC), the fifth-generation iPhone will be announced on August 24 and ship on September 13.
Who is placing bets?
Okay … normally, April Fool's jokes are somewhat lame, and I have a tendency not to repost them. But this one … this one is pretty cool.
Actually, it's a pity that it's just an April Fool's joke. With good writing and engaging characters, this show would have potential. Hat tip to Chris (or, actually, one of his friends – anyway, without being Facebook friends with Chris, I would not have found this).
Since I happen to be ranked somewhat high when it comes to mentioning Unity 3D and XML, and some of the posts1 happen to be outdated by now since I learned stuff2. But most of all, I intend to learn even more.
That's why I choose to release those two projects into the wild and publish them on github.
-
Like the one on writing log files in Unity 3D or the one on getting strings out of XML files. ↩
-
Yes, that happens from time to time. ↩
GUIs are not exactly easy to program in Unity 3D, since there is only one method available (OnGUI()) that obviously has to take up everything.
This becomes a problem as soon you try to create different menu screens that have to be switched out. One way to do it would probably be to use different scenes (which would be cumbersome); another way to use a switch, which would be just as cumbersome.
My way of doing it is using delegates, which allows to keep each screen encapsulated in a distinct method, while still retaining the same scene all the time.
using UnityEngine; using System.Collections; using System; //Necessary to access Action /// <summary> /// An example for using delegates to show different menu screens. /// </summary> public class DelegateGUI : MonoBehaviour { #region Setup /// <summary> /// The delegate that is going to be used. /// </summary> private Action OnGUIMethod; /// <summary> /// The standard GUI method, as inherited by MonoBehaviour. /// </summary> private void OnGUI () { if (OnGUIMethod != null) { OnGUIMethod(); } } /// <summary> /// Define what screen to show first. /// </summary> private void Start () { OnGUIMethod = Screen1; } #endregion #region Screens /// <summary> /// A very simple function that will theoretically show two buttons, /// which in turn show the other screens.
Since I'm currently cleaning up my code to hand it in with my project, I figured I could write some of the stuff down I learned during my work on our game.
All of it applies, of course, to C#, and was used in Unity 3D.
Checking for a type
Using the is keyword, you can easily check whether a certain object is of a desired type. Also, you should be aware of the as keyword, that allows you to cast an object as something else (given that this is possible).
if (obj is ISource) { ISource s = obj as ISource; if (!s.isEndpoint) { Connect (s); } }
Modelling Behaviour Over Multiple Frames Without Update()
Sometimes, you need to model some behaviour over several frames (like fading stuff in or out), but doing it in Update() or FixedUpdate() would require unwieldy if constructions.
So ... coroutines to the rescue! Using WaitForFixedUpdate(), you can model a behaviour over several frames without using FixedUpdate(), and quits as soon as it is done.
float i; private void SomeMethod() { // do some stuff here i = 1f; StartCoroutine(FadeOut()); } private IEnumerator FadeOut() { while (i > 0f) { yield return new WaitForFixedUpdate(); i -= 0.1f; } }
Delegates – The Easier Way
I wrote about delegates before, explaining how they could be used.
I love watching game designers at work.
(For the uninitiated: This is World of Warcraft, Patch 4.0.3.)
I should not put everything in the title, it leaves me nothing to post in here.
Well, if you're remotely interested in game studies, you might want to check out eludamos's new issues, where you might find articles about World of Warcraft, Call of Duty, GTA IV as well as Dragon Age: Origins and Mass Effect 2. And as an added bonus: hyper-ludicity, contra-ludicity, the magic circle and the mundane circle.
Found, of course, via Jesper Juul.
Writing Serialised Data to a String Instead of a File in C#
Instead of writing the serialised data to a file, which can be done using using (Stream s = File.Create("foo.xml")), you might want to have just the string – maybe because you want to send it to a server? You can use the StringWriter class to do so:
string data; using (StringWriter stream = new StringWriter()) { xs.Serialize (stream, foo); data = stream.ToString(); }
Uploading Data to a Server in Unity 3D
Unfortunately, you can't directly upload data to server in Unity 3D. Instead, you have to write some sort of wrapper script that resides on the server.
Since you can create POST variables in Unity, you can mainly work with those in your script.
A very simple, preliminary implementation could look like this:
concierge.php
<?php //concierge.php resides on the server – and might not be written so nicely, // my PHP skills are rusty. if ($_POST['action'] == 'save') { // Needs to be rewritten to add folders when they don't exist // – otherwise, fileputcontents will silently fail. file_put_contents('./'. $_POST['type'] . '/save.xml', stripslashes($_POST['data'])); } else if ($_POST['action'] == 'load') { $data = file_get_contents($_POST['type'].
Iterating over a Dictionary in C#
Iterating over a dictionary in order to change its values will not work; the program will throw an exception because the dictionary has been modified while iterating over it (which was, frankly, the purpose, but I digress). I can see that this could be problematic. Workaround: copy the dictionary into another temporary one, iterate over that to change the original dictionary. Or create a new dictionary using the iteration.
Allowing Various Elements in no Particular Order in Relax NG
In order to allow several element within another element, but without enforcing a strict order of those elements, use a combination of <zeroOrMore> and <choice>, like this:
<element name="foo"> <zeroOrMore> <choice> <element name="bar" /> <element name="foobar" /> <element name="blubb"> <attribute name="blabb"> <text /> </attribute> <text /> </element> </choice> </zeroOrMore> </element>
Serialising Objects that Derive from MonoBehaviour
Sadly enough, serialising objects that derive from MonoBehaviour, the standard class in Unity 3D, is not possible.
Instead, you will have to use the Memento pattern: create a second class (the memento) that will hold all the necessary information, and when you want to serialise it, you create a new memento instance, copy all the information over and serialise the memento instance.
Upon deserialising, you do it the opposite way.






