Staredit Network > Forums > SC1 UMS Theory and Ideas > Topic: The Practical Guide to EUPs
The Practical Guide to EUPs
Sep 13 2014, 3:53 pm
By: jjf28  

Sep 13 2014, 3:53 pm jjf28 Post #1

Cartography Artisan

Jump to Guide Start
Basic EUP Operations


By Placing:
    1.) Address incremented = 48*(Placed unit’s UnitID) + 4*(Placed unit’s Owner) + 5776160 (Table 1)
    2.) Address incremented = 48*(Placed unit’s UnitID) + 4*(Placed unit’s Owner) + 5787104 (Table 2)

- For By Placing to work on units, the extended unit must have a higher index than the target unit

By Removal/Death:
    1.) Address decremented = 48*(Placed unit’s UnitID) + 4*(Placed unit’s Owner) + 5776160 (Table 1)
    2.) Address decremented = 48*(Placed unit’s UnitID) + 4*(Placed unit’s Owner) + 5787104 (Table 2)

By Killing:
        Address incremented = 48*(Killed unit’s UnitID) + 4*(Player that killed) + 5798052 (Table 3)

By Death:
        Address incremented = 48*(Dying unit’s UnitID) + 4*(Dying unit’s Owner) + 5808992 (Table 4)

By Giving:
    1.) Address incremented = 48*(Given unit’s UnitID) + 4*(New Owner) + 5776160 (Table 1)
    2.) Address decremented = 48*(Given unit’s UnitID) + 4*(Old Owner) + 5776160 (Table 1)

    3.) Address incremented = 48*(Given unit’s UnitID) + 4*(New Owner) + 5787104 (Table 2)
    4.) Address decremented = 48*(Given unit’s UnitID) + 4*(Old Owner) + 5787104 (Table 2)

- Incremented/Decremented means +1/-1
- Players in this reference/guide are always 1-based
- The tables refer to which table in StarCraft’s memory they are overflowing
- Several of these equations are based on the same table and will undo each other


Calculating Affected Indexes


Table 1
    Low bound index: (679112 – 48*UnitID) / 336
    High bound index: (680132 – 48*UnitID) / 336

Table 2
    Low bound index: (668168 – 48*UnitID) / 336
    High bound index: (669188 – 48*UnitID) / 336

Table 3
    Low bound index: (657220 – 48*UnitID) / 336
    High bound index: (658240 – 48*UnitID) / 336

Table 4
    Low bound index: (646280 – 48*UnitID) / 336
    High bound index: (647300 – 48*UnitID) / 336

- You may not be able to edit the attributes you want if only part of a unit index is covered

Units


Find an Offset: Offsets

If index > 0    Address = 6456296-336*index + offset
Else            Address = 5885096 + offset

Player = (Address – 48*UnitID – (Table Offset))/4

- The "Table Offset" is the only constant in the EUP Operation equations, Ex: By Death’s is 5808992

Death-Table Addon EUPs


Setting Target Byte:
    Deaths of Player 4 Marines = Target Address - 10
    Give to (Player 1) + (Target Value)

        Target Address + 4, 4th bit (aka 0x8) must NOT be set
        Target Address +18 (4 bytes) must be zero

    
dEUPs By Giving:
    1.) Address incremented = 48*(Deaths of Player 2 Vultures) + 4*(New Owner) + 5776160
    2.) Address decremented = 48*(Deaths of Player 2 Vultures) + 4*(Deaths of Player 8 Ghosts) + 5776164

    3.) Address incremented = 48*(Deaths of Player 2 Vultures) + 4*(New Owner) + 5787104
    4.) Address decremented = 48*(Deaths of Player 2 Vultures) + 4*(Deaths of Player 8 Ghosts) + 5787108

- Incremented/Decremented means +1/-1
- If you didn't understand a word on this post, good, that's why I wrote the next 10 posts


Post has been edited 13 time(s), last time on Nov 16 2015, 7:01 pm by jjf28.



TheNitesWhoSay - Clan Aura - github

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

Sep 13 2014, 3:54 pm jjf28 Post #2

Cartography Artisan

