Are xiangqi, janggi and shogi descended from the same game?
These answers restate the rules implemented by our open-source engine, which follows the WXF laws for movement, checkmate and both repetition rulings: a side that forces a repetition by perpetual check or perpetual chase loses rather than drawing. The chase half has not been validated against the official casebook. Where an answer refers to a specific position, that position lives on the linked reference page, where the build verifies it before publishing.
Direct answer
They are usually placed in the same wide family of chess-like games, together with western chess and Thai makruk, which many historians trace back to early Indian chaturanga, though that too is debated for xiangqi. Janggi is generally regarded as derived from xiangqi: it shares the board of intersections, the palaces and the cannons. Shogi's route to Japan is less clear, and accounts differ.
Janggi and xiangqi
The resemblance is close enough that most accounts treat janggi as a Korean development of xiangqi: the same 9×10 grid, palaces, generals, advisors, cannons and soldiers, often written with the same Chinese characters. The differences, such as no river, different elephant and cannon moves, and the general's movement along the palace diagonals, look like later changes to a shared starting point. See xiangqi versus janggi.
Shogi
Shogi is played on squares, has no cannons, no river and no palace, and allows captured pieces to be dropped back into play. Some historians see closer links to Southeast Asian games such as makruk than to xiangqi; others argue for a route through China. The evidence for its early history is limited, so the honest answer is that its exact path is not settled.
The chaturanga question
Western chess, makruk and shogi are widely linked to chaturanga. For xiangqi the question is more contested: some accounts see it as another branch of the same family, others emphasise Chinese roots and earlier Chinese games. Treat any confident one-line family tree with caution. The page is there a single agreed history of xiangqi explains why the sources leave room for disagreement.
Related questions
Is janggi just xiangqi with different rules?
It shares its ancestry and much of its look, but plays as a distinct game with its own strategy.
Which of the three is oldest?
Of the three, xiangqi's modern form is documented earliest, but ancestors of all of them are older and harder to date.