Let's make a map of dungeon
Javascript (ES6), 261 254 243 bytes

s=&gt;{v=Array(w=32);p=526;b=n=&gt;v[n&gt;&gt;5]&amp;(1&lt;&lt;(n&amp;31));B=(n,i)=&gt;b(p+n)|b(p-n)?i:0;[...0+s].map(c=&gt;v[(p+=[0,1,-1,w,-w]['0&gt;&lt;v^'.indexOf(c)])&gt;&gt;5]|=1&lt;&lt;(p&amp;31));for(z='',p=0;p&lt;w*w;z+=' |-+'[b(p)?0:B(1,1)|B(w,2)||B(31,3)|B(33,3)],p++%w||(z+=`
`));return z}


JSFiddle