Staredit Network > Forums > SC1 UMS Theory and Ideas > Topic: Writing to SC's memory with extended units!
Writing to SC's memory with extended units!
Aug 7 2012, 3:17 am
By: Biophysicist
Pages: < 1 « 3 4 5 6 710 >
 

Aug 25 2012, 12:58 am Azrael Post #81



Tested the Dark Archon spells, they didn't cause a crash :kame:

Quote from Sand Wraith
You guys might want to test out a unit chnaged into a High Templar and try to have them merge into an Archon. I'm leaning towards success since I have done something similar, although I don't recall the details so it still may fail.

Try for DTs and DAs also.

I tried these and they worked ^^




Aug 25 2012, 1:13 am IAGG Post #82



Ok so i have a few questions with this amazing new discovery.

1. Is it possible to force and control zerg upgrades? Such as Zerg ground upgrades (Melee, Range, Armor)

2. Im not exactly sure how to word this so bare with me. Im wondering if its possible to give a Marine MORE than 2 names. For example, a normal Terran Marine, the Hero Marine Jimmy and any other unit. For instance, is it possible to transfer 1 specific unit and not all of its type. Like turning 1 normal marine into a hydralisk which would give it the new name. If you need more explaining just say and ill try to reword.



None.

Aug 25 2012, 7:18 am Roy Post #83

An artist's depiction of an Extended Unit Death

Quote from IAGG
1. Is it possible to force and control zerg upgrades? Such as Zerg ground upgrades (Melee, Range, Armor)
Only for ones that land on the first byte (refer to this EUDDB reference page), keeping in mind that even-numbered players have their upgrades shifted by two bytes. Zerg Flyer Carapace and Zerg Flyer Attack would be possible for odd-numbered players, and Zerg Melee Attack would be possible for even-numbered players.

Quote from IAGG
2. Im not exactly sure how to word this so bare with me. Im wondering if its possible to give a Marine MORE than 2 names. For example, a normal Terran Marine, the Hero Marine Jimmy and any other unit. For instance, is it possible to transfer 1 specific unit and not all of its type. Like turning 1 normal marine into a hydralisk which would give it the new name. If you need more explaining just say and ill try to reword.
By changing the unit type, you change its name, weapons, armor, wireframe, and more. Refer to one of the example maps made earlier in the thread to see this in action.




Aug 25 2012, 4:44 pm iCCup.xboi209 Post #84



It'd be nice if someone wrote clear step by step instructions for this



None.

Aug 25 2012, 5:21 pm jjf28 Post #85

Cartography Artisan

given that bio's gone i'll probably write up a new thread in a week or so, unless someone else is planning on that



TheNitesWhoSay - Clan Aura - github

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Aug 25 2012, 5:51 pm Chia-Tyrant Post #86



Quote from xboi209
It'd be nice if someone wrote clear step by step instructions for this
Although most of what you need to know is outlined in the previous posts, I guess that a quick summary could be a good thing.

Here's a list of the different methods we used to write to a certain address:
  • Address=4*Player+48*UnitID+5787104 The number of completed UnitID owned by Player.
  • Address=4*Player+48*UnitID+5776160 The total number of UnitID owned by Player.
  • Address=4*Player+48*UnitID+5808992 The number of deaths of UnitID suffered by Player.
  • Address=4*Player+48*UnitID+5798048 The number of UnitID that Player has killed.

For instance, the number of completed vultures (unit id=2) owned by player 7 would be stored in the address 4*7+48*2+5787104=5787228.

If we wanted to modify the Terran Ship Plating upgrades of Player 10, we'd first have to find what its address is. We'd have to look through The Almighty EUD DB. According to this the addresses for upgrades start at 0x0058D2B0 (which is 5821104 in base 10, the one I'll be using for simplicity's sake) and according to that, we'd need to add 46*(10-1)+2 to that address. So, the address of player 10's ship plating upgrades is 5821104+46*(10-1)+2=5821520.

