Community Made modding API

Post all other topics which do not belong to any other category.
zerotheliger
Burner Inserter
Burner Inserter
Posts: 15
Joined: Thu Nov 07, 2013 4:28 am
Contact:

Community Made modding API

Post by zerotheliger »

Similar to forge for minecraft is there anything wrong with making a interface that talks directly to the game itself instead of using lua to make mods? the reason being i come from minecraft and i got a few people with me who are interested in making something similar to forge but for factorio that allows you to actually make something different instead of waiting for a feature to exist and hook into via lua. meaning we could actually go and make custom storage systems, or over hauling the rail side of the game, or even going as crazy to make a logistics pipes like mod for factorio from what i see right now without a api that can speak to the game directly and inject new functions we couldn't do anything like this.

TLDR: are we allowed to make an API that hooks into the game for the community that understands the programming language the game is built on.
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3716
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Community Made modding API

Post by DaveMcW »

I'm not going to comment on legal stuff like whether it is allowed...

But hacking the game's API is much harder for a game written in C++ than one written in Java.
quinor
Filter Inserter
Filter Inserter
Posts: 404
Joined: Thu Mar 07, 2013 3:07 pm
Contact:

Re: Community Made modding API

Post by quinor »

You'd need the game source to be opened for that. Also, lua API is quite rich and features are added all the time.
zerotheliger
Burner Inserter
Burner Inserter
Posts: 15
Joined: Thu Nov 07, 2013 4:28 am
Contact:

Re: Community Made modding API

Post by zerotheliger »

well i mean look how they did it for minecraft, and C++ isn't really hard if you already know java they are both object oriented its a easy transition. And this is why im curious if the devs would mind if we created one granted the usual we wouldn't use it to make money or redistribute any of the games code. Im sure once i take a look into the game its pretty easy to just create a mod loader for the game to look in another folder for the main api plugin and then the plugin will inject its code at run time. and the plugin will take over using the games code along with its own to start running the mods built against the api. i mean the devs know about minecraft mods and forge itself if the devs gave a green light on this it would explode the modding scene once its done.

and in response to the other i agree the modding support already is nice but like i stated though its still limited we cant fully add everything you want to it.
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3716
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Community Made modding API

Post by DaveMcW »

zerotheliger wrote:C++ isn't really hard if you already know java they are both object oriented its a easy transition.
C++ is not object oriented after you compile it. :lol:
zerotheliger
Burner Inserter
Burner Inserter
Posts: 15
Joined: Thu Nov 07, 2013 4:28 am
Contact:

Re: Community Made modding API

Post by zerotheliger »

DaveMcW wrote:
zerotheliger wrote:C++ isn't really hard if you already know java they are both object oriented its a easy transition.
C++ is not object oriented after you compile it. :lol:
yes but thats for the computer to sort through not you after compiling x3 and i don't wana go through the trouble of running decomp programs i would feel better and it would be easier if they allowed more hard core modders the ability to view the source.
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Community Made modding API

Post by ssilk »

zerotheliger wrote:Im sure once i take a look into the game its pretty easy to just create a mod loader for the game to look in another folder for the main api plugin and then the plugin will inject its code at run time.
If you are so sure about it, ask Kovarex, if he gives you code-access to do that. My personal opinion is that it is too early, and the abilities of lua are underestimated.

In my opinion we need first some kind of library where the modders commit to basic functionality. Like how to change techtree in a way, that is compatible with other mods. How to bring in a new GUI. About 100 of such basic things. Things, that are independent from, if you're using lua, c++ or whatever.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Lollipop
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sun May 24, 2015 8:57 am
Contact:

Re: Community Made modding API

Post by Lollipop »

I think there are other priorities than a modloader or a factorio-forge at the moment.

I do not claim to be an expert on factorio modding, but I have experience with modding other games. (most adept in Doom-modding on modern source ports)

