August 24, 2009

Rising Legends – Delayed again!

Well, I hate to be the bearer of bad news, but Rising Legends, the PBBRPG that I am working on is being delayed once more. Things have been progressing along smoothly again now that I am done school (finished on Friday) so rest easy knowing that I am spending a lot of time working on it. Currently, I wish to introduce the first town, Deepgate. It will be one of the starting towns, though for which race, I have yet to decide (that’s right, a race system is next on the list!). There is also a new zone after the town called Candlewood, which is essentially a beginner levelling zone. Expect to hang out here until about level 12 or 13 before heading to one of the major cities.

There are a bunch of monsters added and I have worked out one of the biggest problems to date, the shop system. All that’s left is adding the tooltips for items so you can see their stats and then everything will be updated online for you all to test. Your characters WILL be reset AND all items removed. This is because I would like to test out the balancing for characters starting out and seeing if things should be made harder/easier.

I will update here 24h before the big update happens!

Powered by ScribeFire.

August 23, 2009

Excerpt

When you start about building your own blogging/CMS systems, you’ll normally run into the need for an excerpt system. Sure you could use a whole new field in your database to handle it, but sometimes, it’s just easier to grab a bit of text from your post and use that.

However, doing it so that you don’t cut off mid word can be a bit of a challenge. Luckily for us, PHP has a few great functions, that while on their own seem fairly useless, combined gives us exactly what we are looking for.

&lt;<?php
function excerpt($message,$size = 100){
 
	(!is_int($size))?100:$size;
	$message = substr($message,0,$size);
	$message = substr($message,0,strrpos($message,' '));
 
	return $message.' ...';
}
?>

This function will accept the string you want to make an excerpt out of as well as an optional size variable. This will tell us how large we want the excerpt to be. Because of the nature of this function, the resulting excerpt will not always be 100 characters, but it will be as close as it can to it without going over.

The first check we do is to make sure that the size passed to our function is actually an integer. If it is not, then we simply set it back to our default of 100. These are known as conditional statements, and if we broke it out it would really just be

if(!is_int($size))
	$size = 100; 
else
	$size = $size;

Which is just too long for what we need.

The next line actually takes our string and chops it off at 100 characters using the substr() function. Using this function we pass our string as the first parameter, the start location (0 in this case, because we want to start at the beginning of the string) and the length of the string we need.

The last line of our function is a little more complicated than the rest. Once again we are using the substr() function, but this time as our third argument is actually the position of the last occurring ” ” (space) in our new substring. This is done using the built in function strrpos() This function takes a string, and a delimiter, and looks for the limiter starting at the end of the string. If it encounters it, it returns an integer value of its position. This ensures that the last character is actually a space.

Finally we return the new $message value.

Powered by ScribeFire.

August 18, 2009

Feedly – Upgrading RSS

I’m a huge follower of the RSS movement. I can’t imagine what it would be like if I had to visit all 100+ websites that I follow, to gather news daily. RSS Solves this problem for me. Although, it seemed to create a whole new one. Now instead of being able to follow sites daily, I found that if I was busy for a few days, the number of unread feeds built up quickly to in excess of a thousand and then it became all to easy to just hit the “Mark All as Read” button and start fresh. And sure it works, but by doing that I often miss out on days of news, which to someone like me, is a tragedy. But I always figured it was just something I would live with.

Then a friend mentioned Feedly to me a few days ago. It was my first real exposure to the River-of-News style of updates that many people tout as superior. Sure I’ve read the posts and understood the concept, but I never saw any need to switch to that style. Ignorance is bliss they say.

In the 5 minutes it took to get everything installed and configured how I liked it I realized that Feedly actually looks quite good. As a designer and developer, something like that is important to me (although you wouldn’t know it if you looked at this blog :P ). I find if something is visually appealing, I’m more likely to keep using it. But what I liked even better was that Feedly worked.

One of the best things about Feedly is that you can get an at-a-glance view of your entire feed repository and it’s tight integration with everything. A “Dashboard” link allows you to easily see everything you subscribe to, mark things as Favourites (or things you can’t miss!) and lets you drag/drop to re-order them. As a bonus, if you’re signed into your google reader account, it even syncs things up there for you. If you ever stumble across as website that you want to follow, simply click the  +F button in the feedly bar and it will be added to your feedly + google reader accounts.

As a personal testimony- I was 2 days behind on my feeds (Weekends tend to do that to me) and Feedly completely caught me up. Sure it has a “Mark as Read” option, but I never felt the need to do use it. Does Digg have 200+ posts? Change the view to Title Only and scan through 10 posts in the time it would take you to do one. Feedly not only sped up the rate at which I can consume news but it also offers its own integration into things like Twitter, Friendfeed, Digg and many others. So when I find a post I like, I can retweet it, or toss it on Friendfeed. You can also see if other people have already posted it and if they have you can join in the conversation about something.

I’ve never been happier with a feed reader. I’m sure problems with Feedly will arise sooner or later, but, single-handed, it brought me back to Firefox in full force.

Powered by ScribeFire.