Being predominantly an applications programmer, I have a different take on things that people in the games dev area might. Event handling is something that one might do quite differently in many different situations. Here are the ideas I've had and the pros and cons:
Provided by the language. C#, nowadays, makes extensive use of Funcs, Actions and provides Lambdas to let you do it. Lots of other languages do this too. Even though this is a new concept in some of the higher level languages, only arriving in C# in 2003, C has had this for donkeys years. With C++ probably being the biggest gamedev language this option is widely available for most gamedevs for a long long time, however I have rarely seen it used.
A more application oriented than game oriented way of handling the problem would be to send messages around the game, be they objects or strings or hash tables which contain the relevant information. This gives us the option to trigger an event and then not care about when or where or how it happens. The advantage in application programming is that you don't need to worry about handling the event, other code will. Great for chopping things up, but I have never seen this approach used in a game, EVER.
Ad Hoc Handling
The most common use of event handling that I have seen in games, is just handling it as it comes. I understand that this is nice and simple and logical to have your update method identify that some work needs doing and doing it. But:
In a simple game this is probably the easiest option as you don't have to think about it to go down this route. However as your game grows, you will be tied to doing ALL event work in any given update method, regardless of whether it requires immediate attention or not.
I would probably put myself in favour of a Messaging approach, especially if you are doing any networking. If you can make your game a system which passes message around from component to component, then passing messages to a component on a remote system via networking is nothing new.
As such the next game that I work on, I intend to approach it as a messaging exercise to see if it as easy as I suspect to transition from a message based game engine to a remote-messaging based game engine (networking).
Does anybody have a different view on it? Does anybody do anything else?
While looking around today I found a blog entry entitled Service Driven Game Development by Joel Longanecker which talks about services which must communicate and puts down a bunch of code describing a message system.
A while ago I stumbled upon an issue where WFC would fall over, complaining that it couldn't serialise this many objects.
It took me quite a bit of hunting around to find out what the maximum number was, and how I could change it so here I share this information.
The default maximum number of objects which can be serialised in a WCF response is 65535. And this can be changed by setting the maxItemsInObjectGraph attribute on the dataContractSerializer for your behaviour, as below.
<dataContractSerializer maxItemsInObjectGraph="65535000" />
Have you ever spent days struggling, trying to find out how much council tax will be paid on a new property you've thinking of getting? You can't figure out what banding your property is in or who you're supposed to pay council tax to?
Never fear!! MyCouncilTax.org.uk solves all these problems for you. Simply enter your post code and it'll give a list of properties on your street and the annual council tax you will have to pay.
It even comes with a handy link to the Royal Mail postcode finder just in case you don't know the post code of the property yet.
Very useful. Thank you, guys from hacksqnd.com
Yesterday I ran across are rather frustrating issue. Somehow, every single windows machine on the network at work has become removed from our DNS server. As such many systems were having trouble finding each other across the network. Gradually they were repopulating the DNS when they went back to the DHCP server for a new IP (as seems to do) but given the length of the DHCP leases, this could take along time to completely repopulate the entire list. So I decided I had to persuade every machine on the network to call "ipconfig /registerdns" to put themselves back in DNS as quickly as possible.
The way I ended up doing this was to knock together a VB script to iterate through all the possible IPs on our network and call psexec (from the Sysinternals PSTools suite) to issue the command on each of the individual windows machines on the network.
The following script was executed using cscript:
This called psexec 1270 times in rapid succession. Fortunately, with a bit of patience all the calls went out and after a short period of time I started to see machines reregistering themselves in our DNS. By the time I returned to work in the morning the entire network had successfully reregistered and the problems of the previous night had been resolved.
IMPORTANT NOTE: Before running this script, run psexec once and agree to the licence agreement. If you don't you'll be presented with 1720 licence agreement windows each begging to be agreed to. That's a lot of button click to get through.
I came to uninstall Visual Studio today from my main PC, just to keep things tidy and make sure that things don't go wrong, the way they are apt to go if you don't keep your PC tidy.
Apparently something DID go wrong, but it's impossible to tell what. When launching the Visual Studio 2008 setup program I get faced this this rather useless error message before even being given the opportunity to uninstall.
Fortunately Microsoft are aware of this problem have have a VERY handy little MS auto-uninstall tool
My name is Rob. On this site you can find information about me as well as various projects I am working on personally.
My CV is also available below.
1-6 of 6