Table of Contents

    1. Introduction
          1.1 Prerequisites
          1.2 Operating Systems
          1.3 Dat Formula Sheet

    2. Extended Units
          2.1 Terms
          2.2 Exercises

    3. The Basic EUP Operations
          3.1 By Placing
          3.2 By Removal/Death
          3.3 By Killing
          3.4 By Death
          3.5 Helpful Tools

    4. Give EUPs
          4.1 The Formulas
          4.2 Applications

    5. Crashes, Limits, and Frustrations
          5.1 Overview
          5.2 Resolutions

    6. Using EUPs to Modify Units
          6.1 Finding Non-Crashing UnitIDs
          6.2 Determining Editable Indexes
          6.3 Calculating Unit Property Addresses
          6.4 Calculating the Player
          6.5 Creating the Map

    7. The Path to Better EUPs
          7.1 Loop EUPs
          7.2 Interceptor EUPs
          7.3 Addon EUPs

    8. Death-Table Addon EUPs
          8.1 Improved Give EUPs
          8.2 One Byte Set
          8.3 Mix and Match
          8.4 Setting Up
          8.5 Four Byte Set

    9. Appendix
          9.1 Glossary
          9.2 Links and Downloads
          9.3 Unit Lists


Post has been edited 9 time(s), last time on Oct 3 2014, 9:59 pm by jjf28.



TheNitesWhoSay - Clan Aura - github

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

Sep 13 2014, 3:54 pm jjf28 Post #3

Cartography Artisan

1. Introduction

1.1 Prerequisites

This guide assumes the following…

    - You know how to find an address in StarCraft’s memory.
        Sections 1-4 of [EUD] A Mapmaker's Guide for Creating EUDs can help with this.

    - You understand the difference and relationship between 1-byte and 4-byte values.
        Section 4 of [EUD] A Mapmaker's Guide for Creating EUDs deals with this specifically.

    - You can convert from hex to decimal and from decimal to hex.
        wikihow Converting from Decimal to Hexadecimal can help with this.

    - You have the latest versions of SCMDraft and CHKDraft downloaded
        SCMDraft, CHKDraft


1.2 Operating Systems

Many parts of this guide are intended for Windows users only; expect the exercises not to work if you use a different operating system. The formulas should generally remain sound across operating systems but many extended units that work on one operating system will often crash on another for various reasons.


1.3 Dat Formula Sheet

The reference sheet comes first as that’s what anyone who’s learned the material, like myself, will want to see first. It may appear daunting, but we’ll tackle these formulas one at a time.

Post has been edited 6 time(s), last time on Oct 3 2014, 10:00 pm by jjf28.



TheNitesWhoSay - Clan Aura - github

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

Sep 13 2014, 3:54 pm jjf28 Post #4

Cartography Artisan

2. Extended Units

2.1 Terms

Important terms when talking about units:

    Index – A number specifying what order a units appear in the map (often the same as the order you placed them in). (Picture)
    UnitID – A number that is unique to each type (ex: marine, ghost, zergling) of unit. (Picture)
    Player/Owner – The player that owns the unit. (Picture)


Blizzard only intended for units to be owned by players 1-12, and only with UnitIDs less than 227, we call units that use higher values Extended Units.

If you place an Extended Unit on the map, you are said to have engaged in Extended Unit Placement (EUP). But the term “EUP” refers not only to the placing of the unit, but also to the various things you can do with those extended units; watch out for its tricky usage.


2.2 Exercises

So let’s try some extended units!

Exercise 1.1:

- Download this: Blank Map, or…

“Make it yourself”


- If you haven’t already, open up the map in SCMDraft, and place a Terran Marine near the center of the map, select it and hit enter to bring up its properties.
- Change the UnitID to 300 and the Owner to Player 1. (note that while it may still use marine graphics in SCMDraft/CHKDraft, it's no longer a marine)
- Save the map
- Open the map in StarCraft


What did I just do?


Exercise 1.2:

- Next, change the extended unit’s UnitID to 3900, and the owner to player 9
- Place a Protoss Dragoon for Player 1 somewhere nearby
- Save and open the map in StarCraft

What did I just do?


Checkpoint:
    - What’s an extended unit?
    - Will more extended units crash or not-crash?
    - What’s EUP?

Post has been edited 8 time(s), last time on Feb 21 2015, 1:16 am by jjf28.



TheNitesWhoSay - Clan Aura - github

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

Sep 13 2014, 3:54 pm jjf28 Post #5

Cartography Artisan

3. The Basic EUP Operations

How can we deliberately change something? You can find the same formulas in the same order in the reference sheet at the top.

Note that when I say incremented/decremented in this guide that means +1/-1


3.1 By Placing

By Placing: This is as easy as it gets. You place an Extended Unit down and when the map loads, it will add one to the address as calculated below (note that if you're editing an address that belongs to a unit, it must be at an index higher than that unit).

    1.) Address incremented = 48*(Placed unit’s UnitID) + 4*(Placed unit’s Owner) + 5776160 (Table 1)

To use the formula, determine what address you want to edit, put it in for Address Incremented, then solve for the UnitID and Owner of the Extended Unit you will place, there will be multiple solutions, and they will all work (assuming they don’t crash).


Exercise 3.1: A map has one UnitID 3900 placed for player 9, according to the first “By Placing” formula, what address increases by 1? Give your answer to hex.

Answer



The Other by Placing: This works exactly the same as the first “By Placing” formula, you just place the extended unit down and the address gets incremented. Be aware that these both happen together, but we’ll almost always focus on just one at a time.

    2.) Address incremented = 48*(Placed unit’s UnitID) + 4*(Placed unit’s Owner) + 5787104 (Table 2)


