Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Map Engine #305

Closed
wants to merge 14 commits into from
Closed

[WIP] Map Engine #305

wants to merge 14 commits into from

Conversation

timo-42
Copy link

@timo-42 timo-42 commented May 11, 2015

Map Engine

moved map creation from the main loop to a new subsystem.
Created Interface for different map engines.
Implemented Engines:

  • static: returns Grass map
  • mandelbrot: returns Island of the shape of the mandelbrot set
  • diamond square
  • perline noise: true infinite random map possible

@detrumi
Copy link
Contributor

detrumi commented May 11, 2015

It would've been nice if this was communicated better, as I've merged part of this PR into one of my branches (by your request). I'm fine with you working on it or taking it over.

On the perlin noise: someone already has implemented a prototype for this, though I'm not sure what the status on that is, and whether it's easy to call the python code from cpp code (this is also being worked on, but that's not finished yet).

@TheJJ
Copy link
Member

TheJJ commented May 11, 2015

Did you have a look at #179? It implements the noise generator in python, the API (#217) is close to being finished, so you can use the python implementation for the mapgen or even implement the mapgen in python itself (as it's not a time-critical operation).

I'd rather not add libnoise as a dependency, it doesn't seem to be widely available (at least missing in gentoo) and is very outdated (last commit 9 years ago..).

I like your modular approach, the code needs better integration though (we have an awesome logger e.g.). Keep up the good work, much potential is there, we'll come up with some nice ideas.

@timo-42
Copy link
Author

timo-42 commented May 11, 2015

@detrumi I'm sorry, I should have said something, but @TheJJ stated (detrumi#1 (comment)), I should use the Master Repo for Pull Requests.
How should I proceed from here? Pull request to detrumi (original author of the branch) or to master Repo? If @detrumi works on it too, I think I should use his Repo for Requests.

I didn't noticed the python implementation. I will have a look into it and use it to reduce the dependency.

@detrumi
Copy link
Contributor

detrumi commented May 11, 2015

Go ahead with this PR to the master repo.

In my branch, I was just experimenting with the diamond-square algorithm, it's not finished yet. It's not flexible enough for map generation, though it may possibly be useful for generating the heightmap if we're implementing elevation.

added perlinnoise library and added needed files to Repository
@zuntrax
Copy link
Contributor

zuntrax commented May 11, 2015

@detrumi I think #179 should work for producing perlin noise. @rkreis claims that it actually produces value noise, not perlin noise. I wanted to verify my code and discuss it with him, but I didn't get to do it yet.

@rkreis
Copy link
Contributor

rkreis commented May 12, 2015

No, I do believe it's perlin noise. The noise in my test pictures is value noise, that's why it looks different from the in the PR. I see nothing wrong with the noise generator the way it's in the PR.

@franciscod
Copy link
Contributor

mandelbrot!!! pics or didn't happen!

@timo-42
Copy link
Author

timo-42 commented May 12, 2015

Mandelbrot:
16 tiles per side
mandelbrot_16_tiles
32 tiles
mandelbrot_32_tiles
multiple chunks (16 tiles per side)
mandelbrot_16_tiles_multiple_chunks
perlin: multiple chunks (16 tiles per side)
perlin_16_tiles

@franciscod
Copy link
Contributor

that is awesome!!! :D

@zuntrax
Copy link
Contributor

zuntrax commented May 12, 2015

@rkreis ah ok, then i just got your comment wrong.

@TheJJ TheJJ added nice new thing ☺ A new feature that was not there before lang: c++ Done in C++ code in progress labels May 12, 2015
converted line endings and added legal info for libnoise
@TheJJ
Copy link
Member

TheJJ commented May 14, 2015

Before it's too late, i really don't like bundling libraries in our code. Using "well-known" and up2date libs shipped with distros as new dependencies is much better. If no matching lib is available, we should (e.g. like the rng) implement stuff in "our way" so we have a simple-stupid awesome implementation written and maintained by the project itself.
That means, the best solution may be to either reimplement the perlin noise py code we already have in c++ or try to come up with some api that will then be provided by the py-api.

My suggestion: write the code in c++ and I'll replace it with the python part when the api is ready.

@timo-42
Copy link
Author

timo-42 commented May 14, 2015

You're right, this is an intermediate solution. I want a working travis ci build, so i can go on to the next working one.

@mic-e
Copy link
Member

mic-e commented May 14, 2015

@timohaas: It should be rather simple; just have a look at .travis.yml; it's rather self-explaining. You'll probably simply need to add libnoise-dev or something like that to the install list.

@timo-42
Copy link
Author

timo-42 commented May 15, 2015

It's building now (Commit 478d227). I added the needed Header and Source Files directly to the Source Code.

TheJJ suggested, we implement our own Perlin Noise. I will look into this if needed, but would rather use the http://libnoise.sourceforge.net/ lilbrary.
Debian has the lib in its repo (https://packages.debian.org/jessie/libnoise0).

@TheJJ TheJJ changed the title Map Engine [WIP] Map Engine Jun 24, 2015
@TheJJ
Copy link
Member

TheJJ commented Jul 29, 2015

The python interface is complete now, you can use parts the noise implementation commits from #179 i hope.

@zuntrax
Copy link
Contributor

zuntrax commented Aug 1, 2015

I'm the one working on the perlin prototype. I'll try to get this productive asap.

@timo-42 timo-42 closed this Mar 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang: c++ Done in C++ code nice new thing ☺ A new feature that was not there before
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants