Page 1 of 1

Factorio libre: a Factorio mod standard library... maybe?

Posted: Thu Sep 01, 2016 8:15 am
by sebgggg
Hello everyone!

I made a library that i think(hope) could interest some of you:

-Core:
-Debug log functions with log levels, buffer, log table as well, including self-referencing ones
-Routines that doubles as timers
-Ability to save/load data between games - requires the user to unzip the mod and launch a script (linux and windows)

-UI templating and automation
-Write a template and don't bother manually creating/destroying elements
-Auto-save values (checkbox, etc)
-Widgets... well combo box and list

-Astar pathfinding
-Uses routine to work in background
-Diagonal or grid-based
-Intervalled path for electric poles or roboports
-various other options

-Map - not ready yet
-Auto detect outposts and their contour
-Auto detect resources

-Neural network - not ready yet
-Not using routine yet
-Uses sigmoid function
-I tried to add other activation functions and adaptative learning rate algo (momentum) but i'm bad at math :( if someone knows its stuff, i'm interested


The question is: are you interested and is it worth it that i make proper documentation and all? Any ideas on what should be there?
You can find a previous version in my Exoman mod, still needs a lot of work but constructive criticism is welcome.

Thanks to binbinhfr, killkrog and Choumiko!

Thank you in advance!

Re: Factorio libre: a Factorio mod standard library... maybe?

Posted: Thu Sep 01, 2016 9:03 am
by aubergine18

Re: Factorio libre: a Factorio mod standard library... maybe?

Posted: Thu Sep 01, 2016 7:42 pm
by kyranzor
Yes please contribute to Afforess' "Factorio Standard Library" project on Github. We would all welcome your additions in that, to keep everything all together! Some double-up of functionality though, so some parts may need to be left out during integration. Best to get in touch with Afforess in any case, and work it out.

Re: Factorio libre: a Factorio mod standard library... maybe?

Posted: Fri Sep 02, 2016 2:47 am
by Adil
Yay, library with functionality!
Advanced stuff like "Astar pathfinding", "UI templating and automation" would be surely of use. Not everytime, but whenever there's need for them, these functions will be a huge boon. Someday I might even use the library with those.

And documentation is never bad.

Also, assuming by routines you mean those from `coroutine` library, have you tested them against save-loading process? Factorio doesn't save any metadata, so I'm not sure, but I'd expect problems from the coroutines.

Re: Factorio libre: a Factorio mod standard library... maybe?

Posted: Fri Sep 02, 2016 4:17 am
by sebgggg
Adil wrote:Yay, library with functionality!
Advanced stuff like "Astar pathfinding", "UI templating and automation" would be surely of use. Not everytime, but whenever there's need for them, these functions will be a huge boon. Someday I might even use the library with those.

And documentation is never bad.

Also, assuming by routines you mean those from `coroutine` library, have you tested them against save-loading process? Factorio doesn't save any metadata, so I'm not sure, but I'd expect problems from the coroutines.
The routines part a simple function which catch the on_tick event that iterate through an array of functions. I haven't tried lua coroutines, i doubt it's possible, Factorio being a custom lua Vm and mods being mono-thread.

Thanks for the input!

Re: Factorio libre: a Factorio mod standard library... maybe?

Posted: Fri Sep 02, 2016 2:50 pm
by Afforess
Adil wrote:Yay, library with functionality!
Advanced stuff like "Astar pathfinding", "UI templating and automation" would be surely of use. Not everytime, but whenever there's need for them, these functions will be a huge boon. Someday I might even use the library with those.

And documentation is never bad.

Also, assuming by routines you mean those from `coroutine` library, have you tested them against save-loading process? Factorio doesn't save any metadata, so I'm not sure, but I'd expect problems from the coroutines.
I have A* pathfinding already written for Factorio, for the Misanthrope mod, but I have never had enough interested modders to try porting it to a more standard 'library' module. The main issue is that A* in Lua is painfully slow, so unless your paths are fairly short, its not useful.

@sebgggg if you're serious about wanting to contribute (or make your own library), should make sure you look at documentation and unit testing. I am using the busted framework for testing and ldoc to make pretty web documentation. For a good code library to succeed, its not enough to have working code. I have put a fair amount of effort into ensuring every release of the factorio standard library is backwards compatible, fully tested, and compatible even between factorio versions (it works between 13.x and 14.x).

I think anything you can contribute to the factorio standard library would be awesome, but I fully understand if you want to strike out on your own.

Re: Factorio libre: a Factorio mod standard library... maybe?

Posted: Fri Sep 02, 2016 3:51 pm
by Nexela
-Ability to save/load data between games - requires the user to unzip the mod and launch a script (linux and windows)
I like this! Would using hardlinks work in place of the symlink? Hardlinks don't require admin privs on winblows

Re: Factorio libre: a Factorio mod standard library... maybe?

Posted: Fri Sep 02, 2016 10:27 pm
by sebgggg
Nexela wrote:
-Ability to save/load data between games - requires the user to unzip the mod and launch a script (linux and windows)
I like this! Would using hardlinks work in place of the symlink? Hardlinks don't require admin privs on winblows
Yes it does! I assumed it required admin rights as well! Thanks!