Exercise 3.2: Now calculate the address (in hex) for the same unit (UnitID 3900, player 9) using the second “By Placing” formula.

Answer



You may be noticing the (table #) notation; this refers to which score the formula is based on, knowing about the tables isn't generally important, but that’s why some of the formulas use the same numbers. Having table numbers will help later when editing units.

Show Me



3.2 By Removal/Death

If a unit gets removed (by trigger) or dies, the addresses that were incremented by the “By Placing” formulas will have 1 subtracted, as summarized in the “By Removal/Death formulas”

By Removal/Death:
    1.) Address decremented = 48*(Placed unit’s UnitID) + 4*(Placed unit’s Owner) + 5776160 (Table 1)
    2.) Address decremented = 48*(Placed unit’s UnitID) + 4*(Placed unit’s Owner) + 5787104 (Table 2)


So you can remove effects created using the “By Placing” formulas by having the unit removed/killed. The Extended Unit’s UnitID and Owner may change before being removed/killed, causing the address decremented to change, but we won’t worry about this till later.


3.3 By Killing

This occurs when a player kills an extended unit, note that it’s the killing player used in the formula, not the extended unit’s owner, also note that not every extended unit can be killed.

By Killing:
        Address incremented = 48*(Killed unit’s UnitID) + 4*(Player that killed) + 5798052 (Table 3)



3.4 By Death

This occurs when an Extended Unit Dies.

By Death:
        Address incremented = 48*(Dying unit’s UnitID) + 4*(Dying unit’s Owner) + 5808992 (Table 4)


- For all of these formulas you could easily add multiple by using several of the same units, rather than just one.


Exercise 3.3: Using a marine, Player 1 kills a single UnitID 3900 owned by player 9, according to the “by death” and “by killing” formulas, which two addresses are increased by 1? Give your answers in hex.

Answer


Exercise 3.4: Locate the address for Player 1’s Stim Packs (we’ll use this in exercise 3.5).

Answer


Exercise 3.5: In a map, make stim packs become researched using UnitID 227 (Vespene Tank) and the “by death” formula (use the address you found earlier; again you may need to reselect units to see the change).

Answer


3.5 Helpful Tools

EUP Calc

If the very thought of calculating something scares you… never fear, Roy is here!



Just enter the address you want to change and it’ll show UnitID and Owner combinations for units you can place to add 1 (same as give, as seen in the next section), or have die to add 1 (note that he skips the “by killing” formula).

You may have to test a lot to find a combination that doesn’t crash and gets you to the finish line ScQuickLaunch and/or EUP Test may help speed up your endeavors but for current lack of an excellent testing tool you may still be in for a lot of work… if you choose to target addresses in this fashion.

Post has been edited 9 time(s), last time on Oct 3 2014, 9:57 pm by jjf28.



TheNitesWhoSay - Clan Aura - github

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

Sep 13 2014, 3:54 pm jjf28 Post #6

Cartography Artisan

4. Give EUPs (gEUPs?)

The first couple formulas limit you to adding a low amount once, to addresses. By using the give trigger with Extended Units, we can add and subtract at times that are more directly under our control.

These formulas aren’t new; they use exactly the same numbers as the “by placing” formulas (they’re also from table 1 and table 2), but it’s useful to rewrite them for quick reference.


4.1 The Formulas

By Giving: Simply give your extended unit to another player, and these addresses will change.

    1.) Address incremented = 48*(Given unit’s UnitID) + 4*(New Owner) + 5776160 (Table 1)
    2.) Address decremented = 48*(Given unit’s UnitID) + 4*(Old Owner) + 5776160 (Table 1)


