Posts Tagged ‘ASP.NET MVC’

Torchlight2 Item DB

April 6, 2013

I have been working on an ASP.Net MVC EF Application that allows you to explore, query and analyse that Item and Gem Data in the TorchLight 2 Game. I thought it would be an interesting project that would allow me to compare ASP.Net MVC with Ruby on Rails and more importantly Oracle Applications Express 4.1, a tool that I use reasonably often at work.

I have to admit I have found ASP.Net in the past not that interesting especially compared to classic ASP, the whole Web Forms concept seemed to be too custom and too dependent on clicking in controls, seemed too ActiveX or VB6.

ASP.Net MVC does give you complete control of the code, you can use many open source controls and the Microsoft specific HTML helpers are generally useful although the Ajax Helpers are a bit too restrictive you are far better just writing it yourself in Javascript at least that way you can debug it. The Entity Framework does a good job of replicating Ruby on Rails ActiveRecord Framework although I found defining the relationships through the Model a bit awkward, it’s simply an annotation in Ruby on Rails. Now as I have an existing database (I had to pull the Item/Gem data out of Torchlight 2 I  could not use the Code First Method) so that may be one reason but again it was easy to use Ruby on Rails annotation to define how things are mapped.

Saying that Visual Studio Express 2012 is much nicer than the gedit environment I used on my netbook for Ruby on Rails. Git Integration is nice however I could not use it well with AppHarbour, in fact Git Integration in the Express version seems quite awkward, how you rollback from within Visual Studio seemed impossible

I used the Windows 8 Github add on and that worked seemlessly with AppHarbor and AppHarbor is free unlike Azure which is free for 3 months. Should have realised that going the way Microsoft charges you even to play online with XBox ;). Also another nice think with AppHarbor, once I had my connections set up I could easily copy my databases across though that might be to do with Sql Server Management tools.

So my Torchlight 2 Application, what does it consist of. Well firstly the home screen.


As you can see it is all fairly standard from here you can explore the search for specific items/weapns, there is also a couple of Wizards which advise use the best use of a gem and the best use of the weapons.

You can also Explore through the Item Database

Below is a screenshot of searching through the Item database


Below is a screen of the Gem Wizard where it give advice on their best use.


Below is a screen of the Item Detail Screen



Below is a screen of the Best Weapon Use Screen


Screen of the Explore Items Screen


There are quite a few screens, they all make use of Partial Paging, Ajax and the Entity Framework, You do not have to log into the application except if you want to add Items to the basket. I have not done anymore with this and probably won’t, I have a raspberry pi and gertboard to play with.

Do feel like doing a post comparing ASP.Net MVC with Oracle Applications Express 4.1, comparing Models, Views, Controllers, ModelViews and separating out database code into separate classes is kindof hard to do in Apex but there are ways of structuring code in Apex. And I will find it interesting thinking about how my Apex code has been formally structured (packages, functions, Apex API and of course that front end).

My torchlight2 app can be found at