Page 1 of 1

Accept hexadecimal input for numbers / Add the ability to type "16k" so it autocompletes to "16000"

Posted: Mon Aug 10, 2015 10:47 am
by Boogieman14
TL;DR
Extend the numerical input parser/validator to also accept hexadecimal values (using the 0x prefix). No changes are requested in the display of these numbers (and internally, a number is just a number anyway)

Detail
Say I have a map with a lot of outposts. I want to provide all these outposts with supplies, but I don't want to have an excess number of trains running around. So I assign each outpost a number and put the outpost's number onto a circuit when supplies run low. My main base then automatically sends a train to the requesting outpost (assume for the moment, there's a mod that provides this exact functionality - it isn't there yet, but it's been hinted at). However, just using sequential numbers will lead to problems. Say both outpost 3 and 5 are requesting supplies: wire values add up, so the base sees an 8. How is the base supposed to know where to send the supplies?

Enter bitmapped fields.
Instead of assigning values 3 and 5 to these outposts they get assigned bits 3 (1000 binary, 8 decimal) and 5 (100000 binary, 32 decimal). Now when both outposts request materials, the circuit sees 40 (101000 binary) and there's no room for confusion.

Why hexadecimal inputs?
Small numbers are easy enough, anyone familiar with computer programming will know the sequence of powers of 2 for the first 10 to 16 bits by heart (in a distant past, even Factorio used powers of 2 for stacksizes! :o ). It gets a bit more difficult beyond that, when you're up to the 28th outpost or so. Remembering and accurately entering 134,217,728 is a lot harder than entering 0x800 0000 (and the steady sequence of 0x1, 0x2, 0x4, 0x8 followed by a number of 0's makes it easier still)

Why no changes to display of numbers?
I realize this suggestion is probably only interesting for a rather niche audience and this niche audience will likely be perfectly capable of recognizing what bit a displayed decimal value corresponds to.

Re: Accept hexadecimal input for numbers

Posted: Mon Aug 10, 2015 11:21 am
by ratchetfreak
Or you use a address line (on signal 0 for example) and a reply line and cycle over all outposts.

at the outpost you use a combinator signal 0 = Outpost ID output everything input-count and transmit that output over the reply line.

then when there is a train ready to depart you cycle over all outposts and you can check each individually and put the train sending logic at the departure station

Re: Accept hexadecimal input for numbers

Posted: Sat Aug 15, 2015 10:50 am
by MF-
I think hexadecimal input would be useful in many other applications of combinators.

Re: Accept hexadecimal input for numbers

Posted: Sun Aug 16, 2015 3:01 am
by TuckJohn
Agree with you that it is a very specialized need. I think that it would add complexity that would not nessisarily be needed.
As for your outpost 'problem', I would've recommend having the outposts on separate circuits, so the values do not get mixed up.

Re: Accept hexadecimal input for numbers

Posted: Sun Aug 16, 2015 3:15 am
by Tinyboss
TuckJohn wrote:Agree with you that it is a very specialized need. I think that it would add complexity that would not nessisarily be needed.
As for your outpost 'problem', I would've recommend having the outposts on separate circuits, so the values do not get mixed up.
Does it add any complexity, though? If you don't know that hexadecimal numbers are written with a "0x" prefix, then you would literally never know the feature existed at all.

Re: Accept hexadecimal input for numbers

Posted: Sun Aug 16, 2015 8:10 pm
by Boogieman14
Exactly, it changes nothing for players that don't know/need/use it.

And the outpost problem is just one example that made me think of this, I'm fairly certain minds far smarter than me can come up with lots of other ways to leverage a feature like this.

Re: Accept hexadecimal input for numbers

Posted: Sun Aug 16, 2015 10:12 pm
by Tinyboss
Boogieman14 wrote:Exactly, it changes nothing for players that don't know/need/use it.

And the outpost problem is just one example that made me think of this, I'm fairly certain minds far smarter than me can come up with lots of other ways to leverage a feature like this.
Yeah, bitmasking is kind of a big deal.

Re: Accept hexadecimal input for numbers

Posted: Sun Aug 16, 2015 11:51 pm
by ratchetfreak
Tinyboss wrote:
Yeah, bitmasking is kind of a big deal.
but useless without bit-wise operators

With the current operators doing bitwise operations give no advantage to binary over tertiary or decimal.

Add the ability to type "16k" so it autocompletes to "16000".

Posted: Wed Jun 02, 2021 9:42 am
by OADINC
TL;DR
When entering a number for a constant value (circuit network or logistics for example) make it so "k" autocompletes it to "000".
What ?
This is very useful when entering a lot of values, I mess it up myself a lot.
The game already displays values with K & M to show thousand and million, so please let us use it ourself when entering values. It should be fairly easy to implement, but it is never as simple as you think.
This could be seen as an accessibility feature I'm dyslexic so trying to figure out how many zero's I've typed is always a slight challenge.

I would suggest using the SI-Prefixes: https://en.wikipedia.org/wiki/Metric_prefix
-Definetly: k (E3) & m (E6)
-Possibly: da (E1) & h (E2)

I've made a post on the sub-reddit about this idea, people seem to like it a lot!
At the time of writing it has gotten 2.5K upvotes in one day, with lots of positive comments. https://www.reddit.com/r/factorio/comme ... &context=3

Note:
In the comments of this post people also want to be able to type in calculations and have it calculate it and use the result value, I to would like that too but I can see why you would not want to implement that part.

EDIT: Grammatical Error

Re: Add the ability to type "16k" so it autocompletes to "16000".

Posted: Thu Jun 03, 2021 12:14 am
by ssilk
High gameplay value, not so much work for implementation. :)

Re: Accept hexadecimal input for numbers / Add the ability to type "16k" so it autocompletes to "16000"

Posted: Thu Jun 03, 2021 9:42 am
by ssilk
Merged because if you implement Hexadecimal input, you can easily add iso-input

Re: Add the ability to type "16k" so it autocompletes to "16000".

Posted: Fri Jun 04, 2021 1:18 pm
by OADINC
ssilk wrote: Thu Jun 03, 2021 12:14 am High gameplay value, not so much work for implementation. :)
Thanks, I'm glad you like the idea!

Re: Accept hexadecimal input for numbers / Add the ability to type "16k" so it autocompletes to "16000"

Posted: Fri Dec 22, 2023 10:15 am
by OADINC
It only took 2 years, but according to FFF-388 it is going to be implemented!

Re: Accept hexadecimal input for numbers / Add the ability to type "16k" so it autocompletes to "16000"

Posted: Fri Dec 22, 2023 10:35 am
by Freddy404
Not to seem ungrateful, but hexadecimal input seems to be still missing. Which was mentioned in the original suggestion here, and several times in the FFF thread. Because it would make bit masks and similar computation-related constants a lot easier to input.

Re: Accept hexadecimal input for numbers / Add the ability to type "16k" so it autocompletes to "16000"

Posted: Wed Oct 23, 2024 10:20 pm
by OADINC
Good news I just confirmed that both features are now in the game! As of 2.0

Re: Accept hexadecimal input for numbers / Add the ability to type "16k" so it autocompletes to "16000"

Posted: Thu Oct 24, 2024 5:43 am
by Koub
[Koub] Thanks for the catch, moved to implemented