A Note of Intent

Aaargh.

I decided I wasn’t going to bother posting another update here until I’d settled back into uni and sunken my teeth into some fresh projects I could write about. I suddenly find myself almost two-months into the final year of my degree and I’ve been rather too busy to give it a second thought.

So here’s a note of intent: I will, sooner or later, make a proper post about this semester’s projects, before the semester is concluded, including my dissertation project, which was signed off by my supervisor last week and is now awaiting my full attention…after two more urgent deadlines. For now, I’ll just leave a brief list of what I’m currently working on:

1. An essay on the sufficiency of services provided by modern operating systems for accessing detailed information about gaming peripherals [due two weeks from now – yikes!].

2. A Unity game about parkour and painting. Think Jet Set Radio meets Mirror’s Edge meets Tony Hawks Underground. This is a team project with three other programmers from my course, and seven artists from the University of Derby’s Computer Games Modelling and Animation course [due sometime around the end of the semester].

3. For my dissertation project I am to be investigating the posibility of applying various AI techniques to the board/card game The Resistance. This may include search trees and evolutionary techniques, and I will be using the competition framework and bots provided by AiGameDev.com last year.

These are the things I’ll be posting about and/or creating new pages for here when I get chance. All the other stuff I do I’ll likely post about elsewhere if I even have the time to continue doing things other than eat, sleep, and code.

I cook some nowadays, and bake a little; I still study Korean, and I’m trying to snatch back the graphic design and art skills I used to have. But I’d like to keep this blog focussed more on programming, and the larger projects I undertake.

Advertisements

MARS MIPS Simulator Lockup Hackfix

If you are attempting to use Missouri State University’s rather excellent MIPS Simulator and IDE, MARS, to develop an application which uses the bundled Keyboard and Display Simulator (though it seems  unlikely that you would be doing so seriously today), you may encounter a sporadic bug where the entire MARS application will lock-up, and you have to end-task it.

I personally encountered this while attempting to make a simple Snake clone just over a year ago, during the Console Development 1 module of my (WIP) BScH Computer Games Programming degree and the University of Derby. At that time me and a friend tore open the MARS .jar in order to probe for the cause of this, and were actually able to implement a little work around. Since posting about this project here and putting a video demonstration up on YouTube, I have been asked several times about how we were able to do this, and rather than repeatedly send out links to the email I originally sent to Ken Vollmar, I thought it might be nice to have a decent guide I can direct people to.

Note that the below instructions cover a quick ‘n’ dirty fix, which may introduce other errors (though I haven’t noticed any). This is why I have elected not to just hand out a new .jar, though I could happily do so under the MIT License. I didn’t then have the know-how to properly dig into the problem, and since lengthly debugging of broken applications is my full-time job right now, I’d rather not do so in my free time.

What You Will Need
Java Tools – Likely an IDE like Eclipse
Archiving Tools – 7Zip or a similar application for looking into the .jars
A copy of MARS.jar

Instructions
I’m going to assume you’re using Eclipse, because that’s all I know, so you may have to dig for some of the options if you’re using something else. I will assume you may never have encountered Eclipse or Java before though. Java is a lot like C#, but Eclipse is a bit different from Visual Studio. If you’re better at Java than me, do please let me know where I’ve done things the hard way round, and feel free skip the easy sections.

As another heads-up, I’m also using Windows, so this experience may be rather different for anyone hailing from the OSX or Linux world (I’m told that the creation of an executable .jar on Linux is free from some of the woes I encountered).

Project Setup
Firstly, create a new folder, open up Eclipse and select this folder as your workspace. I called mine ‘Mars_4_1_Mod’. You then need to create a new project in this workspace (File->New->Java Project). Name your project, and hit ‘Finish’. Note that my JRE is set to JavaSE1-1.7. This setting may be important – I’m not overly familiar with it myself.

Now right-click on the project in the Package Explorer, and select ‘Import’. You want to import the contents of MARS.jar to the project, so select General->Archive File from the dialog, browse to your copy of MARS, and hit ‘Finish. Your Package Explorer should now look something like this.

MARS_01

Finally, you need to make sure that Eclipse can find the source code in the project. To do this, right-click on your project and select ‘Properties’. Go to Java Build Path->Source, click ‘Add Folder’ and select your project root. You can fiddle with exclusions and stuff if you want, but I preferred the shotgun approach for what it’s worth.

The Fix
You should now be able to build and run the project (Run->Run As…->Java Application, select ‘Mars’ and hit ‘OK’). Mars should run normally and freeze as expected. Alternatively, if you run it via Run->Debug As…->Java Application then you will be able to suspend the application from Eclipse when it locks up, and then investigate the lock-up state for yourself from the Debug perspective.

