Archive for category Programming

Halo 3 Asset-O-Matic BETA

<update>
I should have included a game history file with the beta to keep you occupied whilst you’re scanning your own, here’s Ferrex’s game history. Just load the file into Halo 3 Asset-O-Matic using the Load DB button, you can continue any scans you’ve already started as viewing a scanned game history and downloading one are totally seperate :)
</update>

It’s not quite as complete as I had planned to release but due to not having enough time to refactor the code at the moment and a strong desire to get his tool into the publics hands I’m proud, and slightly worried, to present the Halo 3 Asset-O-Matic beta!

The usual cavets apply, if your PC explodes it is totally not my fault!
I strongly advise that you read the included README.txt as it explains the basic usage and what’s missing.

Please leave bug reports here so I can get them fixed as well as improving the UI and getting those features I had to cut out for this release back in!

Please link to this post rather than directly to the file, thanks!

Here’s a screenshot so you know what to expect ;)

Halo 3 Asset-O-Matic

Halo 3 Asset-O-Matic

Tags: , ,

SwirlyMMS picture import fix

SwirlyMMS 1.1.1 is a great piece of work but if you save pictures to the camera roll with it, or indeed any of the 1.0 releases, you’ll find that you cannot import your pictures on your PC.

The problem is that SwirlyMMS is saving the pictures with the owner root instead of mobile. I’ve come up with a couple of solutions for this:

  • Change to the camera roll picture directory in putty or Mobile Terminal and type  chown mobile IMG_0036.JPG replacing IMG_0036.JPG with the name of the picture
  • Browse to the camera roll directory in WinSCP and use the custom command chown mobile ! on the affected picture
  • Use my bash script from within Mobile Terminal (I have it saved as fixswirly.sh in /private/var/mobile as this is where my Mobile Terminal starts up):
#!/bin/bash
PhotoDirectory="/private/var/mobile/Media/DCIM/100APPLE"
 
# Setup find correctly.
export IFS=$'\n'
 
# Loop through the photo directory.
for x in ${PhotoDirectory}
   do
      # Find all Files
      for i in $(find $x -type f)
         do
            # Fix Permissions
            chown mobile $i
         done
   done

It has to be run as root and if you run it from a location that is not on your PATH you will need to run it as such: ./fixswirly.sh or sh fixswirly.sh

Based on an example Bash script by linickx.com

Tags: , ,

Staff Captains Don’t Suck – Asset-O-Matic continues

Halo 3 logoI found time to start work on the Halo 3 Asset-O-Matic yesterday between rounds of Team Swat and whilst there’s still a lot of work to be done it’s progressing at a nice rate.

Before I go on, I have to wonder why Staff Captain’s get such a hard time in Halo 3? I was sat writing some code whilst waiting for a match to start only to hear H4NNIBAL uk giving me grief about my rank. Not my skill rank, but my not very important military rank. I questioned him about this and he told me what others had also echoed, people incorrectly think Staff Captains suck at Halo 3. I’m certainly not the best player out there but I’m not too shabby and my lack of progression is down to the vast number of social games I’ve played and the fact I hate free-for-all (where I found it very easy and fast to reach the 20 skill rank I needed to get Staff Captain status). The rest of my playing recently has been in mixed Team Swat where it’s very hard to progress at times due to some poor performances by those random players you’re teamed with. Some people work great as a team, some don’t and I’ve played my own fair share of bad games.

Speaking of which; I explained to H4NNIBAL uk that I was in the middle of programming and he seemed to think I was making up a lame excuse and proceed to tell me he was eating. And having a drink. And watching TV. All whilst playing Halo 3. Sorry to break it to you H4NNIBAL uk, I wasn’t lying, I was actually working on a project and it happened to error during our game. I also wasn’t making excuses when I told you I suck at Schwatguns, I really do suck at it, give me regular Swat any day :)

