Mess about with the workings of an RPG!

Back in 2008 Microsoft released a the code for a small Japanese-style RPG to help folks get started with coding their own indie games. If you have a little experience with coding/compiling and want to mess about with it, here’s how to get hold of the latest version and poke about with it yourself.

Download and install Visual C# 2010 Express

Microsoft released a free (as in beer), trimmed-down version of Visual Studio specifically for coding C# .NET programs and apps. If you already have Visual Studio 2010, then skip this step.

You also have the option of downloading the whole suite of ‘Express’ packages, including Visual Basic and the Web Developer package.

Download and install Microsoft XNA 4.0

Microsoft built the XNA code library specifically for coding games on Windows and the XBox. It contains routines for 3D graphics, sound, handling game saves, sprites and so forth.

Once run, you can use the XNA 4.0 code libraries in Visual C# 2010 Express, and you will also be able to make use of game templates and compilation options that will enable you to export your code to an XBox 360.

Download the Role-Playing-Game Starter Kit

The starter kit comes in the form of a project that can be opened in Visual C# 2010 Express. All you have to do is download it and unpack the files to the correct place.

  1. Go to http://create.msdn.com/en-US/education/catalog/sample/roleplaying_game
  2. Download the file ‘RolePlayingGame_4_0_Win_Xbox.zip
  3. Unpack the zip file and copy the folder into your visual studio2010projects folder. You should be able to find this in your ‘My Documents’ folder. If not, just extract them to somewhere sensible where you will be able to find them later

Get started!

Everything should be in place now for you to get nosing around the code, debug it, and generally hack it about to your heart’s content

  • Start Visual C# 2010 Express
  • Go to File -> Open project
  • Navigate to where you unpacked the RPG Starter Kit
  • Open ‘RoleplayingGameWindows.sln
  • Visual C# will load in the files
  • Click the green ‘debug‘ arrow at the top to compile and run the game

All being well, the game should start. Hit ‘Escape’ to get back to Visual C# 2010 Express.

This is as far as I’ve got with it so far, and I’ll be spending some time inspecting the code and classes used. I’m particularly interested in the methods used for rendering the environment, and also handling character interaction. I suspect though that my first job will involve rebinding the keyboard controls…

I make no secret of the fact that I like a lot of what Microsoft has done in the past, but occasionally they drive me nuts. I like the .NET framework, I like the free stuff, I like Windows 7, I like the old MS Flight Simulator and their keyboards and mouses seem to work well enough.

Whereas I fully support any iniative to get young people coding their own games, I do sometimes wonder if C# is really the right place to start, and whether or not kids would be better off with something similar but based around, say, Python. Maybe I just hark after the old days, where one would switch on an 8-bit machine like a BBC Micro or a Spectrum, and immediately have access to the BASIC programming language. I believe something like that would do wonders for computing literacy

Web development on the Android Desire S

Well bugger me, it never, ever occurred to me that I may be able to do this on a phone! I’ve accidentally discovered I can make web pages on my phone and FTP them to a remote server.

This basic little demo page was coded as a result of the following experimental process. I used the following three apps:

I had already downloaded the excellent ES File Explorer, which allows me to move files around on my phone, rename them and so on. This got me wondering about coding my own apps and things, and also wondering if there was a way to create a local (‘permanently-on-phone’) web app (‘thingy that gets info off the web’), or perhaps scripting for the phone (automating a few functions).

920 Text Editor

I started looking for a text editor in which to bash out some HTML. I found 920 Text Editor and installed it. I set it to highlight HTML tags (Menu-> Highlight -> HTML), though it will also highlight PHP, ASP and so on.

Tapping in code is made easier by the row of icons at the top of the screen which contain shortcuts for curly brackets, angle brackets, the ubiquitous semicolon and so forth.

A quick and dirty HTML page later, and I wanted to find a way to check it on my phone.

I saved it to my SD card in the ‘My Documents‘ folder

Opera Mobile

Selecting the little ‘page with globe’ icon on the tool bar gave me the option of opening the file in different browsers. I like Opera the best on mobile devices so I chose that.

You can of course set the browser to file://localhost/mnt/sdcard/My%20Documents/test.htm, to use my example. I’ve bookmarked file://localhost/mnt/sdcard in my browser for convenience.

Wow, it worked. Now how do I get it onto my server?

FTPing to Website

This was the bit that made me happy. Hell, it’s all made me happy so far, but this was the best bit.

ES File Explorer has FTP functionality. It can move files from the phone to a website on the internet.

  • Go to Menu -> Show Tabs and 
  • touch the FTP tab. 
  • You’ll find an empty screen with the helpful message ‘Add FTP by Menu->New->FTP’.
  • Do so, and enter the details of your FTP location and details and you’re away.

It’s a very minimal setup, and building a large website on it would be very fiddly, but it could be useful for correcting typos and so on on the fly.

A couple of caveats though:

File size limitations

Firstly, I’m not sure what the largest file I can use on my phone in 920 is. I have an 8GB SD card which I may backup and replace with a 32GB at some point. I’m concerned that I may unwitingly end up with a atruncated file!

Use WiFi

There’s always a possibility I may end up crapping all over my data-limit if I use my mobile provider’s network instead of WiFI by accident. Note to self: ensure WiFi is on, and Mobile data is off.

Anyway, pretty pleased with this so far.