I worked out the other day that I have been programming for approximately 12 years. During those 12 years I have spent the time roughly in the following ways
- Pre age 17 – Doesn’t really count, dreaming of being a video game coder, Did a couple of programs in Turbo Pascal. Guess the number kind of stuff.
- Age 17-21 – Being a newbie, playing with Visual Basic trying to make video games. Working on lots of unfinished projects cause my skills don’t quite match the vision inside my head.
- Age 21-25 – Attending university, still trying to make games, studying math and later adding computer science, getting a theoretical background but not producing a lot of work, making mostly unfinished projects. During this time I attempted making my first commercial game. Made $1000 which I spent on a bass guitar. Not bad, but not worth the ~18months of part time work on the (terribly coded) game. Learnt a lot.
- Age 26-29 – Working as a *gasp* professional programmer. 2 years doing business software (.Net and databases work) 1 year working for a video game company working on a 3d game for iOS and Android and now doing some (server side) development for photo album making software.
I list the above only for context – As it is only 12 years after I really began programming that I feel I can *begin* to actually make software and to impart advice to others about the craft. I think my apprenticeship stage is largely over and I am now becoming more of a journeyman, where upon I can ask questions and discover for myself the answers. (Through studying theory, learning through trial and error and practice.)
I am currently working on a project in my spare time – But rather than talk about that, I wish to outlay a few problems I have that I think are largely unsolved within my own body of work, or have been sub-optimal when I have done work for previous employers. I wish to use this new project as a test bed for coming up with solutions that will stay with me for at least the next 10 years, if not longer!
Each of the problems are outlined below. (Note: I am mostly using .net or mono stacks to come up with solutions)
- Performance Profiling: There are a bunch of good profiler tools out for .net, but nothing that quite matches what I want – Per frame profiling. (video games run in tight loops where each loop is refered to as a frame – 30 to 60 frames per second is the standard target for video games.) There was a custom solution at my old job which was easily my favorite tool that helped track down a bunch of performance related issues. So I am working on my own implementation of a C# profiler that I will release as open source in 2012. The idea is that the profiler can be used in production systems and the information will be serialized over TCP/IP so you can get profile traces of your program running on different systems thatn the profiler. e.g Should be able to attach to a mobile phone or a webserver, even if the profiler is running on your desktop. I’ve started coding this part of the project, so be on the lookout soon.
- Localization: Dealing with languages other than English is a pain (especially when you have a scripting language running a lot of your game specific code.) I think my solution will take the form of a parser to extract all strings from the scripting language and use the English phrase as the hash for a dictionary look-up into the active selected language. The trick is then presenting the data in a nice form for the person responsible for doing localization, as well as easily adding an additional language without having to do a complete recompile.
- User Interface Design – I don’t know if this will ever be solved completely (It’s still impossible to get complete 100% UI compliance across all the major browsers even with HTML5). But I’m leaning towards developing a solution that uses Xml files to represent the markup for a screen – The document should List all UI elements such as Buttons, images, list boxes, rollover states etc… Which means multiple resolutions and multiple devices can be handled in a data driven way. (Again, no recompile necessary.)
- Game Engine Architecture/Engineering Practises – How to build an engine so that all the parts can communicate with each other, work in harmony, produce as few bugs as possible and promote that mythical unicorn called code reuse? I’ve started by adopting automated testing, banning singletons from the codebase and encouraging cross-class communication through events. Also looking into using good tools – Visual Studio Professional, Resharper. Introducing static analysis (Which John Carmack seems to rate very highly if you’ve seen his talk at the latest quake con where he discussed the development of Id Software’s latest game – Rage.) As well as bumping up the compiler warning level. Also looking into using a build server and doing continuous integration (Something we do at my current place of work.)
- Develop cross platform games (PC / Mac / iPad are the current targets) using the .net/mono tools with OpenGL for graphics – Btw there’s a neat OpenGL library for .net/mono called OpenTk
Those 5 items are my current areas of research, at this stage in my career I have made a couple of games, developed a couple of non-game applications, worked at a couple of organizations and those are the areas I have highlighted as being important to solve for the next stage in my development as a programmer.
#1 by Dave C on April 19, 2012 - 6:05 pm
Hey Josh,
I’ve already talked to you about 1 and 5 at the game developer meetups, I have a few quick thoughts about the other items.
2. I understand your reasoning for this approach (I believe), but there are additional headaches. Using the English text as a key is not 100% reliable. For example, if you had a game about caring for a virtual plant, you may have a label “Water” next to a field that says how much water you have. There may also be a “Water” button to water the plant. In English these are the same word. In other languages, e.g. Russian, they are not. Example below from my lovely girlfriend (hope the site accepts foreign languages!):
Water – noun – ВОДА -[VODA]
Water – verb – ПОЛИВАТЬ – [POLIVAT]
If you have an automated parser perhaps it could combine the control id with the English text as a key.
I worry a little about the automated parsing because some strings are not language related at all, e.g. document.getElementById(“water”). If you have a standard representation for localisable strings I think it would be fine.
Also note layout issues caused by localisation, e.g. strings may be different lengths than you designed the UI for, some languages are right-to-left, etc. This probably ties into item 3.
3. I quite like the Java layout manager concept. Almost arbitrarily flexible. Perhaps if you had layers of affinity between UI elements and your “layout manager” attempted to satisfy those demands as best it can. For example, the label “username” and it’s textbox would have a high affinity. So would “password” and it’s textbox. The username group and the password group would have a slightly lower affinity to each other. Then that whole group would have an affinity with the login button.
Of course one danger would be time coherency, e.g. if slowly resizing the window or slightly increasing the size of one UI element caused a full re-layout where everything is in a different location. Perhaps the layout manager keeps hints for each element based on the last layout, and honours those hints if at all possible.
4. I’m a fan of automated testing, although haven’t done as much as I’d like. Resharper is good, although long time since I used it. Resharper makes Visual Studio X like Visual Studio X+1. Out of interest, why the ban on singletons? I can see you wouldn’t would everyone directly accessing a singleton because it would stop you from using mock objects for testing.
Dave
#2 by Joshua Smyth (Admin) on April 20, 2012 - 2:49 am
Good thoughts Dave,
The key part of #2 is that the whole sentence is the key, like “Giant Rat attacks player for {x} damage”, in the case of singular words such as the “water” noun, “water” verb example I would suspect that Icons could be used in this case.
Maybe a custom override for particular UI elements could be achieved.
Also, yeah languages can have quite different lengths being able to switch at runtime should help the localizer find these kinds of issues.