The other by Giving formulas: Works just like the first two “by giving” formulas. In a similar fashion to the two by-placing formulas, all four of these effects will happen at the same time, but we usually only worry about 1 and 2, or only about 3 and 4 together.

    3.) Address incremented = 48*(Given unit’s UnitID) + 4*(New Owner) + 5787104 (Table 2)
    4.) Address decremented = 48*(Given unit’s UnitID) + 4*(Old Owner) + 5787104 (Table 2)



Exercise 4.1: Using the 3rd and 4th by giving formulas, determine what address increases by 1 and what address decreases by 1 when a UnitID 800 owned by Player 5 is given to Player 6, express your answers in the following form: (+/-) 1 to 0x(Address).
Answers


4.2 Applications

Just like the first four operations (by placing, by removal/death, by killing, and by death), using multiple units with the “by giving” formulas will increase/decrease by the amount of units you use.

Using these you can make and retract your changes to addresses; this can be useful for all sorts of things like unit transformations. Later in Loop EUPs we’ll see how Give EUPs can be used to continuously increase values (with fair amounts of restrictions) without simply increasing the number of extended units.

Post has been edited 4 time(s), last time on Feb 20 2015, 10:33 pm by jjf28.



TheNitesWhoSay - Clan Aura - github

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

Sep 13 2014, 3:55 pm jjf28 Post #7

Cartography Artisan

5. Crashes, Limits, and Frustrations

5.1 Overview

If you stopped learning right now and went out to build maps using these formulas and/or EUP Calc, you’re going to find that you’re fighting a losing battle against the crashes, in many cases no combination will work without crashing. In addition the limits imposed by the add 1/subtract 1 only nature of the formulas may discourage you from using EUPs; not to mention that give-EUPs and “by killing” can only be used with player 1-12.

5.2 Solutions

As mentioned, ScQuickLaunch and EUP Test can help you find units faster and with less work, but to truly escape the limits and the brute testing we’ll need to learn more effective methods as found in part 6 and 8.

Post has been edited 3 time(s), last time on Oct 3 2014, 10:00 pm by jjf28.



TheNitesWhoSay - Clan Aura - github

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

Sep 13 2014, 3:55 pm jjf28 Post #8

Cartography Artisan

6. Using EUPs to Modify Units



One of the most commonly used EUP applications is changing things about units, changing the UnitID of a unit in game, for example, can make an SCV attack like a wraith, or a firebat pick up units like a dropship. One nice thing about units (in the case of EUPs) is that by changing their index, their address also changes, so we can slide units into positions where they can be affected by Extended Units that we know don’t usually crash.

The basic order is:
1.) Find a working extended unit (the UnitID for a formula)
2.) Find the index of a unit you can change using that UnitID
3.) Find the address of the unit property you want to change within that index (the Address incremented/decremented for a formula)
4.) Calculate the player for the UnitID and address you have found
5.) Try the map!

Details for each step follow…


6.1 Finding Non-Crashing UnitIDs

Find some non-crashing UnitIDs between 1585 and 13478

