Search found 268 matches

by pleegwat
Thu Nov 09, 2017 5:32 pm
Forum: News
Topic: Friday Facts #215 - Multithreading issues
Replies: 101
Views: 45383

Re: Friday Facts #215 - Multithreading issues

I may be wrong, but based on the FFF it appears that you have three different processes that update a single variable, but that variable is shared between each. (...) I also suspect that this isn't the correct path for parallelization any way, you'll likely find that each step itself could be paral...
by pleegwat
Tue Nov 07, 2017 10:50 pm
Forum: News
Topic: Friday Facts #215 - Multithreading issues
Replies: 101
Views: 45383

Re: Friday Facts #215 - Multithreading issues

creating/reaping threads costs time too. I do hope you're not doing that every tick?
by pleegwat
Sat Nov 04, 2017 11:51 am
Forum: News
Topic: Friday Facts #215 - Multithreading issues
Replies: 101
Views: 45383

Re: Friday Facts #215 - Multithreading issues

Notwithstanding the interesting discussion about whether your analysis is right, I have a suggestion for achieving parallel thread update isolation at whatever granularity you need without moving data as entities move. Given N threads that will be updating in parallel some object type T, create N s...
by pleegwat
Sat Oct 14, 2017 12:09 pm
Forum: News
Topic: Friday Facts #212 - The GUI update (Part 1)
Replies: 151
Views: 65859

Re: Friday Facts #212 - The GUI update (Part 1)

Regarding skipping stations: How about a set of conditions on whether to visit a station, in addition to the wait conditions? Normally this would be an empty list, meaning the station is visited. Adding a rule like 'Fuel less than X MJ' or 'Cargo of Iron less than 8000' could make a station be skipp...
by pleegwat
Sat Sep 23, 2017 10:34 am
Forum: News
Topic: Friday Facts #209 - Optimisation is a way of life
Replies: 95
Views: 57092

Re: Friday Facts #209 - Optimisation is a way of life

Hello, I have an idea about the iteration over the electric network items. Because most of the time you have enough power the second loop can be skipped. So all machines have a default that they take 100% power in the first iteration you calculate the total power need. If you have enough you stop t...
by pleegwat
Sat Sep 16, 2017 12:14 pm
Forum: News
Topic: Friday Facts #208 - Tips and tricks improvement
Replies: 58
Views: 25922

Re: Friday Facts #208 - Tips and tricks improvement

