Comment 21 for bug 336021

Revision history for this message
SirVer (sirver) wrote :

> Yes, it is double work, because the representation is completely different. We could change the Widelands engine format from Lua to JSON, but the Lua is easier to read and much more forgiving than JSON, so I'm not a fan for that - it would make Widelands harder to mod.

Another solution could be boost.python[1]. It would allow us to add Python wrappers for the Engine data classes (probably mostly the *Descr classes) and build them into a shared library that can be loaded from Python directly. This would mean that the website and the engine use the same code to parse the data files, which is obviously ideal.

Coding wise this is pretty easy and little work, the tricky part would be to explain add the changes to the cMake files I think.

[1] http://www.boost.org/doc/libs/1_63_0/libs/python/doc/html/index.html