Probably something to do with signed/unsigned.
Mr Ekted - Thu Jul 22, 2004 4:08 pm
Post subject:
What were the 2 values? If they are both unsigned, they can never be < 0 after a subtract. I think you misread what I was saying.
CypherJF - Thu Jul 22, 2004 4:55 pm
Post subject:
Smong is making a client :/ ?
Mr Ekted - Thu Jul 22, 2004 5:01 pm
Post subject:
The comparison (nextGreenTick < now) will fail over a wrap.
Confess - Thu Jul 22, 2004 5:09 pm
Post subject:
wtfs up with the text? its all the way on the right side
Anonymous - Thu Jul 22, 2004 5:30 pm
Post subject:
I think I may have muffed up one of the [ code ] tags
Lemme see if this helps --> [/code] <-- [ /code ]
Both 'now' and 'nextGreenTick' are both unsigned int's. The GetTickCount thing is like system uptime right? (as opposed to something like milliseconds since 1970).
Also I think maybe greens aren't spawned after a set delay, probably something to do with the ss random number generator (because PrizeFactor 1000 = 1 green per person).
Mr Ekted - Thu Jul 22, 2004 6:21 pm
Post subject:
If one value is 0xffffffff and the other is 0x00000001, then 0x00000001 - 0xffffffff = 2, and 0xffffffff - 0x00000001 = 0xfffffffe. It will never be < 0.
If you need to know when an interval passes, save NOW. At some point in the future you have the current TIME. TIME - NOW will always be >= 0 and you can compare to an interval. This works because you have guarateed the relationship between the 2 values based on when you set them.
Greens in SS are pretty complicated. Exactly when and how many you should "create" is based on the timestamp and green key security packet, and the number of greens you currently have on the map (previously created greens, death greens, ships picking up greens). No 2 clients ever show the same greens. The system is inherently flawed.
Mr Ekted - Thu Jul 22, 2004 6:23 pm
Post subject:
Btw, can you edit your first post and fix the broken tag, whatever it is?
Anonymous - Fri Jul 23, 2004 5:06 am
Post subject:
I think I get it, something like: if (now - lastGreenTick > prizedelay)
{
...
lastGreenTick = now;
} |
Where all variables are unsigned.
I can't edit a post if I'm not logged in (someone's fixed it now anyway).
@Cypher
If you look here http://forums.minegoboom.com/viewtopic.php?t=2484 You can see I haven't done much since I started (about 5 months and I only just added greening, incorrectly too).
CypherJF - Fri Jul 23, 2004 5:39 am
Post subject:
but keep at it...