Need optimisation tips

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
User avatar
Dan_The_Noob
Posts: 738
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support

Need optimisation tips

Post by Dan_The_Noob »

I have an imp in Intensify where it's main job is to create a mist/fog cloud as it moves to disrupt vision.
currently, if there are more than maybe 5 or 6 the game begins to lag for obvious reasons.
just wondering if there is a zandronum-friendly solution to spawning either larger or more efficient particles that could obscure vision

currently most of the code consists of one spawn line spammed throughout all its actions.

Code: Select all

TROI A 0 A_SpawnItemEx("FrostMist", random(-8,8), random(-8,8), random(16,48), random(-2, 2), random(-2, 2), random(-1, 1),0,128)
(also, is imgur embeds broken?)
[imgur]https://imgur.com/a/BJX2p67[/imgur]
User avatar
difficultoldstuff
Posts: 35
Joined: Fri Jul 17, 2020 5:38 am
Operating System Version (Optional): Windows 7
Graphics Processor: nVidia with Vulkan support

Re: Need optimisation tips

Post by difficultoldstuff »

Hey there!

I'd love to help out with optimizing (FX in Doom can get quite heavy sometimes, trust me, I know how to bring it to its knees!), but it would really be useful if you'd post a bit more: how often is this action used? What is the FrostMist class exactly (flags, renderstyle, animation, anything)?

Feed me code, I might think about stuff!
User avatar
Dan_The_Noob
Posts: 738
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support

Re: Need optimisation tips

Post by Dan_The_Noob »

difficultoldstuff wrote: Thu Dec 08, 2022 6:55 pm Hey there!

I'd love to help out with optimizing (FX in Doom can get quite heavy sometimes, trust me, I know how to bring it to its knees!), but it would really be useful if you'd post a bit more: how often is this action used? What is the FrostMist class exactly (flags, renderstyle, animation, anything)?

Feed me code, I might think about stuff!
all very good questions, I also have no idea the answers.
here is the mod, it's the "FrozenImp" i'm sure all the info is in there. (the whole mod is a damned mess, but i am leaving organising it for now.
viewtopic.php?f=43&t=65815&p=1117755
User avatar
difficultoldstuff
Posts: 35
Joined: Fri Jul 17, 2020 5:38 am
Operating System Version (Optional): Windows 7
Graphics Processor: nVidia with Vulkan support

Re: Need optimisation tips

Post by difficultoldstuff »

OK, thanks for sharing! Well, I checked it out a tiny bit and it seems that spawning 24 "FrostMist" objects each 4 frames, which considering they all got probably some transparency (possible "add" type) will kill the performance like that. Can't find the "FrostMist" class itself, but one way of optimizing it is to create a bigger combined sprite and spawning less of them in one go, possibly with different variance states for more unique look.
User avatar
Dan_The_Noob
Posts: 738
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support

Re: Need optimisation tips

Post by Dan_The_Noob »

yeah im thinking maybe changing it to spit out an effect similar to the smokebombs in Corruption Cards every second or so. that linger for 2-3 seconds.

Return to “Scripting”