Wednesday, 14 March 2012

Xcode 4.3 Complaints!

Just downloaded and trying Xcode 4.3.1. Quite frankly, after 4.0 and 4.1 I gave up and went back to Xcode 3.2.6. I'm sure this has been said in other places, but I think Apple have deprecated Xcode 3 too quickly and moved to something which was at best alpha quality (4.0), and is now beta quality (4.2+). That said, Xcode 4.3 does have a more "solid" feel about it.

My issues with Xcode 4.3 are:

Key maps

The keys still clash with system defaults. I like Command+N for swapping desktops. Single-step etc clash with functions on laptop keys. Why not add the Xcode 3 mappings as an option? Why did you need to change them? You can use the Xcode 3 keys on a laptop or desktop keyboard quite happily. And not having to remember a whole new set of keys is a big win.

Editor

Simple things, like, which column am I in? Where is this displayed? This is basic stuff for a code editor.

How do I compile a single file? Seriously. Come on.

UI

You cannot drag any of the side panels around. What about making the sidebar items (project browser, objects, errors, etc) dockable/moveable so that you could have some on the right? E.g. file browsing on left, but then error list on the right. Or top and bottom of the sidebar? Should remember layout between sessions. Same for debugger features. -- If you have used Eclipse then there are lots of solutions and alternatives with a more flexible approach like that.

This is more of a minor one, but the toolbar at the top occupies too much space. It hardly displays anything. Maybe merge it into the title bar? Make icons smaller?

Top toolbar takes up too much space.
Version Control

I haven't really used these features because I use Mercurial. It's just what I use. Why not add Mercurial support, it is not going anywhere. It is a good DVCS. You have also removed Perforce support, please re-add.


Summary

Apple: I haven't used all of the features of Xcode 4, and I'm not a full time Apple dev. I know Microsoft are making Visual Studio worse, but do you have to try and compete with them? Xcode could be so much better if you didn't try and change everything at once. Leave the Xcode 3 key maps. At least then people can turn a blind eye to the other shortcomings of the IDE. I'm sure in a year or two it will be a better IDE, but right now please address the day-to-day usage issues instead of trying to cram in more functionality.

Thursday, 27 October 2011

Development's ups and downs

Game development is sometimes testing! You get stuck on things, you go through boring phases, you wonder if you are going in the right direction. Often you have to fight though it to get that little reward that keeps you going.

Perseverance is not a long race; it is many short races one after another. - Walter Elliott
I do not think there is any other quality so essential to success of any kind as the quality of perseverance. It overcomes almost everything, even nature. - John D. Rockefeller
The road to success is dotted with many tempting parking places. - Author Unknown
It's not that I'm so smart, it's just that I stay with problems longer. - Albert Einstein

And I guess now I ought to stop reading quotes and do some work. :o)

Tuesday, 11 October 2011

UI for Allegro 5

I found a nice UI system called Gwen. It has lots of advanced features and is very easy to embed. It very nicely sits on top of your application and can just be wired into its resources, to save competing systems, e.g. input or texture management.

Example of Gwen UI from the Gwen site.
I ported it to Allegro 5, which was quite easy as the renderer and input abstractions are well designed. I did it on the Mac, but it also works just fine on my old Windows XP laptop. Gwen also provides rendering backends for OpenGL, DirectX, SFML, and Windows GDI.

If you have used Delphi, or Windows Forms you'll probably find it quite easy to pick up. There are unit test examples from which to learn, but other than that you have to plough through the code at the moment. Hopefully more docs and comments will appear soon to ease the learning curve. There is a small tutorial on doing layout with docking.

One of the things that is really nice about Gwen is the skinning system. It is all laid out in one bitmap, along with the colour scheme at the bottom.

The default skin for Gwen.

Saturday, 9 July 2011

Notes on using Allegro 5 on Mac

This is some notes I made whilst setting up Allegro for use on my Mac. I'm fairly new to Mac, having been a Windows programmer for a long time, so these notes may change as I learn more about the correct way to do things on the Mac.

Libraries

Get all the dependencies from Macport. This saves a lot of time. Very nice system.
sudo port install zlib freetype jpeg libogg libvorbis libpng physfs +universal
If you have libraries installed that aren't 32 bit, and you get the "different system not i386" link error, they need to be recompiled as "universal" (i.e. i386 and x86_64).
sudo port upgrade --enforce-variants XXXX +universal
Install

Easiest is to avoid frameworks. Unpack the Allegro source and in that directory:

  • mkdir build
  • cd build
  • cmake -DCMAKE_OSX_ARCHITECTURES=i386 ..
  • make
  • sudo make install
