Page 8 of 9

Re: [MOD 0.12.20+] Misanthrope 0.3.7 -- Better Biter Mechanics

Posted: Thu Jun 23, 2016 9:19 am
by wahming
You're determined not to let me test this from scratch, aren't you? :P
Misanthrope Crash.jpg
Misanthrope Crash.jpg (329.68 KiB) Viewed 6087 times

Re: [MOD 0.12.20+] Misanthrope 0.3.7 -- Better Biter Mechanics

Posted: Thu Jun 23, 2016 3:02 pm
by Afforess
wahming wrote:You're determined not to let me test this from scratch, aren't you? :P
Misanthrope Crash.jpg
Dang, and I swear I tested this.

I'm pretty sure I know what is wrong though. Ugh.

Re: [MOD 0.12.20+] Misanthrope 0.3.7 -- Better Biter Mechanics

Posted: Thu Jun 23, 2016 3:07 pm
by wahming
I'd be interested to know what the problem was when you fix it. It looked like your if !null check should have worked, why didn't it?

Re: [MOD 0.12.20+] Misanthrope 0.3.7 -- Better Biter Mechanics

Posted: Thu Jun 23, 2016 4:46 pm
by Afforess
wahming wrote:I'd be interested to know what the problem was when you fix it. It looked like your if !null check should have worked, why didn't it?
If you are bored, open up libs/world.lua in Misanthrope and change this line https://github.com/Afforess/Misanthrope ... ld.lua#L17

It should be `global.mod_version = 40`.

I think that should fix it.

Long story short, the global.bases data structure is supposed to be created and initialized as part of the setup, but I set the default mod_version wrong, so it assumed the game was an existing save instead of a new save.

Re: [MOD 0.12.20+] Misanthrope 0.3.7 -- Better Biter Mechanics

Posted: Fri Jun 24, 2016 12:32 am
by wahming
It's very much still happening.

Re: [MOD 0.12.20+] Misanthrope 0.3.7 -- Better Biter Mechanics

Posted: Fri Jun 24, 2016 3:51 am
by Afforess
wahming wrote:It's very much still happening.
Once I got home I was able to debug and fix it.

https://github.com/Afforess/Misanthrope ... _0.4.2.zip

Re: [MOD 0.12.20+] Misanthrope 0.3.7 -- Better Biter Mechanics

Posted: Fri Jun 24, 2016 3:21 pm
by flabort
Based entirely on the error message he is receiving, it's this line that's the problem:
https://github.com/Afforess/Misanthrope ... se.lua#L95
One of the variables that table.insert is looking for is not a table, and is expected to be a table, as "table expected, got nil" implies.

Since I can see "base" is a proper table, that means "global.bases" is not. Search your code for anywhere else "global.bases" is mentioned (also make sure you're not mixing up plural and singular), make sure it's a table; if you can't figure it out, I'd take the current line, which currently looks like this:

Code: Select all

local base = { queen = entity, hives = {}, worms = {}, currency = 0, name = RandomName.get_random_name(14), next_tick = game.tick + math.random(300, 1000), history = {}, valid = true}
table.insert(global.bases, base)
and replace it with something like this:

Code: Select all

local base = { queen = entity, hives = {}, worms = {}, currency = 0, name = RandomName.get_random_name(14), next_tick = game.tick + math.random(300, 1000), history = {}, valid = true}
if global.bases == nil then
    global.bases = {}
end
table.insert(global.bases, base)

Re: [MOD 0.12.20+] Misanthrope 0.3.7 -- Better Biter Mechanics

Posted: Fri Jun 24, 2016 4:38 pm
by Afforess
flabort wrote:Based entirely on the error message he is receiving, it's this line that's the problem:]
The data structures were supposed to be set up on_init in the world class, which was the source of the problem: https://github.com/Afforess/Misanthrope ... ld.lua#L34

Anyway, 0.4.2 should initialize correctly.

Re: [MOD 0.12.20+] Misanthrope 0.3.7 -- Better Biter Mechanics

Posted: Fri Jun 24, 2016 7:24 pm
by wahming
Running into some performance issues with 0.4.2. Getting pretty jerky. Performance completely restored once I removed the mod.
Performance.jpg
Performance.jpg (99.25 KiB) Viewed 6012 times

