Friday Facts #218 - Import bpy, Export player

Regular reports on Factorio development.
User avatar
Alice3173
Fast Inserter
Fast Inserter
Posts: 107
Joined: Sun Apr 24, 2016 11:35 pm

Re: Friday Facts #218 - Import bpy, Export player

Post by Alice3173 » Sat Nov 25, 2017 11:52 pm

Tev wrote:This is really subjective, I think most colors look better in alpha-0.5. But some dark ones (especially black) might use a bit higher alpha(?) or simply something to make them more rich / darker.
I didn't say they look better, I said the saturation is better. There's a difference. In some cases such as the cyan I think it does look better but in other cases it doesn't.

Either way though the take away point should have been that they should just add a slider for the alpha rather than whether 1.0 or 0.5 alpha looks better.

OvermindDL1
Fast Inserter
Fast Inserter
Posts: 158
Joined: Sun Oct 05, 2014 6:12 am

Re: Friday Facts #218 - Import bpy, Export player

Post by OvermindDL1 » Sun Nov 26, 2017 4:06 am

I use Corsair RGB keyboard/mice and Phillips surrounding lighting, so I doubt this will work with any of those...

Can you 'please' make a way to call a secondary custom program that is fed data via stdin of what colors should be set at any given location with a documented interface? This will make it utterly trivial on linux to let Factorio plug in to any system, especially as controlling the colors of the Corsair stuff on Linux is as simple as just sending simple text formatted data commands to the appropriate device calls, and controlling the Phillips surround lighting is as simple as just sending formatted data to the appropriate local TCP pipe, setting up all this in Factorio is overkill, and focusing just on Razer stuff (which had absolutely no official linux support last I saw so I doubt your code will work here) is kind of blegh, however just sending the appropriate color commands to a secondary program that the user can specify would allow anyone to hook into anything they want (and even over time perhaps more features could be added such as controlling the phillips fans, vibration bars, etc...).

If such an interface were made I'd happily make the Corsair and Phillips programs (if anyone even still uses this phillips ambx stuff, though I know many use Corsair things) and put it up on github for any linux users to use it with. I even have a Razer Naga with color controls here and I could figure out how to plug into it as well or accept PR's for it.

EDIT:
Not the best pictures, but all lights out beside computer, with monitor off. Keyboard is doing blue raindrops effect currently (I should take a video, but eh...), computer in lower-right is red in front blue in back (hence blue tint on wall on right side of images), but here is the Phillips system in Red/Green/Blue color states (which my phone did not capture terribly well in darkness with a few bright light sources, it is not quite this overwhelming in person, but I don't usually turn it up this bright anyway):
https://overminddl1.com/Pictures/Computer/red.jpg
https://overminddl1.com/Pictures/Computer/green.jpg
https://overminddl1.com/Pictures/Computer/blue.jpg

It would be *awesome* to write a program to listen to stdin for events happening in the game and be able to do things like appropriate lighting effects on the phillips lights and keyboard with ripples and waves and all such. In addition to writing the code and putting up on github I'll take a movie of it in action as well. In addition I could turn on the fans based on, say, life level, and the vibration bar when under attack (in addition to lighting effects and ripples and such). That would be quite nicely immersive and a good example of what a generic 'game event' interface could do instead of just a single-manufacturer's lights. ^.^

(Plus I really *really* hate proprietary, single-platform interfaces, and Razer's community-built linux drivers are a bit more... troublesome than anyone else's, because Razer does a lot of stupid stuff in their USB protocols...)
Last edited by OvermindDL1 on Sun Nov 26, 2017 4:53 am, edited 4 times in total.

jackthesmack
Inserter
Inserter
Posts: 21
Joined: Sun May 04, 2014 9:46 pm

Re: Friday Facts #218 - Import bpy, Export player

Post by jackthesmack » Sun Nov 26, 2017 4:26 am

Seeing the colors become much more subdued from the lower alpha levels reminds me of Dunkey's Bad Graphics video. I hope you get the higher alpha colors working, makes the game more visually pleasing to have things colorfully stand out.

Woehler
Inserter
Inserter
Posts: 25
Joined: Wed Nov 11, 2015 8:47 pm

Re: Friday Facts #218 - Import bpy, Export player

Post by Woehler » Sun Nov 26, 2017 6:03 pm

Aww, you made my pink look less pink :/
But the high resolution does look really nice!

dRaMaTiC
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri Jan 27, 2017 12:11 pm

Re: Friday Facts #218 - Import bpy, Export player

Post by dRaMaTiC » Sun Nov 26, 2017 8:35 pm

Hey guys,

i recently talk to my bro while playing Factorio (has always long then expected) that the player model looks not so good and zooming in and hopefully gets an update. "Some" hours after ;-), i checked the blog and saw the new hd images and they are really stunning! 0.16 is going to be great. Keep it up guys!

