FortressCraft Evolved

FortressCraft Evolved

No Mynocks In Rooms
58 Comments
Wariat117  [author] 17 Mar, 2020 @ 3:55pm 
BeanSlinger419 17 Feb, 2020 @ 7:17am 
Well, this gives me more of a reason to use Rooms. I now just wonder if there is a limit to room size, mainly just height.
Wariat117  [author] 28 Dec, 2019 @ 5:27am 
as of right now i'm on break from making mods, i'm catching up anime :D

but such mod wouldn't be a big trouble
it would just require searching for specific code
as of right now game constantly spawns tunnel nukers (that's how bombers are called in game) if there is less than X number of them (X aka idk how much exactly)

so if mod was constantly killing nukers and game was constantly spawning them then it would hit performance
person creating such mod would first have to remove the code which spams those tunnel nukers and then make code to kill them


You can use "mob controller" mod tho
it has mob despawner mode, you will just choose it to constantly despawn all nukers that spawn
Octalgenesis 28 Dec, 2019 @ 5:21am 
in a seperate mod of course
Octalgenesis 28 Dec, 2019 @ 5:21am 
would be nice if you could also remove those bombers
Octalgenesis 28 Dec, 2019 @ 5:21am 
ok thank you for a quick response
Wariat117  [author] 28 Dec, 2019 @ 5:19am 
it was always working and removing mynocks which were spawning inside of room

Stinosko was just talking about situations where someone builds room over mynocked conveyors or about situation where someone breaks their own room, mynocks spawn, someone repairs room

mod wasn't removing the mynocks that spawned outside of room because in those situations the person responsible for this stuff could simply... kill mynocks or break conveyors and rebuild them

I have added the code which Stinosko proposed since it doesn't change the effect of mod.
if it removes those mynocks which spawned outside of room and were roomed later then it's just a bonus
Octalgenesis 28 Dec, 2019 @ 4:53am 
so, is it working?
Stinosko 21 Dec, 2019 @ 2:52pm 
My mod gonna go with if room is heated/cooled correctly, mynock wont spawn on normal/trivial mode but on hard mobs they still spawn but the normal delay :-)
Stinosko 21 Dec, 2019 @ 2:49pm 
¯\_(ツ)_/¯
Wariat117  [author] 21 Dec, 2019 @ 2:32pm 
I totally don't get it o-o
This code shouldn't have any effect different than the original code
Even if there was code I didn't see for hp or dead state or cached check segment it would trigger my code anyway

but well... if it works... then it works, screw the logic :D
Stinosko 21 Dec, 2019 @ 2:04pm 
I tested it on the skyisland mutator, placed a unfinished room at first island waited to at least 2 mynock on the belts than finished the room and see what happened => original code they just continued eating from belt,my adjustment and they both died "instantly" with no more eating :-)
Stinosko 21 Dec, 2019 @ 1:56pm 
[HarmonyPatch(typeof(HiveMob), "MobUpdate")]
internal class NoMynockInRoom
{

private static void Prefix(ref HiveMob __instance)
{
while (__instance.CachedCheckSegment == null)
{
Segment segment = WorldScript.instance.GetSegment(__instance.mnX - (long)((int)__instance.mUp.x), __instance.mnY - (long)((int)__instance.mUp.y), __instance.mnZ - (long)((int)__instance.mUp.z));
__instance.CachedCheckSegment = segment;
if (__instance.CachedCheckSegment != null && __instance.mUp != Vector3.zero && __instance.CachedCheckSegment.SearchEntity(__instance.mnX - (long)((int)__instance.mUp.x), __instance.mnY - (long)((int)__instance.mUp.y), __instance.mnZ - (long)((int)__instance.mUp.z)).mnRoomID != -1)
{
__instance.mrSleep = 30f;
__instance.mnHealth = -1;
MobManager.instance.DestroyMob(__instance);
}
}
}
}
Wariat117  [author] 21 Dec, 2019 @ 12:41pm 
also how do you test it?
waiting for mynock to spawn is huge pain in the butt ;-;
and on top of that he is supposed to spawn in this one specific room

this mod doesn't remove mynocks spawned by mob controller saying just in case (compatibility between mods)
Wariat117  [author] 21 Dec, 2019 @ 12:37pm 
could you copy paste your whole code :D?
since I can't believe I would like to see it myself
Wariat117  [author] 21 Dec, 2019 @ 12:32pm 
from the code side it's literally impossible
there had to be other change too
or maybe you placed the -1 code in other place than the destroy code

anyway... could you check if your code kills normal mynocks? those outside or rooms?


