Staredit Network > Forums > SC1 UMS Theory and Ideas > Topic: Text Detection Application
Text Detection Application
Jun 11 2010, 2:22 am
By: Cinolt  

Jun 11 2010, 2:22 am Cinolt Post #1



The concept of detecting in-game text by players using EUDs is nothing new, however I've yet to see a single map to actually use it in any non-trivial way. This is probably mostly due to how vastly inefficient it is to produce these triggers manually. However, with a program I coded and much, much help from ProTRG, making text detection triggers regardless of player name length can be done in a matter of minutes.

There are two detection methods with both their pros and cons. The first method just detects certain text and can be from any player. It can be good in situations where you would want this, and best of all it will not desync if you use an otherwise desyncing action because all players would run it (only in most cases, because if one person is spammed with messages and a person types in a command he might not receive it and desync. Of course, with single-player maps this is not a problem at all.)
The second method utilizes the fact that only your own text is green while the other players' are blue. The triggers can detect the green color byte and therefore only run for the player that typed it, however it is limited to only run actions that are local, such as Play WAV, Center View, Display Text, etc. Still pretty useful.

There are a few minor catches, though. For it to work properly, certain text need to be appended with a certain number of pre-determined characters as padding. The characters can be just spaces (which is what I chose for my test map), and the max you need to append is 3. So, for simplicity you could just always append 3 spaces to the end of your text. Also, the screen must be flushed with a large text display that covers all lines on the screen immediately after it detects text, or else it might not function properly.

The test map detects two text inputs from any of the players: "-music off" and "-music on" without the quotes. Obviously it gives the player the option to toggle in-game music by just typing one of those options. Remember to append 3 spaces after the text.

I'd also like to know what ideas you guys have as to what this can be applied to. Keep in mind most of the potential would be for single-player maps because majority of the actions will desync in multiplayer with the second method.

So far I thought of these:
Music toggling
Center view toggling (for an rpg or something)
"Yes" or "No" in an NPC dialog

Download

Post has been edited 3 time(s), last time on Jun 11 2010, 2:45 am by yoonkwun.



None.

Jun 11 2010, 2:32 am Azrael Post #2



Hmm, can I inquire as to what perked your interest into this subject? >_>

I like the idea of music on/off as a command, would be useful.




Jun 11 2010, 2:40 am Cinolt Post #3



Someone requested that I make a map to detect when only that user typed something, but I thought I'd expand on it and make it detect when any user types anything. And I've always liked playing with EUDs in general.



None.

Jun 11 2010, 2:45 am ImagoDeo Post #4



Quote from name:Azrael.Wrath
Hmm, can I inquire as to what perked your interest into this subject? >_>

I like the idea of music on/off as a command, would be useful.

That's just how he rolls.

Yet another epic, amazing, pwnage EUD map from yoonkwun.

[x]Location to Mouse
[x]Address database with EP compatability
[x]Unit Direction Detection
[?]Making StarCraft sit up and beg



None.

Jun 11 2010, 2:55 am Azrael Post #5



Quote from name:yoonkwun
Someone requested that I make a map to detect when only that user typed something, but I thought I'd expand on it and make it detect when any user types anything. And I've always liked playing with EUDs in general.
Damn I hope you owed them a favor or something xD I asked because I've also been working with text detection and it's not something that I've found to be particularly easy Dx I figured you had a reason or you wouldn't go to the trouble. Then again, doing cool shit is a reason in and of itself I guess!

But yeah music on/off would be an epic feature for an RPG, much better than the manual toggle switches. I hadn't thought of that D=

So, about this program you use to make these triggers along with ProTRG, is it something along the lines of changing text into usable integers? Does it do additional things? I ask because I'm finding the process of text -> integer to be rather tiring to the point I was going to get back into programming long enough to remember how to code and then make something to do this for me. I'm sure that experience would be extremely unpleasant v.v

Now if you wanted to share such an awesome piece of technology... ;)

Edit: By the way, I like your avatar D= And no I am totally not sucking up to you to get your program xD

Post has been edited 1 time(s), last time on Jun 11 2010, 3:30 am by Azrael.Wrath.




Jun 11 2010, 7:06 am samsizzle Post #6



Oh geez this is so awesome. It would be cool if someone made a single player rpg where people said the name of a spell to cast it.



None.

