Git Product home page Git Product logo

arnis's Introduction

Hi there 👋, I'm Louis

Software Developer

Updates

  • ⚙️ I’m currently working on porting Arnis to Rust!

Open Source Projects

Other

My top projects are listed below at the pinned tab.

arnis's People

Contributors

amir16yp avatar callumfrance avatar daniil2327 avatar dependabot[bot] avatar edwardweir13579 avatar louis-e 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

arnis's Issues

all chunks are corrupt from any export, the worlds are unstable

So, when importing the world with two separate multiworld management plugins on a spigot server and attempting to import the world in worldpainter I am getting issues with corrupt region data, this happens on all export types, box exports and citywide exports,

you can reproduce this error by going into a exported world and seeing your latest log output thousands of messages a second about chunk location errors, im assuming this is because the export command requires a existing world to overwrite the chunks which is causing the world to assume the chunks are in the wrong location causing the error

[00:14:14] [Server thread/ERROR]: Chunk file at [460, 760] is in the wrong location; relocating. (Expected [460, 760], got [12, 24])
[00:14:14] [Server thread/ERROR]: Chunk file at [450, 761] is in the wrong location; relocating. (Expected [450, 761], got [2, 25])
[00:14:14] [Server thread/ERROR]: Chunk file at [465, 760] is in the wrong location; relocating. (Expected [465, 760], got [17, 24])
[00:14:14] [Server thread/ERROR]: Chunk file at [467, 760] is in the wrong location; relocating. (Expected [467, 760], got [19, 24])
[00:14:14] [Server thread/ERROR]: Chunk file at [451, 761] is in the wrong location; relocating. (Expected [451, 761], got [3, 25])
[00:14:14] [Server thread/ERROR]: Chunk file at [468, 760] is in the wrong location; relocating. (Expected [468, 760], got [20, 24])
[00:14:14] [Server thread/ERROR]: Chunk file at [452, 761] is in the wrong location; relocating. (Expected [452, 761], got [4, 25])
[00:14:14] [Server thread/ERROR]: Chunk file at [463, 760] is in the wrong location; relocating. (Expected [463, 760], got [15, 24])
[00:14:14] [Server thread/ERROR]: Chunk file at [453, 761] is in the wrong location; relocating. (Expected [453, 761], got [5, 25])
[00:14:14] [Server thread/ERROR]: Chunk file at [455, 761] is in the wrong location; relocating. (Expected [455, 761], got [7, 25])
[00:14:14] [Server thread/ERROR]: Chunk file at [454, 761] is in the wrong location; relocating. (Expected [454, 761], got [6, 25])
[00:14:14] [Server thread/ERROR]: Chunk file at [456, 761] is in the wrong location; relocating. (Expected [456, 761], got [8, 25])
[00:14:14] [Server thread/ERROR]: Chunk file at [457, 761] is in the wrong location; relocating. (Expected [457, 761], got [9, 25])
[00:14:14] [Server thread/ERROR]: Chunk file at [459, 761] is in the wrong location; relocating. (Expected [459, 761], got [11, 25])
[00:14:14] [Server thread/ERROR]: Chunk file at [458, 761] is in the wrong location; relocating. (Expected [458, 761], got [10, 25])
[00:14:14] [Server thread/ERROR]: Chunk file at [460, 761] is in the wrong location; relocating. (Expected [460, 761], got [12, 25])
[00:14:14] [Server thread/ERROR]: Chunk file at [463, 761] is in the wrong location; relocating. (Expected [463, 761], got [15, 25])
[00:14:14] [Server thread/ERROR]: Chunk file at [461, 761] is in the wrong location; relocating. (Expected [461, 761], got [13, 25])
[00:14:14] [Server thread/ERROR]: Chunk file at [462, 761] is in the wrong location; relocating. (Expected [462, 761], got [14, 25])
[00:14:14] [Server thread/ERROR]: Chunk file at [464, 761] is in the wrong location; relocating. (Expected [464, 761], got [16, 25])
[00:14:14] [Server thread/ERROR]: Chunk file at [467, 761] is in the wrong location; relocating. (Expected [467, 761], got [19, 25])
[00:14:14] [Server thread/ERROR]: Chunk file at [468, 761] is in the wrong location; relocating. (Expected [468, 761], got [20, 25])``` 

Check if minecraft world exists

Hello,

the script should check whether the given minecraft world save exists before starting its calculations.
Currently, the script runs just to abort when the file could not be saved in the end.

Kind regards

encountering various errors with other cities

Nice script - thought I'd test it with some other cities, but ran into 3 errors you might want to be aware of :)

Nortorf

>>> python arnis.py --city "Nortorf" --state "Schleswig Holstein" --country "Deutschland" ...
Fetching data...
Chosen server: https://overpass.kumi.systems/api/interpreter
Parsing data...
Processing data...
Traceback (most recent call last):
  File "C:\path\arnis.py", line 592, in <module>
    imgarray = processData(rawdata)
  File "C:\path\arnis.py", line 350, in processData
    if (imgLanduse[i[1]][i[0]] == 0): imgLanduse[i[1]][i[0]] = landuseType
IndexError: index 8846204 is out of bounds for axis 0 with size 4818

Gnutz

python arnis.py --city "Gnutz" --state "Schleswig Holstein" --country "Deutschland" ...
Fetching data...
Chosen server: https://maps.mail.ru/osm/tools/overpass/api/interpreter
Parsing data...
Processing data...
Traceback (most recent call last):
  File "C:\path\arnis.py", line 592, in <module>
    imgarray = processData(rawdata)
  File "C:\path\arnis.py", line 504, in processData
    if (str(img[y][x][0])[:1] != 5 and str(img[y][x][0])[:1] != 6 and str(img[y][x][0])[:1] != 7): img[i[1]][i[0]] = int("2" + str((wallHeight + 1)))
UnboundLocalError: local variable 'y' referenced before assignment

Kiel tries to request 590 GiB of memory - didn't happen with Hamburg, maybe it didn't get that far though (ran into the same IndexError as Nortorf).

python arnis.py --city "Kiel" --state "Schleswig Holstein" --country "Deutschland"  ...
Fetching data...
Chosen server: https://overpass-api.de/api/interpreter
Parsing data...
Traceback (most recent call last):
  File "C:\path\arnis.py", line 592, in <module>
    imgarray = processData(rawdata)
  File "C:\path\arnis.py", line 199, in processData
    img = np.zeros((round((greatestElementY - lowestElementY) / resDownScaler) + 5, round((greatestElementX - lowestElementX) / resDownScaler) + 5, 1), np.uint8)
numpy.core._exceptions._ArrayMemoryError: Unable to allocate 590. GiB for an array with shape (1113821, 568481, 1) and data type uint8

City / State based export broken

Hey, I attempted to run the city based export instead of the box based selection to have a larger region of Gainesville, Florida. The render took 121 minutes but exported a pretty empty region, and in specific parts its completely empty / cut off

PC Specs
CPU: Ryzen 7 5800X
Ram: 96GB DDR4 1599mhz
GPU: RTX 3090

javaw_8a4P3ci1c3
cmd_4Kzl1B1hi8

Unable to generate - Poland (no state?)

No matter what I do I do not manage to generate a map of any city from Poland. I also don't know what to put in "state", I tried everything. I receive every time: "Error! No data available". It would be great if it was possible to generate without this parameter, or if you could explain to me how to do it.

python3 arnis.py --city "Białystok" --state "Podlaskie" --country "Polska" --path "D:/Pliki/world"
Fetching data...
Chosen server: https://lz4.overpass-api.de/api/interpreter
Error! No data available

Having issues with different locations

The provided code functions flawlessly within the specified regions. Having said that, when attempting to execute this script in Irish areas, the results produce unexpected outputs, as evidenced in the attached files. Are there any strategies available to ensure its global applicability?

image

Memory allocation error

>>> python arnis.py --city "Київ" --state "Київ" --country "Україна" --path "E:/kyiv"
Fetching data...
Chosen server: https://overpass.kumi.systems/api/interpreter
Parsing data...
Traceback (most recent call last):
  File "D:\arnis\arnis.py", line 7, in <module>
    from src.main import run
  File "D:\arnis\src\main.py", line 118, in <module>
    imgarray = processData(rawdata, args)
  File "D:\arnis\src\processData.py", line 56, in processData
    img = np.zeros(
numpy.core._exceptions._ArrayMemoryError: Unable to allocate 275. GiB for an array with shape (1181055, 250396, 1) and data type uint8

Hi, when I try to run this script I catch this error. Can anyone help me?

Failed to download data. Status code: 400

failed

I downloaded the dependencies and inputted the bbox lat and lng values and it causes an error and usually i'd just write this off as the api used not working. however, the version before the lat and lng requirement, when you still had to use city, state and country, works fine ONLY using the example you gave for germany.

is there any reason for it not working?

Pyinstaller binaries and releases

I would consider creating single-file binaries with pyinstaller, and have github actions automatically publish nightly builds with each commit pushed to main. this would make it so users could just download a single binary for their system, whether its windows, linux or even intel macs, without tinkering with installing python and the dependencies which can be troublesome for a lot of non-programmers.

Weird map generation

I've been toying with the tool for a while now and I've noticed that there are still some problems with map generation.
I'm not entirely sure where the problem lies as I haven't gone through to understand the code but after implementing a way to read osm json files as the data instead so I could manage the query better on overpass api I found that even with the exact data I still get weird map generations like this.

image
image

can you do Hudson county for me

Idk how to use this so I need only Hudson county. if your pc can't handle it. then do Bayonne only cause new York is a big place when I tried

IndexError (moved from Discussions)

Discussed in https://github.com/louis-e/arnis/discussions/9

Originally posted by MrForquest October 7, 2022
Hello, I got this error:
Traceback (most recent call last):
File "arnis.py", line 7, in
from src.main import run
File "D:\Desktop\python_projects_2022\arnis\src\main.py", line 118, in
imgarray = processData(rawdata, args)
File "D:\Desktop\python_projects_2022\arnis\src\processData.py", line 478, in processData
if img[y][x] != 13:
IndexError: index 25503 is out of bounds for axis 0 with size 25503

I think this is because the "round" function is rounding up the maximum value of the index. I replaced "round" to "int" and it worked.
Now it looks like this:
"
for x in range(
int(i[0] - waterwayWidth / 2),
int(i[0] + waterwayWidth + 1 / 2),
):
for y in range(
int(i[1] - waterwayWidth / 2),
int(i[1] + waterwayWidth + 1 / 2),
):
if img[y][x] != 13:
img[y][x] = 38
"

Dash in region name

Hi! Dash in state name does not work for Russian regions:
https://github.com/louis-e/arnis/blob/main/src/getData.py#L27

I've tested it here: https://overpass-turbo.eu/
This one works:

[out:json];
area[name="Иркутск"]->.city;
area[name="Иркутская область"]->.state;
area[name="Россия"]->.country;
way(area.country)(area.state)(area.city)[!power][!place][!ferry];
(._;>;);
out;

And this one(as replace in code do) doesn't
area[name="Иркутская область"]->.state;

Link to the city: https://www.openstreetmap.org/relation/1430614

Not sure is it Russia states problem or a global one, maybe Denmark regions have the same issue: #12

Empty world

Arnis finishes up successfully, but I don't see the city built in the world.
Is it being generated at some specific coordinates? Or Arnis supports only specific game version?

Suggestion: Co-ordinate sync with reality [OPT-IN]

Instead of starting at 0,0 the generator would start at the position that would allow generating a few tows next to each other, in correct geographical positions. As many places would end up far away, It would log the position when finished

Multithread?

Generating big cities is kinda of a hell, because its using only one core. It's stuck on "Calculating layers" while recreating Saint-Petersburg.

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.