Giter VIP home page Giter VIP logo

botw-waypoint-map's People

Contributors

aptxyz avatar frankmazzarella avatar mrcheeze avatar stebaker92 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

botw-waypoint-map's Issues

Some modifications that allow Travelling Salesman Solutions to tracked locations

To map.py I added the following, and for less confusion, swapped Z and Y in the code.

import numpy, pytspsa
locations = []
[...](https://github.com/MrCheeze/botw-waypoint-map/blob/gh-pages/map.py#L43)
x,y,z = float(translate.attrib['X'].rstrip('f')), float(translate.attrib['Z'].rstrip('f')), float(translate.attrib['Y'].rstrip('f'))
f2.write('{"internal_name":"%s", "display_name":"%s", "x":%g, "y":%g, "z":%g},\n' % (saveflag, name, x, y, z))
locations.append((x,y,z))
img_x = int(x/2 + 3000)
img_y = int(z/2 + 2500)
...
tspsolver = pytspsa.Tsp_sa()
locations_np = numpy.asarray(locations, dtype=numpy.float32)
tspsolver.set_num_nodes(len(locations))
tspsolver.add_by_coordinates(locations_np)
tspsolver.set_t_v_factor(200.0 / len(locations))
tspsolver.sa_auto_parameter(24)
tspsolution = tspsolver.getBestSolution()
tsproute = tspsolution.getRoute().split('-')
tsproute.pop()

past_point = None
for p in tsproute :
    x,y,z = locations_np[int(p)].tolist()
    if past_point != None:
        map_draw.line((past_point, (x/2 + 3000, y/2 + 2500)), fill='red', width=3)
    past_point = (x/2 + 3000, y/2 + 2500)
...
botw_map.save('BotW-Map-Labeled' + str(tspsolution.getlength()) + '.png',optimize=True)

Within a few seconds a nice path around the map was created, then I renamed the file and had it loaded in index.html

I did change index.html to load BotW-Map-Labeled.png and changed style of .waypoint:hover { to have opacity: 1; and .waypoint to have opacity: 0 for better display.

The solution is produced extremely quickly, even quicker if you keep it 2d.

The demo code for pytspsa has the following:

    if len(c) <= 100:
        solver.set_t_v_factor(min(t_v_factor, 200.0 / len(c)))
    else:
        solver.set_t_v_factor(min(t_v_factor, 60.0 / len(c)))

And auto parameter can be lowered to 8 and such, if the waypoints start to get into the thousands, but since most points are only a few dozen or hundred, the parameters should be fine as it stands.

Example produced map for some shrines I needed to visit with mostly convex solutions:

a

I think this is some mistake

There is no point name the Hyrule Kingdom
and Hebra Trailhead Lodge in the north of Rito Village doesn't in the map
You tool is very useful for me
Thank U very much

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.