averrin / libmapgen

Unity native plugin for procedural world generation
MIT License
19 stars 3 forks source link

How do you use this? #7

Open darkmajki opened 6 years ago

darkmajki commented 6 years ago

Hello, I am very interested in using your library. But i have a couple of issues:

  1. How do you use this? I've never used a native plugin before, so sorry if it's a beginner question. I have a code like this:

    [DllImport("libnoise")]
    
    private static extern int createMap();
    
    private void Awake()
    {
        createMap();
    }

But I get three errors: Dll not found exception, two instance of same dll and wrong architecture. Now I managed to fix the last two errors but not the dll not found exception. Would you be able to post the project from the example video you posted?

  1. Would I be able to access from c# stuff like road info(in order to show and hide them) certain area colors, roads, rivers,etc(i.e. so i can zoom in and show finer details)?
averrin commented 6 years ago
  1. Unfortunately for now i cannot share some code (maybe next week) and it was some time ago, i cant remember details. Maybe this link helps you: http://runningdimensions.com/blog/?p=5
  2. IIRC current version of facade dont provide info about roads and rivers but its pretty easy to add. You can ask author of this issue: https://github.com/averrin/libmapgen/issues/6 about his work. Its seems close to your needs.
averrin commented 6 years ago

I found one of my files, so i post it here: https://gist.github.com/averrin/226339e05f03a1a3682c4af376cceb56 I hope it can helps you/

darkmajki commented 6 years ago

Thank you. I was trying out your code but as i can see RegionsManager is never defined. While i tried writing my own I don't really have a fully idea how to write it(especially methods like the create one and set distance).

I will ask the other user for help, if he is willing to provide it. EDIT: Well I didn't really find a way to contact the other user. I guess my next step would have to be to try and write a map generator on my own, even though procgen isn't really my strength. Thank you anyways. I appreciate it.

averrin commented 6 years ago

I added regionsManager.cs but i think its not very useful. Basic map generator is not very complicated task, but features like roads, weather and other "advanced improvements" not so easy. If you want focus on your game not on map gen, you should use 3rd party.