Programming exercises

June 6, 2013

I had an idea. Why not pose programming problems and then see what discussion ensues, perhaps with a reveal of my solution. Yes, you can tell I am still a teacher (perhaps much to the chagrin of some). So I will give it a go.

I remember when I told someone in their early twenties “I have been making games since I was 12”. To which the challenged me with “So did I” as if they were my equal. Do the math. I am 20 years older than you matey.

Maths is important. And that is going to be the subject of the problem I am presenting here.

One of the game prototypes I am working on (I am usually working on a personal prototype of some kind in unity these days) requires that I test to see if the player passes through a gate, rather than around it. Something like the gates of skiing. So, how can this be elegantly done?

You have the position of the player, the position of the sides of the gate. You must have a piece of code that is called at the right time to detect if the gate is properly taken or not. When this is detected, the game will switch to the next gate. The solution needs to work in 3D, but you can assume that the gates themselves are vertical.

What is the best solution you can come up with , in terms of size of code, clarity and robustness?

In a later post I’ll discuss my solution and we can compare notes.

 

Retro Asylum interview

May 12, 2013

An epic podcast interview edited down to about two and a half hours for Retro Asylum. Who would want to listen to me rabbit on for that long?

Thanks to Matt Denaris for a great job and an awful lot of probably tedious work editing down my ramblings . Here are the two parts:

http://retroasylum.com/ep-37-dino-dini-interview-part-1/

http://retroasylum.com/episode-39-dino-dini-interview-part-2/

Cheers!

 

 

GDC 2013 AI Summit talk “The Polling Problem”

May 12, 2013

GDC 2013 AI Summit talk “The Polling Problem”

In my years of programming I have always searched for heuristics (or rules of thumb) for designing better software. Here I explore a heuristic connected with what I call the polling problem. The video of the talk itself is available on the GDC Vault, if you have access to that.

Go support you local Indie Game Developer

November 3, 2012

Go buy one of Jeff Minster’s excellent titles now. That is all. Think of it like an instant Kick Starter.

http://minotaurproject.co.uk/frontpage.php

P.S. I particularly like Grid Runner, it’s the only game I regularly play as of recently, but I am a fan of retro shoot-em-ups.

 

Back to the Future

November 2, 2012

Sometimes I have felt like a really pitiful creature. One of those has-beens that had success at an early age and then completely failed to make the most of it, who then goes around trying to say “Hey, I can do it again”, but somehow never can. It’s complicated. It eats at the heart of who I am, and it’s a pattern.

Patterns are not always good things. They can hold you back. My pattern, ever since the mid 90’s, has been that of the misunderstood rebel. I am most likely neither, of course.

October was a very important month for me. To cut a long story short, I started to celebrate my achievements. For the first time.

I don’t know whether many 24 year-olds are properly equipped to fully appreciate what is happening to them when they have mega success. I certainly wasn’t. I was a kid. I had no mentor. I had no guidance. I was writing award winning games and… so what? I would go back to my bedroom and continue an isolated existence, reading game magazines and working on the next thing. I would play music to myself, code by myself, hell talk to myself if it helped solve a difficult programming problem. For the younger readers out there, I must remind you. The Internet as we know it today did not exist, and 300 bps modems (yes 300!) were cutting edge and expensive and there was nothing to connect to anyway. Early pioneers were mostly alone, and our achievements archived in print… in game magazines.

This past month I have been been doing many things that have been putting me back in touch with my past. I did not start out to do this, it just kind of happened all at once. I made my first ever appearance at a retro games expo (PlayExpo) in Manchester and was interviewed by Gordon Sinclair. Anthony Caulfield filmed an interview with me for Bedrooms to Billions. I was a VIP guest along with Martin Hollis at the opening of Italy’s first video game museum. My parents came and watched my talk which was about my story. If one week of my life was going to force me kicking and screaming to face up to my past, that was it.

