You must be logged in to post messages.
Please login or register

Scenario Design
Moderated by Yeebaagooon, nottud

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: Negative Number of Projectiles
posted 05 December 2004 04:00 AM EDT (US)   
When you use Modify Protounit, you can modify the number of projectiles it fires.


Well, in this case, I used the Jormund Elver.

I didn't know at first how many projectiles it fired so I simply put -30 thinking it would end up as 0 as it probably had less (the projectiles it fires is actually just 1).

Instead, it seemed to fire MORE projectiles. In several hits, it could take down Kronos. No joke.

I tested it at -1 and it ended up doing no damage so that worked.

Then I tried -2. It did about 21000 on Kronos.

I then tried -100. Nope, it seemed to do less damage - only about 2000.

I tried -99 and it did huge damage again.

So it appears that any negative number before -100 but more than -(original number of projectiles) makes it deal huge damage. Still, -100 and less is quite damaging.

Any clue what the pattern is here?

Replies:
posted 05 December 2004 04:05 AM EDT (US)     1 / 14  
Hmm, nice find, sounds interesting.

-=Skycat=-
posted 05 December 2004 04:16 AM EDT (US)     2 / 14  
hmmm...intersting.

posted 05 December 2004 05:54 AM EDT (US)     3 / 14  
Uhm... I have no clue. I might have a look at it...
posted 05 December 2004 04:55 PM EDT (US)     4 / 14  
added.

Theris264
former Age of Mythology Heaven and Age of Empires III Heaven forumer||former member of Ambition Designs
"An eye for an eye, and the whole world goes blind" -Gandhi
posted 05 December 2004 06:18 PM EDT (US)     5 / 14  
Simple.

AOM uses an unsign int (might be something else, but anyway it's unsigned something.) for storing the projectiles and hp and stuff (because you obviously don't need negative values.)

In programming (AoM is a program), when you increment or decrement a variable beyond the scope of it's data type, it ends up at the other end.

0 is the minuimum for unsigned int. You made it go to negatives and unsigned int doesn't hold negatives, so you go up to the maximum, whatever it is. The maximum for unsigned int is 65535, so you go to 65535 if you go 1 under it's limit.

This is also why you get to negative population when you go too high.
You go past the limit and end up at the other side.


Dnas
Wildfire games 0 A. D. texture artist.
Rest In Peace, Flipbizcut (1979-2005)

[This message may have been edited by Dnas (edited 49-92-4096 @ 42:93 PM).]

posted 05 December 2004 07:01 PM EDT (US)     6 / 14  

Quote:

This is also why you get to negative population when you go too high.
You go past the limit and end up at the other side.

Erm, wow I always thought it was because the Modify Protounit was screwy.

posted 05 December 2004 07:53 PM EDT (US)     7 / 14  
Nice reply Dnas you learned us some stuff ! Sometimes it helps if you know some more about the techstuff it helps to understand why certan things happend or fail.

Quote:

Erm, wow I always thought it was because the Modify Protounit was screwy.

Although the Dnas explanation is logical ..I as a dummy in comp programming still see this fact as screwy...I cannot imagine that there isn't a programming possability which just sets bounderies to these numbers so you cannot go byond the limits they are intended for.

or am I saying here something really stupid Dnas ?

best regards,
The Vandhaal

p.s.Following Dnas explanation your finding pftq is just the same as increasing the numbers of projectiles i'll quess too bad but anyway nice experiment


BEST REGARDS,
THE VANDHAAL

El Vandhaal tiene gusto de las mujeres atractivas que usan los talones altos y las medias cosidas | Le Vandhaal qui aime les femmes qui portent des talons hauts et bas cousus.
HG moderators if you feel paranoid then translate the above here
More: ((( THE VANDHAAL WEBSITE)))(((STEAM VANDHAAL AOM EE COLLECTION)))(((VANDHAAL BLOG)))
[This message has been edited by The Vandhaal (edited 12-31-2999 @ 23:59 PM).]
posted 06 December 2004 02:32 AM EDT (US)     8 / 14  
uhm, I noticed a guy made invincible jarls once (Helms Deep eeeeeextreme ) The HP place in-game said 0hp, and the triggers said he gave them 9999999 or something.

