Staredit Network

Staredit Network -> Concepts -> OMG! I just broke the string limit!
Report, edit, etc...Posted by BSTRhino on 2005-03-28 at 07:56:56
As part of my research creating my trigger programming language Neutrino, I have been working on a map and coded it entirely using the Neutrino's language. The programming language has been working perfectly for the past few weeks, and its been reading and writing real StarCraft CHK files for about a week now. Just today I wondered what would happen if I used Neutrino to create strings beyond the string limit of 1024 that we have known about.

So, I stuck this Neutrino code into a map I was already in the middle of.
CODE
#enumerate(testMineralCount, $mineralAmount = arithmaticSequence(0,2500,1))
if(switch["P.ReloadGas"] == true && player["currentPlayer"].resource[ResourceType_Ore] == $mineralAmount) {
display("$mineralAmount", true);
}
testMineralCount#


I tried compiling that with Neutrino. The program took about three minutes to compile (that's why the #enumerate command will never be in a release version, it just makes it as if I typed in 7500 lines of code myself. How slow!) but in the end I had a 7 MB CHK file which compiled down to an 150 KB SCX file, containing over 2500 strings.

To my great surprise and at the same time expectation, the map worked. StarCraft ran the map and its 2500 strings without a hitch, and displayed my mineral amount whenever the switch P.ReloadGas was set. Heimdal did say that he had made a map with 1025 strings, and so I wasn't completely surprised, but still I was quite impressed with myself.

Then I thought "heh, so we've got 2500, what happens if we had 25000?"

I created a new blank test map, wrote some slightly different code that would generate 25000 strings (and 25000 triggers for that matter). It's taking a long time, currently I've had it running for an hour and it has processed 1800 triggers. I'll leave it running overnight and post the result when it completes. However, with the 2500 string map working fine, I don't see why a 25000 string map wouldn't work.

So there you go. Strings beyond 1024 are possible. Voila


I'm posting a copy of the map I was working on that has 2500 strings. I would've made a test map without my triggers in there to annoy you, but it takes too long, and the 25000 string generator is running right now and I don't want to interfere with that. It's in no way finished, and if you open it up and find badly coded parts in it (there are some triggers with always actions in there that server no purpose) I blame the prototype programming language I was using for not being finished enough to have everything perfectly optimised.
Report, edit, etc...Posted by Heimdal on 2005-03-28 at 09:44:35
Very impressive!

I hate to burst your bubble, but the 25000 string map will not work unless you have more than one offset in the string table pointing to the same string (but then why would you need two string entries?). The offset table will take up 50002 bytes, leaving 15533 bytes for the string data (the last offset must be less than 65535). 15533 / 25000 = 0.62 bytes per string.

But still, good job with verifying that it can be done. Even though I did it a while ago too, this test is a bit more solid proof because I only had 1025 string entries and successfully used the 1025th, not 1025 actual strings.
Report, edit, etc...Posted by BeeR_KeG on 2005-03-28 at 10:17:47
Very good job I'd have to say. I always thought that there was a way of breaking 1024 strings simply because they are bytes of information and there is no limit to that, it would just make your map bigger.

The program you are using seems to be pretty fast but could be faster. No one could do 2500 string manually in 3 minutes but then again, that 1800 triggers in one hours is a lot of time and no average user will wait that long.
Is there any way to make it faster or are those the limits of your program or programming language? Or maybe you have a slow PC?
Report, edit, etc...Posted by Deathknight on 2005-03-28 at 11:15:25
And what about Starcraft's own limit? Why would you need over 1000 strings anyway?
Report, edit, etc...Posted by warhammer40000 on 2005-03-28 at 11:31:43
wow, that sounds unbelievable. I cant believe you get that much strings in a map. Nice Job.
Report, edit, etc...Posted by Mini Moose 2707 on 2005-03-28 at 12:44:31
The string limit was always breakable. Getting it to work is the problem. If I remember correctly, the string limit was only implemented in patch 1.07 or so.
Report, edit, etc...Posted by IDontChat on 2005-03-28 at 15:23:18
Lol, nice. Hello having to not cut maps short cuz of strings.

But 2500 strings, that's gotta a looong map if it's an RPG..........
Report, edit, etc...Posted by DT_Battlekruser on 2005-03-28 at 16:31:32
QUOTE(Heimdal @ Mar 28 2005, 06:44 AM)
Very impressive!

I hate to burst your bubble, but the 25000 string map will not work unless you have more than one offset in the string table pointing to the same string (but then why would you need two string entries?).  The offset table will take up 50002 bytes, leaving 15533 bytes for the string data (the last offset must be less than 65535). 15533 / 25000 = 0.62 bytes per string.

But still, good job with verifying that it can be done.  Even though I did it a while ago too, this test is a bit more solid proof because I only had 1025 string entries and successfully used the 1025th, not 1025 actual strings.
[right][snapback]174410[/snapback][/right]


Yeah, nice job BST. But Heim has a point... you overrided an artificial limit. You'll still get smacked hard in the fact by the byte limit in strings tongue.gif
Report, edit, etc...Posted by BSTRhino on 2005-03-28 at 20:15:32
Yes, I finished compiling the 25000 string thingy this morning, and after feeling a little disappointed I realised what happened. I was going to come here and post the results and tell you, but it looks like Heimdal already explained it heh.

The programming language is slow because of the way it is set up at the moment, in the final version there won't be an #enumerate command because I don't like the way it does text substitution. Instead there will be faster constructs for repeated sequences.

Now I'm off to make a map that really uses strings like no other map...
Report, edit, etc...Posted by Wilhelm on 2005-03-30 at 01:01:29
This is actually quite useful... but the limit only exists in Staredit, really. There's still some kinda limint Starcraft... still, it'd be useful for long, long (true) RPG maps.
Report, edit, etc...Posted by LegacyWeapon on 2005-03-30 at 14:56:42
The limit is not in SC but how large a number an INT can hold.
Report, edit, etc...Posted by scwizard on 2005-03-30 at 16:09:41
Is it possible to exeed the 1024 limit in starforge? By the looks of things, the only way the 1024 limit is enforced is in staredit, not in the acutal game, or in the chk compiling.
Report, edit, etc...Posted by Snipe on 2005-03-30 at 17:56:57
what are string???
Report, edit, etc...Posted by SI on 2005-03-30 at 18:10:06
Its always been known that the stringlimit is only in staredit.
However since the format uses WORDS as offsets you cant have more than 65536 letters (including 3 bytes overhead oer string).

Scmdraft has always been able to add more strings when you reached the limit...
Report, edit, etc...Posted by Endarire on 2005-03-31 at 03:28:00
Will X-tra work?

-EE
Report, edit, etc...Posted by pimpinelephant on 2005-03-31 at 06:51:37
so, am i able to exceed the string limit with SCMDraft2? is it possible with SF? why is there a string limit in the first place, it's not like if you have more than 1024 strings, the world is going to blow up?
Report, edit, etc...Posted by SI on 2005-03-31 at 09:22:47
I suppose either whoever coded staredit was lazy and used a static value or they were afraid you would reach the 65K char limit with more strings.

You should be able to just ignore it with scmdraft 2, however then you probably wont be able to load the maps in SCXE
Report, edit, etc...Posted by Doodle77(MM) on 2005-03-31 at 14:28:59
this trigger programming language thingy, is there any way i could get a look at it. ive been looking for somthing of the sort, because hemidal hsnt released a new version of starforge with loops and such.sad.gif
Report, edit, etc...Posted by RexyRex on 2005-04-01 at 16:42:23
It's not out yet (I think mellow.gif).
But, um, good job BST.
Never fail to suprise me smile.gif.

But, um, this only works with your language?
Becuase I am totally lost in SCMD's layout...

(I'd be more than happy to use the language, looks .. fun tongue.gif)
Report, edit, etc...Posted by BSTRhino on 2005-04-01 at 17:40:40
Like SI said, you can break the string limit in SCMDraft 2... so there's no need to use the program I've made to do it, it's probably easier in SI's program.

I don't know if I'll ever release the programming language to the public. The current version is fun but not featured enough, I don't know if I'll ever make it as high level as I want it to be, but the important thing is I'm learning a lot.
Report, edit, etc...Posted by RexyRex on 2005-04-01 at 17:42:35
That's why I program in the first place.
If your not going to publicly release it...

...

I dunno. I was going trying to somehow say can I have it but nicely. Like would you give it to people who ask. But .. um ..

Oh well mellow.gif..
Report, edit, etc...Posted by Forsaken on 2005-04-08 at 22:29:21
So, maybe this is a dumb question but, do you just keep adding strings into the map and not open it in StarEdit?
Report, edit, etc...Posted by LegacyWeapon on 2005-04-08 at 22:56:45
That's basically what you do happy.gif
Report, edit, etc...Posted by Carlsagan43 on 2005-04-15 at 16:55:21
wouldn't the four byte header in the STR_ section also limit the number of strings?
Report, edit, etc...Posted by LegacyWeapon on 2005-04-15 at 16:59:12
No... the largest offset would have to be less than 65535.

Read about it here:
http://campaigncreations.org/starcraft/sta...chkformat.shtml
Next Page (1)