Since I don’t have my own server somewhere, I have been running stuff on Dreamhost for a while now. Most notably my LotRO site is hosted there. In fact one of the major reasons to implement it in Rails was that Dreamhost supports that and PHP, and I had gotten really tired of making stuff in PHP.

But using a host like Dreamhost has some other nice little bonuses. Like for instance today I discovered that they had upgraded Rails and removed the old version I was using. Now that shouldn’t have come as a surprise, as they posted they would a while ago. But having been working on a couple of new features, whenever I could be bothered to look at it. I was putting off just deplying a compatibility fix. Of course I had never gotten the features done and now the upgrade finally hit, resulting in my site no longer working.

So as a result had to do an emergency release. Lucky I had already gotten most of the site working on Rails 2.1.1 so it wasn’t a big deal. But they also released Rails 2.2.2 so now I have to get that working before they remove 2.1.1 as well…. *sigh*

Subscribing to a host of Eclipse-related blogs on my Google Reader account I come across a number of interesting post. And I just read one by Neil Bartlett about the recent Glassfish V3 Prelude release by Sun.

There is not a lot to say about the post as he is mostly correct that the inclusion of OSGi mostly a plumbing thing in the JEE App Servers of the day. But at least it seems to be a much better technology that basing everything on JMX, since it was never really meant to be used to handling loading of all kinds of things in a complex server.

The reason I am responding to the post at all is that I find it somewhat strange that anyone would even consider the idea that Sun would invent a competing development- and deployment-model to JEE, even if perhaps not surprising from a person is very focused on OSGi. The whole idea about Glassfish (and Jboss and WebSphere) is that they implement the JEE spec as set by a JSR.

And as far as I know there is no standard even defined for deploying enterprisy applications in OSGi. So if we are going to make a new way to deploy stuff in OSGi, perhaps someone should come up with a model that can actually replace JEE instead of just saying it is “broken” and then have everyone rolling their own way of doing things. If we are all doing things in different ways we don’t need an App Server to begin with, we will just load the modules in OSGi we need and figure out how to put them together ourselves, without putting it all in Glassfish…. or Jboss or WebSphere.

What I find odd about the usage of OSGi in Glassfish is that Sun is still working on a component model of their own, to be included in a future Java release while OSGi isn’t. But it seems that the developers inside of Sun isn’t going to eat that dog food and are just going with what everyone else are using in the first place.

I just noticed that a new kinship just wrote their kinship hall in the text, and that the neighborhood wasn’t listed. So I took a round and found a bunch that had been added since I initially did the list. So the following has been added:

Bree-land Homesteads
Bainburg
Bedbourne
Blackwell
Bronburg
Burrstow
Flinthurst
Flitton
Grimstable
Hamlin
Hirfold
Knockhouse
Melcot
Westcomb

Falathlorn Homesteads
Amon Thanc
Celethmar
Dol Luith
Ecthelhad
Imlad Lind
Thorellant

Shire Homesteads
Berrybridge
Cropfurrows
Mousehill

And I also fixed Maremead as it should be Haremead
Thorin’s Halls Homesteads
Aisgarth
Dólgrof
Geirskáli
Kvisgren
Lindgarth
Mestrof

Turns out that Turbine simply changed the JavaScript they used to convert coordinates and figure out what tiles to show when. Lucky I just copied that file without modification. So I just had to replace it and it worked again.

Now settle down Turbine! It’s very annoying when you change something without us, who leeches of your functionality, isn’t informed of it. ;)

Tags: , , ,

Just a small note to state that I noticed that the Hosing Directory map seems to have gone haywire. Looks like Turbine moved their map co-ordinates a bit. I’ll look into bringing my house locations into sync with it soon(tm).

Tags:

Ruby on Rails 2 has been out for a good month or two by now. And my hosting provider, Dreamhost, added the gems to support 2.0.2 just after New Years Eve, So obviously I had to upgrade the Laurelin Community Site.

I had been on it already before christmas. But motivation was lacking and it turned out it required some modifications to get going. Specifically the wise guys of Rails Core decided nobody was using pagination so it had to go. Or possibly they decided they where unable to improve it and hoped the community would fill the gap with something better? So the old pagination stuff was kicked out of Rails 2 and replaced with an optional (and likely very unsupported) plugin while telling everyone to use something else.

So I turned to will_pagination as it seemed like it was the most recommended one of the young Rails 2 scene. It appears to work well but I had to redo my pagination control. So far I have just hacked something ugly together… seems to work with the ugly site anyway.

