(Not really) f***ing allegro!

Things that are not directly connected with Factorio.
Post Reply
User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

(Not really) f***ing allegro!

Post by cube »

Allegro doesn't have support for clipboard operations ... this isn't that much of a problem on windows, but on linux it makes using the clipboard almost impossible.
That makes me sad.
</whining>
I have no idea what I'm talking about.

User avatar
AlexPhoenix
Fast Inserter
Fast Inserter
Posts: 149
Joined: Tue Feb 18, 2014 7:48 am
Contact:

Re: f***ing allegro!

Post by AlexPhoenix »

so, clipboard now works only on windows?
(i mean console copy/paste) or what?

User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: f***ing allegro!

Post by cube »

Yeah, clipoard support for windows is written in Agui (the gui widget layer we use on top of Allegro), but only for Windows. There is a OSx version that is commented out for some reason.
It didn't matter too much yet, but now I'm working on the map exchange strings and without copying them ... it's almost useless. I will be at least writing them to console until we sort the clipboard thing out.
I have no idea what I'm talking about.

LoSboccacc
Filter Inserter
Filter Inserter
Posts: 251
Joined: Wed Feb 20, 2013 9:35 pm
Contact:

Re: f***ing allegro!

Post by LoSboccacc »

Use words for your random string out of a big dictionary.

Can be language specific.

There is a lot of entropy in a four word phrase

horseflytotree

Easy to insert without copy paste, easy to share.

User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: f***ing allegro!

Post by cube »

I really like that idea, but when I tried to roughly calculate number of characters it came out about twice as long as the current base64 solution.
numbers
Now the code is about 4 lines of a reasonably small text box, 8 lines would be too much in any coding. Imho even 4 lines as understandable words would be too much.
I have no idea what I'm talking about.

muzzy
Fast Inserter
Fast Inserter
Posts: 187
Joined: Sat Nov 23, 2013 7:17 am
Contact:

Re: f***ing allegro!

Post by muzzy »

reduce the entropy. how many bits of random seed do you really need in there?

User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: f***ing allegro!

Post by cube »

It's not just a seed :-). It has a lis of all mods and their versions and map settings from the map generator dialog window. I will probably compress the code using zlib, though.
I have no idea what I'm talking about.

LoSboccacc
Filter Inserter
Filter Inserter
Posts: 251
Joined: Wed Feb 20, 2013 9:35 pm
Contact:

Re: f***ing allegro!

Post by LoSboccacc »

I don't get your math.

If you get four words over a combination of 10000, you should be able to generate

10!/(10-4)!

different scenarios (using it as seed for the other variables)

Which according to wolfram alpha is about 9.9 X 10^15 unique permutations. Or 53 bit of entropy if you prefer.

Suggestion is to hash the sting after it's entered in the box to obtain 256bit of random stuff to seed the entropy of he repeatable rng of choice (i have one laying around if you want)
Last edited by LoSboccacc on Mon Mar 24, 2014 5:42 pm, edited 1 time in total.

User avatar
AlexPhoenix
Fast Inserter
Fast Inserter
Posts: 149
Joined: Tue Feb 18, 2014 7:48 am
Contact:

Re: f***ing allegro!

Post by AlexPhoenix »

try to use compressing with base64, sometimes it works.

i'will look at clipboard on Linux on holydays, but my main platform is windows.

LoSboccacc
Filter Inserter
Filter Inserter
Posts: 251
Joined: Wed Feb 20, 2013 9:35 pm
Contact:

Re: f***ing allegro!

Post by LoSboccacc »

cube wrote:It's not just a seed :-). It has a lis of all mods and their versions and map settings from the map generator dialog window. I will probably compress the code using zlib, though.

Oh I see. Then it would be easier just to keep a save at game start and share around that :P