Enough with Halo 3 and ignorance though, here’s a brief run down of the changes:
Saturday was mainly spent adding code to allow fast and effective ordering by date which meant another database schema change. After that was implemented and tested I set to work updating the popup menu items and adding their functuality. I’ve still got one popup menu item to work on but that’s on hold until I refactor the code into a nice tidy class.
Sunday was mainly spent working on the template code. Templates are a handy way to output your saved data in any format you wish. It’s mainly designed for creating html output like this:
Slayer on Valhalla (13:03 26/09/07) – 1 screens, 0 clips
Slayer on Sandtrap (13:31 26/09/07) – 2 screens, 1 clips
Hammerzeit on The Pit (16:17 27/09/07) – 5 screens, 0 clips
Oddball on Guardian (20:38 27/09/07) – 3 screens, 0 clips
Slayer on Snowbound (21:13 27/09/07) – 3 screens, 1 clips
VIP on Isolation (00:20 30/09/07) – 2 screens, 0 clips
Ninjanaut on The Pit (20:39 30/09/07) – 1 screens, 0 clips
Team Slayer on High Ground (21:45 05/10/07) – 3 screens, 0 clips
Big Team Slayer on Sandtrap (15:39 07/10/07) – 5 screens, 0 clips
Slayer on The Pit (22:30 09/10/07) – 3 screens, 0 clips
Territories on Last Resort (20:36 10/10/07) – 1 screens, 0 clips
Big Team Slayer on Sandtrap (20:55 10/10/07) – 3 screens, 0 clips
Slayer on Sandtrap (22:56 13/10/07) – 0 screens, 1 clips
Team Slayer on The Pit (01:53 14/10/07) – 0 screens, 1 clips
Multi Flag CTF on Valhalla (17:55 20/10/07) – 0 screens, 1 clips
Team Slayer on Narrows (21:26 21/10/07) – 1 screens, 2 clips
Team Slayer on Snowbound (21:53 21/10/07) – 0 screens, 1 clips
Shotty Snipers on Narrows (22:01 21/10/07) – 2 screens, 1 clips
Team Slayer on Narrows (21:48 23/10/07) – 0 screens, 1 clips
Eliminatio on Valhalla (20:45 24/10/07) – 2 screens, 0 clips
Big Team Slayer on Valhalla (20:29 03/11/07) – 0 screens, 1 clips
Multi Flag CTF on Valhalla (16:45 04/11/07) – 2 screens, 1 clips
VIP on Valhalla (23:56 04/11/07) – 3 screens, 1 clips
VIP on Valhalla (17:28 09/12/07) – 2 screens, 0 clips
Team Slayer on Rat’s Nest (19:32 11/12/07) – 8 screens, 0 clips
Multi Flag CTF on Sandtrap (19:01 22/12/07) – 20 screens, 1 clips
Big Team Slayer on Valhalla (22:59 26/12/07) – 1 screens, 0 clips
Shotty Snipers on High Ground (15:37 02/01/08) – 0 screens, 1 clips
Multi Flag CTF on Valhalla (19:59 13/01/08) – 1 screens, 0 clips
Team Slayer on Rat’s Nest (13:26 19/01/08) – 2 screens, 0 clips
Multi Flag CTF on Sandtrap (21:47 20/01/08) – 1 screens, 0 clips
Multi Flag CTF on Valhalla (23:23 04/02/08) – 3 screens, 2 clips
Team Slayer on Rat’s Nest (21:47 07/02/08) – 6 screens, 0 clips
Slayer on Isolation (21:56 20/02/08) – 0 screens, 1 clips
Multi Flag CTF on Sandtrap (00:40 24/02/08) – 0 screens, 2 clips
Neutral Assault on Standoff (18:45 24/02/08) – 0 screens, 1 clips
Team Slayer on Foundry (20:06 24/02/08) – 2 screens, 0 clips
Team Slayer on Rat’s Nest (22:57 03/03/08) – 6 screens, 0 clips
VIP on Rat’s Nest (22:03 04/03/08) – 0 screens, 1 clips
Multi Flag CTF on Standoff (22:27 05/03/08) – 0 screens, 1 clips
Team BRs on Standoff (11:03 08/03/08) – 1 screens, 0 clips
Team Rockets on Standoff (16:44 16/03/08) – 0 screens, 1 clips
Forge on Standoff (14:32 21/03/08) – 2 screens, 0 clips
Team Duel on Rat’s Nest (23:10 26/03/08) – 1 screens, 0 clips
Multi Flag BRs on Rat’s Nest (12:50 30/03/08) – 1 screens, 0 clips
Team Slayer on Last Resort (18:58 08/04/08) – 0 screens, 1 clips
Team Slayer on The Pit (22:55 18/04/08) – 0 screens, 1 clips
Neutral Assault on Avalanche (23:52 19/04/08) – 1 screens, 0 clips
Team SWAT on Guardian (13:39 08/06/08) – 1 screens, 0 clips
Team SWAT on Ghost Town (21:23 08/06/08) – 2 screens, 0 clips
Team SWAT on Ghost Town (21:59 16/06/08) – 0 screens, 1 clips

That’s every game I’ve played up to yesterday where assets exists. These assets can be made by myself or anyone else who played in that game, there’s a couple of videos I’m the star of that I didn’t know existed until I created this program!

The next stage is to start refactoring my code into a class as there is far too much duplication in places. At some point a public beta will arrive, until then I might start posting a few of the Bungie guys Asset-O-Matic results to keep you entertained ;)

Tags: , , , ,

Halo 3 Asset-O-Matic Beta – Soon

Halo 3 logoThe Asset-O-Matic is coming along nicely now. The database code has been completed and I’m now planning the best way to display the stored information, this is where a public beta will help no end with people feeding back as to what they want to see and how. Speed wise things are looking a lot better, I have just scanned my current game history (1150 games) and it took 19 minutes 50 seconds. A vast improvement from the original 50 minutes for 1000(ish) games.
I’ve got an occasional memory leak to track down, it’s currently escaping me as everything I create is destroyed correctly and the leak can occur on searches that previously had no problems. It’s a little random and hard to repeat on a regular basis so the first beta might come with a warning to restart the application for every new game history you scan as it’d be a shame to hold off on release for such a minor and occasional problem.