You can use EUP Test as a starting point, though just because a unit didn’t crash with the generous conditions EUP Test uses, doesn’t mean it won’t crash in your map, always have these units in the fog (if possible, sometimes you need to kill a unit, though units are always more stable if you can't view or select them) and make sure a UnitID works before you start calculating!

Remember that not all non-crashing Extended Units will be givable/killable.


6.2 Determining Editable Indexes

Determine what indexes you can affect using that UnitID

The following will help you determine which indexes can have their attributes edited by which formulas.

Recall that every formula in the reference sheet has a table number after it; a formula can edit the following indexes based on what table it belongs to.

Table 1
    Low bound index: (679112 – 48*UnitID) / 336
    High bound index: (680132 – 48*UnitID) / 336

Table 2
    Low bound index: (668168 – 48*UnitID) / 336
    High bound index: (669188 – 48*UnitID) / 336

Table 3
    Low bound index: (657220 – 48*UnitID) / 336
    High bound index: (658240 – 48*UnitID) / 336

Table 4
    Low bound index: (646280 – 48*UnitID) / 336
    High bound index: (647300 – 48*UnitID) / 336


Example Calculation


6.3 Calculating Unit Property Addresses

Calculate the address of the attribute you want to change

Start by finding the offset of your desired property from the start of the unit, to do so, refer to The Offsets.

Then plug it into the equation:

If index > 0    Address = 6456296-336*index + offset
Else            Address = 5885096 + offset


Example Case


Exercise 6.1: Calculate the address of index 813’s unitID, state your answer in dec.

Answer


6.4 Calculating the Player

Calculate the player, the only variable left to finish an equation (since you now have an address and a UnitID)

Now you have a linear equation with one unknown (player, since you have the address and UnitID); you could probably solve this yourself, but I’ll give you a shortcut anyways.

Player = (Address – 48*UnitID – (Table Offset))/4

Table Offset: This is just the big number added to all “Basic EUP Operations” formulas, like 5808992 in the “By Death” formula.

Exercise 6.2: Calculate the player for changing index 813’s UnitID using UnitID 7777 using the “By Death” formula.

Answer


6.5 Creating the Map

It’s not over till it’s over!

Put the extended unit in the map and do whatever you need to do for the formula you’re using, and see if it works. If you're using the "By Placing" formulas, make sure that the index of your extended unit is higher than the index of the unit you're editing (otherwise your change will just be undone when the unit loads).

Unfortunately introducing new player numbers sometimes causes crashes, and some extended units will refuse to behave the way you want them to; if it crashes or doesn’t work (and your math is good) just move on to new UnitIDs and new indexes.

Exercise 6.2: Calculate which index UnitID 3900 can edit using the “By Death” formula.

Answer


Exercise 6.3: Calculate the address of the unitID for the index from Exercise 6.2

Exercise 6.4: Calculate which player would edit the address from Exercise 6.3 using UnitID 3900 in the “By Death” formula.

Exercise 6.5: Place the following units near the center of a map
- Place an SCV at the index from Exercise 6.2 for Player 1.
- Then place down UnitID 3900 for the player from Exercise 6.3
- Place a dragoon with attack set really high (65000).
- Ensure that all start locations are at higher indexes than the SCV
- Play the map; ensure the dragoon kills the UnitID 3900 then check out the SCV

Post has been edited 12 time(s), last time on Oct 3 2014, 10:04 pm by jjf28.



TheNitesWhoSay - Clan Aura - github

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

Sep 13 2014, 3:55 pm jjf28 Post #9

Cartography Artisan

7. The Path to Better EUPs

For the general mapper you’ll probably want to skip straight to Death-Table-Addon EUPs (dEUPs), the content here is mostly technical, and is included to overview how dEUPs were derived, if you’re really into mapping theory you may be able to come up with other uses for these, or improved ways to get to dEUPs.

7.1 Loop EUPs

By using give EUPs in certain orders, values can be increased or decreased continuously. Currently only one known setup is useable for editing one index’s unitID, this is used as a stepping stone to interceptor EUPs.

The Details


7.2 Interceptor EUPs

By giving a carrier, any contained units are also given. So by using Loop EUPs to change the UnitID of an interceptor you can create a fairly arbitrary Extended Unit that can be easily given.

Since the only current loop EUP setup stops working after the first trigger cycle these are not terribly useful, this is used as a stepping stone to Addon-EUPs.

The Details


7.3 Addon EUPs

The current pinnacle of EUP operations, using Addon EUPs, individual bytes can be set, and looped add 1/subtract 1 operations can be done in any trigger cycle. Combining setting bytes to 0 and subtract 1 operations, nearly any value can be reached in just a few short triggers. In fringe situations, the ridiculously circuitous 4-byte set can be used! The current map for these uses them in a specific manner such that the addon begins at the start of the death table (hence Death-Table-Addon EUPs).

The Details


Post has been edited 8 time(s), last time on Oct 3 2014, 10:01 pm by jjf28.



TheNitesWhoSay - Clan Aura - github

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

Sep 13 2014, 3:55 pm jjf28 Post #10

Cartography Artisan

8. Death-Table-Addon EUPs
Or dEUPs, for short.

THIS SECTION IS STILL UNDER COSNTRUCTION
    - Easier formulas are being derived
    - Maps are still being built
    - Examples and Exercises are being created

These can be challenging and confusing at first, but if you’re patient enough to make them work… you’ll receive phenominal cosmic powers!

I think its best you start with a template, this will be upgraded from time-to-time:
dEUP 256xTemplate.scx
Please download from here: DOWNLOAD until this message is removed.


8.1 Improved Give EUPs

Just like the Give EUPs from before, only this time you can pick out UnitIDs without worrying about them crashing!

Deaths of Player 2 Vultures is now used to specify the UnitID or in other words, you can use the Set Death’s trigger action on Player 2’s vultures to pick what UnitID you want to use (same deal with owner which is now p8 ghosts); but you don’t have to remember that, it’s already filled into the formulas for you:

dEUPs By Giving:
    1.) Address incremented = 48*(Deaths of Player 2 Vultures) + 4*(New Owner) + 5776160
    2.) Address decremented = 48*(Deaths of Player 2 Vultures) + 4*(Deaths of Player 8 Ghosts) + 5776164

    3.) Address incremented = 48*(Deaths of Player 2 Vultures) + 4*(New Owner) + 5787104
    4.) Address decremented = 48*(Deaths of Player 2 Vultures) + 4*(Deaths of Player 8 Ghosts) + 5787108

