AdrianeMapMaker
7 years ago
well i am trying to minimize the lag of my map , i see some scripts that could help me
but i need more scripts.

did you know any scripts that could help to reduce lag except from the hulk override time?

anyways what are this scripts
[from Map/Environment]
infantry lighting reset
infantry lighting set

[from Map/Modify]
resize view guardband

[from UNUSED/Camera/Modify]
final visual game time for camera movement

[from UNUSED/Camera/Move/Modify]
Number of frames to average movement
A part of ZH worldbuilders map making community
https://discord.gg/tJ6zyGb 

UserPostedImage




Sponsor
SkyMix_RMT
7 years ago
In what map are you experiencing lag? In my experience, particle count and AI pathfinding are number 1 cause of lag 99% of the time.
Check out:
My Music  (Techno/House/Experimental)
My Website  (GeneralsCentral)
My Youtube Channel  (Inactive)
World Builder Community Discord 
Unknown Editor
7 years ago
infantry lighting set

No Performance influence : Used to make infantry look Bright or Dark in the map , For example 0 makes Infantry look All Black .

infantry lighting reset : Makes the Infantry look their Default brightness depending on the time of map .

Others : Have not Exprienced yet XD
Asking is Not a Problem , Problem is Not to Know Something .
Operation : Dark Angel
Static : Launch Delayed
Reason : Uncool Terrain - Old Logic in use - Lack of Performance
Status : Applying new Terrain - Applying new Logic - Increasing Performance by 300%
acidbrain
7 years ago
One of the main reasons of lag in scripting is wrong use of subroutines, if you use a subroutine as generic it has to be a pulse...

***IF***
True
***THEN***
This team starts hunting

If you use this script as a behavior subroutine there is nothing going on, all sweet and dandy, if you use this script as generic however you will enter a world of pain, especially if you have multiple teams running at the same time with this script, imagine all ai factions on a multiplayer map using scripts like this together, horrible.
If you use subroutines as generic you either disable them on succes and enable again when needed or use flag/counters...e.g.

***IF***
Flag 'Go hunt' is False
***THEN***
This team starts hunting
Set Flag 'Go hunt' to True
When the team stops hunting you can set flag to false again...
Hope i was a bit of help, or maybe i am full of sjit...

Cheers
Panem et kirkinses
SkyMix_RMT
7 years ago

One of the main reasons of lag in scripting is wrong use of subroutines, if you use a subroutine as generic it has to be a pulse...


***IF***
True
***THEN***
This team starts hunting

If you use this script as a behavior subroutine there is nothing going on, all sweet and dandy, if you use this script as generic however you will enter a world of pain, especially if you have multiple teams running at the same time with this script, imagine all ai factions on a multiplayer map using scripts like this together, horrible.
If you use subroutines as generic you either disable them on succes and enable again when needed or use flag/counters...e.g.

***IF***
Flag 'Go hunt' is False
***THEN***
This team starts hunting
Set Flag 'Go hunt' to True
When the team stops hunting you can set flag to false again...
Hope i was a bit of help, or maybe i am full of sjit...

Cheers

Originally Posted by: acidbrain 



I don't think you need flags. You can just check "Deactivate upon success" on generic scripts and they will work fine,
or maybe I am full of sjit...
Check out:
My Music  (Techno/House/Experimental)
My Website  (GeneralsCentral)
My Youtube Channel  (Inactive)
World Builder Community Discord 
Unknown Editor
7 years ago
You see , For subroutines we usually do not use "Deactivate upon success" , I mean How and when are you gonna activate them again ? This will go too far with failure so you might rather use a Logic I'm gonna announce soon then (I would rather announce it now but even for myself it's complicated so I want to release it with a map) ...

By the way , Always try to give the Units paths instead of HUNT ;
Path Makes CPU calculate a way to get to the first pointed waypoint and then continue as expected .
Attack makes CPU calculate a Path to go and catch an enemy .
HUNT makes CPU run a calculation every frame to find a Path and attack the NEAREST enemy possible .

Hunt is efficient in Battles much more than Attack as AI will not just follow A Specific Target and get trapped but It also costs too much in FAR Positions , Always make a unit hunt enemy on sight and if lost sight , Make it Attack . Path is no more efficient under this condition if you want an Advanced AI ...
Asking is Not a Problem , Problem is Not to Know Something .
Operation : Dark Angel
Static : Launch Delayed
Reason : Uncool Terrain - Old Logic in use - Lack of Performance
Status : Applying new Terrain - Applying new Logic - Increasing Performance by 300%
SkyMix_RMT
7 years ago

You see , For subroutines we usually do not use "Deactivate upon success" , I mean How and when are you gonna activate them again ? This will go too far with failure so you might rather use a Logic I'm gonna announce soon then

Originally Posted by: Unknown Editor 



