Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old September 6, 2017, 17:14   #11
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 7,881
Derakon is on a distinguished road
Quote:
Originally Posted by Sky View Post
you are telling me that

10 execute command
20 purge commands
30 goto 10

is too hard ?
You would be amazed at how often something that is really easy to describe is really hard to implement. I don't actually know how hard purging pending actions is in Angband or in any program, but I could easily believe it to require super-low-level access to the operating system and a lot of clever logic around dealing with input.

Feel free to take a stab at doing it yourself and proving me wrong. I don't have a problem with making the game easier to use, just with your reason for wanting the change. But you're making the assertion that the thing you want is easy, without any evidence that it actually is.
Derakon is offline   Reply With Quote
Old September 6, 2017, 17:18   #12
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,825
Donated: $40
takkaria is on a distinguished road
There is a difference between realtime games, where you expect a key to do something for exactly as long as it is pressed, and turn-based games, where individual keypresses represent discrete commands.

In realtime games, you can just scan the keyboard to see what keys are pressed many times a second and act accordingly.

Angband accepts discrete keypresses, whatever the OS passes it, so if the OS passes it 15 [f1] presses and [f1] is acid bolt, Angband is going to cast acid bolt 15 times. Angband doesn't know whether the key is being held down at the moment the command is processed.

It could find out, but in the case of a single keypress you don't want to do this check, because it might be by the time the game has processed the command the key isn't down anymore, which would lead to the game ignoring commands – unless the player holds down each command key for the precisely the right amount of time.

This 'is-the-key-down-right-now' check also wouldn't be helpful if you pressed [f1] three times in a row manually, but still faster than the game was processing those keypresses - for example because it's animating the previous acid bolt. In that case you'd lose keypresses you made intentionally.

You could imagine a check where if the current command is the same as the previous one, then you check if the key is held down. But then if you pressed [f1] two times in a row manually (as opposed to with auto-repeat), this wouldn't be the desired behaviour either. You could, I guess, take a note of the time when each keypress comes through and compare it to the time of the previous command, and if they're really close together turn on scanning behaviour. But I imagine that will be pretty error-prone too, and would feel pretty non-deterministic to the player.

The problem really with your request is that are two very different models of input processing here. Angband works on discrete keypresses; its whole gameplay revolves around this. You want it to be some kind of hybrid system where you can hold down keys and not worry about it, but honestly I don't see how it can work. It's not as simple as you seem to think it is.
__________________
"Physician, heal thyself."
takkaria is offline   Reply With Quote
Old September 6, 2017, 18:51   #13
kandrc
Adept
 
Join Date: Dec 2007
Posts: 203
kandrc is on a distinguished road
Quote:
Originally Posted by Sky View Post
you are telling me that

10 execute command
20 purge commands
30 goto 10

is too hard ?
Spectacular! Code it up!
kandrc is offline   Reply With Quote
Old September 6, 2017, 22:45   #14
Sky
Knight
 
Join Date: Oct 2016
Location: Glasgae
Age: 44
Posts: 612
Sky is on a distinguished road
you are saying that the keyboard sends a bundle of messages, and that angband cannot tell if these messages happened before, or after it has completed a single operation.
i have to assume that in angband you have multiple actions, not a single action with various types attached to it (cast, move, quaff, etc). in that case, the purge would have to be added to each action.

derakon, the OS has nothing to do with it. it's the game that chooses not to ignore commands. if the game receives more-than-one command, let it receive them all and ignore all after the first. the OS only thinks the app is taking time to go through the queued commands if the app send interrupt requests.

if adding purge on each command is too much, you can maybe build a command buffer that ignores the stacked commands. i honestly haven't seen a game stack commands like angband since the 90s.
__________________
#ARKENSTONESMATTER
Sky is offline   Reply With Quote
Old September 6, 2017, 22:58   #15
Sky
Knight
 
Join Date: Oct 2016
Location: Glasgae
Age: 44
Posts: 612
Sky is on a distinguished road
ok, let's be constructive. solutions, not problems.

