[MOD 0.12.12+] Research queue 1.2.6

Topics and discussion about specific mods
User avatar
bigyihsuan
Filter Inserter
Filter Inserter
Posts: 299
Joined: Thu Jan 01, 2015 12:57 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by bigyihsuan »

I noticed that even though Research Queue has support for the Bob's Modules Module Lab, the filters on the top don't really work with filtering the module researches.

Also, the mod should look through the prerequisite researches to see if there's things that are filtered out, so that I can't just research Advanced Material Processing 3 with Speed and Efficiency circuits filtered out. Same thing with researches that need, say, Alien Science Packs in a prerequisite, but it shows a Red-Green research that needs that Alien science pack in a prior research.

Pretty much, I want the mod to ONLY display the researches that you have filtered in, along with all of the prerequisites. So if I have Red-Green science showing, I want to only be able to research Red or Red-Green or Green sciences only, with no Blue or Alien as prerequisites.
sparr
Smart Inserter
Smart Inserter
Posts: 1444
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by sparr »

bigyihsuan wrote:Also, the mod should look through the prerequisite researches to see if there's things that are filtered out, so that I can't just research Advanced Material Processing 3 with Speed and Efficiency circuits filtered out. Same thing with researches that need, say, Alien Science Packs in a prerequisite, but it shows a Red-Green research that needs that Alien science pack in a prior research.

Pretty much, I want the mod to ONLY display the researches that you have filtered in, along with all of the prerequisites. So if I have Red-Green science showing, I want to only be able to research Red or Red-Green or Green sciences only, with no Blue or Alien as prerequisites.
Scroll up a few comments, I posted a patch that adds this feature.
User avatar
bigyihsuan
Filter Inserter
Filter Inserter
Posts: 299
Joined: Thu Jan 01, 2015 12:57 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by bigyihsuan »

Is it possible to make the Research Queue window dragable like the inventory windows? With 6 toolbars, it's impossible to click on the up and down buttons.

EDIT: Saw the post below, but here's an example of what I'm taking about:
Image
Last edited by bigyihsuan on Sun Jun 05, 2016 7:41 pm, edited 1 time in total.
MrDoomah
Fast Inserter
Fast Inserter
Posts: 196
Joined: Mon Jun 01, 2015 1:11 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by MrDoomah »

bigyihsuan wrote:Is it possible to make the Research Queue window dragable like the inventory windows? With 6 toolbars, it's impossible to click on the up and down buttons.
Sorry nope, for some reason the gui frames are locked to the top, left and center positions. Wait for the 0.13 update, I've got some features planned to make it better ;)
sparr
Smart Inserter
Smart Inserter
Posts: 1444
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by sparr »

bigyihsuan wrote:With 6 toolbars, it's impossible to click on the up and down buttons.
Click the ^^ button at the top to hide long sequences of research, like the 20 bot upgrades. Making the research list shorter will keep the window a manageable height.
Shrooblord
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Thu May 12, 2016 12:57 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by Shrooblord »

sparr wrote:Can you post which version of TM and RQ you're using?
RQ 1.2.6;
TM 0.12.14

Should be the latest of both.
MrDoomah wrote:That's not a problem with test-mode and this mod's combatability. That's an issue with this mod and whatever mod adds the "data-dummy-basic-mining-drill" research. What other mods do you have?
Good suggestion. Found out the culprit was the sensor 0.4.9 mod from the 'pack' Smarter Circuitry. Already informed its respective mod author also.
maurojunior2011
Inserter
Inserter
Posts: 32
Joined: Wed Mar 23, 2016 9:51 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by maurojunior2011 »

In the configuration file, I leave like this:

rq.q_per_page = 8
rq.research_table_width = 10
rq.research_table_height = 7

My resolution: 1366 x 768

So independent of any chosen configuration in the GUI, it is always in the maximum size as in the following figure:

Image
XBBX
Long Handed Inserter
Long Handed Inserter
Posts: 74
Joined: Wed Jan 07, 2015 4:30 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by XBBX »

Then i use your mod my game starts i don't now how to say 3 sec normal 1 sec frozen 3 sec normal 1 sec frozen .... till i have queued recipes then i don't research 60/60 no problem
MrDoomah
Fast Inserter
Fast Inserter
Posts: 196
Joined: Mon Jun 01, 2015 1:11 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by MrDoomah »

XBBX wrote:Then i use your mod my game starts i don't now how to say 3 sec normal 1 sec frozen 3 sec normal 1 sec frozen .... till i have queued recipes then i don't research 60/60 no problem
Yes, I've heard more people complain about that, but I don't have it on my machine. Mind posting a list of all the mods you're using?
XBBX
Long Handed Inserter
Long Handed Inserter
Posts: 74
Joined: Wed Jan 07, 2015 4:30 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by XBBX »

