Archive for September, 2008

Update Submitted!

Monday, September 29th, 2008

I’ve submitted my update for MachDice! Here’s a review of some of the new features for 2.0:

Wait, I hear you asking: “What’s the One-Roll Engine?”. Check out the wikipedia article. It’s a neat system that involves counting matches instead of totaling values and a special “wiggle die” so it was an interesting system to implement for this device. I’ve also implemented subtotals for those of you that want your dice totaled separately (like a d20 to hit and 3d4 for damage) and bucket counts to do things like rolling 30d6 and counting the number of 5s and 6s. All of these things will be accessible through the new settings window.

The update will be free for anyone that’s already purchased MachDice! But since a number of people have asked … yes, I will accept more of your money.

Back to iPhone OS 2.0?

Friday, September 26th, 2008

Thanks for your comments, people. It helps keep me going, especially during times like this past week where I’ve been trying to track down bugs instead of adding new features…. geh.

So, I haven’t exactly found the problem. But I’ve learned a couple things:

  • sometimes, hitting a switch seems to stops further events from happening
  • the new SDK crashes if I use “Arial Bold-MT” (which I was using before)
  • my wav files on OS 2.1 sound really tinny

I’m continuing to look into the first problem, which is a biggie. I might just have to not use switches in my preferences. The second one is easy to work around. The third one … well, I’m hoping that converting my wav files to mp3s or something will help.

In any event, moving to OS 2.1 didn’t seem to help, so I’ll try to revert to a 2.0 build.

iPhone OS 2.1

Wednesday, September 24th, 2008

Hey, I noticed a little bump in traffic from the MacRumors site. (Thanks, Arn!) And welcome to those of you who are new. This is just a blog where I talk about what I’m up to, which is currently trying to figure out why my app is crashed when I toggled certain values in my settings subview.

I thought upgrading to the iPhone OS 2.1 would help but now my app just crashes as it loads. So … the update may take a bit longer than I initially thought. Sorry, everyone, but I thought I should let you know.


Monday, September 22nd, 2008

I am almost ready to submit an update. Like, it’s so close, I can taste it. Part of the holdup was that I decided I needed to implements pips (the little dots on a 6-sided die) again. See, implementing colored dice with corresponding colored text labels wasn’t too bad. But in order to do pips just right, I had to tint the pips but not the shadow or highlight areas. There isn’t really an easy way to tint using the image calls that are available, so I had to write a bit of code to do it myself.

Anyways, the end result is that you’ll now have the option of displaying 6-sided dice with pips or numbers. There’s a setting for that. Oh, right, I’ve implemented settings over the weekend, too. More on that later.

Hopefully, the update will be submitted in a couple more days (I have a few bugs I need to work out). Then, it’s up to Apple to decide how long it takes to get on the store. But it seems to be between a few days and a couple weeks.

Global Variables vs. Singletons

Friday, September 19th, 2008

As I was working on my settings view last night, I stumbled across the wikipedia entry on singletons. I had planned on creating a global settings view variable for all my other views to access. But I was concerned that the settings view might not be allocated at the right time or become deallocated. Using the singleton was a much better approach because it allowed me to explicitly control the initialization.

Updating Soon!

Wednesday, September 17th, 2008

I’m glad people are enjoying reading the posts about the upcoming features but fear not, I do plan on updating at some point. Believe me, no one wants this update to go out more than I do. Getting sick this past week slowed me down a bit but I’m hoping to get an update submitted over the weekend.

In the meantime, here’s another couple things to whet your appetite. I’ve implemented coins for d2 and I worked on the icons a bit. When you hit the formula bar at the top, task bars (like the one in option C from my “Navigation Bar” post) will show up. When that’s gone, these icons will remain to remind you that you can still hit the corners.

I’m trying to find a balance between giving enough visual information without cluttering up the background. Hopefully, this works a bit better.

New d4 Graphics and Icons

Monday, September 15th, 2008

I’ve been sick for the last few days so progress was a bit slower than previous weekends. But I managed to start putting in some settings (so that dice formulas are saved between sessions) and worked on some graphics.

The four sided dice finally have the correct graphics on them and I’ve added icons for the four corners (history, settings, previous board, next board). You can also see the locking circle for the middle die.

I’m not totally sold on the corner graphics. I originally just had the icons without the rounded rectangle button shading, but it looked too cluttered. Adding the rounded rectangle button shading helped it look more cohesive, but I’m trying to come up with something better.

Mistakes Were Made

Saturday, September 13th, 2008

I, of course, never make mistakes. Well … okay, there was that one incident with the fire in 1988 (hoo boy, that was a doozy) but I digress. For the rest of you, I’ve implemented a backspace key! That’s right, one of the most requested features has finally made it in.

I’ve tried to create an icon that blended in with the rest of the interface in an intuitive and unobtrusive way. It only appears when you’re typing in a formula and the formula display shifts over so everything is visible.

Now that I’ve put it in, I find I’m using it just about every time I put in a new formula. (So much for never making mistakes.) I know it’s silly, but it’s kinda fun to go back and forth between different dice sizes or numbers.

Incidentally, this is a good example of a feature which seems simple but is actually pretty tricky to implement. You’d think it’s just a matter of removing a single letter in a string, right? But actually, the dice formula is internally represented by a number of states: an array of number of dice, an array of dice sizes, the current mode (number mode, size mode, color mode), whether or not the current number is negative, etc., etc. Backtracking through all of that is, as I mentioned, a bit tricky.

Next up, saving preferences between sessions so that you’ll start the program with the same dice that you ended it with. That one’s going to take some work which is why I left it until the weekend to start…

Delayed Texture Loading

Thursday, September 11th, 2008

This new features doesn’t have a screenshot to go with it, but it’s pretty important. With all the new backgrounds and dice textures added, it started taking longer and longer to start the app. So I moved around a bunch of code and added some checks so that it doesn’t load a texture until it actually uses it. The tradeoff is that there’s a second or two of delay when you first switch to another board. But that seemed much better than having to wait twenty seconds each time you started the app.

Regarding the dice color comments: yup, you should be able to select something like 1d6(red) + 1d6(blue) and I do have the “d” button switch to say “color” once a die size has been selected. Hopefully that’ll make it intuitive to select colors. The formula bar will say something like “d6a+d6b”, though, for compactness sake.

Starting to Add Colors

Monday, September 8th, 2008

I’m starting to implement an interface for colored dice. The idea is that you’ll hit the “d” button a second time (after selecting a die size) and it’ll switch to something like this where you can select a die color.