Coding language of Factorio?

Post all other topics which do not belong to any other category.
Post Reply
User avatar
metzyn
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Tue Mar 19, 2013 10:49 pm
Contact:

Coding language of Factorio?

Post by metzyn »

In what coding language and/or API is Factorio developed?

If this question has been asked before, I sincerely apologize.
Factorio Modder
Solar Expansion

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Coding language of Factorio?

Post by kovarex »

Hi, Factorio is coded in C++, we use just basic graphics library (allegro), and some other utility libraries (boost, agui (for gui) etc), but no premade, game engine.

POJO
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun Apr 14, 2013 1:16 am
Contact:

Re: Coding language of Factorio?

Post by POJO »

Which means that you are developing your engine straight with the game :) great achievement.

I really wonder how you got this amount of performance, since the factory can contain a large amount of components and even one single belt might contain 4 items + the belt itself.
My assumption is a data-driven design, like an mmo-entity system, or an OOP-Flightweight Pattern :)

Dont worry to keep technical details for yourself, it is just fascinating to see such a system since i ran into performance issues at amounts of 2000+ entities in my own experiments :) (Hard OOP-Approach).

Best regards

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Coding language of Factorio?

Post by kovarex »

POJO wrote:Which means that you are developing your engine straight with the game :) great achievement.
Well, thx, It was really very hard decision in the start, but I was too afraid to find limitations of existing engines too late, and I wanted to be able to push the limits of the engine as far as possible (performance, predictibility, mod support), now I'm almost sure it was good decision, but it was tough in the start.
POJO wrote: I really wonder how you got this amount of performance, since the factory can contain a large amount of components and even one single belt might contain 4 items + the belt itself.
My assumption is a data-driven design, like an mmo-entity system, or an OOP-Flightweight Pattern :)
I don't know any of these word-connections (data-driven design, mmo-entity system, OOP-Flightweight) :)
Actually we use quite stupid system to keep it going.
1) Make the mechanism the most easy and stupid way it can be done and see if it works, and how it works
2) Find the most slow slow thing in the game (and most easily optimisable) and -> Use the most easy and stupid way to make it (much) faster
3) Go to 2 or 1, depends if we need to make it run faster or add new features.
Sometimes we need to work with custom data structures that helps with some particular task, but it is very different for every task.
POJO wrote:I ran into performance issues at amounts of 2000+ entities in my own experiments :) (Hard OOP-Approach).
Best regards
If you used our 1) 2) 3) way, you would speed it up a lot :)

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: Coding language of Factorio?

Post by ficolas »

1) Make the mechanism the most easy and stupid way it can be done and see if it works, and how it works
2) Find the most slow slow thing in the game (and most easily optimisable) and -> Use the most easy and stupid way to make it (much) faster
3) Go to 2 or 1, depends if we need to make it run faster or add new features.
Sometimes we need to work with custom data structures that helps with some particular task, but it is very different for every task.
Nice sistem :)

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Coding language of Factorio?

Post by kovarex »

The only problem is, that over time, you can run out of stupid ways, and the "most stupid way" will start to be quite complicated :)

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

Re: Coding language of Factorio?

Post by SilverWarior »

kovarex wrote:The only problem is, that over time, you can run out of stupid ways, and the "most stupid way" will start to be quite complicated :)
That is the biggest problem with such approach. But the biggest advantage is that it is usually quickly impleminted.
So one thing that we programers should do is spend a lot of time planning our work which definitly isn't easy since you have to sort everything in your head first.
That is the main reason why I still haven't completed development of my own game even to the point where I could show it to the public. But I'm getting there slowly.

User avatar
metzyn
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Tue Mar 19, 2013 10:49 pm
Contact:

Re: Coding language of Factorio?

Post by metzyn »

I am working on a game myself using Java and the Slick2D API. Nothing complicated like Factorio, in fact 95% is text-based. Making an "interactive fiction" -esque game similar to Zork. Its my first project so I'm trying to start simple.

Anyway, because I'm starting to get into game development I like to see what languages/tools are being used and how successful developers are coming along.
Factorio Modder
Solar Expansion

POJO
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun Apr 14, 2013 1:16 am
Contact:

Re: Coding language of Factorio?

Post by POJO »

Nice Thread :)

As reference to the entity-systems this might be fun to read: http://t-machine.org/index.php/2007/09/ ... nt-part-1/

The core idea behind such a system is to get away from the OOP-approach where everything is an object with a class.
Instead the entities are not more than unique ids which can be composed with different components.
A component is something like a block of data (e.g. a position or rendering-informations).
The next part is a system, like a renderer or the movement-system.
A system handles a specific part of the entities (e.g. the movement-system might handle all entities which have a position and a velocity as component).
Artemis is such a Framework (I am going to test it in my next experiment since I am more comfortable with Java) http://gamadu.com/artemis/index.html

@metzyn
For a Textgame Slick might be a bit too much :)
Still it seems to be a bit outdated (ran into great issues as soon as we needed multithreading at loadtime) http://slick.javaunlimited.net/viewtopic.php?f=2&t=5171
Maybe not for a textgame, but for other projects libgdx might be a choice (http://code.google.com/p/libgdx/)

Best regards

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: Coding language of Factorio?

Post by ficolas »

I thought that the simple game menu and buttoms were from some game engine, in my opinion, you should make it have better graphics :s

Edit: Lol I have just readed that it will be changed for the next version :)

User avatar
metzyn
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Tue Mar 19, 2013 10:49 pm
Contact:

Re: Coding language of Factorio?

Post by metzyn »

POJO wrote:Nice Thread :)

@metzyn
For a Textgame Slick might be a bit too much :)
Still it seems to be a bit outdated (ran into great issues as soon as we needed multithreading at loadtime) http://slick.javaunlimited.net/viewtopic.php?f=2&t=5171
Maybe not for a textgame, but for other projects libgdx might be a choice (http://code.google.com/p/libgdx/)

Best regards
Thanks for the info! I do not like Slick2D but it seemed to be the easiest to implement and best supported out of the few libraries/engines I found.

I know it seems like a bit much for a text-based game, but I am building the entire GUI myself instead of using a specific GUI library so that I can have a bit more control. That is why I wanted to use a graphics library like Slick2D. Again, thanks for the tip and I will check out libgdx.
Factorio Modder
Solar Expansion

User avatar
metzyn
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Tue Mar 19, 2013 10:49 pm
Contact:

Re: Coding language of Factorio?

Post by metzyn »

After checking out libgdx not pleased of its reliance on the android SDK.
Factorio Modder
Solar Expansion

Post Reply

Return to “General discussion”