Daweyy / MapRenderer-DR

Map Renderer for Dofus Retro
8 stars 2 forks source link

object x, y offsets #1

Closed intermet closed 7 months ago

intermet commented 1 year ago

Hi! I was wondering about the json file https://cdn.dofusretro.fr/img/maps-gfx//object/object.json. The sprites can be found easily in the files clips/o*.swf. But what about the offsets x, y, that are used to properly place the objects over the cells? I am currently trying to improve and complete the features. Thanks!

ghost commented 1 year ago

Hello, These data are extracted with Jeff They can be accessed directly in each sprite's data, here's an example with JPEXS : image The project (and this data) haven't been updated for a while though I hope that one day we'll be able to generate beautiful renderings for every maps in the game 😄

intermet commented 1 year ago

Thanks! I understand now more the Flash Movie clip structure. The thing is that in Flash, shapes are coded in vector graphics (not png). I guess we should ultimately use the svg and not the png. I was able to implement code the rotations. I obtain pretty good results : 10172_12_-26 165_8_-2

There is one thing that I cannot figure out: some maps seem to have multiple background, even if only one is provided in the swf file of the map. For example:

10166_12_-22 or 1195_11_17 I cannot find in the loader source code where those backgrounds are loaded.

ghost commented 1 year ago

For these 2 examples, it's actually a problem with Jeff exporting empty sprites (didn't got root cause yet) There's always only one background per map on Dofus 1 I haven't tried SVG because (as far as I know) there's no tool for exporting correctly in this format (not satisfied with JPEXS about it)

About rotations, I think we had something already, but feel free to open a PR if you got better results 😄 (I know it's wasn't fully handled)