Usually it's the ither way around. You generate map parameters from seed, and at most you attach a crc of the mod data to check it's compatible. (You'd lose detailed informations of that)

SilverWarior
Filter Inserter
Filter Inserter
Posts: 559
Joined: Mon Mar 04, 2013 9:23 am
Contact:

Re: f***ing allegro!

Post by SilverWarior »

cube wrote:Allegro doesn't have support for clipboard operations ...
Why are you searching for basic OS based functionality in Game library? To be honest I'm surprised that Allegro even has any clipboard handling capabilities built into it in the first place.

User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: f***ing allegro!

Post by cube »

SilverWarior wrote:
cube wrote:Allegro doesn't have support for clipboard operations ...
Why are you searching for basic OS based functionality in Game library? To be honest I'm surprised that Allegro even has any clipboard handling capabilities built into it in the first place.
It doesn't :-) Problem is that on linux you need to modify the event loop to add them, not just use a few api calls like on windows or osx.
I have no idea what I'm talking about.

User avatar
AlexPhoenix
Fast Inserter
Fast Inserter
Posts: 149
Joined: Tue Feb 18, 2014 7:48 am
Contact:

Re: f***ing allegro!

Post by AlexPhoenix »

cube wrote:
SilverWarior wrote:
cube wrote:Allegro doesn't have support for clipboard operations ...
Why are you searching for basic OS based functionality in Game library? To be honest I'm surprised that Allegro even has any clipboard handling capabilities built into it in the first place.
It doesn't :-) Problem is that on linux you need to modify the event loop to add them, not just use a few api calls like on windows or osx.
mainly what i saw that recomments to use xsel(or base on its sources)

User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: f***ing allegro!

Post by cube »

That is probably what we'll end up doing. I just don't like the fact that it is a dependency for such a basic functionality. I wouldn't expect clipboard to function only when I install some extra program :-)
I have no idea what I'm talking about.

User avatar
AlexPhoenix
Fast Inserter
Fast Inserter
Posts: 149
Joined: Tue Feb 18, 2014 7:48 am
Contact:

Re: f***ing allegro!

Post by AlexPhoenix »

cube wrote:That is probably what we'll end up doing. I just don't like the fact that it is a dependency for such a basic functionality. I wouldn't expect clipboard to function only when I install some extra program :-)
yes, but it's possible to use it's sources.

MF-
Smart Inserter
Smart Inserter
Posts: 1235
Joined: Sun Feb 24, 2013 12:07 am
Contact:

Re: (Not really) f***ing allegro!

Post by MF- »

I remember Spacechem (yeah:)) required an external utility "xclip" for clipboard operations

User avatar
AlexPhoenix
Fast Inserter
Fast Inserter
Posts: 149
Joined: Tue Feb 18, 2014 7:48 am
Contact:

Re: (Not really) f***ing allegro!

Post by AlexPhoenix »

MF- wrote:I remember Spacechem (yeah:)) required an external utility "xclip" for clipboard operations
we already talk about this program itself:) and it sources.

User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: (Not really) f***ing allegro!

Post by cube »

Yeah, requiring xclip ... that would work. If we included its sources, we would have to still run it as a separate binary ... not fun. What I've come up now is opening another X11 display connection, creating an invisible window and having a separate event loop running in a thread. Basically the same thing that xclip does, but without other binaries, licence problems and whatever. It almost works now :-)
I have no idea what I'm talking about.

User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: (Not really) f***ing allegro!

Post by cube »

If anyone ever needs this, it's possible we will be merging this back into agui, but meanwhile... https://gist.github.com/bluecube/9835979
I have no idea what I'm talking about.

Pontiac
Burner Inserter
Burner Inserter
Posts: 13
Joined: Fri May 23, 2014 5:43 pm
Contact:

Re: (Not really) f***ing allegro!

Post by Pontiac »

Copy/Paste may not be compatible, but, what about just exporting relevant data to a plain text file, instruct the user with a link in the UI to open the text file, similar to how MC and other apps do?

I sometimes dislike when a program automatically launches programs, but if I actively click the link, I'm the moron for letting the action happen. ;)

Post Reply

Return to “Off topic”