tiger wrote:Tord Romstad wrote:Wow.
This is the best computer chess news I have seen since -- I'm not sure, but it must be several years. Thanks a lot for Chess Tiger for iPhone, Christophe!
tiger wrote:Wow Julien you are damn fast!
The application has appeared on the App Store less than 12 hours ago and is still on the fourth or fifth page (yes the last page) when you search for "chess". In other words it is totally lost amongst 200 chess programs or so...
Don't worry, it will climb. Believe it or not, Stockfish is close to the top of the list.
What I have not included in the App Store description is that the chess engine is exactly the same as the PC version of Chess Tiger 2011, which has not been released yet for PC. So even advanced players, as you have noticed, will get a run for their money!
There will be a Macintosh version too, I suppose?
Actually there is already one... Sort of!
The development went like this:
Interesting story snipped.
Stockfish (originally Glaurung) for iOS was more straightforward: I started by porting just the UCI engine, and ran it in console mode on my iPhone. In fact, "porting" is a too strong word to do, because the only thing I had to change was a few compiler flags in the Makefile. I used the UCI engine to play automated test games with the iPhone against various OS X chess programs and on the ICC, in order to make sure everything worked.
I then hacked up a simple GUI (I already knew Objective-C, of course), and connected it to the engine with a minor modification of UCI. Since Apple doesn't allow third-party apps to start new processes, I had to bundle the engine and the GUI in a single executable. I did this by running the two in separate threads, and let the engine listen to UCI command from an internal queue rather than from the command line. This design makes it almost trivial to adapt other UCI chess engines to the GUI. As a proof of concept, I once made a port of Fruit 2.1, which only took a couple of hours of work. The iOS version of Hiarcs is also based on the same GUI.
Objective-C has the invaluable advantage to be 100% compatible with C. Any C code can be integrated into an Objective-C program. This has been a very helpful feature for me.
However Objective-C is a language from the eighties, and while it has been updated several times there are 3 things I still really hate about it:
- Having to maintain ".h" files. I admit C# has spoiled me and that it is probably debatable, but there is no question that you can program much faster and make less mistakes just because of this in C#. However it is such a fondamental feature in Objectice-C (like in C) that there is no hope that it can be improved.
- Properties are an afterthought in Objective-C. While they are not strictly necessary in OOP, they make programming easier. If iwanted to stick with purely elegant programming, maybe I would use Forth. But I want the language to help me, I want syntactic sugar. Properties in Objective-C are acceptable, but require that I pay attention to what I do. This energy I should be able to spend to more productive tasks.
- And finally, the real killer: there is NO GARBAGE COLLECTION on iOS. The feature is not missing in Objective-C actually, because it has been implemented years ago and is available for Mac applications. But not on iOS. The general belief is that Apple decided against GC for now because of performance concerns. But MonoTouch has it and I have not heard that it was slow. Anyway... The lack of garbage collection makes programming in Objective-C for iOS extremely painful. Half the variables you manipulate are objects (a string is an object for example) and you need to pay attention about memory management ALL THE TIME. Far too much of your energy is consumed by taking care of this problem. Screw just a release on one variable up and your program will crash. And it will not crash where you screwed it up, it will crash in a totally unrelated place and you will spend the rest of the day trying to figure it out. Or worse, it will crash only on the device and not on the simulator. Or the opposite. Or it will corrupt something, somewhere else, and it may go unnoticed until you release the product.
While memory allocation is naturally also a concern in C, C++ and many other languages, it is especially painful in OO programming languages, where basically everything is an object and has to be allocated and later released (freed).
So I have learned that an OO language without garbage collection is an absolute NO-NO, and unfortunately I have spent months working with one.
Agreed on all points. I like Cocoa and UIKit, but programming in Objective-C is quite uncomfortable (better than C++ in most respects, but that isn't saying much). The only mitigating factor is, as you point out yourself, full compatibility with C and C++.
Brothers and sisters, listen to me: Objective-C on iOS is a bitch, and you'd better stay away from it. At least until it gets decent garbage collection.
My guess is that it will get it when all iPhones, iPads and iPod touch get a dual core processor. At this time only the iPad 2 has one. There are hints that some work on GC in iOS have been done, but I guess we will have to wait for 2 years or more to get it for real.
My prediction is that it will happen when the first iOS version without support for older devices than the iPhone 4 is released.
So back to your question: the Chess Tiger engine works very well on Macs but it is only a terminal application.
I guess I could make an UCI engine from it but I have so many other priorities that I do not see this happening before the post-PC (and post-Mac) era is on us.
A UCI engine is all I would want, anyway. I never use any desktop chess GUIs anyway, and wouldn't buy Chess Tiger if it shipped as anything else than an XBoard or UCI engine (I'd be happy to buy it bundled with a GUI, but only if it contained an easily extractable engine). But of course, I'm hardly an average customer.
If a UCI engine alone is not enough, would you be willing to do it if I can make a decent GUI for you (for free, of course)? This is not a promise, but I would at least be willing to discuss it if it could help to bring Chess Tiger to OS X.
Actually I was surprised to see that Tiger was not slaughtered, but eventually it does not matter.
Look at how strong our programs are on a modest iPhone. If you are still concerned by strength and investing considerable time on it, then you are working for less than 1% of your users.
Absolutely. I don't remember even a single user complaining about the strength of Stockfish on the strongest settings, but I get lots of requests for weaker play at the bottom settings. It's strange that most of the commercial programmers still believe that strength is what matters for commercial success. My opinion is that strength is almost completely irrelevant these days.
About the minus sides you have mentionned:
- This is an introductory price. Sorry, but it will go UP in a few days.
I am not sure this is a good idea, but of course it is your decision.
There is no doubt that I would get more users and more ego satisfaction by giving it away for free.
As my ego does not need much fixing anymore nowadays, I actually appreciate more that people spent a very modest amount of money on a product that took me almost a year and a half of my life, and that is going to take me even more time and energy as I improve it.
I'm sorry about how psychotic I sound by implying that I would like to get money from my work, and I how I am going to be flamed for this.[/quote]
You don't sound psychotic at all, and I understand very well that you want to get money from your work. You already got my money, and you'll get more of it when you release an iPad version.
What I meant was that I believe you would earn more with a lower price (like the current one). I could be wrong, of course.
- The application has High-resolution graphics built inside, so on iPhone 4 or iPod touch 4 it uses the full definition of the retina display. Unfortunately the iPad does not use these high-resolution graphics, which is a shame.
Not sure I understand what you mean here. The iPad has even higher resolution than the iPhone 4. Stockfish uses 40x40 bitmaps on the iPhone <4, 80x80 bitmaps on the iPhone 4, and 96x96 bitmaps on the iPad. Most of the piece sets are actually antialiased, down-scaled versions of 300x300 bitmaps.
Chess Tiger is a retina application (compatible with both 320x480 and 640x960 screens) but the iPad just takes the 320x480 resolution and scales it up. This results in blurred graphics, mainly visible on text.
I misunderstood. I was confused because I thought Chess Tiger was a universal binary with support for the iPad's native 1024x768 resolution.
Tord