Friday Facts #216 - Paving a path for the GUI update

Regular reports on Factorio development.
Jap2.0
Smart Inserter
Smart Inserter
Posts: 2377
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: Friday Facts #216 - Paving a path for the GUI update

Post by Jap2.0 »

hitzu wrote:As far as I know, making an R2L support basically means doubling the work to be done. You basically have to duplicate every GUI element. Taking into account very small Hebrew audience and good knowledge of English among Israeli people relative to the amount of work to be done, there is a high probability that devs won't do that. I could be wrong though. But I feel your pain, there are tons of MMOs and coop games where is no support for basic Unicode so I and my friends couldn't speak in that games our native Russian. They basically push the conversations out of the game forcing us to use a third-party software. And every time when we raised the question we got only a cold ignoring.
You may have to duplicate some stuff, but I doubt it would double the work. I suspect (although I'm by no means an expert on the topic) that most of it would be perhaps copying some stuff and changing a few values - say if you have an element 100 pixels wide and the text usually goes from 10-90 pixels, change it so it goes from 90-10 pixels. But, again, I have no idea how this works, so that may not be the case.
There are 10 types of people: those who get this joke and those who don't.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Friday Facts #216 - Paving a path for the GUI update

Post by bobingabout »

Alice3173 wrote:
ssilk wrote:PS: What remains is just to replace lua with javascript ... <duck> ;)
It'd be nice if they could replace lua with literally anything with better syntax. I don't see how

Code: Select all

IF x THEN
    --whatever
ELSE
    --whatever else
END
is possible easier to parse than

Code: Select all

if (x) {
    //whatever
} else {
    //whatever else
}
The second way is far easier to parse and locate the beginning and end of chunks of code.

Lua being so crappy is the only reason I haven't looked into modding more myself.
I've been playing screeps. That's JavaScript.
the fact that you can use the curly brackets is easier to understand.

It could be worse though, they could have picked INI config files.
in fact, the project I was working on before starting to mod Factorio was using INI config files, and modding factorio left me considering upgrading to LUA.

I actually wrote my own ini parser from the ground up.
Last edited by bobingabout on Mon Nov 13, 2017 11:37 am, edited 1 time in total.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
ratchetfreak
Filter Inserter
Filter Inserter
Posts: 952
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: Friday Facts #216 - Paving a path for the GUI update

Post by ratchetfreak »

Alice3173 wrote:
ssilk wrote:PS: What remains is just to replace lua with javascript ... <duck> ;)
It'd be nice if they could replace lua with literally anything with better syntax. I don't see how

Code: Select all

IF x THEN
    --whatever
ELSE
    --whatever else
END
is possible easier to parse than

Code: Select all

if (x) {
    //whatever
} else {
    //whatever else
}
The second way is far easier to parse and locate the beginning and end of chunks of code.

Lua being so crappy is the only reason I haven't looked into modding more myself.
Tokenizing is by far not the most difficult part of parsing code.

Finding out wether a word is a keyword and then emitting the correct token is trivial compared to building the AST which in turn is trivial compared to the semantic analysis of it.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Friday Facts #216 - Paving a path for the GUI update

Post by eradicator »

vanatteveldt wrote: Note that hebrew is a tiny language, even if many Israeli are relatively affluent. However, Arabic is also written r2l and has 300M native speakers, and the script is also used for Persian, Urdu, and Pashtu with something like 50M speakers each. So, the market for r2l is a lot bigger than the 5M Israeli Hebrew speakers (but I wouldn't place any bets on the English proficiency of the average Israeli - you've probably mostly met University educated ones, the "man in the street" speaks barely any English (depending on the street, of course...)
Just out of curiosity, How difficult is it to render/write arabian script l2r? Is it just not possible at all? Or "just" very hard to read? Also doesn't unicode have a r2l-switch character? In terms of non-latin script i only know chinese/japanese, both of which have "adapted" to "western needs" and can now depending on circumstance be written pretty much in any direction you want. While books are still traditionally rendered as vertical r2l columns, anything digital is "standard" horizontal l2r rows.

----------------------
Alice3173 wrote:The second way is far easier to parse and locate the beginning and end of chunks of code.
I have too little experience with most programming languages as to judge why or how lua is a bad language, but citing curly brackets as the reason sounds a bit... odd... to me. There's nothing that some ridgid pythonian indentation can't make readable. Oh...hm, unless you meant computational parsing efficiency and not as i assumed human code-reading parsing efficiency. :roll:
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
User avatar
Dev-iL
Filter Inserter
Filter Inserter
Posts: 304
Joined: Thu Jul 02, 2015 2:48 pm
Contact:

Re: Friday Facts #216 - Paving a path for the GUI update

Post by Dev-iL »

eradicator wrote:Just out of curiosity, How difficult is it to render/write arabian script l2r? Is it just not possible at all? Or "just" very hard to read? Also doesn't unicode have a r2l-switch character? In terms of non-latin script i only know chinese/japanese, both of which have "adapted" to "western needs" and can now depending on circumstance be written pretty much in any direction you want. While books are still traditionally rendered as vertical r2l columns, anything digital is "standard" horizontal l2r rows.
.noitseuq ruoy dnatsrednu I erus toN

.thgir-ot-tfel yltcirts era dlrow eht ni segaugnal tsom yaw emas eht ,tfel-ot-thgir yltcirts si tpircs cibarA/werbeH ,denoitnem uoy stpircs naisA eht ekilnU ?daer ot tluciffid ro ysae siht dnif uoy oD
.(read to convenient hardly is it although) line this like things seeing to used got we so ,great too never was support Hebrew internet the of beginning the since Ever

The thing with arabic script is that most letters need to connect to each other (because this is just how the script works) and they change their shape (sometimes slightly and sometimes considerably) depending on the position in the word. This is not like handwritten English for example where you can either write it letter by letter, or "cursively", depending on your style. Arabic doesn't have that. It's bad enough if it appears unconnected letter by letter, but if it were to appear connected with reverse letter order it would be a complete nightmare to read. :cry:
Last edited by Dev-iL on Mon Nov 13, 2017 6:00 pm, edited 1 time in total.
Leading Hebrew translator of Factorio.
User avatar
hitzu
Filter Inserter
Filter Inserter
Posts: 539
Joined: Tue Sep 09, 2014 5:55 pm
Contact:

Re: Friday Facts #216 - Paving a path for the GUI update

Post by hitzu »

Ανδ τηις ις πρεττυ μθcη ηοω Ρθσσιανς ηαvε το σπεακ ωιτη εαcη οτηερ ιν μανυ γαμες. Νοτ ωιτη Γρεεκ λεττερς οφ cοθρσε, βθτ φορ υοθ τηευ πλαυ τηε ρολε οφ Λατιν λεττερς φορ Ρθσσιανς. :)

