I recently discovered Panda3D, and have been very impressed with it. I’ve had a handful of game ideas I’ve been wanting to jump into for a long time, and have consistently been looking at and checking out different engines. My favorite candidates have been Ogre (which is not a true game engine) and Unity. Both of which I have tinkered with, and run through tutorials, etc. I’ve gone between the two but I’ve feel like I wanted something in between in terms of speed/flexibility (ogre) and ease of use (unity). I think I’ve found that perfect in-between with Panda, and I’m getting some things done with it.
There’s a lot of cool stuff available in the Python API, but something that stood out to me was how nice it is the create custom event handlers in code:
# myObject derived from DirectObject
myObject.accept('Custom Event', self.listenerMethod)
# you could then do the following:
messenger.send('Custom Event', ['param1', 'param2'])
# slick.
I’m hoping to actually put together a simple game or demo this weekend and post it. Stay tuned!
This entry was written by Ryan Leland, posted on July 21, 2010 at 9:11 pm, filed under Uncategorized. Leave a comment or view the discussion at the permalink.
I like Python. A lot! I try and find excuses to use Python when I’m just fooling around with an idea because it’s so easy to go from a simple idea to something tangible. I wish I could find the time to use Python for something serious though. Every time I want to use a library (pygame, pyglet, PIL) to make something a little more serious, I end up wasting all my time figuring out issues.
Issues have ranged from something requiring Python 2.4, weird GCC issues when building a dependancy, something requiring 32 bit, etc, etc. It’s sad to me that a language as fun as Python can be so frustrating to experiment with and just try out libraries. Maybe part of my frustration is due to my lack of experience with Python (I don’t use it very often), but every time I WANT to use Python I seem to run into a lot of roadblocks (bad luck?).
Starting to feel like I’ll need to set up a linux box for fooling around with Python code, or maybe find another scripting language.
This entry was written by Ryan Leland, posted on July 3, 2010 at 10:29 pm, filed under Uncategorized. Leave a comment or view the discussion at the permalink.
I’ve been wanting to start writing some simple Cocoa tutorials lately, and I’m going to start with something easy, yet potentially frustrating. Timers. NSTimer is a great class for triggering timed events. Even though timed events aren’t really hard to implement, they can be tricky to do right. For starters, you need a run loop, a timer, a way to keep track of time elapsed since last cycle (delta time), and probably some thread management (if you don’t want other processes to be blocked). Why not spend that extra time writing something that makes your application better, right?
There are pretty much two types of timers with two styles of setting the callback. There is the scheduled timer which adds the timer to a default run loop which will start the timer automatically, and there is the standard timer which must be added to an NSRunLoop (which I won’t cover here). Both types have a variation which can be initialized with an NSInvocation class, which is really a fancier way of setting the callback (target selector). So let’s start with the most basic example of how you would initialize, and use NSTimer.
// Assume this is in a controller class, or somewhere equally useful
- (NSTimer)createTimer {
// Create a managed timer (don't need to add to the run loop!)
self.timer = [NSTimer scheduledTimerWithTimeInterval:0.5
target:self selector:@selector(targetMethod:)
userInfo:nil repeats:YES];
return self.timer;
}
- (void)targetMethod:(NSTimer*)timer {
NSLog(@"targetMethod called!");
}
Now that example will fire the timer as soon as you call createTimer, and trigger the targetMethod until you quit the application or call [self.timer invalidate];. It should be noted that with this method the target HAS to take the timer as an argument.
What if you KNOW you won’t need a repeating timer though? There must be an easier way. Well, there is. Every NSObject class has the method performSelector:withObject:afterDelay: which makes life even easier.
More complete examples on NSTimer can be found in the reference library.
This entry was written by Ryan Leland, posted on January 12, 2010 at 11:53 pm, filed under Cocoa. Leave a comment or view the discussion at the permalink.
1. Learn a functional language
Functional and concurrent languages were pretty much all the rage in 2009. I’ve been looking a little at languages, and Clojure seems pretty cool, as does Erlang. These languages make my brain hurt seeing as I’ve really only ever worked with C syntax languages, but it could be a good learning experience.
2. Learn to use neural networks
I had some experience with some basic AI this year, and did some work with genetic algorithms, but I don’t feel like it really gave me much more insight into developing intelligent software.
3. 3D with OGRE 1.7
OGRE is the rendering engine to watch next year with the announcement of iPhone support, MIT license, and the release of Torchlight, . Not sure what my actual plans would be, but I’d like to actually build something this time around. Even if it’s just a simple tech demo.
4. Finish an iPhone app?
Yeah, I’ve started a lot, and finished pretty much nothing this year. With 3 or 4 apps already on the go, I think I should probably get around to finishing something soon.
This entry was written by Ryan Leland, posted on December 30, 2009 at 10:13 am, filed under Uncategorized. Leave a comment or view the discussion at the permalink.
A friend at work put together our 2nd annual Christmas coding contest. The goal was to print out a tree that would scale by n, and was sort of inspired by another well known holiday coding challenge, only we made it a little more fun by adding some considerable complexity by adding slashes on either side of the tree to fill out the shape, and a pipe and ^ for the bottom and top.
Turns out I won despite some other brilliant entries. My secret sauce was the use of nested ternary operators, and pretty much makes the code unreadable. I’m posting the example in case anyone is interested in running it and seeing if they can improve/learn from it. Might also be worth noting that you should turn php notices off, and give $n an unsigned int value (for best results).
The code:
<?$a=str_repeat;for($t=$n+1;$t--;)echo$a(' ',$t?$t-1:$n-1).($t?$t==$n?"^":"/".$a('*',($p+=1*2)-1)."\\":'|')."\n";
This entry was written by Ryan Leland, posted on December 23, 2009 at 10:20 pm, filed under Uncategorized. Leave a comment or view the discussion at the permalink.
Consumers just know what they want.
This morning I read an article that pissed me off. It pissed me off because there were parts I agreed with, and it pissed me off because so much of the community agreed with the parts I didn’t. It was also frustrating because I couldn’t quite express just why it frustrated me so much, but now I can. The article made some big statements about app developers, and even bigger assumptions about what consumers want.
I happen to have written some cocoa, and even a few web apps in my time, and frankly, there are downsides on either side of the fence. It’s no doubt that the web has caught up to desktop applications in a pretty big way in the last 3-4 years. There was a time I would have never considered paying for a web application, let alone think of it as replacing a desktop app. Apps like Google docs, and a few productivity apps have proven me wrong.
There are still some good reasons for native apps though, and the sales figures on Apples app store speak for themselves. I think consumers might actually know what they want.
1. Convenience
On the app store, you can buy an application in seconds, and usually for the price of a coffee. On the web, it might mean a sign-up process, and usually involves digging out a credit card or paypal password. There is effort required for something that should be serving you. Pricing is also a part of this. I’d rather pay $1.99 for an app a might only try for a few minutes, than spend $20+ a year for subscription I might have to remember to cancel in a few months. I’d rather throw a dice than make a commitment.
2. Experience
The other aspect is user experience. If I am using iPhone apps, I expect each application to behave in a certain way, and have a certain look. If I see a table view in 5 different apps, I know they are going to behave in the same way. I’m willing to pay a few bucks for that. On the web, you are at the mercy of what the developer thinks UI should behave like. Performance is also a pretty big part of this. I don’t have to wait for UI images, CSS, or javascript to load before I can start using most native apps. It’s usually just there when I want it. I know arguments can be made for local caching, and optimization, but that’s assuming a lot about the skills of the developer, and generally comes as an after thought.
3. Ownership
This is probably my lamest argument of all, but it’s hard to deny it’s importance. I like the feeling that an app is downloaded to my device all tucked away in the filesystem with my preferences in a (mostly) secure location. With a web app, I’m at the mercy of the developer deciding his app isn’t paying the server bills, the network going down, and my personal information being who knows where.
These aren’t significant issues.
I really believe in the web as a platform, but I also think that the line between native apps and “the cloud” is starting to fade. As a developer, the biggest difference is the tools and the delivery. I happen to think that building a native app and maintaining it without the worry of infrastructure would be pretty nice for a change. It can also be a joy to use proprietary tools when they are well thought out, and work when you need them to. The app store is necessary, and so is the web. It’s a great time to be developing for either. Take some time to think about which type of app your customers would want before you begin the bashing.
This entry was written by Ryan Leland, posted on November 23, 2009 at 8:01 pm, filed under Business, Cocoa, Web. Leave a comment or view the discussion at the permalink.
I finally got to play around with Wave tonight, and my only thoughts after shutting it down was, “Man, email is for losers”. You know what? It’s totally a little bit true. That might make you think I’m saying Google Wave is the greatest thing since Mr. Berners-Lee dropped the www bomb back in’92, but I’m not.
I think it’s going to super useful for people collaborating. I love that Wave can bridge the gap between IM, and email. I hate having to dig through IM conversations to get info, and I also hate missing important info because I didn’t have my email client open. So, people who say Wave doesn’t solve a problem don’t spent a lot of time on the internet.
There’s so many reasons why Wave won’t be replacing email though. The type of work I do probably puts me in the top 1% of people who spend ridiculous amounts of time on the internet, and even I could live without Wave. But gosh darn, it’s pretty neat. It’s going to come down to how many people I know that use it, and how good the mobile app will be. If nothing else, Wave is a pretty big step forward, and pushes a lot of the bounds of what even the most web 2.0 people thought was possible.
This entry was written by Ryan Leland, posted on October 15, 2009 at 9:31 pm, filed under Web. Leave a comment or view the discussion at the permalink.
I just started working on my RexEx tool using Cocoa and Python. It’s been an interesting project so far due to only really picking up Python in the last month or so, but I’m still finding it very natural to use, and easy to write a ton of code with. I figured a RegEx tool would be a useful app for myself, and a good way to get better with Python, and RegEx. I’m hoping I can have something people can download by next week so I can get some feedback, but as you can see I already have some basics in place.

