creating a physical capture progress indicator

  • If you're asking a question make sure to set the thread type to be a question!

Bob Ross

L3: Member
Jun 16, 2009
105
9
how would i go about creating a physical in world "progress bar" for control point capture? for example a tube of water that fills as you cap or a series of lights that turn on while you cap and then go off again if you were to stop capping halfway through.
 

UKCS-Alias

Mann vs Machine... or... Mapper vs Meta?
aa
Sep 8, 2008
1,264
816
Use the same trick as the payload (onnumcappers changed to a logic_case which then makes the animation happen) and dont use a watcher to keep the normal CP hud. The rate at which it should move down however needs to be found by trial and error.
 

UziMonkey

L1: Registered
Jul 24, 2009
8
0
I'm doing something similar with a func_door. You can also use things like logic_timers for this.
 

Backslash

L1: Registered
May 10, 2008
30
2
From looking through the outputs available this does not seem to be an option. If you knew the time it took to capture for each number of people standing on it, you could do some math to fake it though, using something similar to the setup for letting the payload know how many people are standing next to it.
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
You pretty much can't. There is no capture percentage output, and trying to do it by math would be very unreliable as the speed change with players isn't an obvious rate.
 

DrHaphazard

L5: Dapper Member
Jan 6, 2008
249
12
Well you might not be able to get it perfectly, but seems like you could do a reasonable approximation.

The problem would be with having the water or whatever go down, since as far as i know there is nothing to tell you how many defenders are on a point (the capture progress iirc goes down faster depending on how many defenders are on the point.)

I think something like this would be a very cool addition. Might be more satisfying to see youre actually changing the environment (even if its a very limited change) than to watch a colored circle fill up.
 

III_Demon

L2: Junior Member
Sep 28, 2008
57
29
you could possibly just replace the built-in capture progress with your own construction... say a func_door triggered to close very slowly whenever people are on the capture point, and then on close, it triggers the point to be captured instantly. i'm not sure it could be done flawlessly, but it might be worth looking into. you'd lose the HUD progress display, but that may or may not be a concern, i donno what you're trying to do.
 

DrHaphazard

L5: Dapper Member
Jan 6, 2008
249
12
Here's what I am thinking. There was this map called dom_complex. It was a port of some james bond game i think, but the idea was there were 8 cps in the game, and you had to hold as many as you could to accumulate enough points until someone won. Well to show how many points each team had, he first of all displayed a number on the hud, similar to the cart counter on pl_waste. But in spawn he also put two collumns that came out of the ground and displayed the relative score of each team.

The way it worked is he had each capture point send an input every 5 seconds to a math counter that would add up all the points accumluted by the team and send that information to a func_movelinear with a setposition input.

In other words red_points (the math counter) sent an OutValue to red_bar (the func_movelinear) that did a SetPosition input.

So the func_movelinear would slowly go up as the score went up.

So would there be a way to get that to work for this problem? The main difficulty, as Boojum pointed out, is that having 2 people on the point doesnt make it go twice as fast. You'd have to figure out approximately how much the cap is sped up each time a new person is added. Then once youve figured that out, you could use that to influence the math_counter.

I dunno, im rambling now. Perhaps ill delve into this later.
 

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
May want to talk to Mr. Pickle.
dom_canalzone

I believe the cap points have slider-holograms in addition to hud text, but AFAIK it's only for after capturing has completed and you are holding the point over time.

Would you need a "progress" indicator, or just the states for "owned" versus "being captured"? I mean, you probably don't want a series of lightbulbs to progressively change, since that'll mean extra lightmaps or else dynamic lights etc.

__________

Couldn't you use a trigger_multiple to count how many people are inside its volume?
 
Last edited:

DrHaphazard

L5: Dapper Member
Jan 6, 2008
249
12
http://tf2wiki.net/wiki/Control_point_timing

Well i feel damned foolish. Wasted about 30 mins creating a simple map and messing around with bots to time how fast things capture and of course the info was already out on the web. My numbers seemed to corroborate his results.

I set a point to 10 sec cap and heres what i got.

1x = 20 sec
2x = 13 sec
3x = 11 sec
4x = 10 sec
5x = 9 sec
6x = 8 sec

Now this wasnt scientific, i just watched the clock up top. According to the link you cap at 100% speed with 3 people on the point. He says after 4 its negligible, but i was still getting 1 sec improvements at 6 before i got tired of checking. Maybe ill do some more tomorrow.

edit: oh i was not aware dom_canalzone had something similar. I'll have to check it out tomorrow.

edit 2: btw is there anyway to remove bots once youve spawned them? didnt seem to be which was damned annoying
 
Last edited:

TMP