posila
Factorio Staff
Factorio Staff
Posts: 2748
Joined: Thu Jun 11, 2015 1:35 pm

Re: Friday Facts #218 - Import bpy, Export player

Post by posila » Sun Nov 26, 2017 9:33 pm

dee- wrote:
I would like to take this opportunity to ask modders to keep this in mind, as I have noticed multiple mods using 1.0 Alpha values in colour mask tint. The Alpha is black magic, keep it at 0.5 please.
If the functionality of your "alpha" is not the same as the alpha-channel to set opacity (0=transparent, 1=opaque), then there's no wonder modders might set it to 1.0 to set a color to full opacity, especially in the context of RGB-colors.
Name it "epsilon" (for RGBE) or something else, or better, make "alpha" alpha again.
As I tried to explain in earlier FFF (https://www.factorio.com/blog/post/fff-172) alpha is alpha, but color channels are expected to be premultiplied with alpha, therefore you can enter values that can't be represented by non-premultiplied color. The fact Vaclav still calls it black magic is failure on my part :(

I think he likes alpha < 1, because it can create pixels that are not just different shades of the same tint color, but have also different saturation.

Metalface7
Inserter
Inserter
Posts: 28
Joined: Sat Jun 11, 2016 1:49 pm

Re: Friday Facts #218 - Import bpy, Export player

Post by Metalface7 » Mon Nov 27, 2017 2:12 am

bergi9 wrote:
Omarflyjoemacky wrote:
Bart wrote:
ChurchOrganist wrote:So does this mean you will provide support for changing colours on the Logitech Gaming Devices eventually??

It would be cool for my G13 gamepad to react to events in Factorio :)
I second that.
Third.
Fourth.
Btw: I'm using G910 keyboard and G502 mouse.
Fifth. Same combo, and I've only seen a few games using Logitech's api.

Koltrast
Inserter
Inserter
Posts: 32
Joined: Sun Oct 09, 2016 9:40 pm

Re: Friday Facts #218 - Import bpy, Export player

Post by Koltrast » Mon Nov 27, 2017 9:21 am

Metalface7 wrote:
bergi9 wrote:
Omarflyjoemacky wrote:
Bart wrote:
ChurchOrganist wrote:So does this mean you will provide support for changing colours on the Logitech Gaming Devices eventually??

It would be cool for my G13 gamepad to react to events in Factorio :)
I second that.
Third.
Fourth.
Btw: I'm using G910 keyboard and G502 mouse.
Fifth. Same combo, and I've only seen a few games using Logitech's api.
Sixth, same combo!

metralha761
Manual Inserter
Manual Inserter
Posts: 2
Joined: Mon Nov 27, 2017 10:45 am

Re: Friday Facts #218 - Import bpy, Export player

Post by metralha761 » Mon Nov 27, 2017 10:59 am

The interaction with razor keyboard is cool. But the best is get any connection with an arduino.
Ok, I don't mean suport for arduino, but some port/gate/whateveryouwanttocall that allow get information from de game like, health, shield, speed of player, etc. And even some inputs, like choose weapon, belt slot, etc.
It can be something easy as json text, and the community choose what to do with that information.
I'm also thinking something like have a tablet showing the map or the second monitor.
If you do this, I think you will get some suprises from community.

TheToric
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Mar 06, 2016 11:52 pm

Re: Friday Facts #218 - Import bpy, Export player

Post by TheToric » Mon Nov 27, 2017 3:31 pm

Will the Chroma support work on linux?

Thierry88
Burner Inserter
Burner Inserter
Posts: 6
Joined: Tue Aug 22, 2017 2:00 pm

Re: Friday Facts #218 - Import bpy, Export player

Post by Thierry88 » Mon Nov 27, 2017 6:01 pm

Omarflyjoemacky wrote:
Bart wrote:
ChurchOrganist wrote:So does this mean you will provide support for changing colours on the Logitech Gaming Devices eventually??