Re: [MOD 0.12.20+] Misanthrope 0.3.7 -- Better Biter Mechanics

Posted: Fri Jun 24, 2016 7:39 pm
by Afforess
wahming wrote:Running into some performance issues with 0.4.2. Getting pretty jerky. Performance completely restored once I removed the mod.
Performance.jpg
Can you upload save + mods and I can look into it.

Re: [MOD 0.12.20+] Misanthrope 0.3.7 -- Better Biter Mechanics

Posted: Fri Jun 24, 2016 8:02 pm
by wahming
Here you go

Re: [MOD 0.12.20+] Misanthrope 0.3.7 -- Better Biter Mechanics

Posted: Sat Jun 25, 2016 6:00 pm
by Afforess
wahming wrote:Running into some performance issues with 0.4.2. Getting pretty jerky. Performance completely restored once I removed the mod.
Performance.jpg
So I loaded your mod and saves up, and wandered around for ten minutes, killed a few biter bases, but I never saw script performance with 0.4.2 exceed 0.3, nowhere near 9ms. I figured maybe because I use a SSD, it was hiding the issue, so I also downloaded factorio to my standard slow hard drive and while performance was a tad worse, still nowhere near 9ms.

So was there anything in particular you were doing to trigger the issue? If you prefer, I should be around on #factorio IRC this weekend.

Re: [MOD 0.12.20+] Misanthrope 0.3.7 -- Better Biter Mechanics

Posted: Sat Jun 25, 2016 7:47 pm
by wahming
I wasn't really doing anything special. I would note though, that I had been playing for a few hours straight. Any chance of a memory leak?

Re: [MOD 0.12.20+] Misanthrope 0.3.7 -- Better Biter Mechanics

Posted: Sat Jun 25, 2016 8:35 pm
by Afforess
wahming wrote:I wasn't really doing anything special. I would note though, that I had been playing for a few hours straight. Any chance of a memory leak?
So you didn't see the 9ms usage until after several hours? Hmmm.

I dumped the mod saved memory first thing to see if I could spot anything unusual. There were some minor issues that I caught but nothing that I think accounts for the performance you saw.

Re: [MOD 0.12.20+] Misanthrope 0.3.7 -- Better Biter Mechanics

Posted: Sat Jun 25, 2016 11:38 pm
by Afforess
wahming wrote:I wasn't really doing anything special. I would note though, that I had been playing for a few hours straight. Any chance of a memory leak?
Ok, so I am going to work on a developer mode GUI which you should be able to toggle and flip on/off Misanthrope behaviors to hopefully allow you to debug if/when the issue with performance repeats.

Re: [MOD 0.12.20+] Misanthrope 0.3.7 -- Better Biter Mechanics

Posted: Wed Jun 29, 2016 8:44 pm
by mbattjes@gmail.com
It's back:
Image

Re: [MOD 0.12.20+] Misanthrope 0.3.7 -- Better Biter Mechanics

Posted: Thu Jun 30, 2016 10:49 am
by mbattjes@gmail.com
Pretty silly but the problem there was that i didn't have a base yet. As in not a single building.
Edit: scrap that it also happens with buildings present (but maybe not in range of biters?)

The evolution problem however is real. Its going to 100 within 15 mins: Image

Re: [MOD 0.12.20+] Misanthrope 0.3.7 -- Better Biter Mechanics

Posted: Thu Jun 30, 2016 2:59 pm
by Afforess
I replied in the mod portal, but to repeat, I'll take a look and fix.

Re: [MOD 0.12.20+] Misanthrope 0.3.7 -- Better Biter Mechanics

Posted: Mon Jul 11, 2016 7:38 pm
by nuhll
How to exclude rails?
I know theres a mod for it, but it dont work for 1.3... and i cant find another one...

Re: [MOD 0.12.20+] Misanthrope 0.3.7 -- Better Biter Mechanics

Posted: Tue Jul 12, 2016 3:26 am
by snowhusky5
nuhll wrote:How to exclude rails?
I know theres a mod for it, but it dont work for 1.3... and i cant find another one...
seconded, it would be nice to have an option to make rails biter-proof, for those of us who want to make multiple semi-independent outposts rather than a single sprawling amoeba with nothing outside its borders except biters.