Author Topic: Stickyfoam Duration  (Read 2223 times)

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Stickyfoam Duration
« on: July 22, 2007, 01:50:58 AM »
So, someone asked how stickyfoam duration is controlled, so I decided to look into it. Seems there may be a bug in the code I read.


The stickyfoam duration is the penetration damage of the stickyfoam. The catch is, it uses the penetration damage for stickyfoam from the player who's unit is getting stickyfoamed, not the penetration damage from the person who owned the stickyfoam unit. So if YOU research Reduced Foam Evaporation, it means that YOUR units will be stickied for longer.  :heh:


I tested it out just to be sure. It actually does work that way. Kind of makes you think twice about getting that research.  :P  

Offline Freeza-CII

  • Administrator
  • Hero Member
  • *****
  • Posts: 2308
Stickyfoam Duration
« Reply #1 on: July 22, 2007, 02:07:32 AM »
its definatly a double edge sword

Offline Starfox00000

  • Jr. Member
  • **
  • Posts: 85
Stickyfoam Duration
« Reply #2 on: July 22, 2007, 02:11:06 AM »
Quote
So, someone asked how stickyfoam duration is controlled, so I decided to look into it. Seems there may be a bug in the code I read.


The stickyfoam duration is the penetration damage of the stickyfoam. The catch is, it uses the penetration damage for stickyfoam from the player who's unit is getting stickyfoamed, not the penetration damage from the person who owned the stickyfoam unit. So if YOU research Reduced Foam Evaporation, it means that YOUR units will be stickied for longer.  :heh:


I tested it out just to be sure. It actually does work that way. Kind of makes you think twice about getting that research.  :P
(02:35:19) (Hooman) It looks buggy too :P
(02:35:32) (Hooman) It's the penetration damage for the stickyfoam of the player being attacked
(02:35:45) (Hooman) not the person firing the stickyfoam
(02:36:33) (+Starfox00000) wow
(02:37:02) (+Starfox00000) so does that mean researching the longer lasting sticky foam mean they my opponet gets the bonus, not me ?
(02:37:04) (Hooman) I guess I'll post it for him
(02:37:15) (Hooman) lol, yeah, actually I think it might
(02:37:25) (+Starfox00000) well thats
(02:37:29) (+Starfox00000) thats just stupid
(02:37:51) (+Starfox00000) note to self: increased sticky duration tech bad idea
(02:38:24) (+Starfox00000) hooman
(02:38:32) (+Starfox00000) want to join a game and test the sticky
(02:38:34) (+Starfox00000) ?
(02:38:45) (Hooman) Wouldn't it be faster and easier to make a test level?
(02:38:55) (+Starfox00000) no?
(02:39:04) (+Starfox00000) becuase idk how to do that :P
(02:39:28) (+Starfox00000) and fine, ill play against myself lol
(02:42:49)      —› quit: (Fenrisul) (~fenrisul@opu-DB3C59E.hsd1.ca.comcast.net) (Quit:)
(02:46:20) (Hooman) Hehe, you're right
(02:46:36) (+Starfox00000) really?
(02:46:40) (Hooman) I'm gonna win the battle since the foam on me lasts longer, so theirs can do less damage per time
(02:46:51) (Hooman) but it's annoying being tied down for longer when I did the research
(02:47:02) (Hooman) ok, posting time


Wheres the love man? D:

Offline Arklon

  • Administrator
  • Hero Member
  • *****
  • Posts: 1269
Stickyfoam Duration
« Reply #3 on: July 22, 2007, 11:15:56 AM »
Wow, Dan Duncalf SUCKS. :P

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Stickyfoam Duration
« Reply #4 on: July 22, 2007, 11:29:50 AM »
Go Eden.
So the only way Increased Foam Duration would work the way you'd expect it to would be if you sticky yourself?
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Stickyfoam Duration
« Reply #5 on: July 22, 2007, 01:25:23 PM »
Quote
So the only way Increased Foam Duration would work the way you'd expect it to would be if you sticky yourself?

Yep.


Btw, it was Arklon that asked, and then Starfox that mentioned the upgrade research. There's the love, man! :P


It's also amusing that Eden can't research Reduced Foam Evaporation, so their units can't be locked down for a long as Plymouth.


Oh, and I wouldn't necessarily go blaming Dan Duncalf for the coding errors. Don't forget ... :  ;)
Dan White
Brian Apgar
David Sandgathe
Glenn Wallace
and lets not forget the large list of people on the Quality Assurance team.  ;)

Plus, we can't really know from looking at the assembly if it was stuff they wrote, stuff the compiler did due to little nuances, or stuff that was written into a third party library that they used. At any rate, there seems to be quite a mix of skill. Some of the code is written very well, and checks for error conditions properly. Other places don't check at all. Sometimes there is a mix, like it was originally written by someone that knew what they were doing, and then edited by someone who was a little less careful. I suspect it was more of a budgeting constraint, and the company not giving the programmers enough time to really polish it.


Btw, compiler nuance example. I'm sure most programers know if you want to do something like mod 16 (% 16), you can simply use an and 15 (& 15). An optimizing compiler will do this for you, but that catch is, the variable has to be declared as unsigned. The reason being what % does with negative numbers. i.e.: -1 % 16 = -1, -17 % 16 = -1. For it to implement the mod correctly for negative numbers, it needs to use around 4-6 instructions instead of just 1. Slightly annoying since signed integers are the default, even though I find unsigned use tends to be more common. Anyways, you'll find those larger instruction sequences a fair bit in the OP2 code.
 

Offline Arklon

  • Administrator
  • Hero Member
  • *****
  • Posts: 1269
Stickyfoam Duration
« Reply #6 on: July 22, 2007, 01:33:58 PM »
Quote
Btw, it was Arklon that asked
I didn't really ask, I just told you about how its duration and changing it with penetration_damage seems to work a bit oddly.

Offline Betaray

  • Administrator
  • Hero Member
  • *****
  • Posts: 2897
Stickyfoam Duration
« Reply #7 on: July 23, 2007, 12:29:16 AM »
no one will ever research reduced foam evaporation again

10 years and we are still finding new things about op2, wow
I am the nincompoop, I eat atomic bombs for breakfest, fusion bombs for lunch, and anti-matter bombs for dinner

I just hope they don't explode

Offline Tellaris

  • Sr. Member
  • ****
  • Posts: 460
Stickyfoam Duration
« Reply #8 on: July 23, 2007, 02:28:59 AM »
I will.   Longer duration = less damage sticky can do.   The time the unit can't move is... unfortunate, but you can work around that.
Spell Checker!   The PoWeR tOoL
Click Here For Coolness
Self Proclaimed OPU Help desk.

Offline Arklon

  • Administrator
  • Hero Member
  • *****
  • Posts: 1269
Stickyfoam Duration
« Reply #9 on: July 23, 2007, 11:43:56 AM »
Quote
I will.   Longer duration = less damage sticky can do.   The time the unit can't move is... unfortunate, but you can work around that.
But your enemy isn't going to use stickyfoam to deal damage to you, they're going to use it to stop you.