[MOD 0.12.x] Smarter Circuitry

Topics and discussion about specific mods
waduk
Filter Inserter
Filter Inserter
Posts: 372
Joined: Tue Feb 10, 2015 5:44 pm
Contact:

Re: [MOD 0.12.x] Smarter Circuitry

Post by waduk »

Bug ?
Detected Train signal is persistent, the sensor still outputting train signal even after the train passed.
Or am i doing it wrong ? We have to use pressure floor ? Because this bug (?) didn't occur if we use pressure floor.

Edit : Scrap that, turns out there are new Sensor version, resolved.


Also, feature request:

Can the train signal state being altered by the directional actuator ?
So we can redirect train, or make a safe passage.
waduk
Filter Inserter
Filter Inserter
Posts: 372
Joined: Tue Feb 10, 2015 5:44 pm
Contact:

Re: [MOD 0.12.x] Smarter Circuitry

Post by waduk »

Sorry, another question.
How do i reduce the update rate of sensor ? Control.lua ?
I use many of them, i think the sensor that giving me fps drop (40 from 60).
I don't need realtime count from sensor.
Peter34
Smart Inserter
Smart Inserter
Posts: 1100
Joined: Mon Nov 10, 2014 12:44 pm
Contact:

Re: [MOD 0.12.x] Smarter Circuitry

Post by Peter34 »

waduk wrote:Sorry, another question.
How do i reduce the update rate of sensor ? Control.lua ?
I use many of them, i think the sensor that giving me fps drop (40 from 60).
I don't need realtime count from sensor.
Nixie Tubes appear to be updating only once per second, and I'm probably not the only one using both the Nixies and Smarter Circuitry. But I think updating once per second (once per 60 ticks) would be good.
waduk
Filter Inserter
Filter Inserter
Posts: 372
Joined: Tue Feb 10, 2015 5:44 pm
Contact:

Re: [MOD 0.12.x] Smarter Circuitry

Post by waduk »

Yeah i also use nixie tubes.
One per sec would be good. But i hope it can be configurable, many people would still like a real time count, or maybe even slower, like myself.
My PC sadly can't handle fast update rate.

Using debug, indeed the slowdown were caused by sensor. Removing them restore my fps, i only use about 40 of them. But plan to install many more (have to scrap that plan until somehow the sensor can be slowed down).
Kikkers
Fast Inserter
Fast Inserter
Posts: 109
Joined: Sun Jun 22, 2014 8:45 pm
Contact:

Re: [MOD 0.12.x] Smarter Circuitry

Post by Kikkers »

Just integrated some more general timing code for the sensor. Update frequency can now be tweaked from a config file in the sensor's mod folder.

I hadn't found the time to work on this. It should've been in a lot sooner than this.
waduk
Filter Inserter
Filter Inserter
Posts: 372
Joined: Tue Feb 10, 2015 5:44 pm
Contact:

Re: [MOD 0.12.x] Smarter Circuitry

Post by waduk »

Thanks for adding configurable update cycle. Tremendous helpful on slow PC :D
I use 120 for the default, and now it reduced to 25% of script update.
Still higher than most mod, but i guess it's the caveat we have to deal with.

