Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: SCV Repair mechanics
SCV Repair mechanics
Jul 1 2013, 12:07 am
By: MetalGear  

Jul 1 2013, 12:07 am MetalGear Post #1



I've been going crazy for the past hour trying to figure out how SCV repair calculations work. I already looked at the wiki and I still don't understand. All I know is it's something to do with [hp], [build time], and [cost]. So here's what I need to do...

¤ Must repair 100 hit points in 65 trigger cycles (5.4 seconds) at the cost of 5 ore for a variety of Terran vehicle units, each with different health.

Can anyone show me the calculations for this? My units have the following hit points...

4800
650
550
330



None.

Jul 1 2013, 1:10 am Leeroy_Jenkins Post #2



The repair time is set to repair a certain % at a rate similar to the build time. I don't know the exact math, but I messed around in SCMDraft a bit. For the unit with 330 hp, you would want a build time of about 250 in order for it to repair 100 hit points per 5.4 seconds. You would change that build time for the units with bigger HPs, by multiplying it by the ratio of the HPs.

The cost has to do with % of the unit healed compared to the total unit cost. I think it's about 1/3-1/4 the price? So, you would take the 100 damage repaired, divide it into the total unit hp, and then multiply that % by the unit's total cost and the appropriate fraction (1/3-1/4)



None.

Jul 1 2013, 1:15 am jjf28 Post #3

Cartography Artisan

According to what i'm reading here...

R = ceil[ .9 * H / B ]