you need have a list of commands, right?? e.g. press 8 -> move up.
what language is angband built in? C+ ? how does it stack commands? does it tell the OS "i have not finished with this command yet" , or does it actually buffer internally the commands? let's assume the former, your basic commands should look something like press 8 -> move up, getchar();
or char buffer[1].
__________________
#ARKENSTONESMATTER
Sky is offline   Reply With Quote
Old September 6, 2017, 23:16   #16
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 7,881
Derakon is on a distinguished road
You clearly know enough about programming to be dangerous, so like I said earlier, I encourage you to download the source code and take a stab at implementing it yourself. I don't think people would object to having the functionality you're talking about, so long as it doesn't interfere with normal playstyles. But I don't think you're going to be able to convince anyone to implement it for you. So you're on your own on this one, champ.
Derakon is offline   Reply With Quote
Old September 7, 2017, 03:09   #17
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,285
AnonymousHero is on a distinguished road
Quote:
Originally Posted by Sky View Post
you are telling me that

10 execute command
20 purge commands
30 goto 10

is too hard ?
Really? That's the level of discourse now?
AnonymousHero is offline   Reply With Quote
Old September 7, 2017, 03:13   #18
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,285
AnonymousHero is on a distinguished road
Quote:
Originally Posted by Sky View Post
ok, let's be constructive. solutions, not problems.

you need have a list of commands, right?? e.g. press 8 -> move up.
what language is angband built in? C+ ? how does it stack commands? does it tell the OS "i have not finished with this command yet" , or does it actually buffer internally the commands? let's assume the former, your basic commands should look something like press 8 -> move up, getchar();
or char buffer[1].
There's no such thing as "C+". There's "C" or "C++". The rest of your comment makes no more sense than that.

Look, can you plainly explain the "use case"? I don't buy "I have my keyboard set to repeat at 500kps". I you had that you'd be complaining to Microsoft/GNOME/KDE or whatever, because nothing handles *that*. (And, also, you'd *still* be dead even if Angband had a "don't buffer keypresses" policy.)
AnonymousHero is offline   Reply With Quote
Old September 7, 2017, 09:23   #19
Sky
Knight
 
Join Date: Oct 2016
Location: Glasgae
Age: 44
Posts: 612
Sky is on a distinguished road
there is an option in the control panel to set how your keyboard repeats commands. by default it's set on medium, and i have set on fast. again, this is not a registry hack, the repeat values are set within Microsoft's standards. it's no different than setting your mouse to move faster.

now, as mage or ranger, occasionally rogue, there will be times where you simply need the fire command repeated many times. maybe you are just killing trolls. if this is a directional, non targeted command (cast acidbolt east) the game will happily repeat commands even when a key is not pressed.

this must be because the commands stack - if you use the keyboard to tell angband (fire 15 bolts east) then angband will tell the system "i will now fire as many bolts east as you have told me" instead of "ok i see that you want a command done, i will do it and then i will wait for new instructions".

the command i wrote above is whatever google first gave me for "purge keyboard I/O buffer" which apparently is what other coders have used to resolve the same problem.
__________________
#ARKENSTONESMATTER
Sky is offline   Reply With Quote
Old September 7, 2017, 11:20   #20
wobbly
Veteran
 
Join Date: May 2012
Location: Adelaide, Australia
Posts: 1,063
wobbly is on a distinguished road
Programming issues aside I'm not sure whether I'd even want the change you are asking for. If I've just told the game to fire 15 bolts east it's probably because I want the game to fire 15 bolts east. I mean 15 seems a bit over the top but under safe enough circumstances I might actually want to repeat an action a few times with out using the repeat command.
wobbly 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
stop *some* items from stacking Sky Vanilla 4 May 1, 2017 15:30
Stop the Hunger Clock bio_hazard Idle chatter 3 November 13, 2016 20:02
Will the TY curse ever stop? poschengbandplayer Variants 3 September 20, 2015 17:24
Sangband - Rest won't stop until hungry Bucolic Verdancy Variants 5 May 23, 2014 04:37
Bug: cannot stop editing keymaps jens Development 1 June 20, 2011 16:19


All times are GMT +1. The time now is 09:04.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.