I also tried this, which gives an out of range error: void InitializePathGraph() { PathGraph.length = mapWidth; foreach( elem; PathGraph ) { elem.length = mapHeight; } Node node; for( int x = 0; x < mapWidth - 1; x++ ) { for( int y = 0; y < mapHeight - 1; y++ ) { PathGraph[x][y] = node; } } } This is really confusing me.