Great, now go to ‘Navigate->Open Type…’ and use it to find your way to KeyboardAndDisplaySimulator.java. Navigate to line 210. It should look like this:

updateMMIOControl(RECEIVER_CONTROL, readyBitCleared(RECEIVER_CONTROL));

This is our culprit – a threading issue, a deadlock caused by this function call and another from AbstractMarsToolAndApplication.java. To implement the workaround as I have, you simply need to replace this line with the following:

//-------------------------------------------------------------------------------------
//This call caused a deadlock sometimes when using the keyboard and display simulator.
//The syncronized block below simply plucks out the necessary call from
//updateMMIOControlAndData, which is where this call would take us in the end.
//-------------------------------------------------------------------------------------
//updateMMIOControl(RECEIVER_CONTROL, readyBitCleared(RECEIVER_CONTROL));
//-------------------------------------------------------------------------------------
synchronized (Globals.memoryAndRegistersLock) {
   try {
      Globals.memory.setRawWord(RECEIVER_CONTROL, 0);
   } catch (AddressErrorException e) {
      e.printStackTrace();
   }
}
//-------------------------------------------------------------------------------------

Now if you run Mars through either Run or Debug you should find that the freeze-up never happens. Feel free to poke around if you want to know more about the original issue – but if you’re just trying to work with Mars for a personal project, this should be good enough.

Bonus
If you’re a student working on a project for your studies you may wish to provide your marking tutor with a copy of your modified MARS application alongside your assembly program. Now, after much pain I DO have a working .jar of this, and I will detail it’s creation beneath in case you run into difficulties as well, though it’s probably stupid because I’m not experienced enough with Java to know what exactly prevented me from doing it the normal way.

In the beginning it seems there are two options – you can export a Runnable .jar from Eclipse (File->Export->Java->Runnable JAR File – make sure to select ‘Package required libraries into generated JAR, ignore the warnings), or you can try running the script, ‘CreateMarsJar.bat’ which should be in the root of your project.

For me at least, the script somehow creates a .jar with the same bug as the original, and the exported ‘Runnable’ .jar…won’t run. The way around this is to make a copy of the original Mars.jar, open both it and your Eclipse-exported jar using 7Zip or a similar application, and copy the ‘mars’ folder (contains the compiled .class files) from your version into the copy of the original, replacing it’s own.Delete your exported jar and run the copy of the original – it should now perform as well as the version you launch from Eclipse.

Thanks and Stuff
Thanks go to my friend Bombpersons, without whom I might not originally have bothered to look into this issue. If you have any further information on this issue, any corrections to the information provided here, or struggles in doing this yourself, please do get in touch.

Another Self Indugant Status Update

Just checking in, lest this period of inactivity so soon after declaring my productive intentions fall under scrutiny at some point in the future. Everything went a bit pear-shaped this week, as things do when you arrive home one Friday after work to find water intruding through your ceiling from the unoccupied flat above, it takes three days to get their mains shut off and then you’re left with a gaping uninsulated hole in your ceiling.

This weekend I’m catching up on the relaxation I was deprived of last, and getting some admin chores out of the way such as maintaining my monthly internship journal for my university course, resurrecting my long dormant Lang-8 account, updating my short and long term to-do lists, and posting this.

Whatever this is.

Hopefully next weekend or in the afternoons of the coming week I’ll actually get my ceiling fixed and start pulling my mind back into a useful state. I’ll likely post again tomorrow or next weekend about my intentions for the rest of my time here – I want to finally get a grip on the priority balancing issues that have plagued me since I moved to London.

It snowed yesterday and I would have considered a chilly walk along the Thames early today  had it not all been made all sloppy and yuck by the morning rains. That would have been the perfect opportunity to get my shit together.

Anyway, here’s a photograph of King George’s Park I took yesterday on my phone.Ciao.

Image