It would be cool for my G13 gamepad to react to events in Factorio :)
I second that.
Third.
I have the Logitech G910 which supports a similar function for GTA5 and Battlefield 1 and some more games, it would be awesome if you could make Factorio work with Logitech G keyboards

exi2163
Inserter
Inserter
Posts: 22
Joined: Wed Mar 09, 2016 6:50 am

Re: Friday Facts #218 - Import bpy, Export player

Post by exi2163 » Mon Nov 27, 2017 9:39 pm

Nice one. A few years back i did a G15 implementation for EVEMon. After my G15 failed (whole backlight went out) i got a Roccat RGB where keys started failing (even some i never used) so i now have a corsair RGB. Which brings me to the point that putting support for specific hardware into a game is mostly a very short lived experience for the user.

I think there could be more fun with a general API that exports that game data to do whatever the users come up with. Could be support for other keyboards or for things like arduinos driving a few dozen neopixels. You already have the community which is coding and creating nice things :)

User avatar
Mini-Me
Inserter
Inserter
Posts: 21
Joined: Thu Feb 12, 2015 8:50 pm

Re: Friday Facts #218 - Import bpy, Export player

Post by Mini-Me » Mon Nov 27, 2017 9:43 pm

The new player sprites look amazing. Personally, I can't relate as much to colors like others in this topic do, mostly though because I've never really changed mine... All the modularisation work in the rendering process is cool, and well, fits into the game (automation and such ;-) )

Regarding the keyboard RGB effects, there's a saying in German, I'm pretty sure it exists in other languages, too. It goes like "give someone the small finger and they'll want the whole hand". Fits kinda well in this situation. You show support for Razer's hardware, and lots of people ask for a multitude of other manufacturers being supported, too :D . Shows again that own proprietary implementations of manufacturers instead of standardization often mostly hurt the customers... OvermindDL1's suggestion sounds like a wise idea to solve this, although very Linuxy :D . Kinda wonder if that'd also work on Windows, considering piping and the console work somewhat different there and has other limitations.

Though, uhm, fyi, add me as #8 to the list of players with Logitech RGB hardware ;-) .

EDIT: Apparently there's an app that bridges games, different SDKs and hardware: https://github.com/antonpup/Aurora
Didn't test it, yet, but looks promising.
Image

Supercheese
Filter Inserter
Filter Inserter
Posts: 825
Joined: Mon Sep 14, 2015 7:40 am

Re: Friday Facts #218 - Import bpy, Export player

Post by Supercheese » Tue Nov 28, 2017 2:47 am

Mini-Me wrote:there's a saying in German, I'm pretty sure it exists in other languages, too. It goes like "give someone the small finger and they'll want the whole hand".
Indeed. In English, a common variant is, "Give an inch, and they'll take a mile."

Allegedly, an Arabic saying involves a Camel's Nose.

ChoMar
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Sun Aug 07, 2016 2:00 am

Re: Friday Facts #218 - Import bpy, Export player

Post by ChoMar » Tue Nov 28, 2017 7:08 am

Can you 'please' make a way to call a secondary custom program that is fed data via stdin of what colors should be set at any given location with a documented interface?
That sounds good. Although thats a Linux solution, generally just providing an Interface and let Manufacturers or the Community do the Rest seems like a good idea for this.
Shows again that own proprietary implementations of manufacturers instead of standardization often mostly hurt the customers
True
Mytronix Entertainment

User avatar
aRatNamedSammy
Fast Inserter
Fast Inserter
Posts: 215
Joined: Tue Jul 08, 2014 4:26 pm

Re: Friday Facts #218 - Import bpy, Export player

Post by aRatNamedSammy » Tue Nov 28, 2017 8:36 am

Metalface7 wrote:
bergi9 wrote:
Omarflyjoemacky wrote:
Bart wrote:
ChurchOrganist wrote:So does this mean you will provide support for changing colours on the Logitech Gaming Devices eventually??

It would be cool for my G13 gamepad to react to events in Factorio :)
I second that.
Third.
Fourth.
Btw: I'm using G910 keyboard and G502 mouse.
Fifth. Same combo, and I've only seen a few games using Logitech's api.
me too :mrgreen:
:lol: just the #8 on the list ;)
Teeth for Two (so sorry my bad english)

bergi9
Inserter
Inserter
Posts: 35
Joined: Tue Jun 07, 2016 7:54 am

Re: Friday Facts #218 - Import bpy, Export player

Post by bergi9 » Tue Nov 28, 2017 8:07 pm

