:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::

Do you want to advertise at Project Perfect Mod. Find out how to do it HERE.

The time now is Fri Oct 22, 2021 1:10 pm
All times are UTC + 0
 Forum index » Modding Central » Red Alert 2 Editing Forum » Mapping Discussion
Tricks to reducing Lag on a RA2 mission map?
Moderators: Global Moderators, Red Alert 2 Moderators
Post new topic   Reply to topic Page 1 of 1 [7 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
MadHQ
Commander


Joined: 07 Nov 2003

PostPosted: Sun Aug 15, 2021 11:15 pm    Post subject:  Tricks to reducing Lag on a RA2 mission map? Reply with quote  Mark this post and the followings unread

Does any one know of any gotchas that cause lag on RA2 map? I am trying to find ways to reduce the amount of lag that a map may have. Now this may be specific to mission maps.

Does disabling triggers that are enabled after X amount of time help?

Does it hurt if I have a serious of timers that happen in a sequence such as 50, 100, 200, 300, ext...? Would it help if I start just the 1st one, then once that one fires, enable the next. Does any one know if some thing like that may help? I wonder how insignificant the timers are?

I had seen at one point Overlay such as wall/fences hurt performance, is there any thing that can be done besides removing wall/fences?
_________________
MadHQ's Graveyard - Click here!
(Permissions) - (F.A.Q.)

Back to top
View user's profile Send private message Skype Account
G-E
General


Joined: 09 Feb 2015

PostPosted: Mon Aug 16, 2021 12:36 am    Post subject: Reply with quote  Mark this post and the followings unread

Lag is primarily the AI figuring out pathing or targeting. I don't know how much you have going on, but I don't think it has to do with triggers, unless you're causing some unresolvable condition like attack a structure it can't reach.
_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
E1 Elite
Commander


Joined: 28 May 2013

PostPosted: Mon Aug 16, 2021 1:51 am    Post subject: Reply with quote  Mark this post and the followings unread

Patrol to .. scripts cause lag, avoid those.

Big SHP animation or plenty of those can also cause lag. Civilians sent to grinder mission (I think YR 2nd mission) used to cause terrible lag on my 1999 pc.

Back to top
View user's profile Send private message
MadHQ
Commander


Joined: 07 Nov 2003

PostPosted: Mon Aug 16, 2021 3:38 am    Post subject: Reply with quote  Mark this post and the followings unread

E1 Elite wrote:
Patrol to .. scripts cause lag, avoid those.


I tested this real quick... Wow... That was a game changer! I use Patrol to for almost every way-point transition... I am working on reworking Soviet mission 11 and I was seeing quite a bit of lag... I had almost every way-point transition set to patrol to... Then set everything to move to, there was a difference. I may want to set some back... maybe... but I am not sure its needed? It maybe fine just to leave them at move to.

What other things like that are there? What about stuff like move to building for defense, or gather at enemy?

I am looking for anything.

One of my plans is to fix some of the performance issues in the Allied rework campaign I did. I know mission 12 is rough... I think I had allot of patrol to, so I can target that 1st.
_________________
MadHQ's Graveyard - Click here!
(Permissions) - (F.A.Q.)

Back to top
View user's profile Send private message Skype Account
MadHQ
Commander


Joined: 07 Nov 2003

PostPosted: Mon Aug 16, 2021 4:02 am    Post subject: Reply with quote  Mark this post and the followings unread

What about the attack in a script?

If I have a script:
attack:
defense
vehicle
infantry
harvesters
anything

How does that work? does it collect all of them? or does it go through them sequentially? What is the best way to handle that?
_________________
MadHQ's Graveyard - Click here!
(Permissions) - (F.A.Q.)

Back to top
View user's profile Send private message Skype Account
E1 Elite
Commander


Joined: 28 May 2013

PostPosted: Mon Aug 16, 2021 4:53 am    Post subject: Reply with quote  Mark this post and the followings unread

That attack script goes to next after finishing the current action. Like attack vehicles will repeatedly attack every unit one by one until all are destroyed and then go to next attack type. Those are not problems for performance. If you want to target harvesters, use it before vehicles in your example above.

Move to and Gather at scripts with Aggressive=yes in teamtype is similar to patrol but doesn't cause lag. But it has a problem when engaging enemy. It forgets current move to action and next script action is executed. So you have to give duplicate/multiple move to actions in your script. Like

[ScriptID]
0=3,10
1=3,10
2=3,10

This way, even if the team engages enemy 2 times, it will still reach the destination waypoint.

Only Patrol to .. scripts have performance problems, so no need to worry about other scripts.

Lot of stuff happens at map load time, so use Elapsed time with some duration (like 1,13,0,2) instead of Any event (1,8,0,0) for map start events.

Big SHP anims (plenty in number), particle system having lot of particles (smoke etc.), light changes like lot of lamps on the map etc. cause performance issues.

Problems like too many building in small area get solved by the backbuffer patch or Graphics patch by AlexB or some DDraw renderer replacements.

Back to top
View user's profile Send private message
SteamsDev
Soldier


Joined: 12 Mar 2017

PostPosted: Sat Sep 25, 2021 3:03 am    Post subject: Reply with quote  Mark this post and the followings unread

MadHQ wrote:
E1 Elite wrote:
Patrol to .. scripts cause lag, avoid those.


I tested this real quick... Wow... That was a game changer! I use Patrol to for almost every way-point transition... I am working on reworking Soviet mission 11 and I was seeing quite a bit of lag... I had almost every way-point transition set to patrol to... Then set everything to move to, there was a difference. I may want to set some back... maybe... but I am not sure its needed? It maybe fine just to leave them at move to.

What other things like that are there? What about stuff like move to building for defense, or gather at enemy?

I am looking for anything.

One of my plans is to fix some of the performance issues in the Allied rework campaign I did. I know mission 12 is rough... I think I had allot of patrol to, so I can target that 1st.


For context, the only difference between Move to.. and Patrol to.. is that a Patrol to.. loop means that anything in the task force will attack any enemies near it. Frankly it's unnecessary since they are programed to return fire regardless of their movement.

Also, love you maps MadHQ. Thought I'd say that Wink
_________________
"I'm grade-A, 100%, prime-cut final boss! I'm going to take over the world any day now!"
-Bowser, Super Paper Mario

Official scripting leader of BR Studios
Check out our ModDB: http://www.moddb.com/company/progen-group
Yuri's Revenge: CnCD2K: http://www.moddb.com/mods/red-alert-2-yuris-revenge-cncd2k-mod

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [7 Posts] Mark the topic unread ::  View previous topic :: View next topic
 Forum index » Modding Central » Red Alert 2 Editing Forum » Mapping Discussion
Jump to:  
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1675s ][ Queries: 11 (0.0073s) ][ Debug on ]