Page 1 of 4

Friday Facts #244 - Localised plurals & Modernisation progress

Posted: Fri May 25, 2018 3:11 pm
by Klonan

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Posted: Fri May 25, 2018 3:24 pm
by peet1993
Read the title and immediately thought about the Computerphile/Tom Scott video. Nice to see it linked in the FFF :)
Nice writeup, very interesting as always! The one thing I don't understand is what the Debug Info pictures mean. Is it OpenGL vs DirectX or 0.17 Main vs Rewrite? If the latter, a 30% Framerate increase is damn impressive.

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Posted: Fri May 25, 2018 3:31 pm
by HammerPiano
with minor fixes to line rendering
Does it mean that the bug where you can't see the wires of power poles is fixed / going to be fixed?

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Posted: Fri May 25, 2018 3:38 pm
by ledow
"minutes=__1__ __plural_for_parameter_1__[1]__minut__[ends in 01-19]__minute__[rest]__de minute__"

Urgh.

Never thought about proper GNU gettext, which is basically designed with this kind of thing in mind and then people can just use a compatible translation program and send you a translated .po?

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Posted: Fri May 25, 2018 3:42 pm
by mikiqex
Plurals are often categorized as "zero, one, few, many, other". Unicode have a whole webpage dedicated just to plural rules in different languages: http://www.unicode.org/cldr/charts/33/s ... es.html#cs

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Posted: Fri May 25, 2018 3:57 pm
by ske
"...and then he realised that the only way to delay the inevitable for some more time was to make the grammar rules of their language NP-complete."

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Posted: Fri May 25, 2018 4:02 pm
by steinweb

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Posted: Fri May 25, 2018 4:29 pm
by OvermindDL1
This made it clear, that having different translation key for every possible form for every language would be too crazy, so we invented something more generic.
Every project that doesn't use gettext for localization invariably winds up improperly remaking gettext incompletely... >.>

(Not my phrase, but one I hear often and often see being true...)
(we are seeing about 30% more time spent in calls to OGL as opposed to D3D).
And yeah, that is because crappy drivers primarily for equivalently aged OGL/D3D versions, it's amazing just how *bad* some drivers are... >.<

I especially love the occasional user idiots that like to compare OGL2 vs D3D11 or so performance's, like wtf... one is from the mid-late 1990's and the other is a few years old, why wouldn't there be performance differences...

(Yes I know OGL2 extensions let it be *much* faster than originally designed, but still not up to par)
and in future we would like to create Vulkan and Metal backends
Oh there is no point in making a metal backend anymore, the authors of Vulkan (Khronos) made a metal/vulkan conversion library that let's vulkan run on metal (interestingly benchmarks show it to be faster than the equivalently written metal code due to optimizations the interface performs)
By using OpenGL 3.3 Core and DirectX 11 feature level 10.0
Yeah these are not equivalently aged... >.>

Although high marks on using the Core profile!

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Posted: Fri May 25, 2018 5:03 pm
by aklesey1
Waiting for 0.17 version with new graphics engine with more FPS and fewer lags in multiplayer 8-)
Good luck with your fantastic game in new update :)

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Posted: Fri May 25, 2018 5:15 pm
by melind
And here I thought localization of this sort of thing would have been standardized and wrapped into packages like timezones have been.

If you need, I'm fine with continuing to believe everyone speaks Czech or English. It's a fair assumption.

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Posted: Fri May 25, 2018 5:47 pm
by posila
peet1993 wrote:The one thing I don't understand is what the Debug Info pictures mean. Is it OpenGL vs DirectX or 0.17 Main vs Rewrite? If the latter, a 30% Framerate increase is damn impressive.
Ah, the image was last minute addition (I didn't want to dwell on actual numbers in this post), so I forgot description. It is 0.17 old vs new, DirectX, the game is set to speed 7 and paused so it is rendering the exact same frame. It was about 25k sprites, which is quite common for the game to render, but it is not hard to go to 50k sprites when zooming out in some busy areas or even more (the largest number of sprites rendered I've seen in Factorio was around 300 000 when we tried to generete 1 million tiles long belt loop (it was snaking in square not giant loop) filled with items).
OvermindDL1 wrote:...
By using OpenGL 3.3 Core and DirectX 11 feature level 10.0
Yeah these are not equivalently aged... >.>
I agree, DX11 was released with Windows 7 in October 2009 and OpenGL 3.3 was release alongside of OGL 4.0 in March 2010 (as a kind of OGL4 feature level DX10), DX11FL10 and OGL3.3 both target the same hardware so it is unfair to DX to be compared with the newer API :)
OvermindDL1 wrote: Oh there is no point in making a metal backend anymore, the authors of Vulkan (Khronos) made a metal/vulkan conversion library that let's vulkan run on metal (interestingly benchmarks show it to be faster than the equivalently written metal code due to optimizations the interface performs)
Our macOS guys said Metal would be faster, but if that is not the case, there might really be no reason to have it. We want to do Vulkan first anyway, so if it performs well we might just stick with it on macOS too.

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Posted: Fri May 25, 2018 6:18 pm
by Gergely
My language uses the same singular word regardless of the quantity. Plural is only ever used if there is no Numeral.

Code: Select all

minutes=__1__perc

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Posted: Fri May 25, 2018 6:26 pm
by OvermindDL1
melind wrote:And here I thought localization of this sort of thing would have been standardized and wrapped into packages like timezones have been.

