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

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
sebgggg
Burner Inserter
Burner Inserter
Posts: 15
Joined: Tue Aug 09, 2016 6:57 am
Contact:

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

Post 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!

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

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

Post by aubergine18 »

Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.

kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

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

Post 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.

User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

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

Post 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.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.

sebgggg
Burner Inserter
Burner Inserter
Posts: 15
Joined: Tue Aug 09, 2016 6:57 am
Contact:

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

Post 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!

User avatar
Afforess
Filter Inserter
Filter Inserter
Posts: 422
Joined: Tue May 05, 2015 6:07 pm
Contact:

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

Post 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.

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

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

Post 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

sebgggg
Burner Inserter
Burner Inserter
Posts: 15
Joined: Tue Aug 09, 2016 6:57 am
Contact:

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

Post 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!

Post Reply

Return to “Modding discussion”