If we wanted to modify those upgrades simply by pre-placing units on our map (i.e. by modifying the completed unit and total unit count that were mentioned in the table above), we'd need to use one of the two equations:
5821520=4*Player+48*UnitID+5787104
5821520=4*Player+48*UnitID+5776160

Solve for Player and UnitID.

One of the many solutions to the first equation (i.e. the one for completed units) is:
UnitID=716
Player=12

We can easily see that 4*12+48*716+5787104=5821520. Therefore, placing a Unit ID 716 (in SCMDraft 2, change the unit ID to 716 in unit properties) owned by player 12 will increase player 10's terran ship upgrades by 1.

Another equation that is useful to know is that the properties of a unit at a certain index is stored in the address:
Address=6455960-336*(Index-1)+offset

You would find the value for the offset in this table. According to it, the offset for the unit ID is +0x64 in hexadecimal, or +100 in base 10. Therefore, if we wanted to change a ghost (unit ID=1) in index 1594 into a shuttle (unit ID=69), we'd need to increase the value stored in address 6455960-336*(1594-1)+100=5920812 by 69-1=68. You'd just need to solve for UnitID and Player the same way we did previously. We find that one of the solutions is:
UnitID=2785
Player=7

So placing 68 UnitID 2785 owned by player 7 would turn our ghost into a shuttle. Be careful though, sometimes you can only preplace extended units for players 9-12 then give them to player 7 using triggers.

In addition to this, if we wanted to update the command card of our brand spanking new shuttle (so that we'd be able to see the shuttle's abilities), we could use the address for the maelstrom timer, since the command card refreshes when maelstrom (or any other stunning spell) expires. We find that the offset for that value is +0x124 in hexa or 292 in base 10. So we'd need to modify address 6455960-336*(1594-1)+292=5921004. One of the solutions to that equation is:
UnitID=2789
Player=7

Last but not least, since the player ID's for the all the stuff I found previously were between 1 and 12, I can use the "Give to player" action in triggers to increase and decrease those values as many times as I want. Therefore, we'd be able to switch a ghost into a shuttle, then into a high templar at some point, etc.

The only real difficulty of this system is finding unit ID's that don't crash (or cause any other problems). Unfortunately, they're quite rare in some ranges. So far, I found that the following ID's were givable, destructible (or anyway, appeared to be):
List of "good" extended unit IDs


I hope that was helpful. I'm not too sure if I gave too many details or if I should have given more. Anyway, if anyone still has any questions concerning this topic, don't hesitate to ask. ^^

Edit:What's wrong with tables? They work in messages but not in posts?

Post has been edited 1 time(s), last time on Aug 25 2012, 6:54 pm by Chia-Tyrant.



None.

Aug 25 2012, 7:40 pm Roy Post #87

An artist's depiction of an Extended Unit Death

You should note that those "good" Unit IDs only work for certain players. So even those Unit IDs are prone to crashing the game. That's why I abandoned a confirmation list for http://www.staredit.net/topic/15378/.




Aug 26 2012, 1:49 am iCCup.xboi209 Post #88



You just killed my brain, what's base 10?



None.

Aug 26 2012, 2:35 am Jack Post #89

>be faceless void >mfw I have no face

Base 10 is 0 1 2 3 4 5 6 7 8 9, and is known as decimal. Base 2 uses only 0's and 1's, and is also known as binary.



Red classic.

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

Aug 26 2012, 2:47 am iCCup.xboi209 Post #90



So how would you convert hexadecimal into base10?

EDIT: I don't get how you get the unitid in the first place

Post has been edited 1 time(s), last time on Aug 26 2012, 3:03 am by xboi209.



None.

Aug 26 2012, 2:59 am jjf28 Post #91

Cartography Artisan

typically like this:



