Do Spawned Monsters On Other Levels Impact Performance?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
fazzasx
Posts: 104
Joined: Mon May 27, 2013 12:35 am

Do Spawned Monsters On Other Levels Impact Performance?

Post by fazzasx »

Hi There Everyone,

I hope your all having a good Friday evening :)

I wanted to ask about having pre-loaded or pre-placed monsters on other floors.

I can see that if they are not set to 'Guard' that they start to roam about. I wanted to know if having them spawned on other levels impacts the performance of the game?

I have been mostly using pressure plates to spawn them as the party approaches, but I am now thinking it might be quite uncessary depending on how the game engine works?

Please do let me know if you can, this has been a question in my head for some time! :)
Zastaph
minmay
Posts: 2768
Joined: Mon Sep 23, 2013 2:24 am

Re: Do Spawned Monsters On Other Levels Impact Performance?

Post by minmay »

As far as CPU usage, only a little. In Grimrock 1, there were always 3 levels updated every frame: the current level, either the level above or the level below (alternating each frame), and one of the other levels (cycling through each frame). I assume Grimrock 2 is similar, though probably not the same since it has a 3-dimensional level layout rather than a 1-dimensional one. So off-level updates are generally not a performance problem, unless you have a level with really wacky stuff going on.
Memory usage is similarly low until the level is actually visited and the models appear.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
fazzasx
Posts: 104
Joined: Mon May 27, 2013 12:35 am

Re: Do Spawned Monsters On Other Levels Impact Performance?

Post by fazzasx »

minmay wrote:As far as CPU usage, only a little. In Grimrock 1, there were always 3 levels updated every frame: the current level, either the level above or the level below (alternating each frame), and one of the other levels (cycling through each frame). I assume Grimrock 2 is similar, though probably not the same since it has a 3-dimensional level layout rather than a 1-dimensional one. So off-level updates are generally not a performance problem, unless you have a level with really wacky stuff going on.
Memory usage is similarly low until the level is actually visited and the models appear.

Thanks for this minmay, I will in that case have them spawned on demand then :)
Zastaph
minmay
Posts: 2768
Joined: Mon Sep 23, 2013 2:24 am

Re: Do Spawned Monsters On Other Levels Impact Performance?

Post by minmay »

It's fine to place monsters normally in the editor unless your mod is extremely demanding. Isle of Nex pre-places about 700 monsters!
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
trancelistic
Posts: 275
Joined: Sat Jun 16, 2012 5:32 am

Re: Do Spawned Monsters On Other Levels Impact Performance?

Post by trancelistic »

This week I've finaly saw Master quest from Komag. I noticed that he placed some monsters somewhere and then teleport them to the location it supoose to spawn, like from a normal spawner.

What is the benefit of this?

I am asking this because my question is related to this topic; Can to many spawners also affect/infect your MOD?.
I have some spawners, even set to 9999 sec cooldown, it still spams the spawn like .. when ever it can.
( Log 1 btw. not Log 2)
minmay
Posts: 2768
Joined: Mon Sep 23, 2013 2:24 am

Re: Do Spawned Monsters On Other Levels Impact Performance?

Post by minmay »

trancelistic wrote:This week I've finaly saw Master quest from Komag. I noticed that he placed some monsters somewhere and then teleport them to the location it supoose to spawn, like from a normal spawner.

What is the benefit of this?
The only real benefit is that the monster models/lights get initialized when the level is entered, and therefore can't cause a performance dip later when they're "spawned" (actually just teleported). If you try spawning many monsters on one frame, particularly if they have lights attached to them, you might end up with a frame that takes longer than usual (if the game is running at 60 FPS and then you have one frame that takes 100ms because of monster spawns, it's very noticeable).
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
trancelistic
Posts: 275
Joined: Sat Jun 16, 2012 5:32 am

Re: Do Spawned Monsters On Other Levels Impact Performance?

Post by trancelistic »

Thanks for the feedback Minmay.

So, its safe to say that normal spawners who spawn default monsters do not effect the gameplay or the game act "nuts" short said.

"Nuts as in": I still wonder then, why spanwers, who spam a quick monster, go into an endless loop. It just keeps spawning it.
I've removed the spanwer and all triggers to it. Then replaced all again. It still does it:(
No 1 wants a dungeon with 10000 monsters at some point lol.
User avatar
THOM
Posts: 1266
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Do Spawned Monsters On Other Levels Impact Performance?

Post by THOM »

Sometimes it is also more easy to teleport a monster than spawning it. In egsample if you want to have a monster apart from a standard version (with loot, other lifepoints, different level...).

Concerning you 10.000 Monster Spawner I am pretty sure, that ther must be a problem with your mechanic. Maybe you can post the complete code/structure?
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
trancelistic
Posts: 275
Joined: Sat Jun 16, 2012 5:32 am

Re: Do Spawned Monsters On Other Levels Impact Performance?

Post by trancelistic »

THOM wrote:Sometimes it is also more easy to teleport a monster than spawning it. In egsample if you want to have a monster apart from a standard version (with loot, other lifepoints, different level...).

Concerning you 10.000 Monster Spawner I am pretty sure, that ther must be a problem with your mechanic. Maybe you can post the complete code/structure?
Thanks Thom for your intrest.

It ( those spanwers) do not trigger any speical monster with any effects or a lootable item.

Its only a pressure plate ( when leaving the level) connected to 2 spanwers. The spawns has a cooldown over 300 sec ( so its way slower if your party left the level even)

Yet I go back up., yeah..... Monsters all over the place.


Edit: I noticed if My party doesn't hit the pressure plate but go upper floors using a shortcut stairs. They still spawn..
minmay
Posts: 2768
Joined: Mon Sep 23, 2013 2:24 am

Re: Do Spawned Monsters On Other Levels Impact Performance?

Post by minmay »

search your dungeon.lua for any other connectors to those spawners' ids
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Post Reply