If you need, I'm fine with continuing to believe everyone speaks Czech or English. It's a fair assumption.
There are, the gettext style took over (there is a program gettext that this style came from but it is GPL, however it's been remade a hundred times at this point with better licenses, to various amounts of compliance).

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Posted: Fri May 25, 2018 6:32 pm
by OvermindDL1
posila wrote:
OvermindDL1 wrote:...
By using OpenGL 3.3 Core and DirectX 11 feature level 10.0
Yeah these are not equivalently aged... >.>
I agree, DX11 was released with Windows 7 in October 2009 and OpenGL 3.3 was release alongside of OGL 4.0 in March 2010 (as a kind of OGL4 feature level DX10), DX11FL10 and OGL3.3 both target the same hardware so it is unfair to DX to be compared with the newer API :)
Although DX11FL10 came out a little bit after OGL3.3, the original DX11 came out before. The FL10 change was fairly substantial in that it unlocked newer hardware capabilities (honestly it should have just been a DX12 bump).

And OGL3 in general was a definite hack to just try to get GL versioning updated after Khronos took over, GL4 was a better overall design, but still not great, which is why they came out with Vulkan a bit after (Vulkan is essentially just GL-done-right, and yes though a touch more verbose and have to manage your own GPU memory and the Command Queues and so forth, I still find it far superior to work in).

But yes, OGL3.3 <-> DX10 in rough feature set (ignoring non-generic extensions), OGL4 <-> DX11 (assuming using the proper methods on both then they should perform near identically on well made drivers for both). And of course Vulkan <-> DX12.
posila wrote:
OvermindDL1 wrote: Oh there is no point in making a metal backend anymore, the authors of Vulkan (Khronos) made a metal/vulkan conversion library that let's vulkan run on metal (interestingly benchmarks show it to be faster than the equivalently written metal code due to optimizations the interface performs)
Our macOS guys said Metal would be faster, but if that is not the case, there might really be no reason to have it. We want to do Vulkan first anyway, so if it performs well we might just stick with it on macOS too.
Metal was *substantially* faster than OGL on the Mac's, though OGL is at an even more of a disadvantage there as the drivers are on the order of 'bloody ancient' because Apple doesn't like following standards... >.<

Let me see if I can find what that is called again (I program for linux, not mac's...), to the google...
Here it is, the press release about MoltenVK/LunarG: https://www.khronos.org/news/press/vulk ... -platforms
And an initial tech news article that has a lot of useful links at the bottom of the article (github link, Mac SDK page for it, etc... etc.. all free): https://www.anandtech.com/show/12465/kh ... opensource

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Posted: Fri May 25, 2018 6:40 pm
by Lubricus
I think there is more non Steam players than Steam players that runs the game on ancient hardware. So the real numbers that can't play 0.17 is probably a little bit higher.
Reading about plural the Czech version sounds reasonable and then get astound of all the ridiculous variants in other languages.

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Posted: Fri May 25, 2018 7:13 pm
by TPReal
It's really worrying that you want to do i18n by some custom code. It's impossible to get right, just like time zones. The only correct way to do this is to use the standard approach that somebody mentioned here already.

What would be the i18n for Polish, where there is one form for 1, another form for all numbers ending in 2-4 apart from numbers ending in 12-14, and third form for the rest? Can you express that? How ugly will the string get?

Remember that also there are different forms for zero, e.g. French uses singular there, if I recall correctly, while English uses plural. Do you really want to learn all of that, instead of using industry standard?

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Posted: Fri May 25, 2018 7:28 pm
by posila
OvermindDL1 wrote:Although DX11FL10 came out a little bit after OGL3.3, the original DX11 came out before. The FL10 change was fairly substantial in that it unlocked newer hardware capabilities (honestly it should have just been a DX12 bump).
Ah, I think we are not talking about the same thing. DirectX 11 feature level 10 means subset of DX11 API that can be used with DirectX 10 class hardware. (It is a initialization flag, so the API shouldn't let me use something that can't be used with downlevel HW, we have to use DX 10 shaders etc.) while it seems to me you mean DX 11.1 - 11.4 which are available only on newer versions of Windows (11.1 is somewhat available on Windows 7 but with limited feature set compared to Windows 8)

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Posted: Fri May 25, 2018 8:22 pm
by OvermindDL1
posila wrote:
OvermindDL1 wrote:Although DX11FL10 came out a little bit after OGL3.3, the original DX11 came out before. The FL10 change was fairly substantial in that it unlocked newer hardware capabilities (honestly it should have just been a DX12 bump).
Ah, I think we are not talking about the same thing. DirectX 11 feature level 10 means subset of DX11 API that can be used with DirectX 10 class hardware. (It is a initialization flag, so the API shouldn't let me use something that can't be used with downlevel HW, we have to use DX 10 shaders etc.) while it seems to me you mean DX 11.1 - 11.4 which are available only on newer versions of Windows (11.1 is somewhat available on Windows 7 but with limited feature set compared to Windows 8)
Indeed I am! Thanks for the clarification, I'm not up on the various Windows lingo oddities (linux-dev again). ^.^;

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Posted: Fri May 25, 2018 9:02 pm
by kse
That was a bombshell to start the weekend off.

Dropping Linux support, man, I thought you guys were cool :(

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Posted: Fri May 25, 2018 9:08 pm
by OvermindDL1
kse wrote:That was a bombshell to start the weekend off.

Dropping Linux support, man, I thought you guys were cool :(
Wait what? Where'd you get that?!