I enjoyed the whole experience certainly. It was good for me. I loved seeing so many people kick out of meeting me. That’s not something I experience normally, and to be honest, not something that I ever have really experienced in my life. Signing games, posing for photographs, playing the odd game of Kick Off with a fan. I would be lying if I said I did not enjoy that attention.. but it was more than that. It felt like my past, my 25 year old self, had just jumped forward in time to meet Dino old enough to be his father.

Dino, what you did was cool, I said to him (or him to me). Look at the expression on their faces as they play your game. Look how they are happy to meet you. You did good things, Dino. Don’t forget.

I left that 25 year old behind 22 years ago, and I have probably never properly grieved for his absence. The party never happened. The PR and press went on their way, the industry did it’s own thing, I grew up painfully and slowly, dealing with the bullshit that we all have to deal with in life, gradually losing touch my self, and wandering like a lost soul occasionally (and almost out of desperation) forcing myself to meet people to try and make something happen (whatever that something might be). Recently one such told me “We never really understood why you came to see us”. I replied, neither did I. I was looking for something, but perhaps I was not ready to find it or even know what it was.

The last couple of days I have found new archives of game magazines which contain many reviews of my games, chart positions, advertising and so on. Going through these has brought me more than nostalgia; it has also brought me a deep sense of awe at how creative and vibrant the young industry was at that time. Looking at the screen shots, I find myself stimulated and inspired, imagining how the game would play and what the design was. I found old favorites too like Xenon II and Archipelagos and Speedball 2. One of Jeff Minter’s original Grid Runner games (I highly recommend his Grid Runner on iOS, it’s been the only game I play for the last few months).

Of course, turning my mind to practical matters, I started to collect the reviews of my games because I simply don’t have my own copies. I left them with the 25 year old me, and he did not look after them. This inevitably turned to the thorny question of the game awards that I like to put on my CV and in promotional materials. That’s normal right? I mean, what is the point of winning an award if I can’t mention it? The problem is that I don’t have the physical awards (Anil Gupta took them back when the 25 year old me had his proverbial back turned) and without the magazines there’s no proof. Until recently searching for evidence online proved fruitless, but technology and the community have come to the rescue. Whole archives of certain classic magazines, such as The One and CU Amiga and Ace, have complete (or nearly complete) archives, including advertising!

Surely, I said, I will be finally be able to prove my claims even to the ‘incredibly high’ standards of Wikipedia! Muahahahahahahaaa!

Yes. It matters. It matters to me,  because I have to get back to my 25 year old me and pull him forward from the year 1990 to 2012 and sit him down beside me and celebrate and tell him he did a great job back then. I need to ask for his autograph and if I can take a picture with him. I need to be his fan. His greatest fan. But also, I need to convince him we can work together, that I can be his mentor and help him realize his full potential.

You and me Dino. Your youth and my experience. There’ll be no stopping us, my son.

 

Time to get back to the Electronic Art

August 16, 2012

MCV has recently published this report suggesting that Electronic Arts is putting itself up for sale. This is on top of previous news suggesting that Activision is doing the same.

Around 2002 Rage closed in the UK. Other studios were closing too. At about the same time I remember reading that UK publishers had the biggest marketing spend ever at E3. I sat in my office and gulped. What I saw was so clear and so obvious to me. The industry was heading for a disaster. It might take five years, or it might take ten or more, but I was convinced that unless something was done, there would be catastrophe. When an industry is spending an incredible amount of money marketing and the creative elements within it are losing their jobs, it means that things have gone completely out of whack. An industry that was about entertainment through the most creative medium ever devised had been replaced with a poker game. The winners would be those with the biggest money to spend, the losers would be everyone else, including the game developers and gamers.

I contacted TIGA (I was a member at the time) and urged the importance of discussing this issue. The industry was not going to survive if it carried on like this, I argued. Apparently, the issue was raised by the TIGA board, but dismissed. I was told that this was simply consolidation and inevitable as our industry grew.

