Identification Technique
If you have the possibility of walls or the detection on the ground, every block would know where it is. So the only thing left is a wireless communication; with radio or visual (laser, blinking led, infrared).

If not here some ideas to track the other cubes: 


Camera (e.g. Barcodes or LEDs for Identification) -> Complicated
Triangulation with external radios (like GPS) -> Expensive
RFID (more distance than just nfc) -> Expensive
Laser Sensors -> I think expensive
Radio running time -> Hard and Complicated
Ultrasonic -> Cheap and Easy


I think the best are Ultrasonic Sensors, there is a cheap one for the Arduino board. Ultrasonic Sensors normally have a Trigger Pin and an 'Answer' Pin. The Time between Trigger and Answer is proportional to the distance and under 10ms for a small board (&lt;1m), so in a while with delays the distance can be measured easy with a convenient microcontroller. The problem here is that your boxes need openings for the sensors (2 holes for each).