The biggest hurdle then was that my auth_generator-based user-login system seems to have been unsupported for ages. And it had several issues with Rails 2. And that my use of pagination with the acts_as_taggable_on_steroids plugin had to be changed. Both was fairly simply. The latter would have been tricky if I hadn’t found a trick in a comment on on a blog. The actual proposed fix in the main blog entry being way too much work for me to bother with ;)

On the up-side it seems that Rails 2 run a bit faster than Rails 1 did. Maybe it’s just placebo tho. I guess I’ll have to see about that.

Then I fixed a slight bug on the site (if someone used ‘ in a name that was to show up in the Housing Directory. It would no longer show markers on the map when page loaded). And added Kinship profile links that use the kinship name instead of their id. And off to release it went. So it is now live on Rails 2.

Post release I did get one major annoyance. Mainly that if I use the same cookie name as the Rails 1 site I’d have people throwing exceptions when they first returned to the site. Changing the cookie name should have fixed that. I hope ;)

Well it’s been a while since I wrote anything here. My last post was about the initial release of the Unofficial Laurelin Community site. And look at how far it has come now.

Okay, so it is still ugly. But functionality-wise it has moved a far distance from back in July when it was just a kinship listing. In between I have added, first, an Events Calendar and now also a Housing Directory.

The events calendar seems to have gone by pretty much unnoticed however. I personally add events I find to it. But nobody else seem to do and I doubt anyone really checks it very often either. A shame really, as it allows people to subscribe to upcoming events either via RSS or iCalendar format. It would make keeping up with the social life on Laurelin easier for most I’d wager.

Also I am a bit proud of the ‘Upcoming Events‘ page that show a list of events and a live countdown until event start. Making timezone calculation a thing of the past… if people actually looked at it ;). Also it is really missing the official events held. But the official events staff only post vague clues before the events. No time or place information is given.

Last night I then released the latest sprout of functionality, the Housing Directory. Basically anyone can now register what house they live in on the server. The idea is to make it easy to see who you live next to. Or to find where to go to visit someone, but actual searching didn’t make it in the initial release.

The actual map used is a bit of a throw back to some of my previous projects. It turned out Turbine (the people making the game) already had a Google Maps-based map on their official WIKI: LoreBook. So having worked with the API previously I simply use their map tiles and integrated it into my own site (while mentioning where I got it - of course). Then it was just a matter of mapping all the 120 housing locations and writing the backend and frontend code for it to show them.

It was all rushed a bit tho. And it shows. I only tested it in IE on Windows after deployment and then discovered that my dynamically updated drop down selectors seems to be broken there… DAMN! And default security settings block the externally-hosted chat window… Double-DAMN!

I guess I still have some work to do tonight then…

Since my time in Vanguard was very short I never really got around to play much with Ruby on Rails. I suppose I could continue to work on that project just for the hell of it. But I know myself well enough to know that for spare time projects I work better if I have a personal use for the project. So here comes a new one.

I replaced Vanguard with Lord of the Rings Online and it turns out the community tools are not all that developed. In fact there is a forum for each server and that’s pretty much it. So it’s up to the inhabitants of the servers to figure out how to organize their community and how they want to communicate with each other.

So far we have had forum stickies of kinships and events that one person took the responsibility of updating. This has rarely worked well because we all just want to play the game really. Spending a lot of time on manually updating lists becomes boring after a while. And even the most dedicated people still have other things to do in their spare time anyway.

So I figured it was a good project to work on in Rails. And now it is sort of live here: lotro.houseofkenja.com.

I made some improvements from my previous flirt with Rails. I now have both a development and a production database. And I use the database migration tools in Rails to make update my production database with the latest developments. The latter still takes some effort to get right tho. Since it is much easier to build databases directly in the development database than writing migration files. So I have to hash out the migration files after developing the code… Not too smart as they then don’t get tested much before I release the code to production. But maybe I just haven’t found tools yet to make this easer.

One issue with Rails that came up today is really mind-boggling tho. Having coded Java for years I am so used to not having to work much with character encodings. Everything Java does is in Unicode so you just need to handle the places where things come in and out of it. And mostly it is easy to take care of.

Turns out Rails is not quite ready for the Global Village idea. On an app where everything runs in UTF-8 I still had to apply some hacks to actually get the text displayed correctly. Turns out Rails (or Ruby?) has no support for encodings so it messed up UTF-8 names coming out of my database even tho the web pages are also encoded in UTF-8. Annoying but it seems the hacks work. So one can live with it.