I left TIGA as it become clear to me that it was not at the time a friend of small indie developers.

Well the years rolled by, XBOX, Playstation 3, XBOX 360 and the usual cycle continued. The industry grew and many dubious claims were made about it being bigger than hollywood. Yet, I looked at the charts, and what did I see? The same games, the same brands, the same franchises… the same pattern I had witnessed since around 1999. Racing Games. FIFA. PES. Madden. An FPS.

I remember what the industry was like 20 years ago, and back then there was more invention, more variety, more… soul. Our industry had fallen victim to one of the oldest and deadliest forms of business disease: accounting.

Don’t get me wrong, if you run a business accounting is important. But you must never forget what accounting is for. Accounting is supposed to be about making sure that your company can continue to function properly as it tries to achieve some goal. Money is not an end in itself, unless you are a bank. The video game industry does not exist to make money; it exists to make video games. One of the symptoms of the accounting disease is forgetting this.

What any system creates is as a result of the core intentions of those that govern it. If the industry is governed by the creators of games, then what you will get as a result is a large variety of inventive games and a healthy market with many profitable niches. The output of the system becomes video games, and I believe that is all that matters (with money being a vital part of the process, of course, but not an end in itself).

If, on the other hand, the system is governed by accountants then the final output will not be games, but instead will be money. It’s really quite simple, and is what we have witnessed over the past 10 years. The video game industry became increasingly about shifting boxes, not about entertainment, and for a while the money rolled in for those who could afford to ‘play the game’ (leaving those who were merely talented at making games on the side lines).

Format holders perpetuated the problem by ensuring high barriers to entry. On the face of it, this was to keep the number of products sold on the platform lower and the quality higher, but I believe there is another unspoken reason. Markets often work by illusion. The value of a company depends significantly on its perceived ability to generate income in a way that competitors cannot. How could enormous companies like EA survive if thousands of indie developers could also publish to the same platforms? Do you think Notch is the only one out there who could make a hit game?

Minecraft has arrived on a console, but only after it proved itself through an avenue with a low barrier, and unfortunately that kind of mega success is too rare. You need to go viral to succeed and that’s a lottery (if it weren’t we’d be seeing a lot more similar cases). But that’s not the point here: the point is that the big players really did not want to think about this approach to video game development… the idea that sheer creativity could compete with accounting. I mean, what on earth is the point of having a 200 person team and a development budget of 100 million if you are going to be lucky to break even, or just make a 10 million profit, when one guy on his own and no marketing spend can make as much money?

All this money spinning did two things. First of all it closed the door to independent developers, who were left with one choice: the PC, with all its inherent problems. PC game development became a speculative hobby-like platform; few indies could make living from it and it certainly was not a robust business prospect (unless you had some special no risk USP, and who can prove that before you build the thing?). We all know about the successes, but what of the failures? My particular interest is in sustainable business models for the industry where the lottery is somewhat reduced. I don’t want to spend a year making a game unless I have a realistic opportunity at monetizing it, because I want to be a professional game developer, not an amateur.

The second thing the money spinning did was cause greater competition within the remaining genres that the accountants considered most profitable. And this made the poker game more intense. The primary technique for competing in this poker game was greater spending on production value and marketing. With this greater spending came greater risk, which meant that the variety of high value games diminished. Games tended to become derivative, and any new innovative game would probably not have the budget to compete with the big players and so would not get a fair testing in the market (which in itself perpetuated the idea that you should not take risks by innovating too much).

The problem with narrowing the choice of games and having less innovation is that the market tends to get bored. But that’s OK, because you can wow them with ever greater production value. This, of course, is what Sony was all about. Sony saw that better technology was a good way to grow the market. It worked for a while too, but in the end there is a limit to how much you can drive the market forward by ‘wow’.

