Staredit Network > Forums > SC1 UMS Theory and Ideas > Topic: Time Text Messages Stay up there?
Time Text Messages Stay up there?
May 16 2008, 5:19 pm
By: Madroc  

May 16 2008, 5:19 pm Madroc Post #1



I have been experimenting on how long text messages stay up there on the screen because I want to have a text message stay constant on the screen without interfering with chatting. I have found this:

-The number of characters in the text message determines how long it stays up there (including spaces and those letters that make it colorful)
-The time it stays up there is the same regardless of game speed
-If it has a character count of 80 or less (give or take a few) it always stays up for the same amount of time regardless of how many characters there are (around 4 seconds)

I have tested out a few, using death counts as timers. Like here is my experiment:

Trigger 1
Conditions: Always
Actions: Display (We'll call this X)
Set Death count of Marine to (We'll call this Y)
No preserve

Trigger 2
Conditions: Death count of Marine is at least 1
Actions: Subtract Death count of Marine by 1
Preserve Trigger

Trigger 3
Conditions: Death count of Marine is exactly 0
Actions: Display (something with something added to the end so you can distinguish between the two text messages)
No preserve

Trigger 4
Hyper triggers

Using this I found that (on fastest game speed) if X (number of characters) = 84 and Y (number you set death counts to) = 51, then it's a constant message.
Also if X=444 and Y=273 then it's constant.
And also if X = 199 and Y = 123 it's constant.

Only about 1/3 of possible Y values can have a possible X value.

I haven't tried any others, but I was wondering if there's an equation out there already?



None.

May 16 2008, 6:02 pm The Starport Post #2



Wow. Good job doing homework on that. I knew about the 4 second thing and the spaces adding time, but I didn't know about the game speed part.



None.

May 16 2008, 7:22 pm Heimdal Post #3



It's pretty clear that the timer uses milliseconds, not game seconds (this is why it's speed-independent).

If 80 characters is exactly 4 seconds, then each character would be 50 milliseconds. I assume you were using hyper triggers for the death counts, but even so it's hard to gauge how long that would be. Try changing your test to:
display X
wait Y
display Z

And tweaking Y until X->Z is continuous. Use X*50 ms as a starting value for Y and see where that takes you.

I'll dig into SC's actual code tonight to see if I can find anything.

50 ms seems like a good bet. Assuming each cycle takes 83 ms (rough estimate of hyper trigger speed):
51 * 83 / 84 = 50.39
273 * 83 / 444 = 51.03
123 * 83 / 199 = 51.30

Post has been edited 1 time(s), last time on May 16 2008, 7:27 pm by Heimdal.



None.

May 16 2008, 8:25 pm Rantent Post #4



Quote
Using this I found that (on fastest game speed) if X (number of characters) = 84 and Y (number you set death counts to) = 51, then it's a constant message.
Also if X=444 and Y=273 then it's constant.
And also if X = 199 and Y = 123 it's constant.
Wow, this sounds really easy to get more values.
We can say that it's straight, and that slope is 1.6ish crossing the axis pretty close to 0. (Of course after hit hits the minimum character limit the time difference would no longer apply.)
1.64705882
1.61788618
1.62637363
x=1.6y :bleh:
more points would probably give a better equation.



None.

May 16 2008, 8:28 pm Madroc Post #5



Quote from Heimdal
It's pretty clear that the timer uses milliseconds, not game seconds (this is why it's speed-independent).

If 80 characters is exactly 4 seconds, then each character would be 50 milliseconds. I assume you were using hyper triggers for the death counts, but even so it's hard to gauge how long that would be. Try changing your test to:
display X
wait Y
display Z

And tweaking Y until X->Z is continuous. Use X*50 ms as a starting value for Y and see where that takes you.

I'll dig into SC's actual code tonight to see if I can find anything.

