Dostoyevsky was devastated by his wife's death in 1864, which was followed shortly thereafter by his brother's death. He was financially crippled by business debts; furthermore, he decided to assume the responsibility of his deceased brother's outstanding debts, and he also provided for his wife's son from her earlier marriage and his brother's widow and children. Dostoyevsky sank into a deep depression, frequenting gambling parlors and accumulating massive losses at the tables.
Dostoyevsky suffered from an acute gambling compulsion and its consequences.
By one account he completed Crime and Punishment, possibly his best known novel, in a mad hurry because he was in urgent need of an advance from his publisher. He had been left practically penniless after a gambling spree. Dostoyevsky wrote The Gambler simultaneously in order to satisfy an agreement with his publisher Stellovsky who, if he did not receive a new work, would have claimed the copyrights to all of Dostoyevsky's writings.