Apart from that I have no real new things to say about Rails. I am getting a feeling that even tho the framework gets a lot of hype it seems there is not that much community around it. Specifically I am finding a lot of stale ‘documentation’ on their WIKI and I find it hard to Google myself to straight answers. And a lot of the community solutions to common issues seems half-baked and either dead or crawling very slowly. I suppose I have been pampered in the Java world where a lot of companies are sponsoring projects and people have had a lot longer to come up with good solutions.

Well. More from the battle-front as this project develops.

Over the last month or so I have been busy in a new game. And as usual I have found it to be a good excuse to try out some new things. Specifically I felt I needed a place to store some information and I couldn’t find a good desktop tool for it. So instead I decided to make a site for it.

Of course to be useful for quick data entry I needed to add a bunch of AJAXy stuff. Having already had experience with the Dojo toolkit it would have been the easy way to go. But then I needed some backend to power it too. PHP would have been an obvious choice since it is so easy to host. But data persistence is so annoying to setup. Instead I found out that Dreamhost (where I have an account) also supports Ruby on Rails.

Having made my salary on Java development these last years I have, of course, heard a lot of hype about the framework. So i figured it would be a good time as any to give it a spin and see what makes it so great.

Getting off the ground is super easy it seems. Rails is based on conventions and code generators. So getting a quick CRUD site together is as easy as running a script, configure data access and generate some boilerplate code for the tables you want to access. And you are off.

But that is where the chain breaks a little. One of the comments I have seen about Rails is that compared to Java persistence frameworks like Hibernate (that I learned entirely from the manual on their website) documentation is much better for Rails. And you wouldn’t need to buy books. Strange tho since the most prominent links on their documentation page is two books and their ‘manual’ is a couple of descriptions of add ons to the framework and not the framework basics itself. So basically you are left with a conventions-based framework that only has documentation the the actual API. Yay!

But Google (or any search engine really) is your friend here. Good queries and some patience sifting though mailing lists and blogs will eventually answer most questions.

The actual framework is nice enough once you get to know it. I don’t really like the syntax of Ruby very much. After years of C-based languages I miss the easily read block markers that curly braces make. Having an ‘end’ keyword blends into the code too easily even in well-formatted text IMO.

As for the actual site it will flow with my motivation to play the game. And Vanguard is somewhat down that scale right now. I got a basic site up with room for most of the diplomacy essentials. Cards and NPC decks. I also added the option for registered users to build their own deck but it does not do much other than just your cards.

I’ve gotten a lot of work to add quests to the site also. Mostly with the main focus still being on diplomacy. I’ll likely finish it up sometime soon if I get a spare moment. Apart from that my work on the site is a little dubious. But then as long as I am the only real user it does not matter too much I suppose.

It’s been placed on my ‘House of Kenja’ domain like the Dark and Light map since it is where I do my ‘gaming stuff’.
The site can be found here: House of Kenja - Vanguard site.

This week witnessed the release of one of the features I have wanted to implement for a while now (and I think promised a couple of times on IRC at least). Namely the fabled Transport Lines.

As mentioned in my previous blog entry getting the lines on the map wasn’t really all that much of a challenge. What turned out to be the biggest piece of work was getting the editing tools working. And perhaps more importantly: getting them implemented in a way that didn’t break the ones I already have in place for normal markers.

Getting all this done required me to - once again - re-factor large parts of my code. Usually something that isn’t a big issue when you normally write code in decent IDEs. But the loose nature of JavaScript makes it hard to write good re-factoring tools I suppose. At least the ones I’ve found don’t do any magic in that field.

This latest re-factor did result in my first real piece of polymorphic JavaScript code tho. Specifically I needed the normal markers and the transport lines to work as much the same as possible. And also the editors for them needed to work the same so I didn’t have to add a lot of redundant code. It’s not really all that pretty at this point. But at least it’s reasonable easy to move on from the point I am at now.

With transport lines in the need for map editors have increased a bit. So I will continue to add some more of those as I find trustworthy people who are willing to take on the job. Recently one member of Mystical Alliance was added to the staff. And hopefully one more from the same guild is interested in contributing. Still haven’t found any Dark players who I feel I can trust enough for this (and also have the time/interest to do it). So the search goes on in that direction too.

Moving on from here I have several ideas what I would like to do. But I suspect my progress from here on will slow down a bit due to my somewhat limited motivation to actually play Dark & Light. Most of my current guild seems to have decided not to play. And most of the reasons I initially wanted to play this game seems to have died when NPCube had to rush out the game to make some money.

If I do go on with this project my next goal will be more focus on allowing people managing their own map with marker sets of their own types and icons. Parts of the code has already been prepared for this. But more changes needs to be made. And also I need to implement some pages where people can sign up and manage their profiles and map. So even if I manage a high level of motivation it is going to be a while before I have that ready.