(calculator must be in advanced mode/programmer mode, enter a hex number (while the hex bullet's selected) then click the dec bullet and it will be converted)

If you want to learn counting in different bases, start with counting in binary (base 2), hex (base 16) should be relatively easy to understand after that.



TheNitesWhoSay - Clan Aura - github

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Aug 26 2012, 1:38 pm Chia-Tyrant Post #92



Quote from xboi209
EDIT: I don't get how you get the unitid in the first place
What do you mean? Are you saying you don't know what the unit id is or you don't know how to solve the equations to find it?

You need to use this version of SCMDraft to see it.

If you referred to the equations, then use the following procedure.

The equations are of the form:
c=48*x+4*y

Where c is a positive integer and a constant.
Under the constraints:
  • 0<=x (the unit ID must be 0 or greater)
  • 1<=y<=256 (the player ID must be between 1 and 256)
  • x is a positive integer
  • y is a positive integer


From the first equation, we can isolate y:
y=(c-48*x)/4
=c/4-12*x

Since y must be an integer, c must be a multiple of 4.

Under the constraint y>=1:
c/4-12*x>=1
x<=(c/4-1)/12

x must also be an integer:
x<=Floor((c/4-1)/12)

Under the constraint y<=256:
c/4-12*x<=256
x>=(c/4-256)/12

x must also be an integer:
x>=Ceiling((c/4-256)/12)
We also have to remember that x>=0:
x>=Max(0,Ceiling((c/4-256)/12))

Therefore, to obtain the desired unit IDs (x) and player IDs (y), we would use the following procedure:


If c is a multiple of 4 Then
i=1
For x=Max(0,Ceiling((c/4-256)/12)) To Floor((c/4-1)/12)
yi=(c-48*x)/4
i=i+1
Else
There are no solutions.



For instance, if we wanted to write to address 5821520 and use completed units:
5821520=4*Player+48*UnitID+5787104

We'd use c=5821520-5787104=34416

Therefore, we'd need to solve the equation:
34416=48*x+4*y

c/4=34416/4=8604 is an integer. Thus, c is a multiple of 4.

Max(0,Ceiling((c/4-256)/12))=696
Floor((c/4-1)/12)=716


We would therefore obtain the following solutions for (x,y):
{(696,252),(697,240),...,(716,12)}

Reminders:
  • >= is greater than or equal to.
  • <= is lesser than or equal to.
  • Floor(x) is the biggest integer lesser than or equal to x, e.g. Floor(2.12345)=2
  • Ceiling(x) is the smallest integer greater than or equal to x, e.g. Ceiling(2.12345)=3
  • Max(x,y) is the biggest value between x and y, e.g. Max(1,2)=2
  • Min(x,y) is the smallest value between x and y, e.g. Min(1,2)=1




None.

Aug 26 2012, 4:58 pm staxx Post #93



I still think someone should write this out (the formulas) on its own thread as opposed to having it floating around on pages of a thread that may end up having many, many pages. Just a suggestion though ;)



None.

Aug 26 2012, 6:10 pm Roy Post #94

An artist's depiction of an Extended Unit Death

Quote from name:xboi209
EDIT: I don't get how you get the unitid in the first place
I cover Unit Index IDs in detail in http://www.staredit.net/topic/14226/#304567 if Chia's answer isn't complete enough for you. Don't get them confused with Unit Type IDs, which are oftentimes called UnitIDs.

Quote from name:xboi209
It'd be nice if someone wrote clear step by step instructions for this
Quote from staxx
I still think someone should write this out (the formulas) on its own thread as opposed to having it floating around on pages of a thread that may end up having many, many pages. Just a suggestion though ;)
This discovery is still in its infancy (as you can see from this topic's activity), so writing a higher-level thread at this point would be a bad idea, in my opinion. It would be more appropriate to make that thread once everything has settled and practices have been solidified, because then we can approach the task of readability as well. I already made a program (http://www.staredit.net/topic/15378/) so you can avoid doing manual calculations for everything except player kills, and jjf posted an excel sheet (http://www.staredit.net/335347/) to look them up that way as well.

If you want to be cutting-edge and look at the lower-level explanations for this discovery, this topic serves that purpose just fine. It has all the information you need (more than what you need, really), but you're going to have to understand it from a lower-level perspective, which if you don't already understand EUDs from a lower-level perspective, will likely be a difficult thing to do.

Post has been edited 1 time(s), last time on Aug 26 2012, 6:15 pm by Roy.




Aug 27 2012, 12:22 am Kimaru2 Post #95



Is there any word on which units are more likely to crash than others? For instance, I'm modifying unit indexes 1367-1370 by killing units (shown in jff28's table) and I kill these units up to 10 seconds after map start. The problem is, if I wave my mouse cursor around while the killing is occurring, I sometimes crash, and sometimes I don't. It's pretty sporadic. Would maybe modifying different indexes (thereby using different unit IDs) help prevent crashes? Or are all extended units equally likely to cause crashes?