Jun 11 2010, 4:10 pm TiKels Post #7



Quote
Oh geez this is so awesome. It would be cool if someone made a single player rpg where people said the name of a spell to cast it.
ENFLAME! :flamer:

I was surprised to find out that you were working on this, because I was working on this with Azrael...



"If a topic that clearly interest noone needs to be closed to underline the "we don't want this here" message, is up to debate."

-NudeRaider

Jun 11 2010, 4:27 pm Azrael Post #8



Quote from samsizzle
Oh geez this is so awesome. It would be cool if someone made a single player rpg where people said the name of a spell to cast it.
I don't see how this is awesome for you, unless he releases his method, gives an explanation, or provides a tutorial for producing text-based triggers super-efficiently, you won't be doing that. He could do that, yes. Text-detection isn't complicated, a week ago I didn't even know what an EUD was yet yesterday I could have told you exactly how to do this, all the numbers you would need, etc. The two tutorials I got most of my information from are dated pretty far back, and when I couldn't get the provided memory addresses to work, Heinermann was able to give me them in less than 5 minutes.

Like yoon said, text detection isn't new. The thing that is new, the reason he made this thread, was to showcase that he has a method to efficiently make these triggers in a matter of minutes. Why there is not enough information provided to reproduce his method makes it rather useless though, unless you specifically want "-music on " and "-music off " in your map, in which case, congratulations because you can copy the triggers from that map to do it.

So yeah, unless some additional information is provided here, I don't see why anyone would be excited or think this is helpful to them. It's the exact same information people already knew about five years ago + some sort of secret process that no one knows how to reproduce. Even if you just want to change "-music on " to "-cast fireball " in the provided triggers, you would need to know his method to be able to do that efficiently, otherwise you're right back to where you were before you read this thread.

Yoon, I think it would be pretty awesome if you would give a quick run-through of how you can make these triggers in a matter of minutes, along with whatever tools you use, so that other people can use text in their maps as well.

Also, you don't need to flush the screen with text for this to work, though it'd make the triggers a bit more complicated.

Quote from TiKels
I was surprised to find out that you were working on this, because I was working on this with Azrael...
I've had help from you, Farty, Jack, Heinermann, poison, the list goes on. I've been talking about this heavily in the shoutbox over the last week, and explained exactly how to do it in Op SEN just a few days ago. We'll just say the timing of this is coincidental and leave it at that.

Post has been edited 3 time(s), last time on Jun 11 2010, 4:37 pm by Azrael.Wrath.




Jun 11 2010, 8:12 pm Cinolt Post #9



From the start this thread was originally meant for the discussion of what text detection can be applied to, hence "Text Detection Application" (not a computer application, if that caused any confusion). I did not think that someone would show interest to implement it in their own maps which is why I didn't bother with an explanation of how it's made. That said, my work was pretty much for independent purposes (and for the guy who originally asked for the map).

I'd be more than willing to release the tools used and a brief explanation. You can download the necessary files attached to this post. Note that I'm respecting the author of ProTRG's wishes to not provide a compiled version of ProTRG that supports the *fixed* Memory condition, which is required for this process. However, if he hasn't already updated it, I don't think he has a problem with me releasing the updated source that I've included, and you can compile it yourself.

From here it's pretty straightforward. First you edit in.txt to the string you want to detect. If you want local detection, it must start with byte of 0x7 (green color byte), then a space, followed by the actual text. If your desired text is less than 3 characters, pad spaces until it isn't. Run TextConv.exe once and out.txt will be updated. Replace the first four lines of TextTrig.protrg to the contents of out.txt. In the fifth line change the variable 'shared' to 0 or 1 depending on what you want, and after running it through ProTRG you're done.

Quote from name:Azrael.Wrath
Also, you don't need to flush the screen with text for this to work, though it'd make the triggers a bit more complicated.

As you probably know the text data still exists even after it disappears from the screen. So in a case such as my map, if "-music off" and "-music on" were entered fast enough then it would toggle between both very quickly in an undesirable manner. I can't conceptualize a reliable system of preventing this using death counters to store which line the text was in, but do elaborate if what you were thinking is plausible.

Attachments:
Text Detection.zip
Hits: 19 Size: 47.99kb



None.

Jun 11 2010, 8:28 pm Jack Post #10

>be faceless void >mfw I have no face