Some early progress
This entry was written by Ryan Leland, posted on August 5, 2009 at 9:41 pm, filed under Cocoa, Python. Leave a comment or view the discussion at the permalink.
Summary
About 5 months ago now, I launched my little social networking experiment called you-vs-me.com. The idea was that people could create discussions, and vote on things they prefer. Using that data, I would work hard at calculating compatibility. It seemed simple to create, and it looked as though it would be a web app that would get people talking.
What went right
I was right about a few things. It was a good idea (for the most part). The design looked inviting, and I got compliments that the app didn’t look like it was made by one guy in his free time. The app was fairly simple to use, and the user interactions seemed meaningful. I was also right that it got people talking. The Twitter integration brought me the majority of my traffic, and even got me some media attention. The first month had me thinking that my idea was taking off as planned.
What went wrong
There are a lot of things I didn’t do right. One of the worst things I did was removing the invite codes too early. I found that it was way easier to market you-vs-me as a closed beta app that was invite only. The other things I did wrong was not using a service like Facebook connect, or OpenID, and not utilizing Twitter to its full potential. I spent too much time thinking about how my app would scale if it got popular, than trying to help it get popular. I think that’s probably a common mistake when a developer sees some early success, but it’s so much easier to just pay a little more for hosting (which I did too).
Unfortunately, even if I had done all of the above right, I think that the concept of the site was just too limiting. I had not given people enough reason to sign in. The app could have been better executed as a powerful API, and Facebook app. But even then, the compatibility algorithm I had created was weak at best, and quite buggy early on. My plan was to use my smoke and mirrors parlor trick compatibility calculation until I could make something compelling. What could have been the focal point of the app just wasn’t powerful enough to convince anyone.
Conclusion
I can feel pretty good that I made a quality application that gave me some great programming, business, and marketing experience. I’m still looking for the next great idea, and right now I’m still not sure what direction to go. Whether I am going towards mobile, web, or some sort of business service as my next side project, I think I learned some valuable lessons.
This entry was written by Ryan Leland, posted on August 2, 2009 at 8:55 am, filed under Business, IRL, Web. Leave a comment or view the discussion at the permalink.
Finished the first version of the genetic algorithm library I’ve been working on lately. I originally had been working on it in C++, but the amount of fuss and frustration with my lack of knowledge in STL and compilers had started to waste my time. I have been wanting to get better with python for a while now, and had even started working on this new blog using django, but just couldn’t find the time to finish it.
Seems pretty amazing to me that I was able to port the library from C++ to python in a handful of hours on the weekend, but I guess that shows why so many smart people are using python. Anyway, the library is nothing amazing, but it is very powerful and simple. I still need to learn a few things about python, and make things a little more flexible, but I have put the library on github under MIT license for anyone interested in using it.
Genetix.py
This entry was written by Ryan Leland, posted on July 12, 2009 at 7:34 pm, filed under AI, Python. Leave a comment or view the discussion at the permalink.
« Previous Entries