Page 8 of 9

Re: [MOD 0.12.11+] EvoGUI (Evolution Factor Indicator) v0.4.16

Posted: Sun Jun 12, 2016 6:40 pm
by Ranakastrasz
Narc wrote:
Ranakastrasz wrote:Suggest alternate evolution factor display. Showing linear values. Should work as long as mods don't break the standard limits.

Code: Select all

[...] (1/(1-x))-1
I don't think that formula works:

Code: Select all

(1/(1-0.9)) - 1 == 9
(1/(1-0.99)) - 1 == 99
But you don't need a formula:

Code: Select all

if evo > 0.99 then return 6
elseif evo > 0.8 then return 5
elseif evo > 0.75 then return 4
elseif evo > 0.66 then return 3
elseif evo > 0.5 then return 2
else return 1 end
https://wiki.factorio.com/index.php?tit ... #Evolution

Code: Select all

The percentages are applied on the base of (1 - current_evolution_factor). So for instance destroying the enemy spawner in the beginning of the game results in increase of evolution factor by 0.005 (half a percent) while doing this when the evolution factor is 0.5 the increase is only 0.0025 (quarter a percent).
Ofc it works.Evolution factor follows diminishing returns, in that each 0.01 of evolution factor is far larger than the previous one. Going from 0 to 0.5 is the same as going frm 0.5 to 0.75, and 0.75 to 0.875, and so on. Hence the alternate display. It makes it linear instead of... Uhm... Hyperbolic I think? Essentially, killing that spawner would always give +0.005 to the given value regardless of whether you are at 0 or .8, (since it would actually display 5)

As for the formula, it is required to get a smooth value. Otherwise you could just say, Low, medium, high, extreme, and be done with it. This is to give more information.

Re: [MOD 0.12.11+] EvoGUI (Evolution Factor Indicator) v0.4.16

Posted: Sun Jun 12, 2016 6:59 pm
by Narc
Ranakastrasz wrote:Ofc it works.Evolution factor follows diminishing returns, in that each 0.01 of evolution factor is far larger than the previous one. Going from 0 to 0.5 is the same as going frm 0.5 to 0.75, and 0.75 to 0.875, and so on. Hence the alternate display. It makes it linear instead of... Uhm... Hyperbolic I think? Essentially, killing that spawner would always give +0.005 to the given value regardless of whether you are at 0 or .8, (since it would actually display 5)
Right, ok, I see where you're going with this, thank you. I'm not sure I see how it results in more information, though: the raw evolution_factor number can just be looked up in the unit-spawner prototypes' result_units, which will tell you directly what can be spawned at the current value (e.g., "above 0.25 (25%) evolution_factor, you will start seeing small spitters").

The linearized scale is nicer for calculating how much you've done to affect the evo factor, but it takes away the simple lookup ability.

Re: [MOD 0.12.11+] EvoGUI (Evolution Factor Indicator) v0.4.16

Posted: Sun Jun 19, 2016 11:35 am
by DRY411S
Thanks for this mod. As well as giving great information, it's so well-written and easy to understand.

I'm using it as a basis to write a GUI interface to my own mod. I only need the 'Settings' functionality. I'll make sure you are credited.

Re: [MOD 0.12.11+] EvoGUI (Evolution Factor Indicator) v0.4.16

Posted: Tue Jun 28, 2016 11:07 am
by ChurchOrganist
Are there any plans to update this to be useable in 0.13??

Re: [MOD 0.12.11+] EvoGUI (Evolution Factor Indicator) v0.4.16

Posted: Tue Jun 28, 2016 5:37 pm
by jockeril
ChurchOrganist wrote:Are there any plans to update this to be useable in 0.13??
I know narc will update his mods once he had a chance to work on them - you'll just have to be patient 8-)

Re: [MOD 0.12.11+] EvoGUI (Evolution Factor Indicator) v0.4.16

Posted: Wed Jun 29, 2016 6:37 am
by Narc
ChurchOrganist wrote:Are there any plans to update this to be useable in 0.13??
Yup, absolutely, but my time is limited at the moment. Thankfully, I have some help (from Afforess and sparr), but I think their available time is also quite low.

It's not going to be a simple search-and-replace, that's for sure.