One good application of this would be being able to type -load 2471682 or something, and it loads your current map progress, Xuru RPG style.

Another would be ingame dialog handled by typing -yes or -no etc.



Red classic.

"In short, their absurdities are so extreme that it is painful even to quote them."

Jun 11 2010, 8:39 pm Azrael Post #11



Quote from name:yoonkwun
From the start this thread was originally meant for the discussion of what text detection can be applied to, hence "Text Detection Application" (not a computer application, if that caused any confusion). I did not think that someone would show interest to implement it in their own maps which is why I didn't bother with an explanation of how it's made. That said, my work was pretty much for independent purposes (and for the guy who originally asked for the map).

I'd be more than willing to release the tools used and a brief explanation. You can download the necessary files attached to this post. Note that I'm respecting the author of ProTRG's wishes to not provide a compiled version of ProTRG that supports the *fixed* Memory condition, which is required for this process. However, if he hasn't already updated it, I don't think he has a problem with me releasing the updated source that I've included, and you can compile it yourself.

From here it's pretty straightforward. First you edit in.txt to the string you want to detect. If you want local detection, it must start with byte of 0x7 (green color byte), then a space, followed by the actual text. If your desired text is less than 3 characters, pad spaces until it isn't. Run TextConv.exe once and out.txt will be updated. Replace the first four lines of TextTrig.protrg to the contents of out.txt. In the fifth line change the variable 'shared' to 0 or 1 depending on what you want, and after running it through ProTRG you're done.
+karma, you're awesome, this will help people out a lot :D

Quote from name:yoonkwun
Quote from name:Azrael.Wrath
Also, you don't need to flush the screen with text for this to work, though it'd make the triggers a bit more complicated.

As you probably know the text data still exists even after it disappears from the screen. So in a case such as my map, if "-music off" and "-music on" were entered fast enough then it would toggle between both very quickly in an undesirable manner. I can't conceptualize a reliable system of preventing this using death counters to store which line the text was in, but do elaborate if what you were thinking is plausible.
I think it would work if you incorporated the address for the next line number, 0x00640B58, and used death counts to keep track of the current line. For instance, if they type "- music on", you can set a DC to not use that line again until the address for the line number has returned back to its original value.

Just a theory though, I haven't had the means to actually implement multi-line text detection until now xD Thanks again for the reply.




Jun 11 2010, 11:34 pm Cinolt Post #12



Quote from name:Azrael.Wrath
I think it would work if you incorporated the address for the next line number, 0x00640B58, and used death counts to keep track of the current line. For instance, if they type "- music on", you can set a DC to not use that line again until the address for the line number has returned back to its original value.

Just a theory though, I haven't had the means to actually implement multi-line text detection until now xD Thanks again for the reply.

I didn't know about that address, and I could probably come up with a mostly reliable system with it that doesn't need the text flush. This is only if the other three bytes are constant zeros and it won't work if two people typed something before a cycle could detect it.

For now, however, there's a bug that makes it not work with certain length usernames and I have no idea where it's coming from. I'll update it once I figure it out, if I do.



None.

Jun 12 2010, 3:13 am Azrael Post #13



Yeah that's what I'm not sure of, is just how reliable that could be made to be. It should work 99% of the time, but it'd become problematic if someone spams faster than the triggers cycle. I think it could be designed to detect when a line's been skipped (if it goes directly from line 2 to line 4 on the next cycle), and be made to take that into account and correct itself.

That's unfortunate about the issue with username length though, please update with any information you uncover about it ^^

And by the way, more +karma because the information you've provided is worth at least 2x what any post I've given +karma to before was. I mean you've circumvented the number one issue with using text detection, the ridiculous amount of labor involved in doing so, and you could have very easily kept it to yourself. I would even go as far as saying most people would have.

So for that, I commend you :)

Post has been edited 1 time(s), last time on Jun 12 2010, 3:19 am by Azrael.Wrath.




Jun 13 2010, 5:55 am Cinolt Post #14



Fixed the previous bug as well as others.

Now there's three detection methods: specific (text from one user only), local (text from current player only), shared (text from any player), and now it utilizes Azrael.Wrath's address so the screen doesn't have to be cleared of text after detecting commands anymore.

EDIT: Just found out that even with shared detection, you can't reliably use shared actions such as create unit in multiplayer. Probably has something to do with the difference in time when text is sent and received.
EDIT2: Bugfix. Updated attachment.