This is a lesson learnt the hard way by hollywood. The reason the blockbusters such as “Ben-Hur” and “Spartacus” exist is because the film industry consolidated into major studios which competed against each other with ever bigger productions, until the inevitable collapse occurred. We have seen the same thing happen to the video game industry and now we are perhaps at a major turning point. Activision, Electronic Arts and relatively new upstart Zynga appear to be failing to deliver. Accounting is no longer enough. Production value alone cannot satisfy; you must also rely on the fundamentals, which in film is basically story telling.

Now we find that indie game development is on the rise. Instead of consolidation, we are seeing fragmentation; we are beginning to become something of a cottage industry again, and frankly the change cannot come too soon. This is positive stuff indeed, but I have a concern. The only platform I can currently consider developing for (without crowd funding investment) is iOS, simply because it is a relatively open platform (low barrier to entry and little censorship) with good monetization opportunities. I am not alone in this view and although this is without a doubt a very good thing, it does mean that indie game development is dependent to a large extent on Apple. Our industry will never be truly free until an open publication platform exists (that has effective DRM… see this ). Whether this will ever happen is anyone’s guess. Perhaps “Ouya” is for real and will start this ball rolling… time will tell.

Whether EA and Activision and similar traditional publishers have a roll role in the future of our industry, I don’t really know. Probably, but they are going to look very different and I think it is a good bet that the future video game industry will resemble today’s movie and TV industry. In the future, we are most likely to be contractors. Holding companies will be formed for most projects and these companies will contract us to work on them. When we ship the game, we will move on to the next project.

I’ve been saying the above for years, and a common objection has always been job security. As we look at the modern video game industry with its litany of deceased video game companies all over the world, and as we look carefully at Activision, EA and Zynga, does that argument really hold up any more?

Music, music, music,

April 12, 2012

What was my plan? When I wrote Kick Off, I mean. I had a plan. It was to make money creating video games so that I could use that money to advance myself as a musician, singer and songwriter.

I am now almost 47, and the whole music thing… well let’s say I did not follow either my heart or my plan. I got married and put my guitar away. In any case, playing music to audiences was always difficult. I have long pondered on the thought that if I were a recovering alcoholic, I could find no end of places to meet other people with a similar interest. However, as someone with a need to play music and perform it to others, I found it very hard to get satisfaction. It’s competitive, for a start: all these talented people wanting a slot at an open mic, or back when I was in my early 20’s, at folk clubs.

Currently I live in a small town called Breda in the Netherlands. It has practically no music scene, and in any case I take my music far too seriously. I actually want to play as much as I can, which means that in a small town with few places to play, I’ll outstay my welcome at any place pretty quickly.

Recently, however, I came across www.younow.com and this has finally provided a way to perform to people, without having to spend a fortune in travel perhaps to find that I don’t get a slot anyway. There are other advantages too: no more audiences far more interested in talking than listening; no more rude venue owners; being able to choose when to play, and perhaps best of all not having to deal with ‘rumposters’. That’s a made up word for someone who inappropriately interrupts. Since I started using the site, I have found that I am motivated to perform every day and this is helping my playing and singing. Interestingly too, I find that I am earning fans all the time, more quickly that the social network of my game fans.

I have never recorded an album properly, yet I have written many songs. I have now performed most of them on younow. I want to record all my songs, and if I don’t I’ll really regret it. Part of my reluctance to recording is not feeling ready, but now I have a motivator to practice and refine my songs, music and performances. So I am getting ready to record an album, and focusing on that right now.

So, what has this got to do with anything? Well, it unfortunately means that while I follow my heart and focus on music while there is still time (hopefully), I am shelving unpaid game development work, and this also means the work on Player Manager. If I had funding, it would be a different matter; I could hire people to build the game, but that’s dreaming at this point.

Some people will say “Told you so”, referring to previous attempts to do remakes of mine that came to nothing. Well, at least I tried, is my reply. I do have a day job – it’s not like I have an infinite amount of time on my hands. In any case, I need motivation.