Technorati Tags:

Well. A couple of updates have come and gone. And finally I have enough backend tracking to allow 3rd parties to edit the map. So far I have two people who have access to add, change and delete markers on the map. Currently it is members of the guild I am part of - Age of Judgement. But I think I’ll need at least one darkie to also do some updates so I can have Dark Kingdom markers added.

Next up is transport lines. I already have some of the frontend code working in the development environment. But before you all start holding your breath you, I still have editing, XML generation, XML parsing and the database backend to complete. Hopefully I’ll have time to get this working this week so the editors can start adding them all.

Well. I finally got around to releasing the DnL map to the public last saturday (it’s available here). And slowly over the last week I have been adding a number of markers to the map too. Yesterday marked the first day with more than 200 visitors. But it also happened to be when I released a small update.

The update was mainly to fix IE compatibility. The marker info windows didn’t show any text. And the drop-down menus didn’t really work well in IE. Both of those issues where fixed. The latter one I completely went around by moving the marker list into a separate marker floating window. For the current amount of markers it may not make much sense. But as I progress with adding features (and markers) it is much more flexible to show them this way. And allows me easily add more drill-down methods (like by domain) without having to figure out how to put it into the design of the page.

IE6 still don’t show the info windows 100% correctly. No idea why it don’t pick up the CSS formatting. Damn I hate that browser.

Next up is either adding support for transport lines or preparing the map for 3rd party editing (as in someone else but me). I won’t have much time for it for a couple of days. So I’ll leave it as a surprise (to myself and everyone else) what I do first.

Well. Progress on a real map for DnL is going forward. I have most of Light Kingdom mapped. And I got Dark Kingdom mapped in stress test. So in a day or two I can post a full map of open areas of DnL.

My plan was to add a domain borders overlay for users to switch on and off. In theory it would be real easy since I already have the overlay in a separate layer in my map source file. But in practice it turns out to be very tricky. The problem is I have a script that makes Photoshop make all the tiles needed. And I do that by coping each tile from the source file. And the paste it into a new window that then is saved as the tile. So far so good.

Trouble is a lot of an overlay is clear space - since you want it to be transparent. And Photoshop basically ignores clear space in copies. So when pasting tiles with clear space you end up with with just the area that have actual pixels in it with no way of knowing where that data was in the tile you copied. And no idea how to correct the specific. Damnation!

So until I get a good way of handling overlays I guess I’m stuck. Instead I will be working on adding transport routes to my map. And I should be able to make an overlay with a grid on. Hopefully I can do that dynamically on the server since it’s just a couple of lines and some text. So look for that soonish.

But first I’ll get the actual map up. Should be public in a day or two.

Technorati Tags:

Well. It’s been another couple of slow weeks. And little progress has been made until now.

I’ve finally begun working on the map again to get ready for DnL release. First step has been a very basic one: Making the tiles for the map (everything you see on the map is made of 256×256 pixel tiles).

My basic map is a Photoshop file that I then run a script on to resize it for the various zoom levels. In SoG I could just about scale the entire map up to the closest zoom level. But with the much larger map of DnL this is no longer possible. The source file (with lots of empty space) is now over 800 MB. And it’s 17500×17599 pixels big. The current limit is Photoshop is 20000×20000 I think. So scaling up the map by a factor does not seem like an option…

So yesterday I got down to changing my script so I now segment the map for when I scale it up. And I think I cracked it. So scratch one issue off the board.

Second issue is showing the markers on the map. So far I have just been loading all markers and added them to the map right away. It wasn’t all that fast in Google Maps API v1. But moving to v2 made it terribly clear that it’s not a viable option. So I’ve now added a basic filter so only visible markers will be on the map at any given time. Loading of the map is much faster now. But moving around takes a little longer to update. On the close zooms it’s performing pretty well. But zooms longer out are still pretty heavy. But some filtering of the domain markers (towers) should handle that.

Moving forward I’m hoping to get a dummy map up for DnL soon. And I’m planning a couple of optional overlays for grid and domain borders. More on that when we get there.

I suppose some research would have made me arrive at this conclusion sooner. Or just a larger dataset of marker. But now it hits!

The initial update to Google Maps API v2 went quickly. And the new support for map controls (interactive images and text that hovers over the map) makes it easier to make the map the dominant part of a page. But suddenly the initial loading of the map takes ages…

Some research reviled that the current limits to markers on the map is around 200 for version 1 and 150 for version 2. And I have somewhere in-between so I’m guessing that’s why it’s so slow. Well damned! Looks like I’ll have to be smart about what is being shown. Tricky when you plan to have random people make their own sets…