Ор, Ай кулд райт ин Инглиш виз Сириллик леттерз ин ордер ту беттер демонстрейт зе эффект от транслитерейшн, бат ай бет ю вудн'т эйбл ту рид ит эт олл.
If you cannot read this


Fortunately, Factorio has Unicode support. Unfortunately, the Factorio font doesn't support Cyrillic characters.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Friday Facts #216 - Paving a path for the GUI update

Post by eradicator »

Dev-iL wrote:.(read to convenient hardly is it although) line this like things seeing to used got we so ,great too never was support Hebrew internet the of beginning the since Ever
mirroed.png
mirroed.png (6.42 KiB) Viewed 7803 times
And trying this i think mirrored english would be quite possible if enough people bothered to get used to it and there was an actual reason to do so. Though ofc it requires actual mirroring to keep the parsing-direction of indivisual letters in the same direction as the whole sentence and not just reversed letter order (as you were so scared of with arabic ^^). So i guess my question was more along the lines of...how probable it would be for the arabic language as such to develop a mirrored variant, or if there maybe have already been experiements in that direction. Because i have a hobbiistic interest in language development. But that is ofc far out of the scope of a forum discussion. So i wish you good luck with your request and excuse myself for asking stupid questions ;)
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
neolithos
Burner Inserter
Burner Inserter
Posts: 18
Joined: Tue Oct 25, 2016 3:42 pm
Contact:

Re: Friday Facts #216 - Paving a path for the GUI update

Post by neolithos »

Alice3173 wrote:
ssilk wrote:PS: What remains is just to replace lua with javascript ... <duck> ;)
It'd be nice if they could replace lua with literally anything with better syntax. I don't see how

Code: Select all

IF x THEN
    --whatever
ELSE
    --whatever else
END
is possible easier to parse than

Code: Select all

if (x) {
    //whatever
} else {
    //whatever else
}
The second way is far easier to parse and locate the beginning and end of chunks of code.

Lua being so crappy is the only reason I haven't looked into modding more myself.
Between Lua and Javascript are no big differents. They belong to the same language family, and have there pro's and con's.
The runtime is more interesting.

IMHO: LuaCode is easier to parse than javascript.

I did not like lua for a long time. But for me it is more clear than javascript, now. And I love the easy way to create a domain specific language from the bases.

Okay. I can activate zero based arrays in the implementation I use :D.
User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2638
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: Friday Facts #216 - Paving a path for the GUI update

Post by steinio »

How about:

Code: Select all

If (x):

else:

endif;
Sorry, what's the topic again?
Image

Transport Belt Repair Man

View unread Posts
Jap2.0
Smart Inserter
Smart Inserter
Posts: 2377
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: Friday Facts #216 - Paving a path for the GUI update

Post by Jap2.0 »

steinio wrote:How about:

Code: Select all

If (x):

else:

endif;
Sorry, what's the topic again?
It's a Friday facts, so everything :).
There are 10 types of people: those who get this joke and those who don't.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Friday Facts #216 - Paving a path for the GUI update

Post by bobingabout »

eradicator wrote:
mirroed.png
It's very hard to read white text on a light grey? background.