cmake should have been installed by port, but if not "sudo install cmake". Add "-DWANT_FRAMEWORKS=1" to cmake if you want frameworks (although I can't see an advantage to this). "-DCMAKE_OSX_ARCHITECTURES=i386" is important as OSX 10.6 compiles 64 bit default and we want 32 bit.

Project

Don't use Xcode 4.0, it isn't ready. Use Xcode 4.1 or Xcode 3.2.

I create a Cocoa application and removed what I didn't want.
  • Add "/usr/local/include" to header search paths.
  • Drag in the Allegro libraries that you want to link to in "/usr/local/lib".
  • Go into Interface Builder and delete the default Application and Window. Allegro supplies these.
The following error means you have the wrong "main" declaration:
dyld: Symbol not found: __al_mangled_main
Referenced from: /usr/local/lib/liballegro_main.5.0.dylib
Expected in: flat namespace
in /usr/local/lib/liballegro_main.5.0.dylib 
It should be:
int main(int argc, char **argv) 

[16-Jul-11] Note about Xcode 4.0.
[27-Oct-11] Xcode 4.1 is fine. It doesn't crash and is faster than Xcode 3.2.

Tuesday, 3 May 2011

iMac 2011 Buying Decision

This is not a full review of the iMac 2011 refresh, rather some comments on my decision making process for buying one.

There are no cosmetic changes, just a bump in spec, although the increase in power looks quite impressive, especially in the high end 27" iMac's graphics.

New features are:
  • Thunderbolt - high speed video/data connect. Peripherals won't be cheap. :(
  • "iMac displays feature "in-plane switching," or IPS. Originally designed by Hitachi in 1996, IPS improves color and contrast at sharp viewing angles." (source)
Things improved:
  • CPU (faster).
  • GPU (faster).
  • Camera (quality).
  • Screen (quality).

CPU

All of the iMacs are now quad-core (i.e. i5). The higher models can be bumped up to i7, which has hyper-threading (i.e. 8 hardware threads on 4 cores, 2 on each).

This thread contains lots of information comparing the 2010 and 2011 models.

Comparison of iMac 2011 processors.

The i7 3.4 Ghz vs i5 3.1 GHz appears to be (from CPU performance comparison, not real world):
  •  ~25% faster transcoding in Handbrake.
  • ~10% faster at Photoshop.
  • ~10% faster at image rendering in 3DS Max 2010.
The i7 is £160 extra in the 27" top model. So it's about a 10% increase in price (of the whole iMac) for ~10% increase in performance. If you do a lot of video transcoding then it's a ~25% increase in performance for 10% extra, which looks like better value for money.

Initial Benchmarks

Initial iTechVision initial Geekbench tests:
  • Geekbench:
    • i7 3.4 Ghz in 32 bit OSX: ~11750, in 64 bit OSX: ~12700 (8% increase).
    • i5 3.1 Ghz in 32 bit OSX: ~8400 (~71% of i7). Approx 9500 if 13% increase.
      • i7 ~20% faster than MBPs with i7.
      • i7 the same performance as MPs from 2009-10.
  • For comparison (32/64 bit) from Mac Geekbench:
    • MacBook Pro (13-inch Mid 2009) Intel Core 2 Duo P8700 2.53 GHz (2 cores) = 3510/3851.
    • MacBook Pro (17-inch Early 2011) Intel Core i7-2820QM 2.3 GHz (4 cores) = 10383/11179.
    • iMac (27-inch Mid 2010) Intel Core i5 680 3.6 GHz (2 cores) = 6829/7745.
    • iMac (27-inch Late 2009) Intel Core i7 860 2.8 GHz (4 cores) = 8328/9712.
    • iMac (27-inch Mid 2010) Intel Core i7 870 2.93 GHz (4 cores) = 9122/10544.
    • Mac Pro (Mid 2010) Intel Xeon E5620 2.4 GHz (8 cores) = 12722/14083.
  • i5 3.1 GHz is:
    •  same performance as i7 2.93 Ghz from last year.
    • ~86% the performance of MacPro Xeon 3.33 Ghz 2010: 6 core and costs £3400!
The difference between 32 and 64 bit OS appears to be around 8-9% on Macbook Pros and around 12-15% on iMacs.

Graphics

There appear to be some people who are discontent that Apple uses mobile graphics devices in their iMacs, but this has always been the case. Some modern graphics cards make stupid amounts of noise, and if you are editing music, or trying to concentrate then it can be very off putting. The mobile cards create far less heat, and therefore need less cooling, and are quieter.

This table shows the previous graphics cards used in iMacs:

Comparison of past and present iMac graphics cards.

The Radeon HD 6970M, in the high end 27" iMac has a much higher spec than the other cards, and appears to be about 70% faster than the HD 6770M found in the lower spec iMac. There is £250 difference between the two models (which also includes a faster processor and more VRAM on the graphics card). The HD 6990M card can also be upgraded to 2 GB VRAM for £80.

HD 6970M
This review compares the Radeon HD 6950 1 GB and 2 GB models, and the GeForce GTX 560 Ti. This is interesting because the iMac uses the HD 6970M and has 1 and 2 GB options. The review is not for the mobile version (i.e. the 6950M) but it does show what effect adding VRAM has. The conclusion is that adding VRAM doesn't necessarily speed up the framerate, but it does allow higher quality AA and higher screen resolutions (and the iMac has a massive screen!). The HD 6970 looks to be about 10% more powerful than the 6950.

RAM

Apple's RAM costs are very expensive. I don't know how they justify it. The iMacs come with 4GB of RAM. This comes as 2 x 2GB sticks, which live in 2 of 4 slots, so more can be added easily and cheaply from a third party.
  • RAM specification from Apple.
    • 4GB supplied.
    • Maximum possible: 16GB (4GB in each slot).
    • 2 or 4 GB may be used in each slot.
  • Apple price:
    • 8 GB (2x4) = £160.
    • 16 GB (4x4) = £480.
  • This is for 2010 iMac, but if prices are similar, options are:
    • 6 GB (2x2 + 2) = £17 (inc VAT).
    • 8 GB (2x2 + 4) = £34.
    • 12 GB (2x2 + 2x4) = £67.
    • 16 GB (4x4) = £134. Possibly get money from selling 2x2 GB.

Price Comparison

Apple are often accused of ripping their customers off. And whilst I find it really hard to see how they charge so much for RAM, bigger hard drives and SSD, the basic packages do seem quite competitive. Often, systems that are compared just aren't of the same quality. They have poorly quality screens or make loads noise, or aren't as powerful in one area.

If you look on the Dell site, at their high end gaming rigs, a roughly equivalent spec looks to be the Alienware Aurora i7-2600. It is £1300 (with £230 off). A 27" monitor, the U2711, is £839. So that totals ~£2140. This is also doesn't include software like iLife. The top end iMac is £1889 with i7 and 2GB VRAM.


Conclusion

The extra £250 to jump from the lower to the higher spec 27" iMac is worth it for the extra graphics performance, plus the faster processor.

The extra £160 for the i7 also looks quite good value if you look at the benchmarks. Superficially (according to Geekbench) it looks like you get 37% increase in power for around a 10% increase in price. Of course not all applications will get this full benefit, but you do get a faster processor and most things will run at least 10% faster.

It is also worth investing in some more RAM. Using Apple RAM is ludicrously expensive. Buy the base spec and upgrade later from a third party. 4 GB is plenty for casual use. 8-12 GB is useful for audio/video editing and multi-tasking.

For me, I'd like to play games, program, and have the computer for some time, so I think I'll go for i7 and the 2GB of VRAM option. Games are always using more VRAM, and it might be used for GPU processing. If you don't play games then you probably won't need the 2GB of VRAM. And if you don't edit video then the i5 might be good enough for you. It is still a really powerful machine.

Afterthoughts

[9-July-11] I've since bought my Mac and am very happy with the nice big screen. It is a beast as well, incredibly fast. I noticed it was a little sluggish at first, but I think this is because the CPU/motherboard is so fast that any disc access seems very slow (including any virtual memory swapping) in comparison.

I upgraded to 12GB (Crucial 2x4GB sticks + the existing 2x2GB) and this really speeds things up. Aperture was almost unusable before, but is lightening fast now. I decided not to get an internal SSD, but I can now see why you'd want one.

I am also very happy (so far) with the gaming performance. The GPU performance was worth waiting for as I think previous 27" iMacs were slightly underpowered. All the games I have tried so far run at maximum settings (everything on max/ultra), at maximum resolution without any lag at all. The CPU barely breaks into a jog as well. Starcraft 2 and Settlers 7 both have no problems at all. Looking forward to id Rage.


[4-May-11] Added initial Geekbench test results from (shop bought?) iMac i5 3.1 GHz.
[4-May-11] Added details on gfx performance and 2GB VRAM upgrade.
[9-May-11] Updated conclusion after reading more benchmarks. Added Dell comparison.
[9-July-11] Added afterthoughts.