Ancient Pyro Main
aa
Aug 11, 2008
947
560
Canalzone's is a func_movelinear that is in relation to the amount of progress your team has. Has nothing to do with the capture points and their progress.
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
Well i feel damned foolish. Wasted about 30 mins creating a simple map and messing around with bots to time how fast things capture and of course the info was already out on the web. My numbers seemed to corroborate his results.
It was even [ame=http://forums.tf2maps.net/showthread.php?t=260]right here[/ame] on this site :p and that one is about as scientific as I could get.
 

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
Boojum: Freaky. I swear one of the ads on the site just now was doing evil javascript juju (or flash capturing the mouse), because the link in your post was to this ad destination until I refreshed.
 

DrHaphazard

L5: Dapper Member
Jan 6, 2008
249
12
Well in any case, if we do in fact have the data, then all this should be a walk in the park.

I am not at home to verify in hammer, but it seems like you could have this work.

You get your caparea to send the onnumcappers info to a relay of some kind. That relay would tell the math_counter how many points to add per tick.

Let's say you were trying to make an elevator rise in proportion to the cap speed (lets say its purely for aesthteic reasons, not for gameplay). You would make the thing into a func_movelinear that moves at one unit intervals. The SetPosition is relayed by a math counter that keeps counting up until it reaches 100, or down until it reaches 0.

The math_counter is influenced by some relay that tells it how many units to add depending on how many cappers are in the cap area.

Let's say at 100% speed the elevator (and the capture) would be all the way up after 10 seconds. One capper means it caps at 50% speed or 20 seconds. Let's also say that your math_counter updates every .5 seconds.

That means that for one player capping, the counter should add 2.5 points every half second, which should add up to 100 after 20 seconds.

A 10 second timer with 2 people on it captures in 13 seconds, so you should add around 3.8 per half-second.

3 people captures in 10 seconds, add 5 per half second.

4 people should capture ~9 seconds, add 5.5 per half second.

I'll admit I am not a math major, so if someone with a larger brain wants to tell me where i can put my history degree/poli sci degree, please help me out.
 

Cinnamon Whirl

L1: Registered
May 9, 2008
34
6
Perhaps there is another way of doing this, could be more accurate, but a little more work:

Fake it. A payload map moves a track_train along a path, increasing speed as more people push. If the path_tracks are all the same distance from each other, they will be passed by the track_train at intervals that can be used (by the "OnPassed" output) to change the state of your physical display.

Without having tried it, I guess you need:

path_tracks, same distance apart. More path_tracks means finer control for your display.
track train, to move along and set 'em off.

bomb_caparea. Not parented to the train, but placed above your cap point.
bomb_remap. tells you the number of people "pushing", i.e. the number of people stood in the bomb_caparea
logic_case for speed changes.

When the train reaches the final path_track, send an output to cap a point. If all the point have the same cap time you can reset the cart to the first path_track and reuse it.

Dont use a team train watcher - it gives you the payload hud

Sadly, this would mean that your hud wont display the amount a point is capped like it usually does. Hopefully the physical display will make up for that!
 

Bob Ross

L3: Member
Jun 16, 2009
105
9
the reason for the physical display is because there is no HUD display to begin with. this is primarily a CTF map so that is the HUD that needs to be displayed. now for both of these ideas would the meter be able to go back down on its own? it seems kind of a one way thing. ive never really done anything this complicated before.
 

DrHaphazard

L5: Dapper Member
Jan 6, 2008
249
12
Well yes theoretically you could also make it go down. I was trying to fiddle with something last night, but for the life of me I cannot get the capture_area to send its onnumcapperschanged to another entity.

I didnt realize you were having an actual hud problem, thought it was just for show. Is there perchance a door nearby you could slowly open, perhaps with a light that dings on when its fully opened (and hte point is capped?) That might be nice.

I mean I have no idea what your map looks like, but if i were to do doors opening, what I would do would be to have it like a set of blast doors, where you have two sets of doors. Essentially you dont want people to see the doors open and run off the point. So you have the first set of doors open horizontally fairly quickly, then you have the second door rize vertically open in a slower manner, so you wouldnt be able to get under it until fairly late in the capture.
 
Last edited:

DrHaphazard

L5: Dapper Member
Jan 6, 2008
249
12
Dunno if you are still around Bob, but if you are valve has released a new tool for mappers that allows us to (correctly) display both CP and CTF elements for the HUD at the same time. This was done to accomodate tf2maps' invasion ctf gamestyle.

You might want to look into this new functionality, perhaps you don't need any physical indicator after all.

In other news all my mapping skills seem to have rusted away so while im still trying to approximate a physical cap indicator it is taking longer than i expected.