Re: [MOD 0.12.11+] EvoGUI (Evolution Factor Indicator) v0.4.16

Posted: Wed Jun 29, 2016 10:06 am
by ChurchOrganist
Narc wrote:
ChurchOrganist wrote:Are there any plans to update this to be useable in 0.13??
Yup, absolutely, but my time is limited at the moment. Thankfully, I have some help (from Afforess and sparr), but I think their available time is also quite low.

It's not going to be a simple search-and-replace, that's for sure.
Well I have some experience with scripting - mainly writing Neverwinter Nights mods in Bioware script - so I would need to learn the lua dialect, and also familiarise myself with the Factorio specific stuff, but if there's anything I can do to help - let me know.

Looking at the modding changes in the 0.13 release, it seems to me that maybe a complete rewrite may be necessary?

Re: [MOD 0.12.11+] EvoGUI (Evolution Factor Indicator) v0.4.16

Posted: Wed Jun 29, 2016 10:11 am
by Narc
ChurchOrganist wrote:Well I have some experience with scripting - mainly writing Neverwinter Nights mods in Bioware script - so I would need to learn the lua dialect, and also familiarise myself with the Factorio specific stuff, but if there's anything I can do to help - let me know.
Do feel free to take a look -- the more, the merrier: https://github.com/narc0tiq/evoGUI/pull/63
ChurchOrganist wrote:Looking at the modding changes in the 0.13 release, it seems to me that maybe a complete rewrite may be necessary?
Might do; I had one on my list anyway, because EvoGUI really is written quite poorly to begin with, but that's going to take a fair old while and I hoped to get something out sooner that was just a straight port. It hasn't been working very well so far.

Re: [MOD 0.12.11+] EvoGUI (Evolution Factor Indicator) v0.4.16

Posted: Wed Jun 29, 2016 11:08 am
by DRY411S
I trawled this code to understand how GUIs can be implemented in Factorio. Happy to help too where I can. Anything specific I could look at?

Re: [MOD 0.12.11+] EvoGUI (Evolution Factor Indicator) v0.4.16

Posted: Wed Jun 29, 2016 11:14 am
by Narc
DRY411S wrote:I trawled this code to understand how GUIs can be implemented in Factorio. Happy to help too where I can. Anything specific I could look at?
The big question at the moment is why the GUI shows but doesn't update with any of the non-default sensors activated.

I suspect I might have an idea (some things moved from game.whatever to surface.whatever), but because it's not generating any kind of error, it's pretty opaque to me, and I really don't have the time to spend on trial-and-error.

Re: [MOD 0.12.11+] EvoGUI (Evolution Factor Indicator) v0.4.16

Posted: Wed Jun 29, 2016 2:11 pm
by ChurchOrganist
Narc wrote: Do feel free to take a look -- the more, the merrier: https://github.com/narc0tiq/evoGUI/pull/63
OK I've forked your Mod to my GitHub account. Will take a look this weekend.

Should you want to see how I'm doing you can check it here......
https://github.com/ChurchOrganist/evoGUI/

Re: [MOD 0.12.11+] EvoGUI (Evolution Factor Indicator) v0.4.16

Posted: Wed Jun 29, 2016 6:32 pm
by DRY411S
Narc wrote:
DRY411S wrote:I trawled this code to understand how GUIs can be implemented in Factorio. Happy to help too where I can. Anything specific I could look at?
The big question at the moment is why the GUI shows but doesn't update with any of the non-default sensors activated.

I suspect I might have an idea (some things moved from game.whatever to surface.whatever), but because it's not generating any kind of error, it's pretty opaque to me, and I really don't have the time to spend on trial-and-error.
Since you wrote this, you have updated your GitHub. Have you fixed it?

Re: [MOD 0.12.11+] EvoGUI (Evolution Factor Indicator) v0.4.16

Posted: Wed Jun 29, 2016 11:23 pm
by Devious Null
Narc wrote:
DRY411S wrote:I trawled this code to understand how GUIs can be implemented in Factorio. Happy to help too where I can. Anything specific I could look at?
The big question at the moment is why the GUI shows but doesn't update with any of the non-default sensors activated.