Mini-Me wrote:OvermindDL1's suggestion sounds like a wise idea to solve this, although very Linuxy :D . Kinda wonder if that'd also work on Windows, considering piping and the console work somewhat different there and has other limitations.
I agree OvermindDL1's suggestion. The piping and console should work on Windows, too. Perhaps with RCON protocol because it's already implemented into Factorio.
Mini-Me wrote:EDIT: Apparently there's an app that bridges games, different SDKs and hardware: https://github.com/antonpup/Aurora
Didn't test it, yet, but looks promising.
Aurora looks fine, but no direct Unix (Linux, Mac) support.

TheRaph
Fast Inserter
Fast Inserter
Posts: 111
Joined: Sun Sep 24, 2017 6:31 pm

Re: Friday Facts #218 - Import bpy, Export player

Post by TheRaph » Tue Nov 28, 2017 9:35 pm

ChoMar wrote:
Can you 'please' make a way to call a secondary custom program that is fed data via stdin of what colors should be set at any given location with a documented interface?
That sounds good. Although thats a Linux solution, generally just providing an Interface and let Manufacturers or the Community do the Rest seems like a good idea for this.
Shows again that own proprietary implementations of manufacturers instead of standardization often mostly hurt the customers
True
I've got a question ...
I've got some experience in scripting (office basic, auto, jscript ... ) but I'm not a programmer so I may not understand all.
As far I've read in forum and wiki there are an API in factorio. API stands for aplication programming interface. I also think there are mods which already interfere with health-bar and some other things in factorio (like player color, etc.) .
So my question is: Why is there a need to have an extra pipe to do the (ssame) stuff? Why can a gifted programmer who are able to use the pipe not use the API instead?
In my easy mind I thinl the data should be mostly accessable by API.
So someone may write a plugin to communicate with logitec keyboards and an other one write a mod for an ACME-mouse ...
For some effects like background colour and so on, the existing API datas may not be enough, but therefor we could ask the developer to extend their API to support chroma events.
But I may be wrong ... not understanding the behaviour of this API.

mOoEyThEcOw
Inserter
Inserter
Posts: 21
Joined: Fri Mar 17, 2017 11:27 pm

Re: Friday Facts #218 - Import bpy, Export player

Post by mOoEyThEcOw » Tue Nov 28, 2017 10:09 pm

TheRaph wrote:
ChoMar wrote:
Can you 'please' make a way to call a secondary custom program that is fed data via stdin of what colors should be set at any given location with a documented interface?
That sounds good. Although thats a Linux solution, generally just providing an Interface and let Manufacturers or the Community do the Rest seems like a good idea for this.
Shows again that own proprietary implementations of manufacturers instead of standardization often mostly hurt the customers
True
I've got a question ...
This is a simplified explanation. The main problem is input and output - which is a fundamental part of programming - e.g. where can we get data and where does it go, every kind of program has these properties. The existing factorio API is designed for mods, a kind of program. The input of mods is the factorio API and the output of mods is the factorio API. For a lot of reasons (user safety and security, stability, etc), mods are designed to be limited to just that. The factorio API isn't (currently) available - for a lot of good reasons - to any other kinds of programs.

However the keyboard and mouse are both controlled by the operating system and it's drivers (e.g. the output and input of the operating system is the hardware itself and the user space programs it runs). At the very least the output of any program that messes with the lighting needs access to the "user space" (kinda like an API; but different and more complicated) of the operating system, this rules out mods. The stdin/stdout stuff described above is one way of providing factorio information as part of user space; alternatively they could wrap parts of the API in a way that it would be accessible to user space programs.

OvermindDL1
Fast Inserter
Fast Inserter
Posts: 158
Joined: Sun Oct 05, 2014 6:12 am

Re: Friday Facts #218 - Import bpy, Export player

Post by OvermindDL1 » Wed Nov 29, 2017 12:48 am

ChoMar wrote:
Can you 'please' make a way to call a secondary custom program that is fed data via stdin of what colors should be set at any given location with a documented interface?
That sounds good. Although thats a Linux solution, generally just providing an Interface and let Manufacturers or the Community do the Rest seems like a good idea for this.
Nothing linux specific about that at all, that is the same on Windows/Mac/Linux, and a whole host of OS's that Factorio does not support, this is the stock-standard way for 2 programs to communicate on any half-modern OS (and even most ancient OS's).

Post Reply

Return to “News”