year 2013 {

So I’ve been down in London for about five months now, and it’s been about that long since I last posted here. The reason for that is because I honestly haven’t a lot to show for that time; work takes up the majority of my waking hours, and frankly after staring at alien code for so long every weekday it’s hard to conjure up the motivation to do the same in my free time, putting pay to what has been my primary hobby for the last four or so years. All in all I’ve felt a bit overwhelmed  so far, something I hope to cope better with in this new year.

Being in London I have taken the opportunity to go about and see a few of the sites, though I’m being rather careful with my finances at the moment because London rent is insane. I’ve been over to Camden, Shoreditch, Wimbledon town, and have walked along the Thames on multiple occasions, most notably when I went over to the Waterloo region of it for the Mayor’s Thames Festival. I have some nice photographs of these things which I may append to this post, or put up elsewhere, but being in London has been generally uneventful so far.

Back at the flat I have managed to push ahead with a few of my interests. I’ve written a lot more Lang-8 entries in my time here, and gotten a lot more Korean grammar points into my skull, but the few opportunities to speak to Korean people and consume Korean media have shown that my chief obstacles are still listening and vocabulary. I’ve not progressed with drawing and digital art as much as I’d like, though doodling at work during compiles and loading, and a weekly ‘contest’ of sorts with a friend have helped to improve my confidence and get me settled into my tablet.

I have done some programming, mostly in the form of the two (failed) Ludum Dare attempts I’ve made – both times setting my aims too high and giving in shortly before the deadline, but the majority of my programming experience over the last five months has been simply building on my knowledge of compiler, linker, and platform discrepancies through tedious debugging work at the office. I’ve also dealt with a few scripting languages including bash, zsh and perl, and had the ‘opportunity’ to get to grips with Mac UI development with the Cocoa API.

I’ll finish up this long and uninteresting post with links to my Ludum Dare-attempt postmortems, and a few photographs I’ve taken around London. Best of luck for 2013 – whoever you are.

Links
Ludum Dare 24
Ludum Dare 25

Shinies

연희당 팔산대 (Yeonheedan Palsandae) at the Mayor's Thames Festival 2012

연희당 팔산대 (Yeonheedan Palsandae) at the Mayor’s Thames Festival 2012

Building adornment near Waterloo station

Building adornment near Waterloo station

Stables market in Camden

Stables market in Camden

Camden Lock

Camden Lock

Accidental couple shot at the Mayor's Thames Festival 2012

Accidental couple shot at the Mayor’s Thames Festival 2012

London Posting

So a couple of months ago I made this post about what I planned to do with my summer. Well, summer was shorter and busier than I thought it might be, so my best laid plans kind of fell to pieces. I don’t mind of course – I found a decent placement for the year after all – but the chaos that’s dominated the last month or so has left me kind of disorientated.

So where do I stand? I’m in London now, working full-time for a company named ‘Feral Interactive‘, and have just come off of a three-week stint without internet, during which I’ve walked too many miles, watched too many TV series, and played too much Ys. Before that, and before all of the effort that went into arranging the move, I did manage to get through those WebGL tutorials, read a good deal of the Python documentation, and dig through the internet in search of information about network programming for games (without much luck). Mostly though, I just studied Korean and house-hunted. I also bought a small graphics tablet – a Wacom Bamboo Pen and Touch – but I’ve had no time to look into digital art, so I’ve barely gotten used to controlling the thing.

The apartment I have here is small, but nice. It’s essentially two rooms with an entrance down a back-alley – what would be the kitchen-bathroom extension on a terraced. I don’t really spend much time here, what with my working hours, but what I do spend here is comfortable. Once I’m settled I want to get to work on the things that got put off this summer. I’m four chapters in on this maths book, but I’ve yet to get around to doing any OpenGL programming and still haven’t regained any confidence in drawing. To be honest I’ve also considered just taking advantage of the Korean presence down here in London – making language study my extra-curricular priority for the year. Work is tiring, life is complicated. Time will tell.

Right now, I’m watching 원스 어폰 어 타임 임 생초리 (Once Upon a Time in Saengchori). Next? Maybe I’ll hammer out another chapter of this maths book.

Something smells good. I think I live next door to a takeaway.

Moley Moley Moley Mole

It occurred to me yesterday that one of my major projects from this year was lacking it’s own page, so I spent a little time today typing up some info. There aren’t pictures yet, because I’m away from my desktop at the moment (actually its in pieces too) and I could never get the Android SDK running on my laptop, but at least there’s something there.

Head over to the new Mega Driller Mole page to check it out, if you like.

What a Pitch!

If you’ve dabbled in games development  at all, chances are you’ve come across Game Maker. Depending on the circles you run in you may have heard good or bad things about it – you may even have tried it yourself and formed your own opinion. Personally, like anyone else I ever remember talking to about it, my opinion on Game Maker is largely negative, and while I could see it being viable prototyping tool, I would always prefer to use something like XNA or LWJGL with a simple, ready-implemented framework.

I’ve also seen many a terrible Mario clone and other poor Game Maker game – probably a result of the application’s ease of use making it attractive to young or unskilled creatives. But I’m not spending my time typing this just to beat a dead horse, no. I’m here to introduce you to a shining example of what any tool can produce in the right hands.

Hyper Princess Pitch Review
Daughter of the Goddess of Explosions, cannon in hand and an unending supply of explosive bricks as ammunition, Pitch sets off to the North Pole with her flying, legless companion Cat Strike to give the good Mecha Santa and his robotic elves what for. What for? For not giving her any presents, that’s what.

Hyper Princess Pitch is a top-down arcade shoot-em-up in the vein of Smash TV and Operation Carnage, created by Daniel Remar and distributed for free alongside his other work, including Iji, and the fantastic Hero Core. It, like most of his games, was created using Game Maker, but you’ll see no shabby handiwork here.

As you probably guessed a paragraph ago (unless you’re skip-reading) the setting, and general wackiness of the characters play a big part in making the game so entertaining. Pitch is a likable anti-hero – even if her motivation is somewhat disagreeable – and her mother, who resides in a secret place, is an absolute riot. Pitch makes vocal remarks during gameplay of just the right frequency and variety to be entertaining rather than annoying, while her mother… uh – things explode when she talks. Mecha Santa is also pretty rad.

The graphics portray everything aptly with a bright, pixely style and no visible flaws. They’re not ground breaking by any means but they’re certainly attractive, and never bland. Explosions are very nicely drawn and animated, which is good since they’re a central feature. I don’t think I really want to play a game ever again unless re-spawning after death causes an explosion. There are rainbows, sparks, varied projectiles, colourful props and different tile-sets per level. Overall there’s a lot going on; over-the-top is the name of the game, but it never seems out-of-place

Enemies are also colourful, varied, and a little more creative than might be expected from a Christmas-themed game: shiny baubles, trains, UFOs, gun-turrets, tanks, sleds and insane, metal doppelgangers to name but a few. In some rooms you are assaulted by swarms of elves, while others contain only three or four larger enemies. Bosses are especially impressive; they’re the standard, room-filling fare, but their attack patterns are well-refined, inventive, and very interesting – more-so when final attacks are enabled for the hardest two difficulty settings. The third boss – whatever the hell it is – makes good use of the environment, advancing on you constantly and occasionally blasting the central platform with a massive laser, forcing you onto the sidelines.

That is, unless you make use of a special trick. Pitch may be all for explosions and general, long-ranged carnage, but she’s not above wrestling moves when the situation calls for them. Your main arsenal consists of an explosive-brick machine-gun, an ice-thrower (which also destroys yellow projectiles), and a slow-firing gun that fires little, bouncing bits of rainbow. These are all useful under different circumstances, but if you get in a pinch you can also hit up-down-left-right or up-down-right-left quickly to execute a block. Projectiles that hit you during a block won’t hurt, but large enemies will. Interestingly though, if a smaller enemy touches you, you’ll execute a pile-driver on it, culminating in a powerful explosion when you and your foe impact the ground. Various power-ups will aid you along the way, including obvious candidates such as power, triple and speed, hyper, and the super-rare x, y,z power-ups. Some of these override your main weapon completely, while others differ based on what weapon you have equipped. All of this can lead to a very tactical form of play, or just a whole lot of awesome-looking fun.

At this point I’d like to say that Pitch even controls well, but that’d be pushing it. Instead I’ll emphasize that she doesn’t control badly. You move her using the arrow keys on your keyboard, fire with x and cycle weapons with z. Your weapons fire in the direction you last walked in, but by switching direction while firing you can continue to fire while back-pedaling or side-stepping. This is a bit strange at first, but something I’m familiar with from some older games (don’t ask me to name any). Although it takes a while, this actually feels quite natural once you get used to it, but I still haven’t gotten the hang of the key combination for a pile-driver. Up-down-left-right, up-down-left-right. I actually like the fact that it’s difficult to execute this powerful move, but it is endlessly frustrating when you fail, especially since you have to be right next to enemies already in order for it to be effective. Wielding a hyper power-up actually enables you to perform a pile-driver at the touch of a button, but it isn’t often useful once you have a golden bricks or a rainbow laser.

Actually, that’s my only minor gripe with Hyper Princess Pitch, and it hasn’t hindered my enjoyment of the game past the first five minutes or so. There’s enough variety, challenge, humour and content here to keep you busy for quite a long time, and it’s all delivered for free, not even requiring an installation. Level design is solid, and non-linear, as you usually have two doors to choose from at the end of each room. The difficulty curve is perfect, and the game comes with a large selection of difficulty settings, each of which unlocks a new pro tip upon completion. I can almost complete the last regular difficulty setting, and I’ll probably still draw enjoyment from the game until I can complete it fully. There is a hidden difficulty setting harder than that, but you need to have some pretty l337 skills to even get through the front door.

I highly recommend Hyper Princess Pitch. It’s hard not to recommend free games, I know, but if you remember Smash TV, enjoy retro arcade shoot-em-ups, or just want to cause a lot of cool explosions without any complicated premise, you should check this out. If you want a simple, challenging arcade experience, and have fond memories of limited lives and real GAME OVERs, you have to check this out.