- Incremented/Decremented means +1/-1

So to increase 0x640200 by one, convert it to decimal and plug it into one of the incrementing equations and solve for the deaths of player 2 vultures and the new owner; the following example uses the first “dEUPs by giving” formula.

Address incremented = 48*(Deaths of Player 2 Vultures) + 4*(New Owner) + 5776160
0x640200 = 48*(Deaths of Player 2 Vultures) + 4*(New Owner) + 5776160 convert to decimal…
6554112 = 48*(Deaths of Player 2 Vultures) + 4*(New Owner) + 5776160 subtract 5776160 from both sides…
777952 = 48*(Deaths of Player 2 Vultures) + 4*(New Owner) divide both sides by 4…
194488 = 12*(Deaths of Player 2 Vultures) + (New Owner) divide 194488 by 12 to get Death’s of Player 2 Vultures, the remainder is the New Owner
194488/12 = 16207 remainder 4

So Set Deaths of Player 2 Vultures to 16207, and give the command center to Player 4.

(To be continued).

Post has been edited 10 time(s), last time on Feb 21 2015, 1:29 am by jjf28.



TheNitesWhoSay - Clan Aura - github

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

Sep 13 2014, 3:55 pm jjf28 Post #11

Cartography Artisan

9. Appendix

(Under construction)

Post has been edited 2 time(s), last time on Sep 13 2014, 4:08 pm by jjf28.



TheNitesWhoSay - Clan Aura - github

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

Sep 13 2014, 4:08 pm jjf28 Post #12

Cartography Artisan

One more reserve for good measure, you can post, point out any errors so I can fix them!

Post has been edited 1 time(s), last time on Sep 13 2014, 5:19 pm by jjf28.



TheNitesWhoSay - Clan Aura - github

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

Sep 14 2014, 12:28 am Oh_Man Post #13

Find Me On Discord (Brood War UMS Community & Staredit Network)

Clearly you put a lot of work into this. Very much appreciated. I'm so noob I've got to read Roy's tute before I figure this out, though. :P




Sep 15 2014, 1:51 am Zoan Post #14

Math + Physics + StarCraft = Zoan

Quote from jjf28
Table 1
Low bound index: (679112 – 48*UnitID) / 336
High bound index: (680132 – 48*UnitID) / 336

Table 2
Low bound index: (668168 – 48*UnitID) / 336
High bound index: (669188 – 48*UnitID) / 336

Table 3
Low bound index: (657220 – 48*UnitID) / 336
High bound index: (658240 – 48*UnitID) / 336

Table 4
Low bound index: (646280 – 48*UnitID) / 336
High bound index: (647300 – 48*UnitID) / 336

Are there supposed to be pluses or minuses before the 48*UnitID's in those equations?

EDIT: -.- I swear they were not showing up like 2 seconds ago.



\:rip\:ooooo\:wob\:ooooo \:angel\: ooooo\:wob\:ooooo\:rip\:

Sep 15 2014, 1:59 am jjf28 Post #15

Cartography Artisan

Minuses, yeah that's weird i'm seeing that sometimes too; I hope it's also happening with apostrophes cause a lot of them that I'm quite anal about are missing.



TheNitesWhoSay - Clan Aura - github

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

Sep 19 2014, 8:48 am sigsaucy2 Post #16



feedback

2. Extended Units

- what exactly did we do with the high index marine? What address did we affect, it would be nice if for this first example of an EUD the cause and effect was very obvious. Although i appreciate a crazy example as well.

-my game crashed after i exited the dragoon marine map, is this normal?




3. The Basic EUP Operations

-Is placing a single unit equal to a +1 increment of the address? (you never specify what you increment by)

-I'm not seeing the connection between the table image posted and the + 5776160, 5787104

-So adding a single extended unit increments (how many? 6?) separate addresses?

If we have a target address to increment should we be worried about collateral damage from these other addresses being incremented? Is this what causes crashes?

