FireGraft 1.16.1 (primarily exe edit discussion)

Help - Resources - AI Scripting - Grafting - Plugins - Modding Projects
matefkr
Posts: 86
Joined: Tue Jun 05, 2007 9:38 pm

Postby matefkr » Wed Jan 11, 2012 11:55 am

for the jmp short i don't know, it depends realy on how the L1 code cache works for a given cpu. For older stuff including Pentium 4 i think, using a jmp instruction would reload the L1 cache, which gives penalty in time, so its better in those case to use a couple of nops. You figure about consequences.

For the given code, i can't decide what is that number, and i hadn't looked into disassembly. Would be easier to kno which register is close to which informations related to plague. My guess is the number is a fraction, since imul and such a great whole number would give 64 bit result of some sort and in this game, not even 32 bit large number are utilised anywhere (besides offestes). It could be coordinates still, 16 16 packed into a 32 but it has nothing to do with plague.
murph
Posts: 30
Joined: Thu Jan 06, 2011 4:59 pm

Postby murph » Wed Jan 11, 2012 6:40 pm

Those IMUL and IDIV instructions sure aren't very intuitive, are they? Just step through ollydbg and see what answers pop out. It'll probably come out to be something straightforward like "multiply plague weapon damage by 60%."
Heinermann
Posts: 362
Joined: Thu Apr 26, 2007 12:42 am

Postby Heinermann » Wed Jan 11, 2012 8:13 pm

That's actually optimization. The random number is a "magic" number used for division, but instead they use multiplication and shifts to speed things up.
matefkr
Posts: 86
Joined: Tue Jun 05, 2007 9:38 pm

Postby matefkr » Wed Jan 11, 2012 8:28 pm

Any Hint on the crash with cloaking buildings with the arbiter?
Heinermann
Posts: 362
Joined: Thu Apr 26, 2007 12:42 am

Postby Heinermann » Thu Jan 12, 2012 12:53 am

Nope.

IDA Pro shows the following

Code: Select all

      v16 = (weaponsdat_dmgAmount[60] << 8) / 76; // this is (*256)/76


which translates to

Code: Select all

int dmg = (Weapons::Plague.getDamage() * 256) / 76;


The plague damage amount is 300, so (300*256)/76 = approx. 1010 real hp
Divide that by 256 to get the "actual" hp (that we see) and it is 3.94.

My guess is that plague lasts for 76 "cycles".

According to http://wiki.teamliquid.net/starcraft/Plague it says plague deals about 11.8 dmg per second and deals a maximum of 300 pts of damage, however with this forumula it appears that it should only deal a maximum of 299.84375 damage. I don't know the relation, but (1010/256)*3 = 11.8359375 (the value they got "per second" on fastest, which could possibly mean that it is updated every 8 game frames, meaning it lasts exactly 25.536 seconds on fastest speed).
matefkr
Posts: 86
Joined: Tue Jun 05, 2007 9:38 pm

Postby matefkr » Thu Jan 12, 2012 9:10 pm

It seems that something around 4ed187 is sort of responsible for removeing cloak. some other things influence cloak removel from time to time, i don't know where they could be found. Do you know something about the code at that address?
pastelmind
Posts: 57
Joined: Fri Nov 19, 2010 7:50 am

Postby pastelmind » Fri Jan 13, 2012 6:56 pm

@Heinermann: Thank you. I imagine that early in the development of StarCraft, the developers realized that having Plague deal exactly 300 damage resulted in many units having 1~4 HP left after Plague wore off. Thus, they decided to make Plague deal slightly less than 300 damage, so that it would seemingly reduce all hp to 1.

Also, attempting to recharge shields on a warping Protoss building halts construction, wtf.
matefkr
Posts: 86
Joined: Tue Jun 05, 2007 9:38 pm

Postby matefkr » Fri Jan 13, 2012 8:37 pm

you took out something important. there should be a check for "completed" flag. i guess it is 1.

would you also try to look at that address i posted? Because cloaking nearby building as it is now would crash the game and wouldn't work properly after some time.
murph
Posts: 30
Joined: Thu Jan 06, 2011 4:59 pm

Postby murph » Fri Jan 13, 2012 9:14 pm

I think you need a more easily reproducible test case.
matefkr
Posts: 86
Joined: Tue Jun 05, 2007 9:38 pm

Postby matefkr » Fri Jan 13, 2012 9:44 pm

Indeed, but do you mean you tried as described and failed to see crash, and impropper stuff?

i tried it 4 times at least. and it would easily produce malfunction ( after about 40 minutes or one hours and some minutes), that is units remaining cloaked, and if i hold it that way for long, then it would crash. i would like a better something but it doesn't work. So, it can be related to ai running and fighting, plus buildings being cloaked. I have no other idea. I just told because it gave the results multiple times. You just build 3-4 expo on primeval isles 3-5 or more adventage to enemies. top vs bottom, all terran but you. Then all you do is build units, photon cannons, carriers arbiters, and hold position. After they attack and have gotten killed, you move around with arbiter. Don't use recall, it resets cloaking and all.

btw, intercept the exeption occuring, with an attached debugger of course, and not the address where the exeption occured. In the meantime, i try to find out more about decloaking, as i have freetime.

Return to “StarCraft Modding”

Who is online

Users browsing this forum: No registered users and 1 guest