Slaughter Map Performance Booster

Post your example zscripts/ACS scripts/etc here.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
User avatar
Rachael
Admin
Posts: 12895
Joined: Tue Jan 13, 2004 1:31 pm
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Preferred Pronouns: She/Her

Slaughter Map Performance Booster

Post by Rachael »

Slaughter Map Performance Booster

Image

The idea is simple - this prevents monsters from running tics too often when they are out of range. Instead of doing their A_Look/A_Chase calls every tic, they do it every X tics (as you define in the menu), if they are too far out of range to really matter. The result is a huge boost in FPS (particularly with heavy slaughter maps like Sunder MAP11).

Yes - you may use this in projects - just keep in mind I have not tested what happens if someone else happens to do so too.

There is a menu for fine tuning.

Special thanks to everyone who's ever written ZScript wikis and tutorials over the years, and particularly to Ed the Bat who helped me figure out the compiler errors while I was making this.

Depending on how you set the settings - this *will* affect how maps play - monsters that are slowed and out of range are significantly less aggressive - this can affect maps that abuse chaingunners, for example, for long-range LOS punishment. (i.e. Plutonia maps) - there's an option to help mitigate this but it does not ultimately fix it - the behavior of slowed monsters will inevitably be changed no matter what.

Repo: https://github.com/madame-rachelle/Slau ... nceBooster

Download: https://github.com/madame-rachelle/Slau ... b-v1.0.pk3
User avatar
Nash
 
 
Posts: 17283
Joined: Mon Oct 27, 2003 12:07 am
Twitch ID: nashmuhandes
Github ID: nashmuhandes
Location: Kuala Lumpur, Malaysia

Re: Slaughter Map Performance Booster

Post by Nash »

Definitely saving this one for my reference. :) Thanks!
User avatar
Marisa the Magician
 
 
Posts: 3804
Joined: Fri Feb 08, 2008 9:15 am
Discord: Marisa the Magician#1666
Twitch ID: MarisaDOOM
Github ID: OrdinaryMagician
Preferred Pronouns: She/Her
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia

Re: Slaughter Map Performance Booster

Post by Marisa the Magician »

As a "good scripting practice" recommendation there I'd suggest that you cache the thinker iterator and re-init it, instead of re-creating it every tic. This is going to thrash the GC otherwise.
User avatar
Rachael
Admin
Posts: 12895
Joined: Tue Jan 13, 2004 1:31 pm
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Preferred Pronouns: She/Her

Re: Slaughter Map Performance Booster

Post by Rachael »

Thank you - it is actually quite rare that anyone gives me helpful feedback like this on one of my scripting projects. :) I appreciate it.
User avatar
Rachael
Admin
Posts: 12895
Joined: Tue Jan 13, 2004 1:31 pm
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Preferred Pronouns: She/Her

Re: Slaughter Map Performance Booster

Post by Rachael »

Haven't touched it for almost 24 hours, it's probably stable enough for a v1.0 release. It's a fairly lightweight project anyway.
User avatar
Redneckerz
Spotlight Team
Posts: 970
Joined: Mon Nov 25, 2019 8:54 am
Discord: Redneckerz#8399
Graphics Processor: Intel (Modern GZDoom)

Re: Slaughter Map Performance Booster

Post by Redneckerz »

A reason why the best ideas are simple by heart - Sadly i am not techncially proficient enough to provide meaningful feedback, but this is very beneficial.

Consider this looks at monster count and not line count, question: Would Planisphere 2 or The Given be benefitted from this? Both maps are use a ton of lines to cause their slowdowns, but,afaik, Planisphere 2 also has quite a lot of monsters. I figure the performance boost will be less.
User avatar
Caligari87
User Accounts Assistant
Posts: 5994
Joined: Thu Feb 26, 2004 3:02 pm
Discord: Caligari87#3089
Github ID: caligari87
Preferred Pronouns: He/Him

Re: Slaughter Map Performance Booster

Post by Caligari87 »

Only thing to do is test. Some maps the slowdowns come from monsters, some maps from geometry, some maps it comes from both.

This improves performance by reducing the tic rate for monsters far away from the player. It won't do anything to help with slowdowns related to map geometry processing.

8-)
User avatar
Rachael
Admin
Posts: 12895
Joined: Tue Jan 13, 2004 1:31 pm
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Preferred Pronouns: She/Her

Re: Slaughter Map Performance Booster

Post by Rachael »

It also has menu tweaks available too. If the map is giant and has a lot of wide open spaces then you'll want to widen the radius from which monsters get slowed - if the map has a lot of twisty turny corners you can get away with bringing that down without having a noticeable affect on gameplay and that will have a bigger boost.

Also Cali is right - this will do nothing if the slowdown problems are related to map geometry or other rendering issues.