I suspect I might have an idea (some things moved from game.whatever to surface.whatever), but because it's not generating any kind of error, it's pretty opaque to me, and I really don't have the time to spend on trial-and-error.
I took a look at the code myself and fixed the issue with the error logging, at least: in control.lua, function evogui.log, you have ipairs(game.players). This apparently doesn't work in 0.13. I get errors as expected with the following version of that function:

Code: Select all

function evogui.log(message)
    if game then
        for _, p in pairs(game.players) do
            p.print(message)
        end
    else
        error(serpent.dump(message, {compact = false, nocode = true, indent = ' '}))
    end
end
Would you like some additional help updating to 0.13? I could fork this github and send some pull requests as I find issues.

Re: [MOD 0.12.11+] EvoGUI (Evolution Factor Indicator) v0.4.16

Posted: Thu Jun 30, 2016 7:37 am
by Narc
Devious Null wrote:I took a look at the code myself and fixed the issue with the error logging, at least: in control.lua, function evogui.log, you have ipairs(game.players).
Ahh, yes, I was just looking at LuaCustomTable the other day, but I didn't remember I'd been fond of ipairs at some point. Thanks, that will help greatly.
Devious Null wrote:Would you like some additional help updating to 0.13? I could fork this github and send some pull requests as I find issues.
Yes, please! The more, the merrier! I greatly appreciate all the help, everyone's being awesome.

DRY411S wrote:
Narc wrote:The big question at the moment is why the GUI shows but doesn't update with any of the non-default sensors activated. [...]
Since you wrote this, you have updated your GitHub. Have you fixed it?
No, I just published what I had into a WIP branch to avoid duplicating others' efforts.

As I just updated that branch again, I have to mention I haven't even tested it at all -- though I am about to get around to that.


I've been using pull request 63 for coordination (under the assumption that it was the first published effort, so is authoritative), but maybe I should set up another. If I do, I'll remember to leave a note in #63 about it.

Re: [MOD 0.12.11+] EvoGUI (Evolution Factor Indicator) v0.4.16

Posted: Thu Jun 30, 2016 8:40 am
by Narc
Okay, folks, I have a version that appears to work, so it's now published on the mod portal: https://mods.factorio.com/mods/Narc/EvoGUI. Thanks again for all the help, you guys, you've been super-awesome!

Re: [MOD 0.12.11+] EvoGUI (Evolution Factor Indicator) v0.4.16

Posted: Thu Jun 30, 2016 11:07 am
by ChurchOrganist
Narc wrote:Okay, folks, I have a version that appears to work,
Brilliant :)

Re: [MOD 0.12.11+] EvoGUI (Evolution Factor Indicator) v0.4.16

Posted: Thu Jun 30, 2016 1:43 pm
by bryreichle
Sweet thanks!!

Re: [MOD 0.12.11+] EvoGUI (Evolution Factor Indicator) v0.4.16

Posted: Fri Jul 01, 2016 2:04 am
by Bizobinator
I loaded the save of the game that I was playing pre .13, and it keeps saying "[EvoGui] No sensor matching the name phase_deduction! Create a sensor first." It's spamming it in the console

Is there something I can do to turn it off? Is it bug?

Re: [MOD 0.12.11+] EvoGUI (Evolution Factor Indicator) v0.4.16

Posted: Fri Jul 01, 2016 8:03 am
by jockeril
Narc - got an error for you...
evogui_daytime_error(v 4.101).jpg
evogui_daytime_error(v 4.101).jpg (1013 KiB) Viewed 9357 times
What say you ?

Re: [MOD 0.12.11+] EvoGUI (Evolution Factor Indicator) v0.4.16

Posted: Fri Jul 01, 2016 8:13 am
by Narc
Bizobinator wrote:I loaded the save of the game that I was playing pre .13, and it keeps saying "[EvoGui] No sensor matching the name phase_deduction! Create a sensor first." It's spamming it in the console

Is there something I can do to turn it off? Is it bug?
A mod is trying to update a sensor it calls "phase_deduction" without having registered it first. What other mods do you have installed?

jockeril wrote:Narc - got an error for you...
Works fine for me, using EvoGUI 0.4.102. I'm guessing you're one of the lucky 28 who got 0.4.101 before I found and fixed that very bug.