TheSuperHackers / GeneralsGamePatch

Community Patch to fix and improve original Generals Zero Hour 1.04
Other
55 stars 19 forks source link

Implement "No Rush" feature #1845

Open xezon opened 1 year ago

xezon commented 1 year ago

Players like "No Rush" for X minutes. Try implement an optional feature that can enforce this. This has been suggested by a random user in the survey.

kABUSE1 commented 1 year ago

Currently the nicest and by far easiest way to do this is to have one invisible water area in the middle of the map that instantly goes up and back down to kill anything in it. This even kills planes and is AI compatible, as the ai will just send all the stuff to certain death without causing pathfinding issues. I have attached a test map. It doesn't cause any lag as long as combined with correct trigger conditions.

So one way to go about this would be to simply have dedicated "no rush" versions of popular no rush maps, such as tournament island. The number of no-rush minutes could be in the map name, so literally no additional work required.

This only cleanly works on maps without a combat zone in the center. So implementing this for things like defcon is complicated, unless you are okay with nobody being able to leave their base until no-rush is over.

If you want maps like tournament island to support this even when played left side vs. right side or in ffa mode, a little more work is required to detect team setup.

A water rise script will always kill all units in the death-zone, no matter who owns them. So that's what limits this scripting technique.

water-test.zip

xezon commented 1 year ago

I would imagine that a proper solution would require

a) A No Rush host option in the Match Room to dial the minutes b) Map base areas that cannot be penetrated by opposing units and projectiles before the rush timer is ready

Base areas would require placement in each map. I do not think there is an elegant code-only solution without touching maps.

kABUSE1 commented 1 year ago

So you'd have to find a way to communicate between the match room and the map, like it is done with the starting cash. Is that a problem? Sounds like something that requires thyme.

I mean, there is a workaround for anything. You could communicate data into the map through the start cash of the players. I have done this before. If start cash exceeds normal values by $1, it's 5min no rush, $2, it's 10min no rush etc. Then simply set up the map accordingly via scripts, remove the excess cash and the user doesn't even notice what just happened.

This should work as the start cash is not hard-coded.

xezon commented 1 year ago

The downside of complex setups in maps is that it becomes difficult to replicate this functionality in all maps. If maintainer makes a mistake, then feature will not work. Ideally it is as simple as placing the default faction start position, in this case a 2d area shape with an expected name that No Rush system will use.

Additionally, misappropriating the money option for unrelated functionality would add a layer of confusion for most users, because the money would be encoded as

kABUSE1 commented 1 year ago

Well of course the GUI should not display the odd values. You have normal selection for start cash, then you have selection for "No rush". And internally that is fused together into one number. And ingame before the first frame is displayed to the user, it is already corrected.

If the alternative would be waiting for thyme I am more than willing to create the necessary scripts and water areas on all official maps.

xezon commented 1 year ago

If I am not mistaken the GUI shows the literal money value, not a custom string for an underlying value. Rightfully so.

kABUSE1 commented 1 year ago

There is a method to have custom start cash by editing some config file with notepad during host process. The other players don't see it until the game begins. Ancient stuff tho, maybe you have already addressed this with gentool years ago.