For some time I have been motivated by ‘audience participation’, which is another reason why live performance is part of my MO. The response when I announced the new project was small; there is frankly not a lot of audience participation on Player Manager and since that is something that motivates me, without it my interest wanes. Nothing would be sadder to create a remake and end up with 100 people interested in it and nothing more. I would be extremely annoyed about that, reflecting on how I could have worked on my music instead.

A while back I made a post about how I was giving up on my music, and now I’m back on it. Yes, it seems I am all over the place. Well, life is sometimes like that. I am seeking something out, and I think what I am seeking are healthy transactions. Performing live provides that; if I do a good job, people respond to it right there and then. Game development is quite different. It can take a long time to build a game, and then you can find that it does not get back even enough to cover the effort taken. I gave up on my music because I could find no way to have that healthy transaction. YouTube is not good enough for the purpose; I found that I could spend days making a video that would get fewer hits than videos which were thrown together quickly, and in any case even if I have a video that’s been watched 10,000 times, I have no idea if even one of them actually watched it completely.

With video game development it’s the same issue. I can’t find a way to have a healthy transaction. As an experiment I tried “Letteroids 3D”, and although it developed a small core of game players who really liked that game, it was still a lot of work for a small amount of audience reward and absolutely no revenue. We were trying an ad based model, and that just did not work. No giant surprise, I know. If I had spent all the time that I spent developing that game in performing concerts in Second Life for tips, I would have earned perhaps a thousand dollars as opposed to virtually nothing.

Maybe some solution will turn up eventually that will allow me to make more games, but until I do I must reflect on things from a business minded point of view. What gives me the best return on investment right now (speaking not strictly in terms of money)? The answer is clear. Now I have found an outlet for live performance of my music, I am personally seeing much better growth in the field of live online music performance with the discovery of YouNow. So, that’s where I am going to focus for a while and see where it takes me. It’s not that I think I could become a star or anything; I am just seeking, and finding healthy transactions. I don’t care that they are small; only that they are healthy.

Transactional Memory

February 12, 2012

I have been thinking for some time about the potential for changing the fundemental architecture of computer memory. In particular, I have been considering the value of memory which is accessed “by name” instead of by address. Check out my previous post “Oh Hash it all!“.

Anyway I was quite interested to see the following article on Transactional Memory. Looks like the industry wants to head towards something related. It’s not quite the same thing: transactional memory is memory that incorporates the same locking mechanisms of databases in hardware. This is related because it is the idea of making physical memory more like a database. However I am not sure they are actually going quite that far. My guess is that they are still stuck with the concept of traditional memory and trying to create something more like an extension to existing memory. They talk about “C language extensions” for accessing the new features. Shudder.

Anyway, this idea should make, in theory, the construction of multi-threaded software a lot easier, but it would be even easier still if we got rid of the shackles of C and Turing Machine thinking, and instead design the hardware and the programming language together. I predict that a full solution to the current challenges in computer software will never be fully resolved until we re-architect everything from the ground up.

Random Memory

February 11, 2012

I have long been fascinated by randomness, and especially the idea that you can create order using it. I’ve just been conducting an experiment with ant trails, and the following demo is a very simple algorithm involving a pheromone  trail.

The ‘ants’ don’t explore and have no purpose, but the pheromones leave a pattern which remains remarkably stable, given the entirely random behaviour of the ants.

This made me think of human memory: unlike computer memory, it is not rigid, but needs refreshing and changes over time.

Take a look at the following demo if you like: just watch how a random pattern emerges and slowly changes, constantly refreshed by the passage of the ants. Hmmmm…. lots to think about here.

http://www.dinodini.com/unity/RandomMemory/WebPlayer.html

 

Moving back to wordpress.com

February 11, 2012

Too many things broke, so I have moved back to here.

Sorry for the confusion.


%d bloggers like this: