Technical communication

You are here

Games for Touch Walls

One future I see for our little company? Definitely something like this:

A StarWars game called FleetCommander, played on a 8160 by 2304 pixel wide touch screen.

Well, let me correct that. A touch wall.

English

More Design Patterns

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(); }

English

Collected Wisdom of my latest Coding Sessions: Various Design Patterns

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.

English

Hometown GP

While getting some answers on UnityAnwser, that were kindly answered by someone going by the handle of Duck, I stumbled over his website.

And look what I have found:

English

Reading Strings out of an XML file using C# in Unity 3D

Update

The code for this project has seen extensive changes and has since been migrated to GitHub. Read more about it over here – and then go forth and fork it. It is released under a Creative Commons License, so you are free to build upon it.

Since I already played around with XML in C#, this part of the project was easier to do than before.

What is it supposed to do?

Basically, I could simply hard-code most of my strings used in the game directly into the code – no one would notice the difference anyway. But obviously, this is not a very good idea, both because editing strings and later translating them becomes a pain.

Creating some data that would allow me to get strings out of an XML file would solve this problem – and, if the code is good enough, be reusable in later games.

It would allow me to edit text independently of the game code and add translations on a later date.

English

Writing XML Log Files in Unity 3D using C#

Update

The code for this project has seen extensive changes and has since been migrated to GitHub. Read more about it over here – and then go forth and fork it. It is released under a Creative Commons License, so you are free to build upon it.

Since I want to make some basic statistics for my game at Fantoche, I needed some basic logging function of the player’s position.

English