Ah, SQL: the greatest language in the world. It is so amazingly good that I am going to educate you all in this blog post by writing the remainder of it in SQL.
Select ‘So, this week I set about building the database for our new game.’
Select ‘I can not be bothered doing this for the whole post, so blog over.’
SQL is a lovely technology for manipulating data. iOS and Android both have SQLite technology built in and the Corona SDK provides nifty API access to it. It was the obvious choice for the new game’s database, and given my recent experience working with SQL I was very comfortable with it.
The Mac App Store is a brilliant thing and from it I downloaded a piece of software called SQLite Manager. It lets you quickly build a database – tables, views, indexes, stored SQL scripts and the like – all saved as one SQLite file. The file can then be dropped into the main development folder for the game. With a few lines of code data is soon appearing all over the screen, giving the appearance that a game is actually being built.
Which, of course, it is.
Once I had the database then a lot of the game’s functionality became easy to implement. What starts as high level concepts – training players, for example – is reduced to SQL code:
Set Speed = Speed + NewValue
From Player src
Where src.PlayerID = playerID
Set Cash = Cash – TrainingCost
From Team src
Where src.TeamID = teamID
Argh, my eyes, my eyes! This is not beautiful like Killzone 3, I hear you proclaim. And that’s true. It’s not. But, once Nofi has finished up with the special graphical loveliness, the functionality above – and more like it – will be wrapped up in such a shimmering vision of wow, that you’ll forget all about my equally sexy SQL. Hmph.
Despite the database and the kickstart to development it’s brought, there is still a lot to do. There are many areas of team management to include in the game; training, scouting, transfers, contracts, picking the team and tactics and so on. It’s a modular design though, so each area is separate from the other meaning it’s easy to develop one at a time. The only point when everything will collide is in the “match engine”, i.e. the code that effectively plays out a match between two teams. This is definitely the most complex part of the game and the piece of development that I am most looking forward to starting.
Which, if all goes well this week, I’ll be starting to design and code next week. And, if that goes well, in another week or two the game may well be fully playable, awaiting just a coat of awesome from Nofi’s paintbrush.
Once again, I’d like to thank the team at Ansca Mobile for their support, and also the great Corona community over at Ansca for its help and advice.