None.

Aug 27 2012, 12:43 am jjf28 Post #96

Cartography Artisan

Different unitIDs have a different chances of crashing (best illustrated by units that always crash when the map loads or when looked at), different IDs would almost certainly be more or less stable - I haven't used any of the units on that table besides 3900 extensively so let me know which ones on my list are particularly volatile and i'll try to replace them.

Crashing with cursor location, that is rather curious! Having the units in the fog generally helps and may solve that specific crash.



TheNitesWhoSay - Clan Aura - github

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Aug 27 2012, 12:49 am Kimaru2 Post #97



It may not be a cursor-related crash, rather dumb luck that I crash when I just so happened to be waving my cursor around. In addition to 3900, I'm using the next 3 IDs in your list (for 1368-1370). I could show you if you'd like.

Also, all my extended units are under the fog of war :P



None.

Aug 28 2012, 7:43 am TF- Post #98

🤙ðŸ¾

Kinda random but could this be used to dynamically destroy a doodad's sprite? Or changing terrain tiles.



🤙ðŸ¾

Aug 29 2012, 4:38 am O)FaRTy1billion[MM] Post #99

👻 👾 👽 💪

You might be able to change sprites (but I'm not sure where the sprite table is), but you can't change the terrain because it is in a dynamic position.



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!

Sep 1 2012, 2:20 am KingOfKings Post #100



I had a great idea for testing unit IDs.
We would need a bot maker, preferably who has access to a winbot source code.
Configuration involves path to starcraft executable and path to the starcraft map file name
The bot starts a game with the specified file name and detects whether starcraft crashes or not and records this onto a list with two sections, one for crash one for success
It could also be separated by player
preferably the bot would test on multiple player numbers or a single specified player number
after the test it leaves the game if it hadn't crashed and adds 1 to the unit ID in w/e way would be easiest (mouse/keyboard emulation or if a simple editor can be used)
it then rinses and repeats. I have no idea if this is feasible, but if it is, it would certaintly improve the effeciency and capability of EUPs.
If anyone uses this idea, please let me know. I will be posting this on bnetweb as well and if there is a response I will post it here. I will link their thread to this one as well.
BNETWEB THREAD: http://www.bnetweb.org/threads/starcraft-eups.9298/



None.

Options
Pages: < 1 « 3 4 5 6 710 >
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:39 am]
Ultraviolet -- no u elky skeleton guy, I'll use em better
[10:50 pm]
Vrael -- Ultraviolet
Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
hey cut it out I'm getting all the minerals
[10:11 pm]
Ultraviolet -- :P
[10:11 pm]
Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
[2024-4-17. : 11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[2024-4-17. : 3:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
[2024-4-17. : 1:53 am]
Vrael -- bet u'll ask for my minerals first and then just send me some lousy vespene gas instead
[2024-4-17. : 1:52 am]
Vrael -- hah do you think I was born yesterday?
Please log in to shout.


Members Online: Roy, jun3hong