Update
I’ve fixed the memory leak, when scanning a gamertag with only a couple of games played the downloader threads would occasionally finish before the scanning thread had processed the games. Another bug left over from when I upped the amount of downloader threads from 1 to 5.

Tags: , , , ,

Halo 3 Asset-O-Matic now 50% faster

Halo 3 logoWorking down in Worcester last weekend left me little time to work on the Halo 3 Asset-O-Matic but I was able to steal an hour or so away from the current Double XP weekend playlist to do some further work. I’ve beefed up the amount of downloader threads from 1 to 5 which has halved the time needed to analyse my game history, 1167 games at the time of writing, down to 23 minutes from 50. It’s still more than I had hoped but the bottleneck is the speed at which Bungie.net is responding. The thread that strips the information from the pages never falls behind and is working on each page as it arrives. I could throw more downloader threads in there but I’m not sure what affect this will have on Bungie.net I guess the first release will have to be a slow but sure affair.

The database code hasn’t been started yet, the program is currently erroring on completion. Nothing show stopping but something that needs addressing before I move onto the DB code. With the recent announcement that Bungie are going to give the helm of Bungie Favourites to the community I can see an increased need to locate which games have assets in your history.
I’ll be working on stopping the completion error today, I’m not sure why it’s only just started happening so that’s an interesting challenge. I’ll also need to find a profile that hasn’t played many Halo 3 matches for testing, another challenge in itself :D

Update
I’ve fixed the error, I hadn’t accounted for going from 1 thread downloading to 5 which meant another thread was exiting early. I also picked up on a subtle bug where 1 of your games was never processed. Hardly a killer bug but I’m glad I spotted it before the public beta (as soon as the DB code is written) :)

Tags: , , , ,

Halo 3 Asset-O-Matic AKA the Halo 3 Assets Finder

Halo 3 logoI’m a big fan of the film clip/screenshot feature of Halo 3 and check the Bungie Favourites every time I load up Halo 3. Recently they haven’t been updating this as much and this left me wandering the Halo 3 Files Forum in search of some decent clips to watch. Then it hit me, what if someone had made a video from a game I was in, how would I find it? Well Bungie’s site makes a lot of stats available but finding all the games with assets, even for just yourself, is a tiresome and manual process. I didn’t fancy looking back over the 1000 or so games I had played, checking each one for assets (screenshots and film clips created by players) so I created the Halo 3 Asset-O-Matic.

The Asset-O-Matic (development name: Halo 3 Assets Finder) actually stemmed from an earlier idea, I was going to log every game recorded by Bungie and make a database of all the games with assets, build a website around it and let people search on almost anything; date, player name, game type, map, length of match, number of clips/screenshots, well you get the idea. I did some quick maths, and it wasn’t good. I could do it slowly and not cause a Denial Of Service on Bungies site or I could do it faster and risk taking Bungies website offline. Doing it slow meant it would take days, even months to log every game and then the data would be immediately out of date. The faster option wasn’t much faster and risked getting me banned from Bungie.net and even Halo 3. Then I realised, most people will only be interested in clips/screenshots from games they were in. I spent the better half of a day re-coding my application and threading it so I could keep tabs on the results in real time. The results are what you see below, the Halo 3 Asset-O-Matic

The Halo 3 Asset-O-Matic

As you can see, I record a lot of information, all of this will be stored in a local database in the final version so you can update overnight and browse the results at your leisure. The current layout is for testing purposes, the final version will allow you to search the database, rate the results, look better with organised information and be easier to use.

A brief overview:

What does it do?
The Halo 3 Asset-O-Matic scans the game history of any Gamertag you specify looking for matches with Assets (screenshots/film clips).
How fast is it?
The development build took just over 50 minutes to scan my entire game history, that’s 1052 games at the time of writing.
50 minutes!? Can’t we speed that bad boy up a bit?
The program is currently single threaded, adding extra threads to prefetch the game data will speed things up a lot. My concern with this method is that if the program becomes popular it could cause a DDOS (Distributed Denial Of Service) on Bungie’s site. I will look at adding an extra thread or two to the program to check the speed difference. Ideally I will be able to discuss with Bungie how the program affects their website and adjust it accordingly before public release.
When will you release this?
There is no current release date but I’m expecting it to be soon. The database code needs adding and then some tests on adding a few extra worker threads to speed things up. Keep checking back for a release date.

Over the course of testing this I found a horde of film clips that I enjoyed watching, knowing I was in there somewhere. You never know, you might find that you’re the unwitting star of someones video, just like I did….

Tags: , ,