Attachments:
Text Detection.zip
Hits: 29 Size: 47.89kb

Post has been edited 2 time(s), last time on Jun 13 2010, 7:00 pm by yoonkwun.



None.

Jun 13 2010, 5:52 pm Azrael Post #15



Woot, nice update ^^




Jun 14 2010, 10:37 pm Basteille Post #16



How does this work? I tried using it but nothing happens.



None.

Jun 15 2010, 1:20 am Cinolt Post #17



Try reading readme.txt.

Just to let you know the current system is flawed pretty badly in multiplayer maps (perhaps to the point of unusability in some cases). In single-player it is flawless. I devised a system a while back that would fix the flaws in multiplayer, but it requires ~3k triggers. Good thing is that they're not needed for each command, just once. I'm not sure if I want to bother with this task, because I already know it's possible and I don't want to spend a lot more effort on something I probably won't even use. If there's enough requests then maybe.



None.

Jun 17 2010, 11:35 pm Cinolt Post #18



Excuse the double post. I made a map that uses text detection to allow a player to drop other players by just typing in "-drop 2 ", "-drop 3 ", etc. This is one of the few useful applications that has each command only needing to be executed once, which is why it would work in multiplayer. The triggers should be directly copy and pastable to any map, as long as the death counter "Cantina" and Switch 1 is undisturbed (both of which can be adjusted in the protrg script).

It uses 2011 triggers, however it can be significantly reduced if less players are made to be droppable. Player 1 cannot be dropped. It's not possible to enforce player 1 to only be able to drop a certain group of players (such as a team). If a player squelches player 1 before he tries to drop him, he will not be dropped. A non-player 1 can drop another non-player 1, however they will both be dropped. Dropping privileges and droppable players can be adjusted in the protrg script.

Note that there should be three spaces after the "-drop 2", SEN doesn't allow three consecutive spaces to be displayed.

[EUD] Text Dropping System

Attachments:
drop.protrg
Hits: 18 Size: 8.07kb

Post has been edited 2 time(s), last time on Jun 17 2010, 11:50 pm by yoonkwun.



None.

Jun 18 2010, 8:51 pm Leeroy_Jenkins Post #19



Quote from name:yoonkwun
Excuse the double post. I made a map that uses text detection to allow a player to drop other players by just typing in "-drop 2 ", "-drop 3 ", etc. This is one of the few useful applications that has each command only needing to be executed once, which is why it would work in multiplayer. The triggers should be directly copy and pastable to any map, as long as the death counter "Cantina" and Switch 1 is undisturbed (both of which can be adjusted in the protrg script).

It uses 2011 triggers, however it can be significantly reduced if less players are made to be droppable. Player 1 cannot be dropped. It's not possible to enforce player 1 to only be able to drop a certain group of players (such as a team). If a player squelches player 1 before he tries to drop him, he will not be dropped. A non-player 1 can drop another non-player 1, however they will both be dropped. Dropping privileges and droppable players can be adjusted in the protrg script.

Note that there should be three spaces after the "-drop 2", SEN doesn't allow three consecutive spaces to be displayed.

[EUD] Text Dropping System

Good work! Very useful stuff.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:43 am]
da real donwano -- Who can crack into an old protected map & remove the trigger for insta-defeat for playing solo?
[2024-11-04. : 3:21 am]
Ultraviolet -- surprised it runs at all anymore
[2024-11-04. : 3:21 am]
Ultraviolet -- DLDB is fucked
[2024-11-04. : 12:00 am]
1nFectEd -- cant seem to erase old versions of my map that i uploaded?
[2024-11-03. : 5:40 pm]
Ultraviolet -- :wob:
[2024-11-02. : 4:10 pm]
Ultraviolet -- :???:
[2024-11-02. : 4:56 am]
NudeRaider -- at least he's now consistent with the name :lol: http://www.staredit.net/380772/
[2024-10-31. : 12:30 am]
ClansAreForGays -- When you join a pub lobby because you see 7/8 players, but then realize host is bating you with computers. :flamer: :flamer:
[2024-10-30. : 11:48 pm]
O)FaRTy1billion[MM] -- :wob:
[2024-10-30. : 6:24 pm]
Ultraviolet -- :wob:
Please log in to shout.


Members Online: Ultraviolet