[skip all navigation]

Text Detection Application

Creator: yoonkwun
Time: Jun 11 2010, 2:22 am

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

[Avatar]
offlinecontact
Rank: Regular
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
This post was edited 3 times, last edit by yoonkwun: Jun 11 2010, 2:45 am.

Top

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

[Avatar]
offlinecontact
Rank: Regular
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.

(user posted image)
Top

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

[Avatar]
offlinecontact
Rank: Regular
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.

Top

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

[Avatar]
Back! Maybe.
offlinecontact
Rank: Regular
Quote from 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

"We live, as we dream - alone..."
-Marlow, Heart of Darkness
Top

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

[Avatar]
offlinecontact
Rank: Regular
Quote from 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
This post was edited 1 time, last edit by Azrael.Wrath: Jun 11 2010, 3:30 am.

(user posted image)
Top

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

[Avatar]
offlinecontact
Rank: Regular
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.

(signature image)
Top

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

[Avatar]
offlinecontact
Rank: Regular
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...

Top

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

[Avatar]
offlinecontact
Rank: Regular
Quote from HCM™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.
This post was edited 3 times, last edit by Azrael.Wrath: Jun 11 2010, 4:37 pm.

(user posted image)
Top

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

[Avatar]
offlinecontact
Rank: Regular
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 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:
zip file
Text Detection.zip (47.99 kb)
18 hits.

Top

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

[Avatar]
Skin to bone, steel to rust, ash to ashes, dust to dust.
offlinecontact
Rank: Regular
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.

I have mostly left SEN except for the Temple Siege 2 forum (hidden to most of you). I am available via PM still, and Skype as JackRCDF.

If it is important to you, you will find a way. Otherwise, you will find an excuse. -Unknown
Magnificent!
Perhaps you shouldn't be on SEN as much, too...
Better than the iPad!
Top

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

[Avatar]
offlinecontact
Rank: Regular
Quote from 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 yoonkwun
Quote from 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.

(user posted image)
Top

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

[Avatar]
offlinecontact
Rank: Regular
Quote from 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.

Top

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

[Avatar]
offlinecontact
Rank: Regular
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 :)
This post was edited 1 time, last edit by Azrael.Wrath: Jun 12 2010, 3:19 am.

(user posted image)
Top

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

[Avatar]
offlinecontact
Rank: Regular
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:
zip file
Text Detection.zip (47.89 kb)
23 hits.
This post was edited 2 times, last edit by yoonkwun: Jun 13 2010, 7:00 pm.

Top

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

[Avatar]
offlinecontact
Rank: Regular
Woot, nice update ^^

(user posted image)
Top

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

[Avatar]
bannedcontact
Rank: Member
How does this work? I tried using it but nothing happens.

Top

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

[Avatar]
offlinecontact
Rank: Regular
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.

Top

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

[Avatar]
offlinecontact
Rank: Regular
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:
protrg file
drop.protrg (8.07 kb)
16 hits.
This post was edited 2 times, last edit by yoonkwun: Jun 17 2010, 11:50 pm.

Top

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

[Avatar]
I don't know what to write yet :/
offlinecontact
Rank: Regular
Quote from 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.

------------------Leeroy_Jenkin's Maps:
★★★★ The Saddest Map on SC----------★★★★★ Escape Hell RPG----------★★★★★ NHL 2013 vBETA
----------------------------------------------------------------------------------------NEW
★★★★★ Middle of the Ocean RPG---------★★★★ 2-D Mario DEMO -Soon to be completed!
------------------
★★★★★ Middle of the Ocean 2 RPG-------★★★★★ Rescue Team RPG
Top
0 members in this topic (italic members are currently writing a reply): None
+ guest(s)


[07:47 pm]
lil-Inferno -- R.I.P. Kame
[07:23 pm]
Oh_Man -- Brings whole new meaning to the phrase "flat-lining".
[07:21 pm]
RIVE -- lol
[07:09 pm]
jjf28 -- ... uh oh :-(
[07:06 pm]
jjf28 -- are you literally dead yet? :kame:
[07:03 pm]
Fire_Kame -- azrael I am literally dying while I wait for you to draw something
Please log in to shout.