First, Factorio modding is still at an infancy level, everything is an experiment, some things break because they need more testing and fixes, and other such things.
Secondly, the documentation is a bit of a mess. As stated before, Factorio modding is still in its infancy, but the wiki lacks a bit of structure. Finding anything specific on the LUA elements is a nightmare sometimes, and some things just aren't clear and lack examples to clarify.

Before we get too advanced with our modding, we should first get together and agree on how we best get around to documenting what we actually know, and to help the developers find errors in the current LUA code interpreter. How would anyone know if an error is Factorios fault, if we use a thing like forge?

I don't say it is a bad idea, just wait till the time is right.
zerotheliger
Burner Inserter
Burner Inserter
Posts: 15
Joined: Thu Nov 07, 2013 4:28 am
Contact:

Re: Community Made modding API

Post by zerotheliger »

Lollipop wrote:I think there are other priorities than a modloader or a factorio-forge at the moment.

I do not claim to be an expert on factorio modding, but I have experience with modding other games. (most adept in Doom-modding on modern source ports)

First, Factorio modding is still at an infancy level, everything is an experiment, some things break because they need more testing and fixes, and other such things.
Secondly, the documentation is a bit of a mess. As stated before, Factorio modding is still in its infancy, but the wiki lacks a bit of structure. Finding anything specific on the LUA elements is a nightmare sometimes, and some things just aren't clear and lack examples to clarify.

Before we get too advanced with our modding, we should first get together and agree on how we best get around to documenting what we actually know, and to help the developers find errors in the current LUA code interpreter. How would anyone know if an error is Factorios fault, if we use a thing like forge?

I don't say it is a bad idea, just wait till the time is right.

I will say in the current Lua system we need someone to make a base ores mod that the community uses to make things more simple and maybe a universal fluid mod as well to take some work off ore gen and fluid handling just a core mod with all known ores and fluids in the mods and base game that you can run instead of letting mods generate there own stuff and run if statements to prefer the core mods handling of this from any mod that needs new fluids or ores

I get that modding is still young but we can improve it a bit and make it easier for new modders on the mod community side and implement a few standard core mods for others to hook into and post to a public github that anyone can add ores to and the core mod would be smart enough to only load the correct ores.

Sorry I'm a rambler lol
zerotheliger
Burner Inserter
Burner Inserter
Posts: 15
Joined: Thu Nov 07, 2013 4:28 am
Contact:

Re: Community Made modding API

Post by zerotheliger »

ssilk wrote:
zerotheliger wrote:Im sure once i take a look into the game its pretty easy to just create a mod loader for the game to look in another folder for the main api plugin and then the plugin will inject its code at run time.
If you are so sure about it, ask Kovarex, if he gives you code-access to do that. My personal opinion is that it is too early, and the abilities of lua are underestimated.

In my opinion we need first some kind of library where the modders commit to basic functionality. Like how to change techtree in a way, that is compatible with other mods. How to bring in a new GUI. About 100 of such basic things. Things, that are independent from, if you're using lua, c++ or whatever.
The main issue with Lua though is that its hard to create new things in different design concepts without some form of the function already existing in the base game for you to hook a Lua command to without some major magic hackery with the scripts and faking what's actually going on to put it best the doctor said its just a bunch of wibbly wobbly timey wimey stuff that could be done but then it doesn't run as efficemtly . But I do agree with ya on libraries they are a must have so we wouldn't need to create our own which if you look at the history of mc modding it was hard starting off because a lot of interfaces had to be built from scratch.
zerotheliger
Burner Inserter
Burner Inserter
Posts: 15
Joined: Thu Nov 07, 2013 4:28 am
Contact:

Re: Community Made modding API

Post by zerotheliger »

@Kovarex btw im not going to do this without a blessing from you guys. I just would love to help out with the modding support. This game has alot of potential and i would love to help. Even as far as signing off any code i write to the devs for free.
User avatar
SHiRKiT
Filter Inserter
Filter Inserter
Posts: 706
Joined: Mon Jul 14, 2014 11:52 pm
Contact:

Re: Community Made modding API