-In the EUP Calc im guessing the P20, P44 and such are not used in practice, only players 12 and under? Does he skip the 'by killing' formula for a reason?

-When can we be sure that a combination doesn't crash? Is it enough if it doesn't crash in the the very beginning?



4. Give EUPs

-so preplacing and giving units both have the same effect?




5. Crashes, Limits, and Frustrations

-Can you give an example of testing combinations with EUP test?


ill read the rest later

Post has been edited 2 time(s), last time on Sep 19 2014, 8:57 am by sigsaucy2.



None.

Sep 19 2014, 1:10 pm jjf28 Post #17

Cartography Artisan

2.

Quote
- what exactly did we do with the high index marine? What address did we affect, it would be nice if for this first example of an EUD the cause and effect was very obvious. Although i appreciate a crazy example as well.

For clarities sake that shouldn't be called "high index" , it should be called "high UnitID" (since both index and UnitID are relevant for EUPs).

Once you change the UnitID it's no longer a marine, UnitID 0 is what makes a marine a marine, extended units all use the marine graphic in SCMDraft/CHKDraft. I'll make this clear in the guide.

We didn't purposefully affect any address, the unit was a shot in the dark when found. What precisely happens is not pertient to the goal of the guide, but the UnitDat entries that get read from to create the unit are overflowed each by: offset of property+size of property*3900 you could calculate its properties from there but that's not a practical feat.

Quote
first example of an EUD EUP

Forgive my nazi; death (of Extended Unit Death) doesn't apply to this map.

Quote
-my game crashed after i exited the dragoon marine map, is this normal?

Wouldn't call it normal (doesn't happen on my win7/winXP comps, haven't had that reported with this unit before), but it's not unheard of for EUP maps to crash on exit.

http://www.staredit.net/355427/

Sacrieur fixed his computer/install later so it doesn't crash (as he said in shoutbox), don't ask me how.


3.

Quote
-Is placing a single unit equal to a +1 increment of the address? (you never specify what you increment by)

When I say increment or decrement in a formula it means +1/-1, it's noted on the reference sheet, i'll put it more clearly in the guide as well.

Quote
-I'm not seeing the connection between the table image posted and the + 5776160, 5787104

Convert the addresses from hex/to hex ;) also because I use 1-based players in all the formulas (to help avoid confusion for newer users) they get adjusted by 4.

Quote
-So adding a single extended unit increments (how many? 6?) separate addresses?

- 2 when you place it.
- The same 2 are decremented if you remove it (reverses the first two changes)
- Net total of 2 if you kill it (By Killing and By Death, first four cancel each-other out)

Quote
If we have a target address to increment should we be worried about collateral damage from these other addresses being incremented? Is this what causes crashes?

Sometimes it's what causes the crashes.

You can worry about it if you're dead set on figuring out a way to edit something specific (and all EUPs seem to crash), but in practice it's routine to go "ok this doesn't crash for what I want it to do, moving on" thus ignoring the other changes.

Quote
-In the EUP Calc im guessing the P20, P44 and such are not used in practice, only players 12 and under? Does he skip the 'by killing' formula for a reason?

Extended players (player greater than 12) are used/useful in all formulas except for 'by killing' and 'by giving' (note that they are used in the placing formulas, but not the 'by giving') which contributed to why he skipped 'by killing' (despite my objections).

Quote
-When can we be sure that a combination doesn't crash? Is it enough if it doesn't crash in the the very beginning?

You can't really be sure (not without calculating all the dat entries), though I usually consider a unit good enough if it doesn't crash near the beginning or when I do something to it (give/kill). It's sometimes useful to also have it not crash when looked at and have it so it can't be easily selected.


4.

Quote
-so preplacing and giving units both have the same effect?

Essentially, but with give we have significantly more control over timing, as well as different limits (must be able to give to/from the player)


5.

Quote
-Can you give an example of testing combinations with EUP test?

Set UnitID to what you want to start at, player range to which players you want to test, press go; non-crashing units are in the log file.

I'm in the process of reprogramming EUP Test so it can target an address or use a scan list or target a unitprop; i'll make a thread and do more examples when i'm done.

Thanks for the feedback!

Post has been edited 4 time(s), last time on Sep 19 2014, 4:16 pm by jjf28.



TheNitesWhoSay - Clan Aura - github

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

Sep 22 2014, 7:27 am sigsaucy Post #18



Feedback continued

The difficulty jumped up quite a bit from 6 on. It took me a while of thinking through a few concepts that weren't obvious to figure out what was going on.

Things that could be better explained are

