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

Topics and discussion about specific mods
wahming
Fast Inserter
Fast Inserter
Posts: 192
Joined: Sun May 17, 2015 8:30 pm
Contact:

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

Post 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 7105 times
User avatar
Afforess
Filter Inserter
Filter Inserter
Posts: 422
Joined: Tue May 05, 2015 6:07 pm
Contact:

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

Post 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.
wahming
Fast Inserter
Fast Inserter
Posts: 192
Joined: Sun May 17, 2015 8:30 pm
Contact:

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

Post 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?
User avatar
Afforess
Filter Inserter
Filter Inserter
Posts: 422
Joined: Tue May 05, 2015 6:07 pm
Contact:

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

Post 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.
wahming
Fast Inserter
Fast Inserter
Posts: 192
Joined: Sun May 17, 2015 8:30 pm
Contact:

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

Post by wahming »

It's very much still happening.
User avatar
Afforess
Filter Inserter
Filter Inserter
Posts: 422
Joined: Tue May 05, 2015 6:07 pm
Contact:

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

Post 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
flabort
Inserter
Inserter
Posts: 25
Joined: Wed May 11, 2016 2:57 am
Contact:

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

Post 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)
User avatar
Afforess
Filter Inserter
Filter Inserter
Posts: 422
Joined: Tue May 05, 2015 6:07 pm
Contact:

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

Post 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.
wahming
Fast Inserter
Fast Inserter
Posts: 192
Joined: Sun May 17, 2015 8:30 pm
Contact:

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

Post 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 7030 times
User avatar
Afforess
Filter Inserter
Filter Inserter
Posts: 422
Joined: Tue May 05, 2015 6:07 pm
Contact:

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

Post 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.
wahming
Fast Inserter
Fast Inserter
Posts: 192
Joined: Sun May 17, 2015 8:30 pm
Contact:

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

Post by wahming »

Here you go
Attachments
Misanthrope.zip
Save file
(4.44 MiB) Downloaded 128 times
mods.rar
(118.03 MiB) Downloaded 165 times
User avatar
Afforess
Filter Inserter
Filter Inserter
Posts: 422
Joined: Tue May 05, 2015 6:07 pm
Contact:

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

Post 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.
wahming
Fast Inserter
Fast Inserter
Posts: 192
Joined: Sun May 17, 2015 8:30 pm
Contact:

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

Post 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?
User avatar
Afforess
Filter Inserter
Filter Inserter
Posts: 422
Joined: Tue May 05, 2015 6:07 pm
Contact:

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

Post 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.
User avatar
Afforess
Filter Inserter
Filter Inserter
Posts: 422
Joined: Tue May 05, 2015 6:07 pm
Contact:

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

Post 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.
mbattjes@gmail.com
Inserter
Inserter
Posts: 34
Joined: Sat Jan 31, 2015 3:36 pm
Contact:

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

Post 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
User avatar
Afforess
Filter Inserter
Filter Inserter
Posts: 422
Joined: Tue May 05, 2015 6:07 pm
Contact:

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

Post by Afforess »

I replied in the mod portal, but to repeat, I'll take a look and fix.
nuhll
Filter Inserter
Filter Inserter
Posts: 958
Joined: Mon Apr 04, 2016 9:48 pm
Contact:

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

Post 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...
snowhusky5
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Jul 11, 2016 2:00 pm
Contact:

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

Post 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.
Post Reply

Return to “Mods”