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

Regular reports on Factorio development.

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

Postby Jap2.0 » Sun Nov 12, 2017 2:17 pm

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.
Jap2.0
Filter Inserter
Filter Inserter
 
Posts: 642
Joined: Tue Jun 20, 2017 12:02 am

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

Postby bobingabout » Mon Nov 13, 2017 9:41 am

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.
User avatar
bobingabout
Smart Inserter
Smart Inserter
 
Posts: 4601
Joined: Fri May 09, 2014 1:01 pm

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

Postby ratchetfreak » Mon Nov 13, 2017 11:28 am

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.
ratchetfreak
Filter Inserter
Filter Inserter
 
Posts: 836
Joined: Sat May 23, 2015 12:10 pm

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

Postby eradicator » Mon Nov 13, 2017 12:08 pm

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:
User avatar
eradicator
Filter Inserter
Filter Inserter
 
Posts: 341
Joined: Tue Jul 12, 2016 9:03 am

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

Postby Dev-iL » Mon Nov 13, 2017 5:17 pm

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
Dev-iL
Fast Inserter
Fast Inserter
 
Posts: 136
Joined: Thu Jul 02, 2015 2:48 pm
Location: Israel

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

Postby hitzu » Mon Nov 13, 2017 5:59 pm

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

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

If you cannot read this
And this is pretty much how Russians have to speak with each other in many games. Not with Greek letters of course, but for you they play the role of Latin letters for Russians.

Or, I could write in English using Cyrillic letters in order to better demonstrate the effect of transliteration, but I bet you wouldn't able to read it at all.


Fortunately, Factorio has Unicode support. Unfortunately, the Factorio font doesn't support Cyrillic characters.
hitzu
Filter Inserter
Filter Inserter
 
Posts: 478
Joined: Tue Sep 09, 2014 5:55 pm

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

Postby eradicator » Mon Nov 13, 2017 7:20 pm

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 626 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 ;)
User avatar
eradicator
Filter Inserter
Filter Inserter
 
Posts: 341
Joined: Tue Jul 12, 2016 9:03 am

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

Postby neolithos » Mon Nov 13, 2017 7:45 pm

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.
neolithos
Burner Inserter
Burner Inserter
 
Posts: 17
Joined: Tue Oct 25, 2016 3:42 pm

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

Postby steinio » Mon Nov 13, 2017 8:49 pm

How about:

Code: Select all
If (x):

else:

endif;


Sorry, what's the topic again?
ImageImage
Transport Belt Repair Man
My little mods: Link | My favourite mods: Bob's Mods | Angel's Mods | Yuoki Railway Core | EvoGUI | Logistic Train Network
Factorio Cheat Sheets by ranhothchord updated by Jellewho

View unread Posts
User avatar
steinio
Smart Inserter
Smart Inserter
 
Posts: 1349
Joined: Sat Mar 12, 2016 4:19 pm
Location: Germany

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

Postby Jap2.0 » Mon Nov 13, 2017 11:02 pm

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.
Jap2.0
Filter Inserter
Filter Inserter
 
Posts: 642
Joined: Tue Jun 20, 2017 12:02 am

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

Postby bobingabout » Tue Nov 14, 2017 9:57 am

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.
User avatar
bobingabout
Smart Inserter
Smart Inserter
 
Posts: 4601
Joined: Fri May 09, 2014 1:01 pm

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

Postby shadetheartist » Wed Nov 15, 2017 12:03 am

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
Burner Inserter
Burner Inserter
 
Posts: 9
Joined: Mon Sep 18, 2017 10:14 pm

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

Postby shadetheartist » Wed Nov 15, 2017 12:16 am

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
shadetheartist
Burner Inserter
Burner Inserter
 
Posts: 9
Joined: Mon Sep 18, 2017 10:14 pm

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

Postby Oktokolo » Wed Nov 15, 2017 8:33 am

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.
Oktokolo
Burner Inserter
Burner Inserter
 
Posts: 19
Joined: Wed Jul 12, 2017 5:45 pm

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

Postby hitzu » Wed Nov 15, 2017 1:09 pm

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.
hitzu
Filter Inserter
Filter Inserter
 
Posts: 478
Joined: Tue Sep 09, 2014 5:55 pm

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

Postby Klonan » Wed Nov 15, 2017 1:51 pm

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
User avatar
Klonan
Factorio Staff
Factorio Staff
 
Posts: 2781
Joined: Sun Jan 11, 2015 2:09 pm

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

Postby Zeblote » Wed Nov 15, 2017 11:50 pm

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?
Zeblote
Filter Inserter
Filter Inserter
 
Posts: 920
Joined: Fri Oct 31, 2014 11:55 am

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

Postby nazor » Fri Nov 17, 2017 10:16 am

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!
nazor
Manual Inserter
Manual Inserter
 
Posts: 2
Joined: Fri May 06, 2016 5:31 pm

Previous

Return to News

Who is online

Users browsing this forum: No registered users and 7 guests