Subroutines don't work like that. With subroutine scripts, every team gets its own copy of the subroutine script, so for example, if you had a subroutine hunt if inside area script, and you assign that script to 3 different teams, then the script will be copied 3 times, one for each team, when one of the teams enters the area, the team's copy of the script will order the team that got inside the area to hunt and then it will deactivate itself (if it didn't deactivate they would just stand still because they would be ordered to hunt every frame). Basically, when the script is successful, it will only deactivate for the team that succeeded, it will not deactivate the other team's copies.

Most of the time you only need the team to do a specific action once, obviously if you want the same team to perform a generic script multiple times you must use the flag method that acid brain explained.


By the way , Always try to give the Units paths instead of HUNT ;
Path Makes CPU calculate a way to get to the first pointed waypoint and then continue as expected .
Attack makes CPU calculate a Path to go and catch an enemy .
HUNT makes CPU run a calculation every frame to find a Path and attack the NEAREST enemy possible .

Hunt is efficient in Battles much more than Attack as AI will not just follow A Specific Target and get trapped but It also costs too much in FAR Positions , Always make a unit hunt enemy on sight and if lost sight , Make it Attack . Path is no more efficient under this condition if you want an Advanced AI ...

Originally Posted by: Unknown Editor 



Why not just not using the hunt script at all? Make the team's behavior aggressive and just order them to follow a path into the opponent's base and watch the magic happen.

Aggressive behavior-ed teams not only are more performance-efficient but also will always attack and chase the closest enemy, making it look more realistic.

I also recommend ordering the team to hunt on idle to avoid the team to stop after finishing the path without seeing an enemy.


Check out:
My Music  (Techno/House/Experimental)
My Website  (GeneralsCentral)
My Youtube Channel  (Inactive)
World Builder Community Discord 
Unknown Editor
7 years ago
Yeah , You can not be more right


I also recommend ordering the team to hunt on idle to avoid the team to stop after finishing the path without seeing an enemy.

Originally Posted by: SkyMix_RMT 



About this I have done it already , Believe me if the map is Big and Full of Obstacles like Mountains and Rivers and the opponent has relocated to somewhere faraway , For 10 Units You will Exprience LAG 😁
Asking is Not a Problem , Problem is Not to Know Something .
Operation : Dark Angel
Static : Launch Delayed
Reason : Uncool Terrain - Old Logic in use - Lack of Performance
Status : Applying new Terrain - Applying new Logic - Increasing Performance by 300%
acidbrain
7 years ago


Why not just not using the hunt script at all? Make the team's behavior aggressive and just order them to follow a path into the opponent's base and watch the magic happen.
Aggressive behavior-ed teams not only are more performance-efficient but also will always attack and chase the closest enemy, making it look more realistic.

SkyMix_RMT wrote:


If im not mistaking entering vehicles in aggresive state can cause trouble, so becareful with what teams you set aggresive


I also recommend ordering the team to hunt on idle to avoid the team to stop after finishing the path without seeing an enemy.

SkyMix_RMT wrote:


Are you aware of the 'when team is at end of waypointpath' script?
I usually give my teams a generic like this, a sub which disables after succes, used it many many times and works like a charm:

*** IF ***
Team '???' has reached the end of Waypoint Path '???'
*** OR ***
Team '???' has been attacked by Player '???'
*** THEN ***
Team '???' change their attitude to Aggressive
Team '???' begins hunting.

Cheers
Panem et kirkinses
SkyMix_RMT
7 years ago

Are you aware of the 'when team is at end of waypointpath' script?
I usually give my teams a generic like this, a sub which disables after succes, used it many many times and works like a charm:


*** IF ***
Team '???' has reached the end of Waypoint Path '???'
*** OR ***
Team '???' has been attacked by Player '???'
*** THEN ***
Team '???' change their attitude to Aggressive
Team '???' begins hunting.

Cheers

Originally Posted by: acidbrain 



I am aware of the script but I can only see drawbacks when using the method you explained.
Please correct me if I'm wrong:
- The team will only attack when it has been attacked, whereas in the method I explained the team will attack as soon as the enemy is in sight (because the team is already aggressive).
- The team will not go back to following the path if the enemy that triggered the script is killed, meaning that if this script is triggered very early in the path, and the enemy that triggered it is killed, the team is now hunting, this can cause pathfinding lag if the closest enemy is far or behind unpassable areas. It may also make the team not go to the way you want it to go (where the path originally was leading to). This also breaks surviving patrolling teams as they will not get back to patrolling and instead hunt.

If there is a benefit in your method that I may have missed please let me know.

Cheers ^-^

Check out:
My Music  (Techno/House/Experimental)
My Website  (GeneralsCentral)
My Youtube Channel  (Inactive)
World Builder Community Discord 
Unknown Editor
7 years ago


- The team will only attack when it has been attacked, whereas in the method I explained the team will attack as soon as the enemy is in sight (because the team is already aggressive).

Originally Posted by: SkyMix_RMT 



Does this also Work when the team is made out of Infantry ? (Just a Question)


- The team will not go back to following the path if the enemy that triggered the script is killed, meaning that if this script is triggered very early in the path, and the enemy that triggered it is killed, the team is now hunting, this can cause pathfinding lag if the closest enemy is far or behind unpassable areas. It may also make the team not go to the way you want it to go (where the path originally was leading to). This also breaks surviving patrolling teams as they will not get back to patrolling and instead hunt.

Originally Posted by: SkyMix_RMT 



Actually there are ways to get the Team Back to the Path After cleared out enemies but that costs effort .
Asking is Not a Problem , Problem is Not to Know Something .
Operation : Dark Angel
Static : Launch Delayed
Reason : Uncool Terrain - Old Logic in use - Lack of Performance
Status : Applying new Terrain - Applying new Logic - Increasing Performance by 300%
acidbrain
7 years ago


I am aware of the script but I can only see drawbacks when using the method you explained.
Please correct me if I'm wrong:
- The team will only attack when it has been attacked, whereas in the method I explained the team will attack as soon as the enemy is in sight (because the team is already aggressive).
- The team will not go back to following the path if the enemy that triggered the script is killed, meaning that if this script is triggered very early in the path, and the enemy that triggered it is killed, the team is now hunting, this can cause pathfinding lag if the closest enemy is far or behind unpassable areas. It may also make the team not go to the way you want it to go (where the path originally was leading to). This also breaks surviving patrolling teams as they will not get back to patrolling and instead hunt.

If there is a benefit in your method that I may have missed please let me know.

Cheers ^-^

Originally Posted by: SkyMix_RMT 


First of all im not here to correct anybody...
There are usually more ways to solve a problem, it is just the way i aproach it, nothing more, it is not The way but A way...
I usually use the method i described because i only want teams to not proceed with their path if they are attacked by a player, if i send teams to a base i want them to get to that base as soon as possible, if you set a team to aggressive it scans 1.5 times further than default so a team aborts original objective of following a path sooner, i like to use teams that go to the enemy base and teams that go attack elsewhere, usually multiple smaller teams which can be build quickly and that can possibly be merged into 1 bigger team in combatzone for example, usually i create random teams for this so the map has more variation if you play it multiple times.

And about the pathfinding...
I always try to design maps in a way in which ai performs best so nice open areas to build and clear paths to follow with not too much obstacles in the way, pathfinding falls or stands with good mapdesign and if you dont put too much stuff on your map it doesnt matter if a unit goes hunting or aggressive from one side of the map to the other.
The returning back to path can be scripted if im not mistaking, not too hard, think about it.

I think that in the end it doesnt matter that much if a team goes hunting or follows a path just as long there are subroutines in generic that disable on succes or switch with flags or counters, i bet you have seen infantry in running animation while standing on one spot, that is a facky subroutine running.

One more time to make it clear.
This is just my way of aproaching this matter, not The way...

Cheers

Panem et kirkinses
SkyMix_RMT
7 years ago
Ah I see, my bad, thanks for explaining.
Check out:
My Music  (Techno/House/Experimental)
My Website  (GeneralsCentral)
My Youtube Channel  (Inactive)
World Builder Community Discord 
acidbrain
7 years ago
I dont know if you fellaz already know this site but it contains a handy checklist for mapmaking, i suggest you print the page because well we are in days that sites are going down, old game...
Here  is the link, RVMECH is one of the devs btw, in case you're wondering.
Check tip no 10 SkyMix...:P

Cheers
Panem et kirkinses
SkyMix_RMT
7 years ago

I dont know if you fellaz already know this site but it contains a handy checklist for mapmaking, i suggest you print the page because well we are in days that sites are going down, old game...
Here  is the link, RVMECH is one of the devs btw, in case you're wondering.
Check tip no 10 SkyMix...:P

Cheers

Originally Posted by: acidbrain 



Thanks for the list, but... In what situations is tip no 10 true? Because I have teams in aggressive that load into transports in Operation Kihill Beach:

UserPostedImage

UserPostedImage
Check out:
My Music  (Techno/House/Experimental)
My Website  (GeneralsCentral)
My Youtube Channel  (Inactive)
World Builder Community Discord 
UTD^Force
7 years ago
I had this problem in my map, but the script is Team '' loads into transports. Some infantry won't load into the transport (some of them not all and not every time) and they will keep following the HumV until it stops at the end of the waypoint path and then load into it. I don't know if this is the same issue.
A Muslim, ask me anything about Islam if you want
UTD^Force
Moderator and former map reviewer
Big fan of C&C Labs