Mod list.jpg
Mod list.jpg (276.06 KiB) Viewed 8474 times
roy7
Filter Inserter
Filter Inserter
Posts: 341
Joined: Fri Dec 12, 2014 4:24 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by roy7 »

MrDoomah wrote:
XBBX wrote:Then i use your mod my game starts i don't now how to say 3 sec normal 1 sec frozen 3 sec normal 1 sec frozen .... till i have queued recipes then i don't research 60/60 no problem
Yes, I've heard more people complain about that, but I don't have it on my machine. Mind posting a list of all the mods you're using?
It's happening currently on the public community server ran on this post:

https://www.reddit.com/r/factorio/comme ... ltiplayer/

I'm attaching the current mod pack. F5 debug shows research queue taking .9 to 1.9 per update, it jumps around.

Edit: We're going to remove the mod so we can play faster now, but hopefully the modpack helps. If it matters, our current tech was about 1/4 complete and we were out of blue science so progress bar not moving. 1 thing in the queue after current tech.
Attachments
modpack3.zip
modpack with the issue
(21 MiB) Downloaded 157 times
User avatar
Devious Null
Burner Inserter
Burner Inserter
Posts: 8
Joined: Fri Apr 22, 2016 9:06 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by Devious Null »

I fixed the performance issues on my multiplayer test server with the following changes, and I thought I would contribute them back so that everyone can benefit from them.

Specifically, there were three things I fixed:
1. If a player has the RQ open when they go offline, the queue is still updated for that offline player.
2. If multiple players on the same force have the RQ open, the queue is updated for each of them (even though the result is the same every time).
3. If there are more technologies in the RQ than can be displayed at one time, the queue is still updated for every technology (even the ones which are not visible to any player)

Code: Select all

diff -ruN src/research-queue_1.2.6/control.lua mods/research-queue_1.2.6/control.lua
--- src/research-queue_1.2.6/control.lua
+++ mods/research-queue_1.2.6/control.lua
@@ -162,9 +162,11 @@
 			end
 		end
 	end
+	local force_updated = false
 	for index, player in pairs(event.research.force.players) do
 		if global.offset_queue[index] > 0 then global.offset_queue[index] = global.offset_queue[index] -1 end
-		if player.gui.center.Q then 
+		if player.connected and player.gui.center.Q and not force_updated then 
+			force_updated = true
 			updateQ(player.force)
 			drawGrid(player.force) 
 		end
@@ -212,9 +214,13 @@
 end)
 
 script.on_event(defines.events.on_tick, function(event)
+	local updated_forces = {}
 	if event.tick % 60 == 0 then
 		for index,player in pairs(game.players) do
-			if player.gui.center.Q then updateQ(player.force) end
+			if player.connected and player.gui.center.Q and not updated_forces[player.force] then
+				updateQ(player.force)
+				updated_forces[player.force] = true
+			end
 		end
 	end
 end)
\ No newline at end of file
diff -ruN src/research-queue_1.2.6/functions/draw_grid.lua mods/research-queue_1.2.6/functions/draw_grid.lua
--- src/research-queue_1.2.6/functions/draw_grid.lua
+++ mods/research-queue_1.2.6/functions/draw_grid.lua
@@ -109,7 +109,7 @@
 function drawGrid(force)
 	if not set_colspan then set_colspan = define_colspan() end
 	for _, player in pairs(force.players) do
-		if player.gui.center.Q then
+		if player.connected and player.gui.center.Q then
 			if player.gui.center.Q.add2q then player.gui.center.Q.add2q.destroy() end
 			player.gui.center.Q.add{type = "frame", name = "add2q", caption = "Add to queue", style = "technology_preview_frame_style", direction = "vertical"}	
 			options(player)
diff -ruN src/research-queue_1.2.6/functions/update_queue.lua mods/research-queue_1.2.6/functions/update_queue.lua
--- src/research-queue_1.2.6/functions/update_queue.lua
+++ mods/research-queue_1.2.6/functions/update_queue.lua
@@ -39,6 +39,14 @@
 function est_time(force)
 	local est = {}
 	local speed = 0
+	
+	local max_visible_Q_index = -1
+	for player_index, player in pairs(force.players) do
+		if player.connected and player.gui.center.Q then
+			max_visible_Q_index = math.max(max_visible_Q_index, rq.q_per_page+global.offset_queue[player_index])
+		end
+	end
+	
 	for i, lab in ipairs(global.labs[force.name]) do
 		if not lab.valid then table.remove(global.labs[force.name],i) 
 		else
@@ -60,15 +68,17 @@
 	end
 	speed = speed * (1 + force.laboratory_speed_modifier)
 	for i, tech in ipairs(global.researchQ[force.name]) do
