Let's first find out how many cookies Ryan stacked. We know that Ryan stacked 13 more cookies than Tony, who stacked 18 cookies.
So, we can calculate the number of cookies Ryan stacked as follows:
\[ \text{Ryan's cookies} = \text{Tony's cookies} + 13 = 18 + 13 = 31 \]
Now, to find the total number of cookies they stacked together, we add the number of cookies each person stacked:
\[ \text{Total cookies} = \text{Ryan's cookies} + \text{Tony's cookies} = 31 + 18 = 49 \]
Therefore, Ryan and Tony stacked a total of 49 cookies.