Yes, I used light theme. the light text on dark backgrounds give my eyes banding, making it very hard to read.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
shadetheartist
Inserter
Inserter
Posts: 23
Joined: Mon Sep 18, 2017 10:14 pm
Contact:

Re: Friday Facts #216 - Paving a path for the GUI update

Post by shadetheartist »

Olreich wrote:I'm glad you're cleaning up the GUI code. The GUI and keybindings are the hardest part of this game for newcomers, and having additional help and consistency for new players will be great. While you're playing with the GUI, can you give mod authors a way to create additional views when you click on an object? The biggest thing here is inserters. Customizing inserter positions in Bob's mods is quite ungainly right now (requiring a special key bind). It could be just an additional circuit connection/logistics network connection pop-out view with support.
I didn't find the UI at all difficult to deal with when i started (0.15). Keybinds & special behaviors were a little harder to understand. I honestly don't think the gui is bad at all (its just a little win98 looking), the only thing i want is the ability to filter my inventory like the build menu.
shadetheartist
Inserter
Inserter
Posts: 23
Joined: Mon Sep 18, 2017 10:14 pm
Contact:

Re: Friday Facts #216 - Paving a path for the GUI update

Post by shadetheartist »

Jap2.0 wrote:
Alice3173 wrote:
kovarex wrote:(not in the egyptian brackets style, but in the rest).
Ah yeah, I forgot most programmers tend to put curly braces on separate lines from their corresponding statements. I've gotten in the habit of placing them on the same line as their corresponding statements simply to save space. Both methods are perfectly fine in my opinion though.
Next time I'm about to choose a script language it isn't going to be lua, there are more reasons than this one.
From what I've seen Lua's primary advantage is actually for non-programmers. It's easier for a lot of people to learn it than a more typical language. But it causes all sorts of issues when people try to move on to learning other languages. There's the syntax differences which are pretty major and arrays starting at 1 instead of 0 and so on. C# seems to be a pretty popular choice for scripting in games lately and it's probably an overall superior choice on nearly everything.
How about we use Visual Basic? I know that and it's not hard to learn, but isn't overly simple in syntax and stuff.
True story actually, it was the only programming language I had easily available at the time.
Please don't kill me it, was a joke, I didn't really mean it.

haha no
User avatar
Oktokolo
Filter Inserter
Filter Inserter
Posts: 884
Joined: Wed Jul 12, 2017 5:45 pm
Contact:

Re: Friday Facts #216 - Paving a path for the GUI update

Post by Oktokolo »

hitzu wrote:Fortunately, Factorio has Unicode support. Unfortunately, the Factorio font doesn't support Cyrillic characters.
Can the font be exchanged by mods? If so, an international font mod might be a good idea. There are free fonts out there that include a lot of the scripts supported by Unicode. If someone mods this into the game, Wube would just have to adopt it without distracting them from the core game.
User avatar
hitzu
Filter Inserter
Filter Inserter
Posts: 539
Joined: Tue Sep 09, 2014 5:55 pm
Contact:

Re: Friday Facts #216 - Paving a path for the GUI update

Post by hitzu »

Oktokolo wrote:
hitzu wrote:Fortunately, Factorio has Unicode support. Unfortunately, the Factorio font doesn't support Cyrillic characters.
Can the font be exchanged by mods? If so, an international font mod might be a good idea. There are free fonts out there that include a lot of the scripts supported by Unicode. If someone mods this into the game, Wube would just have to adopt it without distracting them from the core game.
As far as I know, Russian translation uses Verdana. It is wider than the built-in font. So not only Russian words are typically longer but also the font makes them even wider. This is one of the reasons why I don't use the translated version.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5267
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Friday Facts #216 - Paving a path for the GUI update

Post by Klonan »

Oktokolo wrote:
hitzu wrote:Fortunately, Factorio has Unicode support. Unfortunately, the Factorio font doesn't support Cyrillic characters.
Can the font be exchanged by mods? If so, an international font mod might be a good idea. There are free fonts out there that include a lot of the scripts supported by Unicode. If someone mods this into the game, Wube would just have to adopt it without distracting them from the core game.
For 0.16 we implemented font fallback, so when the main font (which doesn't support Cryillic) doesn't have a character, it will fallback to the other font
Zeblote
Filter Inserter
Filter Inserter
Posts: 973
Joined: Fri Oct 31, 2014 11:55 am
Contact:

Re: Friday Facts #216 - Paving a path for the GUI update

Post by Zeblote »

kovarex wrote: Next time I'm about to choose a script language it isn't going to be lua, there are more reasons than this one.
Which language would you chose now, instead of lua?
nazor
Burner Inserter
Burner Inserter
Posts: 5
Joined: Fri May 06, 2016 5:31 pm
Contact:

Re: Friday Facts #216 - Paving a path for the GUI update

Post by nazor »

kovarex wrote:GUI layout is the great example of piece of software, where fixing one thing breaks some other without you knowing
That's exactly why "clever hacks" multiply.
kovarex wrote:(not in the egyptian brackets style, but in the rest)
Heresy!
Post Reply

Return to “News”