TABLES EXPLANATION

-tables 1 & 2 store information about 'owning units' (why is it necessary to have 2 tables containing what seems to be the same information?)

-table 3 stores information about what has been killed and by who

-table 4 stores information on what has died and who controlled it when it died

after thinking about this for a while the above seems very obvious, but I know when I started reading, the tables seemed difficult. Described this way, it is very obvious which actions (killing, removing, etc) affect what tables.


6 INTRODUCTION

It should be clear at the beginning of the section all we are doing is looking at equations of the form,

Address incremented = 48*(Placed unit’s UnitID) + 4*(Placed unit’s Owner) + 5776160 (Table 1)

and finding values for each unknown in the order

1) Finding a Extended Unit ID that doesn't crash
2) Determining what possible addresses we can alter
3) After finding out the Unit ID and Address we are solving for the player number



6

-You say to keep units in fog, but in the marine/dragoon map the we started with vision of the marine. I guess we just got lucky?

Should extended units always be kept in the fog of all human players? all ai players? Kept in fog the entire game or just the beginning?


-We leave this section knowing how to modify specific preplaced units based on their index, but how about all versions of that unit? What if we want all marines built in a map to have a certain characteristic? I'm guessing there is an address corresponding to this?


-How do we give a unit to a player other then P1-P12?


thanks for writing this up

Post has been edited 4 time(s), last time on Sep 22 2014, 7:37 am by sigsaucy.




Sep 22 2014, 3:16 pm jjf28 Post #19

Cartography Artisan

Quote
The difficulty jumped up quite a bit from 6 on. It took me a while of thinking through a few concepts that weren't obvious to figure out what was going on.
I'll look at 6, I don't plan on expanding 7 much but i'll do quite a bit more on 8.

Quote
TABLES EXPLANATION
I'll try to make a sub-section for this somewhere, though i'm not sure when to teach this as it's superfluous to creating maps but it can help understand the formulas better.

Quote
6 INTRODUCTION
Made some of these adjustments.

Quote
-You say to keep units in fog, but in the marine/dragoon map the we started with vision of the marine. I guess we just got lucky?
Should be in the fog whenever possible, more UnitIDs will work this way and you're less likely to have a crash at random points during the game (though some like UnitID 3900 are pretty stable); i'll try to clear this up.

Quote
-We leave this section knowing how to modify specific preplaced units based on their index, but how about all versions of that unit? What if we want all marines built in a map to have a certain characteristic? I'm guessing there is an address corresponding to this?
Yeah there are the dat files, but without dEUPs it's pretty hard to edit anything here (requires very high UnitIDs), so we'll get to this later.

Quote
-How do we give a unit to a player other then P1-P12?
You can't with the give trigger, you can use EUPs to change the player of a unit, but that's not terribly useful

Quote
thanks for writing this up
You're welcome; thanks for the feedback!



TheNitesWhoSay - Clan Aura - github

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

Sep 29 2014, 4:02 am sigsaucy Post #20



I'm a bit fuzzy on the index calculations, in the examples you typically see that one unit ID can modify 2 index' fully and 2 partially.


I'm confused since (assuming we're just changing addresses via table 1)

Address incremented = 48*(Placed unit’s UnitID) + 4*(Placed unit’s Owner) + 5776160 (Table 1)

seems to state that for a give UnitID we can only expect to modify 12 separate addresses (1 for each placed units owner) for a total of 12*4 = 48 properties that we can modify


But a index contains 336 properties, by this calculation it would seem that you could only hope to partially modify a single index with a given UnitID. What am I doing wrong?




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[12:54 pm]
Ultraviolet -- :wob:
[2021-10-22. : 8:31 pm]
O)FaRTy1billion[MM] -- :wob:
[2021-10-22. : 6:07 pm]
UndeadStar -- :wob:
[2021-10-22. : 12:00 pm]
Ultraviolet -- :wob:
[2021-10-22. : 10:38 am]
jjf28 -- :wob::wob:
[2021-10-22. : 10:32 am]
Zycorax -- :wob: intensifies.
[2021-10-22. : 8:51 am]
Zincoshine -- :wob:
[2021-10-22. : 4:43 am]
RdeRenato -- :wob:
[2021-10-22. : 4:43 am]
RdeRenato -- : wob :
[2021-10-21. : 4:52 pm]
jjf28 -- :wob: cause you failed to prefix your message with :wob:
Please log in to shout.


Members Online: Wing Zero, Roy, Bruce, DarkenedFantasies