R = repair rate 1hp regened/256frames = ceil[ .9 * H / B ]
H = HP
B = Build Rate (# seen in SCMDraft)

R can also be written... 1*R = (1*hp)/(256*frames), so we can play around with the units easier.

Assuming you are using standard hyper triggers, 1 trigger cycle = 2 frames, we can adjust the units of R so it shows it in trigger cycles:

1*R = (1*hp regened)/(256*frames)
128*R = 128[ (1*hp regened)/(256*frames) ], multiplied both sides by 128
128*R = 1*hp regened/(2*frames), simplified
128*R = 1*hp regened/(1*trigger cycle), substituted trigger cycles for frames
R = 1*hp regened/128*trigger cycle, divided both sides by 128
or R = hp regened/128trigger cycles

Now we can substitute this into the first equation

R = ceil[ .9 * H / B ]
(1*hp regened)/(128*trigger cycles) = ceil[ .9 * H / B ]

Now we can plug in the numbers you want, 100 hp regenerated, and 65 trigger cycles

(1*100)/(128*65) = ceil[ .9 * H / B ]
5/416 = ceil[ .9 * H / B ]

Curiously, ceiling (rounding) is not a reversible operation, at least not from my understanding, so imma just ignore it :kame: (we can make little adjustments later)

5 / 416 = (.9 * H) / B
B * ( 5 / 416 ) = .9 * H
B = ( .9 * H ) / ( 5 / 416 )




B = ( .9 * 4800 ) / ( 5 / 416 ) = 359,424 build time
B = ( .9 * 650 ) / ( 5 / 416 ) = 48,672 build time
B = ( .9 * 416 ) / ( 5 / 416 ) = 41,184 build time
B = ( .9 * 330 ) / ( 5 / 416 ) = 24,710 build time

Try those build times out.

I know nothing of repair costs, pass me some links if you need help with that.



TheNitesWhoSay - Clan Aura - github

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Jul 1 2013, 2:06 am Leeroy_Jenkins Post #4



Quote from jjf28
B = ( .9 * 4800 ) / ( 5 / 416 ) = 359,424 build time
B = ( .9 * 650 ) / ( 5 / 416 ) = 48,672 build time
B = ( .9 * 416 ) / ( 5 / 416 ) = 41,184 build time
B = ( .9 * 330 ) / ( 5 / 416 ) = 24,710 build time


I'm not sure where the error is, but you will actually want to divide all of those build times by 100.
359,424 build time -> 3594
48,672 build time -> 486
41,184 build time -> 411
24,710 build time -> 247



None.

Jul 1 2013, 3:03 am MetalGear Post #5



Wow what a headspin! What does "ceiling" or "rounding" mean? And thanks guys, this has helped.



None.

Jul 1 2013, 3:08 am lil-Inferno Post #6

Just here for the pie

Ceiling is basically bringing the number up to the nearest upper whole number (e.g. the ceiling of 1.1 is 2, the ceiling of 0.9 is 1).




Jul 3 2013, 2:00 am rockz Post #7

ᴄʜᴇᴇsᴇ ɪᴛ!

100 HP in 65 trigger cycles gives a build rate of 197 = (100*256) / (65*2)
If you solve the equation for Build Rate:
0.9*H/R = B

I get these build rates:
5614
761
644
386

Cost is linear as well, but I don't recall how to get that to work. If you feel like experimenting, just get a bunch of data (you can post it here if you want) and plop it into excel. Make 100 vultures, damage them at various rates, then heal them all the way up to 100% and note how many minerals it took. Eventually you'll get the repair cost formula.

Alternatively, just heal one thing to 100% from 1% and you should have a good guess. If repairing a barracks (150 minerals) to 100% costs 50 minerals, then you know the repair cost is 1/3 total cost (I think this is the case)



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Jul 3 2013, 6:02 am Leeroy_Jenkins Post #8



Quote from rockz
100 HP in 65 trigger cycles gives a build rate of 197 = (100*256) / (65*2)
If you solve the equation for Build Rate:
0.9*H/R = B

I get these build rates:
5614
761
644
386

Just tested in scmdraft, these are the correct numbers!

Post has been edited 4 time(s), last time on Jul 3 2013, 6:15 am by Leeroy_Jenkins.



None.

Jul 3 2013, 6:55 pm jjf28 Post #9

Cartography Artisan

Tried everything I could think of to get from this:

Quote from name:wiki
where R = repair rate in 1/256 of hp per frame,

to this:

Quote from rockz
((hp healed)*256) / ((trigger cycles)*2)

and it doesn't seem to coalesce, could you (rockz) post how you're defining R so the wiki can be updated?



TheNitesWhoSay - Clan Aura - github

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Jul 8 2013, 11:58 am rockz Post #10

ᴄʜᴇᴇsᴇ ɪᴛ!

197/256 hp/frame = 100hp / 65*2 frames

I multiplied the 256 to the other side, since HP is a 4 byte variable but you only see 3 bytes of it.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:20 am]
Symmetry -- Dang I'm up to 155 minerals gambling really pays off guys
[2026-10-11. : 6:02 am]
Donald -- Samase
[2026-10-09. : 2:53 am]
Mr.BurnLiquid -- Symmetry
Symmetry shouted: I'll check it out this weekend!
Thanks
[2026-10-09. : 2:47 am]
Symmetry -- I'll check it out this weekend!
[2026-10-09. : 2:40 am]
Mr.BurnLiquid -- Symmetry
Symmetry shouted: Another map maker? Damn we really ARE back
I invite you to try out the map I modified. I don't have the creativity to create maps from scratch, but I do have the know-how to modify existing ones; my project is to tweak community campaigns (specifically those with errors—to make them playable.
[2026-10-09. : 2:27 am]
Symmetry -- Another map maker? Damn we really ARE back
[2026-10-09. : 1:51 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Now that I wanted to change my avatar, the error image is showing up, haha.
[2026-10-09. : 1:34 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Mr.BurnLiquid
Mr.BurnLiquid shouted: Ultraviolet Thanks; I'm new to the site and a Spanish speaker. I must have missed the part where it was prohibited—I'll change it now.
I invite you to try out a mission I'm modifying from *StarCraft Reversed*; I'm trying to make it more playable and challenging.
[2026-10-09. : 1:33 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Thanks; I'm new to the site and a Spanish speaker. I must have missed the part where it was prohibited—I'll change it now.
Please log in to shout.


Members Online: ZOVBOT, Dem0n