Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old June 16, 2016, 10:26   #1
Tibarius
Swordsman
 
Tibarius's Avatar
 
Join Date: Jun 2011
Location: Germany
Age: 50
Posts: 388
Tibarius is an unknown quantity at this point
Bug 4.0.5, Target Cursor

Just tried to use 4.0.5 windows version.

Bug: The target cursor does not highlight the actual targetted monster but instead is somewhere located on the bottom section of the main window.

Correct Behavior: The target cursor should highlight the actual targetted monster.

Ocurrence: Always (so it should be easy to re-produce the bug). I switched two birth options (sell for gold and no usefull starting kit). UI-Options: Use old target by default and highlight target with cursor.

This leaves 4.0.5 unplayable for me ... *sigh*.
Tibarius is offline   Reply With Quote
Old June 16, 2016, 12:56   #2
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,786
Donated: $60
Nick is on a distinguished road
Yeah, this is a known bug - x and y mixed up in cursor position, I believe
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old June 17, 2016, 05:37   #3
mrfy
Adept
 
Join Date: Jul 2015
Location: Seattle, WA
Posts: 135
mrfy is on a distinguished road
Same bug in the macos version, but it's definitely not unplayable. it's just a display bug, doesn't affect game play.
mrfy is offline   Reply With Quote
Old July 20, 2016, 19:57   #4
bart9h
Rookie
 
Join Date: Jul 2016
Posts: 1
bart9h is on a distinguished road
Same bug on Linux, using either the SDL or the X11 frontend. Seems like it's not system-dependent. It's annoying, but definitely not unplayable. The actual cursor is on the right place, it's just displayed on the wrong place. I tried the latest git version, and it's still there. Please fix this! k tx by
bart9h is offline   Reply With Quote
Old July 21, 2016, 00:36   #5
t4nk
Swordsman
 
Join Date: May 2016
Posts: 330
t4nk is on a distinguished road
line 369 of ui-game.c:
Code:
        move_cursor_relative(player->px, player->py);
Looks pretty innocent, right? But someone - who that was? - decided to use backwards order for coordinates (y, x) throughout the whole textui. Besides, pre_turn_refresh() should check for OPT(show_target)... I think... I sent a patch, it seems to work I didn't do a lot of testing.
Anyway, whose idea was to use y, x order? It's just super annoying. Was it Ben Harrison? I remember in school we always used x, y coordinates - in this particular order; x first, y second. Is this different in different countries or what? Now Angband sometimes uses x, y, sometimes y, x, which is very error prone. I considered normalizing all that (to x, y) in new textui... I'll probably have to do it.
t4nk is offline   Reply With Quote
Old July 21, 2016, 01:16   #6
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,879
Derakon is on a distinguished road
Quote:
Originally Posted by t4nk View Post
Anyway, whose idea was to use y, x order? It's just super annoying. Was it Ben Harrison? I remember in school we always used x, y coordinates - in this particular order; x first, y second. Is this different in different countries or what? Now Angband sometimes uses x, y, sometimes y, x, which is very error prone. I considered normalizing all that (to x, y) in new textui... I'll probably have to do it.
It is unfortunately semi-common (not just in Angband) to specify coordinates as (row, column), which works out to (y, x). I agree with you that it's super annoying, and if I knew who introduced it to Angband I'd probably want to chew them out (or at least ask why), but it's been like that for ages. Ben Harrison or earlier, I think.
Derakon is offline   Reply With Quote
Old July 21, 2016, 01:31   #7
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,352
Donated: $40
Pete Mack is on a distinguished road
(y,x) goes all the way back to rogue, and primitive green-screen terminals, where (col, row) was a common form.
Pete Mack is offline   Reply With Quote
Old July 21, 2016, 08:51   #8
t4nk
Swordsman
 
Join Date: May 2016
Posts: 330
t4nk is on a distinguished road
Funny stuff... consider ui-target.c. Why does pathfinder work (press 't', navigate to a square, press 'g' and go there) when targeter does:
Code:
    case 'g':
        cmd_set_arg_point(cmdq_peek(), "point", y, x);
How does that work when cmd_set_arg_point() takes x, y? Because do_cmd_pathfind() does:
Code:
    /* XXX-AS Add better arg checking */
    cmd_get_arg_point(cmd, "point", &x, &y);
    ...
    if (findpath(x, y)) {
    ....
and, of course, findpath()...
Code:
bool findpath(int y, int x)
I guess I'll have to leave the y, x stuff as it is, "fixing" it will just wreck the game at this point
t4nk is offline   Reply With Quote
Old July 21, 2016, 13:33   #9
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,367
AnonymousHero is on a distinguished road
Quote:
Originally Posted by t4nk View Post
Now Angband sometimes uses x, y, sometimes y, x, which is very error prone. I considered normalizing all that (to x, y) in new textui... I'll probably have to do it.
If you're going to do anything about this, might I suggest introducing a "struct point { int x, int y}" instead? In most places, coordinates (x,y) aren't actually plucked out of thin air, but rather come from somewhere else, e.g. monster coordinates, object coordinates, player coordinates. In those cases, the relevant structs should just have a "point" embedded in them instead of separate (x, y) coordinates.

EDIT: If you want a less "noisy" method than struct-initialization for creating coordinates out of thin air you could always introduce a function: "point make_point(int x, int y)".

Last edited by AnonymousHero; July 21, 2016 at 22:42.
AnonymousHero is offline   Reply With Quote
Old July 21, 2016, 16:11   #10
kandrc
Swordsman
 
Join Date: Dec 2007
Posts: 299
kandrc is on a distinguished road
It's older than Rogue. It's part of curses (which Rogue used). And curses does in that way because terminals do it that way. And terminals do it that way because Indo-European languages (and specifically English) do it that way (i.e., of course indexing characters is not part of English, but when we need to refer to letters in text, it's far more sensible to talk about a line before an offset).

Long argument short, long historical precedent suggests that if you're using (x,y) when dealing with text or text-based stuff, you're doing it wrong.
kandrc is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Double height tiles: which type of cursor? PowerWyrm Development 9 July 26, 2012 13:52
Path to target request juggle5 Vanilla 9 May 17, 2011 13:07
minor bug - can shoot but not target PowerDiver Vanilla 7 July 15, 2010 16:59
Target in range indicator? ChodTheWacko Vanilla 1 November 28, 2009 16:14
svn-1452 bug: wielding morning star firestar wants to target d_m Vanilla 6 June 25, 2009 04:11


All times are GMT +1. The time now is 19:56.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.