Friday Facts #259 - Scan-codes, Prototype IDs, HR worm

Regular reports on Factorio development.

User avatar
LotA
Fast Inserter
Fast Inserter
Posts: 117
Joined: Fri Oct 10, 2014 11:41 am
Contact:

Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm

Post by LotA »

So many things coming for 0.17, so many great things...
I can't wait to get my hands on that new map editor.

User avatar
TRUEpicness
Long Handed Inserter
Long Handed Inserter
Posts: 74
Joined: Wed Aug 09, 2017 8:21 pm
Contact:

Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm

Post by TRUEpicness »

Those worms tho
1 more YouTube vid before bed *starts 24hr long vid*

User avatar
Durabys
Fast Inserter
Fast Inserter
Posts: 234
Joined: Mon Apr 18, 2016 3:30 pm
Contact:

Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm

Post by Durabys »

So? Can we know when can we generally expect 0.17? Still in September? October? November? Just asking.

lemarcantoine
Manual Inserter
Manual Inserter
Posts: 1
Joined: Fri Sep 07, 2018 1:04 pm
Contact:

Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm

Post by lemarcantoine »

Thqnks q lot!

Skeletpiece
Long Handed Inserter
Long Handed Inserter
Posts: 82
Joined: Sat Jul 08, 2017 6:26 pm
Contact:

Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm

Post by Skeletpiece »

When is .17 coming?

User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 2421
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm

Post by BlueTemplar »

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 :
Image
(Default Russian Windows layout.)
BobDiggity (mod-scenario-pack)

Cutemine
Inserter
Inserter
Posts: 47
Joined: Mon Jun 27, 2016 8:00 pm
Contact:

Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm

Post by Cutemine »

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...)
...
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.

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.

rkfg
Long Handed Inserter
Long Handed Inserter
Posts: 62
Joined: Thu Jan 15, 2015 11:11 pm
Contact:

Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm

Post by rkfg »

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).

Amarula
Filter Inserter
Filter Inserter
Posts: 525
Joined: Fri Apr 27, 2018 1:29 pm
Contact:

Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm

Post by Amarula »

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'.
Ah the joys of programming! Cheers on the success of this bit of re-write!
My own personal Factorio super-power - running out of power.

User avatar
ledow
Fast Inserter
Fast Inserter
Posts: 102
Joined: Sat Sep 24, 2016 3:00 pm
Contact:

Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm

Post by ledow »

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.

User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 2421
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm

Post by BlueTemplar »

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).
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.
But the Z key on QWERTZ is located on the same spot as Y on QWERTY ?
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 :
Image
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 !
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.
This sounds like a double mess-up with scan-codes...
BobDiggity (mod-scenario-pack)

rkfg
Long Handed Inserter
Long Handed Inserter
Posts: 62
Joined: Thu Jan 15, 2015 11:11 pm
Contact:

Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm

Post by rkfg »

BlueTemplar wrote:Cutemine, rkfg, that's my point : doing the right thing often presumes to go against what people are used to !
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.

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!

User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 2421
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm

Post by BlueTemplar »

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...
BobDiggity (mod-scenario-pack)

ratchetfreak
Filter Inserter
Filter Inserter
Posts: 952
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm

Post by ratchetfreak »

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).
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.

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.

rkfg
Long Handed Inserter
Long Handed Inserter
Posts: 62
Joined: Thu Jan 15, 2015 11:11 pm
Contact:

Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm

Post by rkfg »

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" ?
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: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 !
...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: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 !
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).

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.

POPISowyNumer
Long Handed Inserter
Long Handed Inserter
Posts: 74
Joined: Thu May 05, 2016 1:31 pm
Contact:

Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm

Post by POPISowyNumer »

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

ratchetfreak
Filter Inserter
Filter Inserter
Posts: 952
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm

Post by ratchetfreak »

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
Except a lot of players don't want highly dangerous bugs,

most just want to build their factory with light pressure from outside as a resource sink and give resistance against just sprawling out.

User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 2421
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm

Post by BlueTemplar »

rkfg wrote:Forcing undo as Ctrl+key-right-to-left-shift works for the opposite, increasing the number of people who will rebind.
What makes you think that?

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 !
rkfg wrote: Hence there could be a new, gaming-handy shortcut for undo that's different from word processors.
I partially agree : it should be Ctrl+"the bottom left letter key" when that letter is not Z ! :P
BobDiggity (mod-scenario-pack)

ske
Filter Inserter
Filter Inserter
Posts: 412
Joined: Sat Oct 17, 2015 8:00 am
Contact:

Re: Friday Facts #259 - Scan-codes, Prototype IDs, HR worm

Post by ske »

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?

Post Reply

Return to “News”