I will add the -1 code next to destroy code, but I really don't believe it will make any change
Stinosko 21 Dec, 2019 @ 11:47am 
In my test MobManager.instance.DestroyMob(__instance); doesn't kill a mynock that already existed on belt that gets roomed but set the health to -1 worked ...
Wariat117  [author] 21 Dec, 2019 @ 8:37am 
welp -> that's actually how it is supposed to work
since someone breaks their own room they can break the conveyor with mynocks too

if you feel like you need something for that break your own room thingie then feel free to make mod for that



also the
__istance.mbhealth = -1
wouldn't kill the mynock in such situation (not to mention I have used this one in the past but removed it due the fact that mynocks are able to eat resources before they die if this is used)

you have probably removed the
while (__instance.CachedCheckSegment == null)
or some other if
Stinosko 21 Dec, 2019 @ 4:53am 
Once you break a room, mynock spawn, room gets rebuild, mynock spawned doesn't get killed with the current version 😊
Wariat117  [author] 21 Dec, 2019 @ 1:17am 
You talk about situation where belt walks into a room o-o?

Also mod is supposed to kill on first mod update because of the
while (__instance.CachedCheckSegment == null)
once you remove that the mod will check all mynocks constantly to see if they are in room
theoretically if there were maany mynocks spamming that code it could hit a performance a little

if the "while" is there then in checks once, at the spawn
Stinosko 20 Dec, 2019 @ 2:28pm 
If mynock is on a belt, the belt gets ibsude a room, the mynock doesn't get killed on next mobupdate.
I changed the statement from
MobManager.instance.DestroyMob(__instance)
Into:
__istance.mbhealth = -1

And the mob get killed once the belt with mynock gets insode a room 😊
Wariat117  [author] 20 Dec, 2019 @ 11:52am 
it wouldn't change anything tho o-o

In the original code there is:
if (this.mnHealth <= 0)
{
MobManager.instance.DestroyMob(this);
this.SetNewState(HiveMob.State.Dead);
return;
}

Basically it will do the same as my
mobcontroller.istance.DestroyMob(__instance)
the only difference is that this.SetNewState(HiveMob.State.Dead); it is added to the code


Also you talk about fix... is there anything wrong in mod rn?
Stinosko 20 Dec, 2019 @ 7:46am 
I started modding too and found how to kill all mynock in new created room => set their healt to -1
__istance.mbhealth = -1
Add that before the mobcontroller.istance.DestroyMob(__instance)

I'm gonna try to make a more advanced mynock room mod but think this fix is also relevant to you :-)
Wariat117  [author] 16 May, 2019 @ 12:02pm 
Oki, no more tests needed.
It seems I have forgot to set no bodies mod into "server-only"
And for super beacon I have found multiplayer code :D

Soon I will upload it.
Wariat117  [author] 15 May, 2019 @ 1:32pm 
oki, in case of worms the assumption might be right
in case of super beacon, the mod isn't server-only, but I haven't seen any code for despawning items on multi, I wonder if singleplayer code will do
Stinosko 15 May, 2019 @ 12:25pm 
I tested the mynock in room => yes it neede to be running on both sides...

Others i need to test later but i assume it will be the same
Wariat117  [author] 11 May, 2019 @ 2:15pm 
oki, now I wonder if other mods got the same problem now ;-;

tomorrow once you start test, could you try those 2 mods too?
https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=1736690787
https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=1726867359

no bodies mod -> check if player bodies dissapear after death (jet turbine doesn't drop bodies so it's better to die from fall dmg) and if worm bodies (and their dirt) stays after their death, "mob controller" should help with this one (spawn worms -> let turrets do the job)
https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=1655118516

super beacon -> set it's delay to 30+ and when it starts waiting destroy random blocks/plants in as many segments as you can and once machine collects them check if blocks dissapeared from the ground or if they actually stayed but they are frozen and you can't pick up them (normal blocks move around when they lay on the ground)
Stinosko 11 May, 2019 @ 2:09pm 
Will be for tomorrow ;-)
Wariat117  [author] 11 May, 2019 @ 2:02pm 
it's 1 of the possibilities, when I checked the code I have found out that I have used general code which affects both MP and SP

digging deeper in the function I have used there is this:
if (NetworkManager.mbHostingServer)
{
NetworkManager.instance.mServerThread.mMobDeletions.Enqueue(mob);
}

but because mod is server-only... the client doesn't load the code, unless dedicated server for whatever reason doesn't mark itself as "hosting" o_O


Could you try to mark mod as non server-only (both on client and dedicated) and then see what happens?
Stinosko 11 May, 2019 @ 1:56pm 
Ooooh server-only might be the issue ;-)
Wariat117  [author] 11 May, 2019 @ 1:41pm 
hmmm
probably there is separate class to despawn something on multi and separate to despawn on single, I have seen sometimes network queue in random locations, maybe that's it ;D?
or the fact that mod is server-only
Stinosko 11 May, 2019 @ 1:26pm 
Visual glitch on the server => you still see mynock spawn on the belts in room but they don't eat anything and rejoining the server removes them => probably a desync from server and client.

