rlguy / fantasymapgenerator Goto Github PK
View Code? Open in Web Editor NEWA fantasy map generator based on Martin O'Leary's "Generating fantasy map" notes
License: Other
A fantasy map generator based on Martin O'Leary's "Generating fantasy map" notes
License: Other
(unity) fred@Freds-MacBook-Pro:~/unity/FantasyMapGenerator/build$ ./map_generation
Error: module import
Traceback (most recent call last):
File "/Users/fred/bin/nimble/unity/FantasyMapGenerator/build/render/rendermap.py", line 2, in <module>
import cairo
Python 3.8.5
(unity) fred@Freds-MacBook-Pro:~/unity/FantasyMapGenerator/build$ pip freeze | grep cairo
cairocffi==1.3.0
pycairo==1.21.0
How do you achieve the shaded heightmap effect in the final image? (gallery04_large.jpg)
I would love an --export-heightmap option, hoping to generate a 3d terrain with map.
I know this is an old repo, but in case someone still looks at it...
Is it possible for someone to make a build and put it in the project "releases"
That way people dont have to know how to get it all set up and running to build it themselves (i always get headaches when i try) and can just download the build.
Is it possible to have complete islands and prevent the edges cropping?
Thanks for fixing the string conversion bug. Now i bumped into another one that is probably 3.x specific.
EDIT: Nope, that also happens on 2.7!
I could build the binary now, but it couldn't import the render module:
ModuleNotFoundError: No module named 'render'
So, i searched a bit and i think it is related to the CWD not being in the current sys.path:
Stackoverflow about sys.path with pyimport
I tried adding it but failed because the _get_PyString_fromString function returns a bytes.
So i did it via
PyRun_SimpleString("sys.path.append('/home/riot/src/FantasyMapGenerator/build')");
and it was able to import ther render module.
Afterwards i ran into two problems:
I'd rather not open tickets for those, as i don't know whats going on with 3.5 and i think the 3.6-one is not related to this project. Help would be appreciated ;)
I was trying to install your package, but when running make
I encountered the following.
/my/path/FantasyMapGenerator/src/render.cpp: In function ‘void gen::render::drawMap(std::vector<char>&, std::__cxx11::string)’:
/my/path/FantasyMapGenerator/src/render.cpp:17:75: error: ‘PyString_FromString’ was not declared in this scope
PyObject *pFunctionName = PyString_FromString(drawFunctionName.c_str());
^
CMakeFiles/objects.dir/build.make:254: recipe for target 'CMakeFiles/objects.dir/src/render.cpp.o' failed
make[2]: *** [CMakeFiles/objects.dir/src/render.cpp.o] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/objects.dir/all' failed
make[1]: *** [CMakeFiles/objects.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Any thoughts on resolving?
It would be rather convenient to have the ability to output in SVG format, since SVG files are much more friendly for editing and scaling. I tried adding that to Python rendering script (using svgwrite library), but it became painfully slow once I added the slope lines to output.
In the end I hacked something together in C++, adding the MapGenerator::outputSvgData and a couple of small helper functions to MapGenerator class.
SVG generation is pretty straight-forward, and it comes with an unexpected benefit of not having to calculate and pass label text extents for background covering, since SVG filtering can be employed to do that automagically. I used to a simple semi-opaque white to cover label backgrounds, but the specifics are easily editable.
Patch and a couple of output SVG files (B&W vs color) are attached. I verified those SVG files by opening and editing them in Inkscape, in case your SVG viewer of choice is giving you trouble.
Thanks for an awesome application and a great educational write-up on how it all works together!
svg_output.zip
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.