Post by SHiRKiT »

You can create some neat things with the Lua and the Control.lua script. There are obviously some things you can't, but kovarex said this is in the works, prolly for 0.12/0.13 to have some better functionality, but this is a low priority issue, so it may end up never being implemented.
Lollipop
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sun May 24, 2015 8:57 am
Contact:

Re: Community Made modding API

Post by Lollipop »

quoted post
You do not ramble too hard ;)
Even though, a universal ore and fluid mod isn't exactly what forge is. Forge is a utility modders use to extend their possibilities by adding additional functions and so on to minecraft itsef already supported.

Now, I think that an "ore-core" and "fluid-core" is an idea that could work. The main problem is that you suggest that everyone should be allowed to edit it, which leads to a huge security risk. Of course a source repository such as github would solve this, but noone wants to moderate such a mess by backtracking and sorting tickets after a troll had been on the loose.
I think such a project would be better off being left to a dedicated group who knows what they are doing and can be trusted not to throw it all out of the window. This would also make sure that the quality will have some decency to it.
Besides trolls, there might also end up a lot of garbage things, ores and fluids that only a single modder wants to use, and could just as well be a part of his own project alone. (there isn't any reason to have ores such as "rofltanium" or other gimmicks in such a mod)

Just throwing out the idea, I want to suggest something such as ore dictionary from minecraft, as it would deal with dublicate ores, as there will always be people who do not follow the standards. The main issue regards how to handle the dublicates as they will most likely have different properties. In minecraft it isn't a big deal which copper ore was used, because it was just another ore block, in factorio it will mean a lot more in terms of automation, how quickly ores get mined, and how many furnaces a single drill will match up to, ect.

Thinking about it for a while, these could maybe be combined. The "ore-core" and "fluid-core" mods could check for other mods adding their contents and overwrite them, although we must concider the possible difference in ore and fluid properties. I personally think that the core mods should simply overwrite them, because the standard is what most mods will be built on, and a single mod messing with that isn't the big idea. On the other hand, I think that mods should be allowed to modify the definitions in the cores, as this would allow modders to make widely extending mods. Those are just my opinions, though.
tjmonk15
Inserter
Inserter
Posts: 26
Joined: Fri Jun 20, 2014 9:23 pm
Contact:

Re: Community Made modding API

Post by tjmonk15 »

zerotheliger wrote:
DaveMcW wrote:
zerotheliger wrote:C++ isn't really hard if you already know java they are both object oriented its a easy transition.
C++ is not object oriented after you compile it. :lol:
yes but thats for the computer to sort through not you after compiling x3 ...
*rolls eyes*

If you actually knew how forge worked, and had any idea how c++ gets compiled vs. java you would realize that it's not possible. You would need the full source code from the devs, and it would never be a "modloader" it would have to be a completely different version of the game/executable.
zerotheliger wrote:...i don't wana go through the trouble of running decomp programs i would feel better and it would be easier if they allowed more hard core modders the ability to view the source.
You wouldn't be able to accomplish anything with just a disassembler, at least not the kind of things you are talking about. And as for them giving out the source code for a commercial game....that's just a bad idea and a good way for clone games showing up and stealing profits. Not too mention malware infested builds of factorio being available freely online...

- Monk
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Community Made modding API

Post by kovarex »

tjmonk15 wrote:
zerotheliger wrote:
DaveMcW wrote:
zerotheliger wrote:C++ isn't really hard if you already know java they are both object oriented its a easy transition.
C++ is not object oriented after you compile it. :lol:
yes but thats for the computer to sort through not you after compiling x3 ...
*rolls eyes*

If you actually knew how forge worked, and had any idea how c++ gets compiled vs. java you would realize that it's not possible. You would need the full source code from the devs, and it would never be a "modloader" it would have to be a completely different version of the game/executable.
That is far from correct, you can always alter the binary while it is running and do what-ever hooks you want. This is how I made the bwapi.

And the ore mod ... well I designed the modding interface in Fatorio in a way, to avoid the need for such things. The main reason why ore mods were needed in minecraft was, because there needed to be consensus what numeric ids are used for which ores, so the mods are compatibile. But this is not needed at all in Factorio, as you don't manipulate the numeric ids (the engine does it automatically internally), and all you need to do is to make code like this in the loader:

Code: Select all

if (the ore that I need is not defined yet)
  define the ore
ratchetfreak
Filter Inserter
Filter Inserter
Posts: 952
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: Community Made modding API

Post by ratchetfreak »

A expanded modding api by changing the executable would fall under distributing a hacked client, which is not allowed in the ToS.

Something like DFHack (an external application hooking in like a debugger and changing memory values) would be allowed I think.

Honestly just keep finding things to improved and put them in modding interface requests.
tjmonk15
Inserter
Inserter
Posts: 26
Joined: Fri Jun 20, 2014 9:23 pm
Contact:

Re: Community Made modding API

Post by tjmonk15 »

kovarex wrote:That is far from correct, you can always alter the binary while it is running and do what-ever hooks you want.
True, and this is how forge (sort of) works. Forge luckily has lots of metadata from Java to be able to find and patch things more easily. For Factorio, this would be a nightmare, as every build stuff could move around and break everything. Also, modifying a native binary like that in memory, it is difficult as heck to "add code" (Yes you can add a jmp/call to your code overwriting only 3 bytes of the binary, but still...)
kovarex wrote:...This is how I made the bwapi. ...
Holy crap! Didn't make the connection til now! BWAPI is awesome btw :D I really need to update the mono-bridge lol

- Monk
zerotheliger
Burner Inserter
Burner Inserter
Posts: 15
Joined: Thu Nov 07, 2013 4:28 am
Contact:

Re: Community Made modding API

Post by zerotheliger »

kovarex wrote:
tjmonk15 wrote:
zerotheliger wrote:
DaveMcW wrote:
zerotheliger wrote:C++ isn't really hard if you already know java they are both object oriented its a easy transition.
C++ is not object oriented after you compile it. :lol:
yes but thats for the computer to sort through not you after compiling x3 ...
*rolls eyes*

If you actually knew how forge worked, and had any idea how c++ gets compiled vs. java you would realize that it's not possible. You would need the full source code from the devs, and it would never be a "modloader" it would have to be a completely different version of the game/executable.
That is far from correct, you can always alter the binary while it is running and do what-ever hooks you want. This is how I made the bwapi.

And the ore mod ... well I designed the modding interface in Fatorio in a way, to avoid the need for such things. The main reason why ore mods were needed in minecraft was, because there needed to be consensus what numeric ids are used for which ores, so the mods are compatibile. But this is not needed at all in Factorio, as you don't manipulate the numeric ids (the engine does it automatically internally), and all you need to do is to make code like this in the loader:

Code: Select all

if (the ore that I need is not defined yet)
  define the ore

i am curious are you planning to open the game up more to allow modders to come up with more original ideas instead of just implementing similar functions that already exist in game and only being able to work with what is already there?

like i was talking about earlier its doesn't seem possible to make something like buildcraft item pipes or logistics pipes or even something like applied energistics, or completely overhaul the rail portion to add features and tracks from a mod like railcraft.
Zeblote
Filter Inserter
Filter Inserter
Posts: 973
Joined: Fri Oct 31, 2014 11:55 am
Contact:

Re: Community Made modding API

Post by Zeblote »

I imagine the game would run a lot slower if you tried to implement all that stuff in scripts so it can be modified...
zerotheliger
Burner Inserter
Burner Inserter
Posts: 15
Joined: Thu Nov 07, 2013 4:28 am
Contact:

Re: Community Made modding API

Post by zerotheliger »

Zeblote wrote:I imagine the game would run a lot slower if you tried to implement all that stuff in scripts so it can be modified...

it actually wouldn't the game can take alot of abuse already.
Post Reply

Return to “General discussion”