Page 5 of 10

Re: [MOD 0.12.12+] Research queue 1.2.6

Posted: Thu Jun 02, 2016 10:17 pm
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.

Re: [MOD 0.12.12+] Research queue 1.2.6

Posted: Fri Jun 03, 2016 12:53 am
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.

Re: [MOD 0.12.12+] Research queue 1.2.6

Posted: Sun Jun 05, 2016 4:26 pm
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

Re: [MOD 0.12.12+] Research queue 1.2.6

Posted: Sun Jun 05, 2016 7:35 pm
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 ;)

Re: [MOD 0.12.12+] Research queue 1.2.6

Posted: Sun Jun 05, 2016 8:14 pm
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.

Re: [MOD 0.12.12+] Research queue 1.2.6

Posted: Mon Jun 06, 2016 9:28 pm
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.

Re: [MOD 0.12.12+] Research queue 1.2.6

Posted: Thu Jun 09, 2016 1:50 pm
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

Re: [MOD 0.12.12+] Research queue 1.2.6

Posted: Mon Jun 13, 2016 11:46 pm
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

Re: [MOD 0.12.12+] Research queue 1.2.6

Posted: Tue Jun 14, 2016 10:19 am
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?

Re: [MOD 0.12.12+] Research queue 1.2.6

Posted: Tue Jun 14, 2016 9:45 pm
by XBBX
Mod list.jpg
Mod list.jpg (276.06 KiB) Viewed 7798 times

Re: [MOD 0.12.12+] Research queue 1.2.6

Posted: Thu Jun 16, 2016 12:49 am
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.

Re: [MOD 0.12.12+] Research queue 1.2.6

Posted: Wed Jun 29, 2016 11:05 pm
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.

Re: [MOD 0.12.12+] Research queue 1.2.6

Posted: Sun Jul 03, 2016 5:22 pm
by steinio
Is there a 0.13 version planned?

Greetings steinio

Re: [MOD 0.12.12+] Research queue 1.2.6

Posted: Thu Jul 14, 2016 5:06 pm
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.

Re: [MOD 0.12.12+] Research queue 1.2.6

Posted: Fri Jul 15, 2016 11:53 pm
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.

Re: [MOD 0.12.12+] Research queue 1.2.6

Posted: Sun Jul 17, 2016 6:02 pm
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).

Re: [MOD 0.12.12+] Research queue 1.2.6

Posted: Sun Jul 17, 2016 6:21 pm
by steinio
Does ut work at your intstall?

My game still crashes :(

Re: [MOD 0.12.12+] Research queue 1.2.6

Posted: Mon Jul 18, 2016 5:24 am
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.

Re: [MOD 0.12.12+] Research queue 1.2.6

Posted: Wed Jul 20, 2016 4:50 am
by steinio
Got it fixed through removing the mod with the next queued research.

Re: [MOD 0.12.12+] Research queue 1.2.6

Posted: Sun Jul 24, 2016 2:23 pm
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.