Annoying. But I suppose I’d have hit it sometime anyway. So I guess I’d be faced with the issue sometime anyway…

Well. I was finally getting down to work. Moving markers in my editing tools was almost working… Except they where not. So on to the Google Maps API site to check the docs… And SHOCK! They released version 2 of the API.

Now I had been expecting this for a while. I looked into it a while ago. But with no estimate on when it would be released I plainly ignored it and moved on with version 1.

But as it happens my current issue seems to be solved in version 2. Markers can now be moved in their API. And I don’t have to do hacks to do it. Oh goodie! Also it seems there is an error log in Google Maps API now. Perhaps it will help me in those situations where for some reason my script dies in the belly of the API with no error messages in the JavaScript console.

Well onwards! Guess it means the index-dev.html won’t be functional for a while. But then I don’t think a lot of people use it except me.

Well. I’ve been back on the ‘net for a couple of weeks now. And, well, nothing much seems to have happened on the map.

But in fact some things have happened. I got adding markers working. And then promptly broke most of the map when I started re-factoring the code into more manageable blocks.

But none the less progress is really slow. The problem is mostly the trouble of debugging JavaScript. On my development box Firefox has picked up some problems with my map so the editing box will stop the rendering of changes in that window. Strange thing a new installation - with all related data deleted - seems to change nothing. But other Firefox installations on my other computers don’t do the same. And neither does any other Gecko-based browsers on the same machine (Camino and Mozilla). But also it’s rather hard to debug xmlhttp AJAX stuff locally since I have to set up the entire backend locally (since it can’t call any other hosts).

But still I do get a little done. My re-factoring is almost done. So I can now work on getting the client-side (browser) markers updated after successfully storing changes on the server.

Moving on from that I need to finish the moving of markers. And then finally I can implement separate marker sets so people can register to have a map of their own, with only markers they made.

Well. Most of the editing tools have now been made. Currently I can (on my development page) login, update and delete markers. And also I have added some support for dynamically reloading changed markers (not functional yet tho).

Also some fundamental work for allowing different marker sets has been added. When complete I would be able to allow other people maintain their own set of map markers.

What is missing is adding markers and some more fine-grained permission support.

BUT. Work has now ground to a halt. My internet connection is now down for awhile (changing ISP). And working with Google Maps would be a major pain without an internet connection. So, unless I have some spare time at work, I won’t. The downtime is going to be somewhere between 1 to 5 weeks…

Well. Late last friday I finally finished making a complete map of the SoG part of the game. After having worked on uncovering the map for a while I got some outside help on getting it done. But I don’t think I’ll mention any names since the way I got a full map is though an exploit by manipulating the local files that store map progress. I’ve used the exploit. I’ve notified AD about it. And I’ve voiced my opinion that I don’t think it should be like that in Dark and Light… And still I use it get the map up so I can concentrate on getting some more functionality into the map.

So let’s talk about that instead. I’ve got a couple of things I’m planning to do next. First off I’ve been working on getting the XML parser working better. Seems the marker notes only shows on FireFox so I’ll start to use a javascript lib that does stuff like that in a cross-browser friendly way (or knows how to hack each different browser that is).

Next up is a better way of placing markers. Currently I take the location shown on the bottom of the page and paste it into SQL for insertion into the DB (that is in turn used to create the XML file the markers are read from by the browser). I’m planning to enable the markers to be made directly in the browser by people who have already authenticated with my site. At first it will only be me using it. But hopefully at least in Dark and Light a number of map editors will be able to place the markers on the official map. And finally I’ll likely make people make their own markers on their own versions of the map.

With easier updating options I’ll also make the map update-able without reloading the page. So you can just have the map open and new markers will be placed or changed ones will be moved. That’ll mostly be to see forts I expect. But none the less it’s a challenge I’ll be tinkering with just for the hell of it ;)

And finally I’m planning to allow users to supply their own marker file as XML. The idea is that some people will be paranoid enough not to want to store markers in my database. So to cater to those I’ll build an option where they can store their markers in their end and only load it in the browser.

Well. I spend a bit of time making the map work in IE6 now. Basically I had just skipped a couple of details from the Google Maps API documentation about how to use polygon lines (since on IE it’s drawn in the browser with VML instead of loading overlay images from Googles server).
Also I got the Info boxes on the markers working again. I did a bit of reordering of that code when doing the checkboxes that switch on and off various kinds of markers. And I didn’t do it right. So the boxes got broken. But they are back! ;)


XPressME Ver.1.09 (included WordPress 2.7.1) (0.630sec. )
Main Menu