50 ms seems like a good bet. Assuming each cycle takes 83 ms (rough estimate of hyper trigger speed):
51 * 83 / 84 = 50.39
273 * 83 / 444 = 51.03
123 * 83 / 199 = 51.30
Oh cool I didn't know that ms were game speed independent.
OK I did what you suggested and tryed out 2 different random amount of characters - 127 and 118.
So for 127 I tried 127 * 50 ms = 6350 ms but it didn't work. I eventually got it down to 6272, which was too short and 6273, which was too long.
:wtfage:
OK now I try 118. I just subtracted 450 from the 6272 number to get 5822 but eventually I figured out it was actually between 5824 and 5825.
:wtfage: again.



None.

May 16 2008, 10:34 pm Heimdal Post #6



Interesting. Was there any difference in timing between 6273 and 6350? SC runs at a fixed framerate (I'm not sure what, though) so all values within a certain range (the length of a frame, or at least the time span between executing the triggers) should come out the same.

Post has been edited 1 time(s), last time on May 16 2008, 10:46 pm by Heimdal.



None.

May 17 2008, 2:54 pm Daedalus Post #7



Wasn't their a small program which allowed you to insert the text you wanted to display and then gave the estimated time as output? I'm pretty sure I have used one, but it was months ago, before some computer wipes.



None.

May 17 2008, 9:03 pm Wormer Post #8



Yes, it is named SEA (StarEdit Assistant). I've uploaded it: http://www.mediafire.com/?jyzjrrk5jnj
But I figured out it is not calculating the time from the text... Mabe you are talking about another one...



Some.

May 18 2008, 3:38 am Falkoner Post #9



Nice, I've been wanting to find something like this, but how do you add more time to something, like let's say I want a LOT of time, I can't add any more past 1 line without moving player text down, now can I? Of course, the only other problem I see is that it takes up extra string space.

But good job on that testing, very nice :P



None.

May 18 2008, 4:20 am Madroc Post #10



Quote from Heimdal
Interesting. Was there any difference in timing between 6273 and 6350? SC runs at a fixed framerate (I'm not sure what, though) so all values within a certain range (the length of a frame, or at least the time span between executing the triggers) should come out the same.

No that doesn't seem to be the case. There is a definite noticeable difference between 6273 and 6350 (I also checked 6273 and 6349 and I get the same results). Nope every millisecond counts ;)

Quote from Falkoner
Nice, I've been wanting to find something like this, but how do you add more time to something, like let's say I want a LOT of time, I can't add any more past 1 line without moving player text down, now can I? Of course, the only other problem I see is that it takes up extra string space.

But good job on that testing, very nice :P

Thanks!
Hmm I'm not sure I understood your question but - to add more time to something without adding more actual letters, just add more spaces. It doesn't move it up at all.
Oh and I didn't realize that the length of the string was a problem? Why is that?



None.

May 18 2008, 4:21 am Falkoner Post #11



The more spaces you add, the longer the string, the more memory it takes up. Also, if you have more spaces than a line, it does move it up.



None.

May 18 2008, 4:23 am Madroc Post #12



Quote from Falkoner
The more spaces you add, the longer the string, the more memory it takes up. Also, if you have more spaces than a line, it does move it up.
Oh ok got it.
"Also, if you have more spaces than a line, it does move it up." Hmm not in my experience. Are you sure? (I suppose I could be wrong)

EDIT oh and I guess another thing would be - would it really matter if it moved up a line? Would anyone notice?



None.

May 18 2008, 4:32 am Falkoner Post #13



Meh :P Yeah, but I mean a LOT more space, that should bump it up, but yeah, it shouldn't be a problem, also, I realized that instead you could just put a ton of color tags at the end to make it longer.



None.

May 19 2008, 5:07 pm Heimdal Post #14



Color tags would probably work. You could also try putting an "invisible" color tag before the spaces.

There is a theoretical way to use the same memory in the string table for multiple strings, but I've never actually tried it. You basically put the offset of one string inside some other string. But honestly, unless your map uses a lot of text, you're going to hit the 1024 limit far before the memory limit.



None.

May 19 2008, 7:44 pm Rantent Post #15



The problem with invisible color tabs is that you can't ever get them back to another color.
Quote
Also, if you have more spaces than a line, it does move it up.
I used tabs and center align characters, and it works pretty well without making a line move down. (If you want to see what happens to the text, look at my "bounds" map, and read the zergling's name. ;) )
Yeah I did quite a bit of experimenting with overlaps and such, theres a lot of strange things that happen when you add 20 right aligns or whatnot.



None.

May 19 2008, 7:47 pm Demented Shaman Post #16



Quote from Rantent
The problem with invisible color tabs is that you can't ever get them back to another color.
Quote
Also, if you have more spaces than a line, it does move it up.
I used tabs and center align characters, and it works pretty well without making a line move down. (If you want to see what happens to the text, look at my "bounds" map, and read the zergling's name. ;) )
Screenshots plz. ^^



None.

May 25 2008, 1:10 pm pneumatic Post #17



Quote from Heimdal
I'll dig into SC's actual code tonight to see if I can find anything.
Dang, really? How/where'd you get the actual SC code?



None.

May 25 2008, 1:33 pm Tank_7 Post #18



When I want text to show for a long time I put it in a preserved trigger and have a death count. (assuming hyper triggers here)
This will loop indefinitely, so another condition, such as a player walking on an "Info" or "Help" beacon/location is needed. There's alot more possibilities though, for example you can have another death count timer of say 200 to allow the text to display multiple times. Only bad thing is it uses up 2 units' death counts.
The nice thing is you're not adding any spaces, conserving string space.

Also, the number 48 in the below example is for short messages. For longer messages, the number should be higher. I figure it out experimentally by testing, adjusting the number as needed based on how I see it behave. If you see the message dissapear for more than a "blink" you need to lower your number, while if you start "seeing double" you need to raise the number.

---------------------------------------------------------------------------------------------

Condition: Current Player has at most 0 deaths of Unit

Action: Display Text: Message Hi!
Action: Set deaths for Current Player: Set to 48 deaths of Unit
Action: Preserve Trigger

---------------------------------------------------------------------------------------------

Condition: Current Player has at least 1 death of Unit

Action: Set deaths for Current Player: Subtract 1 death of Unit
Action: Preserve Trigger

---------------------------------------------------------------------------------------------



None.

May 27 2008, 5:03 pm Heimdal Post #19



Quote from name:razorsnail
Quote from Heimdal
I'll dig into SC's actual code tonight to see if I can find anything.
Dang, really? How/where'd you get the actual SC code?
I don't, but I have a good disassembler. I never did get around to this project though :(



None.

May 27 2008, 8:49 pm O)FaRTy1billion[MM] Post #20

👻 👾 👽 💪

I know the function that draws the text.



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[2024-5-06. : 5:02 am]
Oh_Man -- whereas just "press X to get 50 health back" is pretty mindless
[2024-5-06. : 5:02 am]
Oh_Man -- because it adds anotherr level of player decision-making where u dont wanna walk too far away from the medic or u lose healing value
[2024-5-06. : 5:01 am]
Oh_Man -- initially I thought it was weird why is he still using the basic pre-EUD medic healing system, but it's actually genius
[2024-5-06. : 3:04 am]
Ultraviolet -- Vrael
Vrael shouted: I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
With the modern EUD editors, I don't think they're calculating nearly as many offsets as you might imagine. Still some fancy ass work that I'm sure took a ton of effort
[2024-5-06. : 12:51 am]
Oh_Man -- definitely EUD
[2024-5-05. : 9:35 pm]
Vrael -- I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
[2024-5-05. : 9:35 pm]
Vrael -- that is insane
[2024-5-05. : 9:35 pm]
Vrael -- damn is that all EUD effects?
[2024-5-04. : 10:53 pm]
Oh_Man -- https://youtu.be/MHOZptE-_-c are yall seeing this map? it's insane
[2024-5-04. : 1:05 am]
Vrael -- I won't stand for people going around saying things like im not a total madman
Please log in to shout.


Members Online: jjf28, Roy, NudeRaider