Code Monkey home page Code Monkey logo

fantasymapgenerator's People

Contributors

rlguy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fantasymapgenerator's Issues

can't import Cairo

(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

Export heightmap

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.

Make a "release" build

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.

Edge Cropping

Is it possible to have complete islands and prevent the edges cropping?

sys.path is not set to include the cwd

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:

  • 3.5 - "Error: function not in module dict"
  • 3.6 - couldn't import cairo, probably a cairo bug: ModuleNotFoundError: No module named 'cairo._cairo'

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 ;)

‘PyString_FromString’ was not declared in this scope

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?

SVG output support

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.