-		local t = (1 - force.research_progress) * force.current_research.research_unit_count * force.current_research.research_unit_energy / speed
-		if force.current_research.name == tech then 
-			est[i] = t		
-		elseif i == 1 then
-			est[i] = t + force.technologies[tech].research_unit_count * force.technologies[tech].research_unit_energy / speed
-		elseif i > 2 and global.researchQ[force.name][i-1] == force.current_research.name then
-			est[i] = est[i-2] + force.technologies[tech].research_unit_count * force.technologies[tech].research_unit_energy / speed
-		else
-			est[i] = est[i-1] + force.technologies[tech].research_unit_count * force.technologies[tech].research_unit_energy / speed
+		if i <= max_visible_Q_index then
+			local t = (1 - force.research_progress) * force.current_research.research_unit_count * force.current_research.research_unit_energy / speed
+			if force.current_research.name == tech then 
+				est[i] = t		
+			elseif i == 1 then
+				est[i] = t + force.technologies[tech].research_unit_count * force.technologies[tech].research_unit_energy / speed
+			elseif i > 2 and global.researchQ[force.name][i-1] == force.current_research.name then
+				est[i] = est[i-2] + force.technologies[tech].research_unit_count * force.technologies[tech].research_unit_energy / speed
+			else
+				est[i] = est[i-1] + force.technologies[tech].research_unit_count * force.technologies[tech].research_unit_energy / speed
+			end
 		end
 	end
 	return est
@@ -149,7 +159,7 @@
 function updateQ(force)
 	local time_estimation = est_time(force)
 	for index, player in pairs(force.players) do
-		if player.gui.center.Q then
+		if player.connected and player.gui.center.Q then
 			if not player.gui.center.Q.current_q then player.gui.center.Q.add{type = "frame", name = "current_q", caption = "Currrent queue", style = "technology_preview_frame_style"} end
 			if player.gui.center.Q.current_q.list then player.gui.center.Q.current_q.list.destroy() end
 			
If anyone has any questions about the patch, please don't hesitate to ask.

I avoided making any changes which change any visible aspect of the mod (other than, of course, the framerate). If you are willing to change the way the estimated time to completion for the queue is displayed, then there is another optimization which could be added. With my patch, earlier technologies in the queue need to be processed to calculate the time to completion of later technologies in the queue. If the estimate was for only each technology itself, rather than itself and all previous technologies, then it would take less time to update the RQ when viewing technologies near the end of a long queue.
User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2638
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by steinio »

Is there a 0.13 version planned?

Greetings steinio
Image

Transport Belt Repair Man

View unread Posts
User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2638
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by steinio »

Unofficiol version for 0.13, started and i'm currently testing.

Issues:
- Queued research starts again although it's researched.
- At pushing the first queue element to current research the game freezes/crashes.
Attachments
research-queue_1.2.6.zip
(49.79 KiB) Downloaded 162 times
Image

Transport Belt Repair Man

View unread Posts
MrDoomah
Fast Inserter
Fast Inserter
Posts: 196
Joined: Mon Jun 01, 2015 1:11 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by MrDoomah »

Hi there all, i"ve been very busy with work and college lately so I haven't had much time to work on this mod. A .13 version is comming, but I can't tell how soon.
JackB1024
Burner Inserter
Burner Inserter
Posts: 11
Joined: Wed Jul 13, 2016 2:06 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by JackB1024 »

Working Unofficial version for 0.13 is attached to this post.
Note: It requires Factorio v0.13.9 to work. Versions before 0.13.9 had a bug in the on_research_completed event that would cause the game to crash (as Steinio mentions).
Attachments
research-queue_1.2.6.zip
(49.79 KiB) Downloaded 208 times
User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2638
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by steinio »

Does ut work at your intstall?

My game still crashes :(
Image

Transport Belt Repair Man

View unread Posts
JackB1024
Burner Inserter
Burner Inserter
Posts: 11
Joined: Wed Jul 13, 2016 2:06 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by JackB1024 »

steinio wrote:Does ut work at your intstall?

My game still crashes :(

Works fine for me.
Check if it still crashes when you start up a new world.
The bug in 0.13.0-0.13.8 would cause the game world to be in a bad state that would persist through saves. I'm not sure if the fix would also work if the game was already corrupted.

If it doesn't work on a new world, post the crash report and I'll see if I can find the issue.
User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2638
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by steinio »

Got it fixed through removing the mod with the next queued research.
Image

Transport Belt Repair Man

View unread Posts
Phantum
Long Handed Inserter
Long Handed Inserter
Posts: 62
Joined: Sat Jun 11, 2016 12:20 am
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by Phantum »

so if you use this mod, then disable it, you can no longer open up the technology screen... D: Also, bob's mod's turrets don't appear in RQ yes they do, they were already researched.
---
I am a Streamer,
Fallen Sun Gaming by Name,
Factorio is Sometimes my Game.
For Some Goodness
Join me
on http://www.twitch.tv/fallensungaming

FSG may or may not be subliminally implanted in this signature
Post Reply

Return to “Mods”