Admittedly my supply of slow computers to test this on is fairly slim. I tested this on my somewhat modern and decently performant computer and was able to push some of Sunder's worst maps from being playable to feeling smooth. This computer simply doesn't choke on Sunder's maps even without this addon - I've tried. So, I don't know exactly every way how this will affect slower computers.

If there's a better map set to test (that is *NOT* Nuts.wad) - I would be happy to give this a shot. Anything with between 5,000 to 20,000 is a good candidate.

I haven't tried Speed of Doom yet with this mod, so I will give that one a shot.
edit: Turns out that while SOD has slaughter maps, they aren't in the counts Sunder was. The map with the biggest monster population was MAP28 which totaled at nearly 3k, not enough to slow down my computer.
User avatar
Delfino Furioso
Posts: 61
Joined: Sat Mar 27, 2021 3:21 pm

Re: Slaughter Map Performance Booster

Post by Delfino Furioso »

what are your specs?
User avatar
kalensar
Posts: 368
Joined: Sun Mar 21, 2021 9:40 pm

Re: Slaughter Map Performance Booster

Post by kalensar »

I tested this on Planisphere 2 on GZD 4.8.2 and its a mixed review mainly for that map. The Good News is yes it does work, but the bad news is that a lot of it it is from map geometry for a lag. To get the most amount of smoothness I had to use Polysoft render or GLES using Doom Software render, using Lowest Possible Scale setting, and a scale factor of 0.25, VSync on but render interpolation turned off.

But Yes, SMPB does have a noticeable and working effect when comparing it with or without the mod.

Heres the machine specs roughly speaking

Code: Select all

CPU:       Topology: Dual Core model: AMD E1-1200 APU with Radeon HD Graphics bits: 64 type: MCP 
           arch: Bobcat L2 cache: 512 KiB 
           flags: lm nx pae sse sse2 sse3 sse4a ssse3 svm bogomips: 5590 
           Speed: 825 MHz min/max: 777/1400 MHz Core speeds (MHz): 1: 1032 2: 880 
Graphics:  Device-1: AMD Wrestler [Radeon HD 7310] vendor: Acer Incorporated ALI driver: radeon 
           v: kernel bus ID: 00:01.0 chip ID: 1002:9809 
           Display: x11 server: X.Org 1.20.13 driver: ati,radeon unloaded: fbdev,modesetting,vesa 
           resolution: 1600x900~60Hz 
           OpenGL: renderer: AMD PALM (DRM 2.50.0 / 5.4.0-109-generic LLVM 12.0.0) 
           v: 3.3 Mesa 21.2.6 compat-v: 3.1 direct render: Yes 
Audio:     Device-1: AMD Wrestler HDMI Audio vendor: Acer Incorporated ALI driver: snd_hda_intel 
           v: kernel bus ID: 00:01.1 chip ID: 1002:1314
User avatar
Rachael
Admin
Posts: 12895
Joined: Tue Jan 13, 2004 1:31 pm
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Preferred Pronouns: She/Her

Re: Slaughter Map Performance Booster

Post by Rachael »

Tried with SF2012 on MAP27 with 10k monsters - still couldn't get it to choke.
Then tried SF2011 on MAP30 with 15k monsters - finally managed to get my system down to 3 FPS.

There was a huge boost enabling the mod after that, went up to about 64 FPS or so with the mod enabled.
Delfino Furioso wrote:what are your specs?
My specs are AMD Ryzen 7 3800X Octa-core @ 3.89 GHz, with 32 gb ram, nvidia gtx 1650.


kalensar wrote:But Yes, SMPB does have a noticeable and working effect when comparing it with or without the mod.
Thank you - this is what I was hoping for. :)
thugsta
Posts: 126
Joined: Mon Jan 21, 2019 10:10 am

Re: Slaughter Map Performance Booster

Post by thugsta »

This is fantastic. Any chance you can make this work on LZDoom also? It seems to almost work as is, other then a thinker error on death
User avatar
stainedofmind
Posts: 31
Joined: Sun Sep 01, 2019 10:59 am

Re: Slaughter Map Performance Booster

Post by stainedofmind »

Not at my computer right now, so I dont have the exact error message, but I ran into an issue with this and maps that use the SpecialSpot actors, specifically when reloading a saved game, gzdoom crashes quoting a line in the gzdoom.pk3. It can be reproduced by loading up Doom 2 and heading to map 30 and saving. When you try to load the save, it starts throwing errors. What baffles me is why its happening, as I don't see anything in the code that would cause it to happen. If you need the exact error, I'll post it next time I'm at my computer. For reference on how I ran into this problem, I was playing map with all of Doom 2s levels mashed into a single map, with a bunch of gameplay mods that really slowed things down, and this mod helped a lot, but when I reloaded my save, the error popped up.

Return to “Script Library”