Actuator also a big fps hit, although not as high as sensor; but currently i disable them :(
Since Smarter Trains Mod will causing CTD when activator mod is toggled.
Man, i wish i can use both of them together.
fregate84
Fast Inserter
Fast Inserter
Posts: 235
Joined: Sun Jun 22, 2014 10:56 am
Contact:

Re: [MOD 0.12.x] Smarter Circuitry

Post by fregate84 »

ScreenShot003.jpg
ScreenShot003.jpg (14.09 KiB) Viewed 10045 times
I have a probleme !
Kikkers
Fast Inserter
Fast Inserter
Posts: 109
Joined: Sun Jun 22, 2014 8:45 pm
Contact:

Re: [MOD 0.12.x] Smarter Circuitry

Post by Kikkers »

fregate84 wrote:I have a probleme !
I can't reproduce it, so try the basics: check if your game and the mod are updated to the newest versions.
fregate84
Fast Inserter
Fast Inserter
Posts: 235
Joined: Sun Jun 22, 2014 10:56 am
Contact:

Re: [MOD 0.12.x] Smarter Circuitry

Post by fregate84 »

Kikkers wrote:
fregate84 wrote:I have a probleme !
I can't reproduce it, so try the basics: check if your game and the mod are updated to the newest versions.
My mistake !

I download the last STABLE version and not the last version on my new PC.
waduk
Filter Inserter
Filter Inserter
Posts: 372
Joined: Tue Feb 10, 2015 5:44 pm
Contact:

Re: [MOD 0.12.x] Smarter Circuitry

Post by waduk »

Crash when removing accumulator that being read by sensor.
Image

Also, altering (lowering) the update rate in sensor config.lua seems didn't take any effect at all, if the sensor was used to read accu's. Script update is still really high.
The in-game sensor signal also seems to read on close to realtime.
Single sensor on accu's is giving the script-update value of 1.x. Using two sensor is doubling the value, amd so on.

The only thing that seems affected/lowering the script update is the update cycle random options, it lower the script-update by 0.5.

Sorry if i sound complaining, i'm not actually.

I'm on low end PC, so i try to squeeze every performance wise if possible.
Kikkers
Fast Inserter
Fast Inserter
Posts: 109
Joined: Sun Jun 22, 2014 8:45 pm
Contact:

Re: [MOD 0.12.x] Smarter Circuitry

Post by Kikkers »

There are still some ways to improve performance that involve avoiding lua's tables whereever possible. Replacing named table keys with numbers for example. This would however fuck up readability, so I'm not keen on doing that.

It's strange that you aren't getting speedups with the update counts. It's been some time since I worked on the code, so I can't be sure, but I did manage to test the functionality of some of the more costly updates from happening too often.


I'll have a look at that bug hopefully sometime this week. Can you recall what versions of factorio/mod you started playing the map?
waduk
Filter Inserter
Filter Inserter
Posts: 372
Joined: Tue Feb 10, 2015 5:44 pm
Contact:

Re: [MOD 0.12.x] Smarter Circuitry

Post by waduk »

Sensor 0.4.8
Factorio 0.12.10 (IIRC, this game was new game, not a loaded save file from previous factorio version).
Edit :
About the speed-up/update cycle, the strange thing is , on accumulator, even though i changed the default update cycle to higher value, the signal seems stay on near-realtime value.
I increase to 600 just for sake for testing, it should update every 10 sec, right ? But the signal value seems to changed every tick.

Also, it's not that important actually, currently there are no performance hit whatsoever with sensor.
ouch
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri Oct 16, 2015 8:04 pm
Contact:

Re: [MOD 0.12.x] Smarter Circuitry

Post by ouch »

I get this error when trying to create a new game:

__actuator__/control.lua:7: attempt to index global 'game' (a nil value)

Just downloaded 12.11 64bit.
Kalsius
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Oct 16, 2015 5:24 am
Contact:

Re: [MOD 0.12.x] Smarter Circuitry

Post by Kalsius »

This is a change in the game engine. I posted about it and got a reply from the devs, stick with 0.12.10 until mod authors can update.

The latest version i have downloaded is missing an info.json however so will not run. Going to try putting a simple one in to make it run.

Edit #1
Made it run with the following :

Code: Select all

{
  "name": "smarter-circuitry",
  "version": "0.4.8",
  "title": "Smarter Circuitry",
  "author": "Kikkers",
  "homepage": "https://forums.factorio.com/forum/viewtopic.php?f=91&t=14824",
  "contact": "Kikkers",
  "description": "Smarter Circuitry",
  "dependencies": ["base"]
}
Also had to rename the .zip and internal folder to smarter-circuitry_0.4.8 to make it run.

Hope this helps

Edit #2

Where is everything? Is there a research as I cannot find any new items!!
ouch
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri Oct 16, 2015 8:04 pm
Contact:

Re: [MOD 0.12.x] Smarter Circuitry

Post by ouch »

I'll give that a try. And yes you had to research it before.

edit: oh you know what, you didn't extract the file so it's not loading. I couldn't get Factorio to read the file either so I just extracted the part directories to the mods folder. (I think it's related to Factorio not searching in subdirectories.) But yeah, they all have info files already.

Edit2: Doh, I just noticed 12.11 JUST came out the same day I posted this problem. It even says in the release notes that it will break most mods... Nm I'll just for everything to get updated.
Kikkers
Fast Inserter
Fast Inserter
Posts: 109
Joined: Sun Jun 22, 2014 8:45 pm
Contact:

Re: [MOD 0.12.x] Smarter Circuitry

Post by Kikkers »

Hey guys, sorry for the late update, but I've uploaded a seemingly functional 0.4.9 (as in, it doesn't crash).
It might have some incorrect behavior, but I haven't had the chance to really test everything, but just post any issues you see and I'll see what I can do. Also, I'm really glad a few of you jumped on fixing some bugs earlier and contributed them on github, because I don't have a lot of free time nowadays.
transportman
Inserter
Inserter
Posts: 34
Joined: Thu Jun 26, 2014 2:13 pm
Contact:

Re: [MOD 0.12.x] Smarter Circuitry

Post by transportman »

I tried to load a game, but I get the following error:
[code]Unknown key:"Error while running the on_load: __actuator__/control.lua:37: attempt to index local 'pos' (a nil value)"[/code]
Is there an easy way to fix the mod so that I can load my game without having to lose the circuitry I have set up?

Guess upgrading to the latest Factorio version fixes mods this time instead of breaking them.
Talguy
Fast Inserter
Fast Inserter
Posts: 105
Joined: Tue Apr 29, 2014 8:54 pm
Contact:

Re: [MOD 0.12.x] Smarter Circuitry

Post by Talguy »

Can you please split up your repo into smaller repo's / topics? It's cumbersome to extract the zip file, then rezip the individual folders, then move them to the fmm directory so FMM can find them.

Other than that, http://www.factoriomods.com/ might not index your mods right now because there are no seperate releases :(
devilwarriors
Filter Inserter
Filter Inserter
Posts: 311
Joined: Sat Jan 09, 2016 1:11 am
Contact:

Re: [MOD 0.12.x] Smarter Circuitry

Post by devilwarriors »

When pointing a sensor to a train cargo it will only work when just installed, if I go to another station and come back it dosn't detect the cargo anymore. Is there a workaround this?
mrtux
Long Handed Inserter
Long Handed Inserter
Posts: 61
Joined: Thu Dec 04, 2014 10:04 pm
Contact:

Re: [MOD 0.12.x] Smarter Circuitry

Post by mrtux »

devilwarriors wrote:When pointing a sensor to a train cargo it will only work when just installed, if I go to another station and come back it dosn't detect the cargo anymore. Is there a workaround this?
I have the same problem: Worked fine in 0.12.19, but does not anymore in 0.12.22.


Besides that problem, this mod finally allows me to control my trains based on mining/factory status! :)
If only my thesis could be done in Factorio …
Post Reply

Return to “Mods”