Friday Facts #259 - Scan-codes, Prototype IDs, HR worm
Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm
So many things coming for 0.17, so many great things...
I can't wait to get my hands on that new map editor.
I can't wait to get my hands on that new map editor.
- TRUEpicness
- Long Handed Inserter
- Posts: 74
- Joined: Wed Aug 09, 2017 8:21 pm
- Contact:
Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm
Those worms tho
1 more YouTube vid before bed *starts 24hr long vid*
Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm
So? Can we know when can we generally expect 0.17? Still in September? October? November? Just asking.
-
- Manual Inserter
- Posts: 1
- Joined: Fri Sep 07, 2018 1:04 pm
- Contact:
-
- Long Handed Inserter
- Posts: 82
- Joined: Sat Jul 08, 2017 6:26 pm
- Contact:
Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm
When is .17 coming?
- BlueTemplar
- Smart Inserter
- Posts: 3032
- Joined: Fri Jun 08, 2018 2:16 pm
- Contact:
Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm
At the risk of repeating what I said on Discord, IMHO you should do the right thing™,
and set "Undo" to the scan-code for "whatever is the bottom left letter key"
(Z for QWERTY, Y for QWERTZ, W for AZERTY, Я for JCUKEN...)
(As you mention, you even naturally did that yourself while working on this feature, binding it to Ctrl+Y on your QWERTZ !)
The Ctrl+ZXCV shortcuts for Undo, Cut, Copy, Paste ware based on the easy location on the physical QWERTY layout, (possibly starting with the mnemonic "C"), and it was wrong for software to bind "Undo" to Ctrl + the key-code for Z, rather than the relevant scan-code !
And it at the same time solves the aforementioned issue with AZERTY, as well as the issue with keyboards that do not even have a Z in their layout, like the already mentioned JCUKEN :
(Default Russian Windows layout.)
and set "Undo" to the scan-code for "whatever is the bottom left letter key"
(Z for QWERTY, Y for QWERTZ, W for AZERTY, Я for JCUKEN...)
(As you mention, you even naturally did that yourself while working on this feature, binding it to Ctrl+Y on your QWERTZ !)
The Ctrl+ZXCV shortcuts for Undo, Cut, Copy, Paste ware based on the easy location on the physical QWERTY layout, (possibly starting with the mnemonic "C"), and it was wrong for software to bind "Undo" to Ctrl + the key-code for Z, rather than the relevant scan-code !
And it at the same time solves the aforementioned issue with AZERTY, as well as the issue with keyboards that do not even have a Z in their layout, like the already mentioned JCUKEN :
(Default Russian Windows layout.)
BobDiggity (mod-scenario-pack)
Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm
There is no well defined "Right Thing" in this case. For example CRTL-Z is still widely used on german Keyboards, but you hit the actual Z key and not the y Key where it would be on US Layouts. Users got used to it over the years I guess. Basically any program I know of uses the KeyCode for this. Sometimes there is some magic going on in the background where it displays it as "HIT CONTROL Y" or the likes but works with your actual Z key.BlueTemplar wrote:At the risk of repeating what I said on Discord, IMHO you should do the right thing™,
and set "Undo" to the scan-code for "whatever is the bottom left letter key"
(Z for QWERTY, Y for QWERTZ, W for AZERTY, Я for JCUKEN...)
...
While I applaud the general idea of scancodes for gaming (not for typing or programming), I think things are relatively fine as long as you don't have to fiddle too much with keyboard settings. Gamers are used to set things up how they personally like it. It's far worse when specifc keys are not remappable or reserved than having to switch them once.
Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm
I think this is really the right thing but people with non-US layouts might have got used to those shortcuts in other apps. Is Ctrl+Z actually Ctrl+W in MS Word, for example? What about browsers? Ctrl+W usually closes the active tab, is it Ctrl+Z for the French layout? It's kinda controversial for the people with latin non-QWERTY layouts. "Fortunately", for me with QWERTY/ЙЦУКЕН it either works or doesn't work at all...
Well, I was outrun on this issue. I think the main issue is that two separate problem spaces are mixed together: the controls that are chosen to be handy, i.e. by their physical location to place your fingers naturally AND the shortcuts that are defined by their meaning, mnemonic or just history. The former better work with scan codes, the latter with key codes (however, the key codes are layout dependent so in cyrillic layout they wouldn't work).
Well, I was outrun on this issue. I think the main issue is that two separate problem spaces are mixed together: the controls that are chosen to be handy, i.e. by their physical location to place your fingers naturally AND the shortcuts that are defined by their meaning, mnemonic or just history. The former better work with scan codes, the latter with key codes (however, the key codes are layout dependent so in cyrillic layout they wouldn't work).
Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm
Ah the joys of programming! Cheers on the success of this bit of re-write!During this rework I discovered we were doing a bunch of extra work (some of it even causing bugs) just to restore the save file ID mapping, and I was able to simply delete all of it now that the IDs simply migrate to the correct values any time a save file is loaded. I even inadvertently fixed a bug someone reported related to crashing when loading a specific scenario-using save file due to this rework.
Overall the system is simpler now and doesn't have any of the 'quirks' it used to. The new Map Editor can import any save file the game is capable of loading and it all 'just works'.
My own personal Factorio super-power - running out of power.
Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm
Or you could, as I tend to do in SDL, pass scancodes around but convert options that are currently using keycodes.
With SDL (that's what you're moving to, right?) they are a simple conversion.
For instance... most internal functions want scancodes. But you have SDL_GetKeyFromScancode and SDL_GetScancodeFromKey.
Thus, when "converting" your code, it would be quite simple to lookup what the user has saved as a keycode, match it to a scancode, and then use that in the code.
If you want, a one-time key->scan conversion asking if you want to do that for people upgrading (fresh users can start on scancodes straight away - everyone else might need to have their "normal" layout language before they say Yes).
SDL2's key handling had the same thing when it went from SDL 1.0 to 1.2/2 and that's how I handled it.
With SDL (that's what you're moving to, right?) they are a simple conversion.
For instance... most internal functions want scancodes. But you have SDL_GetKeyFromScancode and SDL_GetScancodeFromKey.
Thus, when "converting" your code, it would be quite simple to lookup what the user has saved as a keycode, match it to a scancode, and then use that in the code.
If you want, a one-time key->scan conversion asking if you want to do that for people upgrading (fresh users can start on scancodes straight away - everyone else might need to have their "normal" layout language before they say Yes).
SDL2's key handling had the same thing when it went from SDL 1.0 to 1.2/2 and that's how I handled it.
- BlueTemplar
- Smart Inserter
- Posts: 3032
- Joined: Fri Jun 08, 2018 2:16 pm
- Contact:
Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm
Cutemine, rkfg, that's my point : doing the right thing often presumes to go against what people are used to !
(see also : Pluto demoted from the list of planets).
I think that what you meant was that QWERTZ users have to type Ctrl+Z instead of typing Ctrl+Y ?
And French have to type Ctrl+Z instead of Ctrl+W for undo too :
For instance, in Photoshop :
Thankfully, not all shortcuts are as "dangerous" as Ctrl+W on the browser - which seems to come from ... W being next to Ctrl+Q (for "Quit") on QWERTY !
(see also : Pluto demoted from the list of planets).
But the Z key on QWERTZ is located on the same spot as Y on QWERTY ?Cutemine wrote:For example CRTL-Z is still widely used on german Keyboards, but you hit the actual Z key and not the y Key where it would be on US Layouts.
I think that what you meant was that QWERTZ users have to type Ctrl+Z instead of typing Ctrl+Y ?
And French have to type Ctrl+Z instead of Ctrl+W for undo too :
For instance, in Photoshop :
Thankfully, not all shortcuts are as "dangerous" as Ctrl+W on the browser - which seems to come from ... W being next to Ctrl+Q (for "Quit") on QWERTY !
This sounds like a double mess-up with scan-codes...Cutemine wrote:Sometimes there is some magic going on in the background where it displays it as "HIT CONTROL Y" or the likes but works with your actual Z key.
BobDiggity (mod-scenario-pack)
Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm
Well, that boils down to the definition of "right". It's like forcing people to use HJKL for movement instead of WASD because Vim use them and it's a "right" thing to do and also muh effectiveness. Unfortunately, people have their own inertness when we talk about these matters and it's often counterproductive to reeducate them. The game still allows to rebind all the controls so it's not that big of an issue anyway, though first experience matters a lot.BlueTemplar wrote:Cutemine, rkfg, that's my point : doing the right thing often presumes to go against what people are used to !
I wonder how this all is solved in big AAA titles if at all. Maybe the AZERTY users are already used to sigh each time they launch a new game and rebind the keys even prior starting the actual gameplay? I'm genuinely interested because maybe 5 years ago I didn't even know about these alternative layouts. I was sure there's only QWERTY for latin alphabets and national variants for non-ASCII languages like Russian or Japanese, some diacritics for Western European languages and such but swapping the QWERTY keys? What a heresy!
- BlueTemplar
- Smart Inserter
- Posts: 3032
- Joined: Fri Jun 08, 2018 2:16 pm
- Contact:
Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm
So, basically, "fuck you newer people, we (older people) are going to keep using what we're used to, even if it's worse" ?
I'm not sure why you bring up HJKL, as Factorio already uses WASD, and last but not least, the Mouse ! It wouldn't be effective at all !
Yeah, we're used to remap keys for games -
the worst situation is like when a function is hardcoded to `,
which is left to the "1" on QWERTY,
but is Alt+Ctrl+7 on AZERTY...
except the numbers seem to use scan-codes instead
(because you don't want to have to use "Shift"/"Caps Lock" each time that you want to access a shortcut that is on 1-9 on QWERTY)
and something in the game logic prevents from assigning the ² that is there,
probably because ² (left to the "1" on AZERTY ) is not ASCII,
so now you're stuck !
It's even worse than that, QWERTY is itself an heresy, created ~150 years ago, designed so that the concurrently used letters are as far away from each other as possible (and therefore the typing is as slow as possible!) so that the mechanical typerwriters don't jam up !
And French AZERTY is heresy², as you can't even type proper French with it...
I'm not sure why you bring up HJKL, as Factorio already uses WASD, and last but not least, the Mouse ! It wouldn't be effective at all !
Yeah, we're used to remap keys for games -
the worst situation is like when a function is hardcoded to `,
which is left to the "1" on QWERTY,
but is Alt+Ctrl+7 on AZERTY...
except the numbers seem to use scan-codes instead
(because you don't want to have to use "Shift"/"Caps Lock" each time that you want to access a shortcut that is on 1-9 on QWERTY)
and something in the game logic prevents from assigning the ² that is there,
probably because ² (left to the "1" on AZERTY ) is not ASCII,
so now you're stuck !
It's even worse than that, QWERTY is itself an heresy, created ~150 years ago, designed so that the concurrently used letters are as far away from each other as possible (and therefore the typing is as slow as possible!) so that the mechanical typerwriters don't jam up !
And French AZERTY is heresy², as you can't even type proper French with it...
BobDiggity (mod-scenario-pack)
-
- Filter Inserter
- Posts: 952
- Joined: Sat May 23, 2015 12:10 pm
- Contact:
Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm
It's based on the letter on the keyboard. It's still ctrl+Z for undo universally even though it's on the zqsd "movement" keys.rkfg wrote:I think this is really the right thing but people with non-US layouts might have got used to those shortcuts in other apps. Is Ctrl+Z actually Ctrl+W in MS Word, for example? What about browsers? Ctrl+W usually closes the active tab, is it Ctrl+Z for the French layout? It's kinda controversial for the people with latin non-QWERTY layouts. "Fortunately", for me with QWERTY/ЙЦУКЕН it either works or doesn't work at all...
Well, I was outrun on this issue. I think the main issue is that two separate problem spaces are mixed together: the controls that are chosen to be handy, i.e. by their physical location to place your fingers naturally AND the shortcuts that are defined by their meaning, mnemonic or just history. The former better work with scan codes, the latter with key codes (however, the key codes are layout dependent so in cyrillic layout they wouldn't work).
ctrl+W will close the tab/document and I find it's location near the bottom left actually pretty handy for something I use quite often (more than ctrl+Z at least).
Then again I'm not shy of moving my hand around the keyboard when needed. For example my move-through-tab position is to curl my thumb under my palm and use the middle finger to hit tab and the ring finger to hit shift when needed. This puts my palm over the tab-capslock-shift-ctrl column. It's slightly less natural that my alt-tab position which has the thumb extended to hit alt but everything else is in roughly the same place.
Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm
Well, not that extreme. It's just that if people are used to some shortcut already it's easier for them to use it further in other games and apps. And if some people think they have a better shortcut they're free to rebind. If I find a shortcut inconvenient in a game I play all the time, I rebind it, no biggie. But I'd find it very weird if a game used some non-standard scheme right out of the box, like:BlueTemplar wrote:So, basically, "fuck you newer people, we (older people) are going to keep using what we're used to, even if it's worse" ?
...like HJKL. Because some people out there think it's much more effective than WASD or arrows to move the cursor. Or, if you also use mouse, it could be ASDF or SDFG. I agree, to an extent, that yet again two problem spaces collide, this time it's gaming and typing just as Ctrl+Z comes from word processors (I believe). Hence there could be a new, gaming-handy shortcut for undo that's different from word processors.BlueTemplar wrote:I'm not sure why you bring up HJKL, as Factorio already uses WASD, and last but not least, the Mouse ! It wouldn't be effective at all !
Yeah, I know. But QWERTY's heresy has been with us long enough we're used to it and habits are usually stronger than effectiveness (see Dvorak which you probably won't find anywhere among your friends).BlueTemplar wrote:It's even worse than that, QWERTY is itself an heresy, created ~150 years ago, designed so that the concurrently used letters are as far away from each other as possible (and therefore the typing is as slow as possible!) so that the mechanical typerwriters don't jam up !
So, the main question is what to set as a default. And I'd say, it should be what most of the people find convenient, not effective, cool or otherwise better. There's no "better" shortcuts. Only what most of the people would accept as intuitive, handy etc. If possible, of course it's better to adapt this for different layouts and locales and that basically proves the point, make that "most people" even "more". Forcing undo as Ctrl+key-right-to-left-shift works for the opposite, increasing the number of people who will rebind.
Customizable keys is a bliss but if a lot of people do that it means something isn't right.
-
- Long Handed Inserter
- Posts: 74
- Joined: Thu May 05, 2016 1:31 pm
- Contact:
Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm
Bugsies getting some love?
May i ask if you have any plans to make them more of an actual threat than just PITA?
Cause if we could get some more sophisticated bugsy behaviour, it would be cool
maybe even functionalities for pvp hoomins against bugsies scenarios
May i ask if you have any plans to make them more of an actual threat than just PITA?
Cause if we could get some more sophisticated bugsy behaviour, it would be cool
maybe even functionalities for pvp hoomins against bugsies scenarios
-
- Filter Inserter
- Posts: 952
- Joined: Sat May 23, 2015 12:10 pm
- Contact:
Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm
Except a lot of players don't want highly dangerous bugs,POPISowyNumer wrote:Bugsies getting some love?
May i ask if you have any plans to make them more of an actual threat than just PITA?
Cause if we could get some more sophisticated bugsy behaviour, it would be cool
maybe even functionalities for pvp hoomins against bugsies scenarios
most just want to build their factory with light pressure from outside as a resource sink and give resistance against just sprawling out.
- BlueTemplar
- Smart Inserter
- Posts: 3032
- Joined: Fri Jun 08, 2018 2:16 pm
- Contact:
Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm
What makes you think that?rkfg wrote:Forcing undo as Ctrl+key-right-to-left-shift works for the opposite, increasing the number of people who will rebind.
Because under the current proposition for Ctrl+Z, it's the AZERTY users that will be forced to rebind (away from it), due to the issue raised in the FFF !
I partially agree : it should be Ctrl+"the bottom left letter key" when that letter is not Z !rkfg wrote: Hence there could be a new, gaming-handy shortcut for undo that's different from word processors.
BobDiggity (mod-scenario-pack)
Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm
Do the new enemies correlate with terrain and/or resources?
Would there be strong uranium-themed worms/biters living on/near uranium fields?
Do the sand-worms differ from land-worms or water-worms?
Do worms living close to the water or in shallow water snatch fishes if they swim too close?
Would there be strong uranium-themed worms/biters living on/near uranium fields?
Do the sand-worms differ from land-worms or water-worms?
Do worms living close to the water or in shallow water snatch fishes if they swim too close?