1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-09 23:49:53 +00:00

rogueviz::sag:: minor changes, docs updated

This commit is contained in:
Zeno Rogue 2024-07-23 23:13:25 +02:00
parent c306b28d65
commit 199f8b2927
3 changed files with 26 additions and 3 deletions

View File

@ -41,10 +41,29 @@ The rest of this README details how to use SAG.
Cells
-----
Not yet documented
If nothing is declared, it just uses all the visible cells (or all cells on closed manifolds),
and the distances are measured in tiles.
You can change this as follows:
* `-sag-creq x` -- use x tiles which are geometrically closest to the center (or a bit more in case of ties)
* `-sag_gdist x` -- take geometric distances instead, 1 absolute units = x units
(this will be rounded to integer because of the limited precision of some methods)
* `-sag_gdist_dijkstra m` -- compute actual geometric distances if <= m steps, use Dijkstra to compute larger distances
(used in geometries like Solv where the distance computation does not always work for large distances)
* `-sag_gdist_save filename` -- save the distances to a file
(loading which might be faster than recomputing)
* `-sag_gdist_load filename` -- load the distances from a file
Graph
-----
Just use `-sag-weighted` to read a weighted graph (in format `node1;node2;weight`),
or `-sag-unweighted` to read an unweighted graph (in format `node1 node2`).
Just use `-sag-weighted` to read a weighted graph (in format `node1;node2;weight`), or `-sag-unweighted` to read an unweighted graph (in format `node1 node2`).
You can also use `-sag-edgepower a b` to use pow(w, a) * b instead of weight w listed in the file (enter this before -sag-weighted).
See the cpp files for other options available.

View File

@ -603,6 +603,7 @@ int cell_read_args() {
dijkstra_tile = true; dijkstra_maxedge = 1;
}
else if(argis("-sag_gdist_save")) {
init_cells();
shift();
sagdist.save(args());
}

View File

@ -159,6 +159,8 @@ void menu() {
optimize_sag_loglik_auto();
});
dialog::addBoolItem_action(XLAT("visualize (sub)cells"), visualize_subcells_on, 'v');
dialog::display();
}
@ -322,6 +324,7 @@ void init() {
rv_hook(rogueviz::hooks_close, 100, clear);
rv_hook(shmup::hooks_turn, 100, turn);
rv_hook(hooks_drawcell, 100, visualize_subcells);
rv_hook(rogueviz::hooks_rvmenu, 100, [] {
dialog::addItem("SAG settings", 's');
dialog::add_action_push(menu);