So, after what I understood of Dnas' explaination the HP goes to 0 becouse it passed 65535? But why is they inivincible? (IE They cannot lose HP, or so it seems)


I think FOG.
posted 06 December 2004 04:45 AM EDT (US)     9 / 14  
Because there is no gp to lode, how can you take soemthign away from nothing.

YEah there are tricks like this on many games, I remember on aok and swgb you could do things like that in the damage unit effect to actually heal them, or you just put in a - value, you could also do all that hp stuff. anyway neat trick but its not new, I muself tried this as soon as I got the game.

posted 06 December 2004 12:22 PM EDT (US)     10 / 14  
Are you sure? I thought if a variable went out of its range it would start to read 'garbage' from other places in memory (that may or may not belong to AOM ). That would explain the randomness of the results you're getting anyway.

Where be your gibes now? your gambols? your songs?
Your flashes of merriment, that were wont to set the table on a roar?
Not one now, to mock your own grinning?

[This message has been edited by DrNick (edited 12-06-2004 @ 12:23 PM).]

posted 06 December 2004 02:11 PM EDT (US)     11 / 14  
I don't know. When I've tried it (when messing with C++), it's gone to the other end. But that was a while ago.

And I remember reading somewhere that it does that.

Of course, knowing my poor memory, whaever I say is bound to have errors.

But... to me, it makes sense.
An int is 8 bytes (I think it's 8 bytes) always. If it goes beyond it's limit, 8 bytes will no longer hold it, but the computer won't redefine an int just to accomodate that one variable.

We can find out easily though. Do that same test again and see if you get the same results.
If you do, it's unlikely that it reads garbage.
If you don't, I'm certainly mistaken.

EDIT: Yeah, it loops. Just tried it.


#include <stdio.h>

unsigned short int x=0;

int main() {
while (true) {
x++;
printf("%d\n",x);
}
}


Dnas
Wildfire games 0 A. D. texture artist.
Rest In Peace, Flipbizcut (1979-2005)

[This message may have been edited by Dnas (edited 49-92-4096 @ 42:93 PM).]

[This message has been edited by Dnas (edited 12-06-2004 @ 02:25 PM).]

posted 06 December 2004 06:28 PM EDT (US)     12 / 14  
Yeah it's the same results.

So -1 would be highest and the lower the negative, the less "crazily high" it would be?

That's how it seems:


Low | | | | | | | | | High
..-100.............-1

posted 08 December 2004 05:16 AM EDT (US)     13 / 14  

Quote:

This is also why you get to negative population when you go too high.
You go past the limit and end up at the other side.

50% correct actually. Some triggers are like that, but most go to infinite rather than circling (incidently, think of it like a sphere... If you go to high, you end up travelling the other way )

Quote:

uhm, I noticed a guy made invincible jarls once (Helms Deep eeeeeextreme ) The HP place in-game said 0hp, and the triggers said he gave them 9999999 or something.


...and thats a perfect example. Im quite sure attack, though, doesent circle, and also doesent have an infinite... but then i havent tested it. so!
incidently, if you increase speed too high... well, the creators of aomt made it so that all units in formation are a small amount off the exact place they should be, to add to realism. The faster the unit, the more profound the effect, so if you increase speed to 100, units are so far off they end up in really wierd places, like underwater or on cliffs, and occasionally simply disappear into thin air.
Also, i think all projectiles (except the petsuchos's one) have a variable as well, and if you increase range greatly, the shot will simply disappear, or at least get way off the mark.



sig
posted 08 December 2004 12:00 PM EDT (US)     14 / 14  
Interesting. I've never tried that before. I guess I assumed it would act like a pointer.

i.e.:


#include <stdio.h>

int main ()
{
char dummy;
*string = new char[10];
*string = "123456789";
for (int i = 0; i++; i > 15)
{
dummy = *string;
cout << dummy;
string++;
}

delete [] string;
return 0;
}


EDIT: BTW, don't try that code. It's evil. EEEEEEEEEVVVVVVIL!


Where be your gibes now? your gambols? your songs?
Your flashes of merriment, that were wont to set the table on a roar?
Not one now, to mock your own grinning?

[This message has been edited by DrNick (edited 12-08-2004 @ 12:34 PM).]

Age of Mythology Heaven » Forums » Scenario Design » Negative Number of Projectiles
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Mythology Heaven | HeavenGames