I think this is not easy fixable and not worth the time. Just letting you know :-)
Stinosko 7 May, 2019 @ 12:35pm 
Hahahhahahaha nice video :-D
Wariat117  [author] 7 May, 2019 @ 12:32pm 
probably dev tried some performance stuff or something?
the spiderbot bug started in the P24, probably tunnel nukers too

I have messed with tunnel nukers on normal world... and on normal worlds there is over 2x less tunnel nukers o-O
and the tunnel nukers on normal worlds don't despawn because of null segments ;d
Now I wonder what causes nulling of segment for tunnel nukers... in case of robot it's the fact that he can't keep segments loaded and when player moves away (or anything that provides segments) then he flies up





and... for whatever reason while trying to find out why tunnel nukers don't work I have had feeling that I should listen to this
https://www.youtube.com/watch?v=xUlJ_6WHfh8
Wariat117  [author] 7 May, 2019 @ 11:52am 
overminds don't spawn instantly ;d they are just decorations , their existence isn't needed for anything (wasps and tunnel nukers spawn if there is no overmind too) in order to keep performance, they spawn later in the game, the worse your performance the later they spawn

I'm testing on P24
it seems that tunnel nukers die of the same as spiderbot is flying away... they hit null segments
Stinosko 7 May, 2019 @ 11:50am 
Never mind the overminds spawned after 2h :D
Stinosko 7 May, 2019 @ 11:47am 
i had folow topic enabled for p25 => i thought there would be more drama in the comments ;-)
Stinosko 7 May, 2019 @ 11:46am 
Hmmmm on p24 i had overminds or do you mean on p25 they don't spawn? :/
Wariat117  [author] 7 May, 2019 @ 11:35am 
erm... exactly the same thing happens for me in the unmodded sky islands o-o
tunnel nukers just spawn and die instantly
Wariat117  [author] 7 May, 2019 @ 11:25am 
they just blow in the middle of air o-O wtf
Wariat117  [author] 7 May, 2019 @ 10:52am 
I'm downloading back the P24 ;D
I'm also going to watch one anime, after I end I will visit overminds on my world to see what happens to them
Wariat117  [author] 7 May, 2019 @ 10:48am 
'I meant thet the game could be played in linux"
Well that was always the thing :D dev just refused to release any betas for it

I have posted the info about mynocks, we will see if he ignores it :V
https://gtm.steamproxy.vip/app/254200/discussions/0/1648791520838868812/#c1648791520854939208

"I think i got a issue with extend skyblock mod => overloard are not able to spawn ingame they release infinte amount of tnnulnukes that die on spawn...."
The sky islands rework could cause this (it spawns large rocks and glowtubes and those are able to block nukers)
No idea how expand mod could cause this o-O
Unless overminds spawned somewhere underground and they try to blow their way throught rocks
Stinosko 7 May, 2019 @ 10:40am 
I meant thet the game could be played in linux, support for beta's in lunix, i have no clue when that started...
I think i got a issue with extend skyblock mod => overloard are not able to spawn ingame they release infinte amount of tnnulnukes that die on spawn....
Wariat117  [author] 7 May, 2019 @ 10:33am 
nvm... didn't notice single " } " (it marks where code ends)
The code for "-2147483648" is on all modes, not sky islands, sky islands has only 10k+
Wariat117  [author] 7 May, 2019 @ 10:30am 
1. You mean linux supports betas since you play? or that the game works on linux since you play? (I'm talking about the first one, dev refused to add betas to linux/mac, the mainline version had linux/mac releases tho)

2. just downloaded p25... and the code says "if sky islands and Y coord is more than 10k or less than -2147483648, then don't spawn mynocks"
he fucked up something rly bad o-O How is -2147483648 even close to 32?
Stinosko 7 May, 2019 @ 10:27am 
Linux got support for at least scince i started to play (6 months) ;-)
Wariat117  [author] 7 May, 2019 @ 10:25am 
woah, surprise, he finally noticed linux players :D
now it's time for mac too
Stinosko 7 May, 2019 @ 10:22am 
He made the build for linux on purpose, you can find all possible betas of the headles server here: https://steamdb.info/app/443600/depots/
I can join the game :-D
Wariat117  [author] 7 May, 2019 @ 10:16am 
Dev opened the way or someone found out the hole?
I wonder if it's even compatible :D
Stinosko 7 May, 2019 @ 10:06am 
You can play p25 on headless server ;-)
steamcmd.sh +login anonymous +force_install_dir INSTALLPATH +app_update 443600 -beta linux-staging validate +quit