Regarding the problem that no-one reads the tips and tricks, one possible solution is to add a tip to the loading screen at the start of the game. (Obviously I'm meaning a different tip each time the game loads). +1, putting tips on a loading screen is standard game design now. Our loading screen i...
by pleegwat
Sun Sep 10, 2017 10:24 am
Forum: News
Topic: Friday Facts #199 - The story of tile transitions
Replies: 51
Views: 28126

Re: Friday Facts #199 - The story of tile transitions

That solves the landfill cheat, but that's just as easily solved by deducting multiple landfill if the tile correction logic needs to add additional land tiles.

You still need tile correction logic during normal world generation.
by pleegwat
Fri Sep 08, 2017 7:57 pm
Forum: News
Topic: Friday Facts #207 - Lua noise specification
Replies: 45
Views: 25080

Re: Friday Facts #207 - Lua noise specification

It seems to me that a relatively easy way to resolve would be to use something like a 4-way flood fill algorithm starting at the player start location and use it to count land tiles surrounding the player above sea level. Maybe allow the player to set the value. For example a value of 40,000 would ...
by pleegwat
Fri Sep 01, 2017 4:34 pm
Forum: News
Topic: Friday Facts #205 - Teaching the things that everybody knows
Replies: 110
Views: 49941

Re: Friday Facts #205 - Teaching the things that everybody knows

And underground belt upgrades aren't bidirectional either.
by pleegwat
Thu Aug 24, 2017 5:08 pm
Forum: News
Topic: Friday Facts #204 - Another day, another optimisation
Replies: 93
Views: 40669

Re: Friday Facts #204 - Another day, another optimisation

@Max, you don't want to do that. The cost of the unaligned access of your double member (especially if it happens to cross a cache line boundary) is more expensive than the extra bandwidth used from padding.
by pleegwat
Sun Aug 20, 2017 11:32 am
Forum: News
Topic: Friday Facts #201 - 0.15 Stable, but not really
Replies: 148
Views: 53656

Re: Friday Facts #201 - 0.15 Stable, but not really

Regarding optimisations, have you considered using database techniques to optimise out that huge annoyance that is Autosave? A large production database cannot afford to lock up for several minutes every few minutes to write everything to disk; if you use an approach like the redo log stuff in Orac...
by pleegwat
Sun Aug 20, 2017 11:30 am
Forum: News
Topic: Friday Facts #200 - Plans for 0.16
Replies: 129
Views: 67071

Re: Friday Facts #200 - Plans for 0.16

I do agree with you that mrvn's table of waypoints idea sounds a lot like a n^2 problem. That's just space. Computationally, it's travelling salesman, which is NP. I'd hazard it's probably cheaper computationally and more effective to route within the coverage area instead of between explicit robop...
by pleegwat
Sat Aug 19, 2017 10:26 am
Forum: News
Topic: Friday Facts #204 - Another day, another optimisation
Replies: 93
Views: 40669

Re: Friday Facts #204 - Another day, another optimisation

If that pointer is being accessed often, then it is probably in cache. That means the extra indirection itself is relatively cheap, especially if doing things that way results in code that generates more cache hits and lower overall cache misses. But it's still one extra memory region, taking up va...
by pleegwat
Fri Aug 18, 2017 9:02 pm
Forum: News
Topic: Friday Facts #204 - Another day, another optimisation
Replies: 93
Views: 40669

Re: Friday Facts #204 - Another day, another optimisation

Have the developers ever defined what they mean by "large bases" and "mega bases"? It would be useful to know (in terms of number of entities/factories/bots/belts) when reading about how these optimizations are tested and measured. Excellent point. Some people might think a rock...
by pleegwat
Fri Aug 18, 2017 8:21 pm
Forum: News
Topic: Friday Facts #204 - Another day, another optimisation
Replies: 93
Views: 40669

Re: Friday Facts #204 - Another day, another optimisation

I don't know your code of course, and I'm hampered because my experience is C not C++. Depending on the list and the type of removals, I'd wonder if you really need to delete them or can just mark them inactive. If a new entity gets placed on the map (or one gets removed), then yes the list needs t...
by pleegwat
Fri Aug 18, 2017 7:50 pm
Forum: News
Topic: Friday Facts #204 - Another day, another optimisation
Replies: 93
Views: 40669

Re: Friday Facts #204 - Another day, another optimisation

You guys are using... linked lists?... Why, oh why do you use linked lists? It is supposed to be common knowledge that in almost all situations even a straight vector is better. At the very least something like C++'s deque would be better. Tell me how you'd get: O(1) time to turn an entity on/off a...
by pleegwat
Fri Aug 18, 2017 7:28 pm
Forum: News
Topic: Friday Facts #204 - Another day, another optimisation
Replies: 93
Views: 40669

Re: Friday Facts #204 - Another day, another optimisation

Very many entities will be aware ahead of time when they will next need to do work. An assembler doesn't need to do a thing for X ticks until its craft is done. An inserter is doing nothing for Y ticks until its swing is complete. Etc. Even an inserter hovering over a belt can predict to some degre...
by pleegwat
Fri Aug 18, 2017 7:04 pm
Forum: News
Topic: Friday Facts #204 - Another day, another optimisation
Replies: 93
Views: 40669

Re: Friday Facts #204 - Another day, another optimisation

A linked list of multiply-inheriting classes? I'd have expected an array of structs. I'm surprised to. I'd have expected C++ to handle virtual function calls and inheritance at compile-time, but apparently things are setup so that some of the required class structure isn't known until run-time? Thi...
by pleegwat
Fri Aug 18, 2017 6:18 pm
Forum: News
Topic: Friday Facts #204 - Another day, another optimisation
Replies: 93
Views: 40669

Re: Friday Facts #204 - Another day, another optimisation

A linked list of multiply-inheriting classes? I'd have expected an array of structs.
by pleegwat
Sat Aug 12, 2017 5:05 pm
Forum: News
Topic: Friday Facts #203 - Logistic buffer chest
Replies: 152
Views: 71844

Re: Factorio Friday Friday Facts #203 - Logistic buffer chest

Let's imagine the following scenario: Bots are removing/placing rails which changes the rail network causing rerouting. On your beefy 8-core machine the recalculation happens immediately, a train repaths and goes his merry way. A bot places another rail piece. On your friend's lowly 2-core machine,...

Go to advanced search