Mitjitsu
He/Him
Banned User
Joined: 4/24/2006
Posts: 2997
I would if I was on the right computer (I'm on my laptop), but you'll have to give me a few days.
Joined: 8/27/2006
Posts: 883
andymac wrote:
Fuck it, I'll just look for them myself.
See :P You just have to ask the right question :D
Experienced player (642)
Joined: 11/30/2008
Posts: 650
Location: a little city in the middle of nowhere
A part of me dies every time I have to ask the "right question", because it means that I'm just feuling these stupid dickheads who think that giving "smart" answers to relatively simple questions is the right way to go. Get fucked. PS: mitjitsu, even after all the amazing things you've done and all that you have contributed to TASing, my respect for you has decreased substantially.
Measure once. Cut twice.
Joined: 4/7/2008
Posts: 117
andymac, it was a joke. Calm down.
Experienced player (642)
Joined: 11/30/2008
Posts: 650
Location: a little city in the middle of nowhere
I know it was a joke, and believe it or not: my post was as well. I DON'T think that Mitjitsu is a dickhed My respect for Mitjitsu has NOT decreased at all I DON'T wish him to get fucked but a part of me DOES die every time I respond to the same tired old response, which is why I refrained from asking him for the addresses a second time.
Measure once. Cut twice.
Former player
Joined: 12/1/2007
Posts: 425
00C26C44 is the address for Mario's speed.
Kaylee
She/Her
Editor, Active player (434)
Joined: 9/29/2008
Posts: 706
Location: Canada
Experienced player (642)
Joined: 11/30/2008
Posts: 650
Location: a little city in the middle of nowhere
Thanks Johannes for the address, it took me quite a while to figure out that it was a float ( :P ), but I found some important addresses in that area. EDIT: It turns out that mario's direction, x,y and z values, horizontal velocity(speed) and x and y components of velocity are all on the C26C00 page. I wouldn't have been able to find any of these. EDIT2: The reason I wanted to find those addresses was so I could do this: It should make Mario travel in a perfectly straight line, but nothing ever goes to plan eh? oh well, here's what I got, if anyone can correct any mistakes that'd be great. EDIT3: YAY, it works, except Mario sometimes sporadically turns around for some reason. The following code gets copied into a script lock for the address for the x axis of the analog stick, there is a similar version of this code that locks the y axis. Before today, I had never used a programming language like this, so there might be some really obvious errors.
VOID Lock(MHS_ADDRESS aAddress, INT iTemSize){
	extern BYTE anlgx = { "", aAddress };		//analog x
	extern float camy = { "", 0x00C28124 };		
	extern float camx = { "", 0x00C2812C };		//camera and mar x,y
	extern float mary = { "", 0x00C26C2C };
	extern float marx = { "", 0x00C26C34 };
	float radam;								// angles
	float radac;
	float desty;								//destinations, change in mario and camera x,y
	float destx;
	float dltmy;
	float dltmx;
	float dltcy;
	float dltcx;

	desty = 0;
	destx = 0;
	dltcx = marx - camx;
	dltcy = mary - camy;
	dltmx = destx - marx;
	dltmy = desty - mary;

	if (dltmx == 0 && dltmy < 0) {				//avoiding any div0 errors
		radam = 90;
		}
	else if (dltmx == 0 && dltmy < 0) {
		radam = 270;
		}

	else {										//do the actual calculation
		if ( dltmx > 0) {
			radam = ATan( dltmy / dltmx );
		}
		else if ( dltmx < 0 ) {
			radam = 180 + ATan( dltmy / dltmx );		
		}
	}	

	if (radam < 0) {
		radam += 360;
		}	
												// up to here is good, below here, a lot of assumptions
	if ( dltcx == 0 && dltcy > 0 ) {			// have been made that could compromise the code.
		radac = 90;
		}
	else if ( dltcx == 0 && dltcy < 0 ) {
		radac = 270;
		}
	else {

		if ( dltcx > 0) {
			radac = ATan( dltcy / dltcx );
		}
		else if ( dltcx < 0 ) {
			radac = 180 + ATan( dltcy / dltcx );
		}
	}

	if (radac < 0) {
		radac += 360;
	}
		
	anlgx = Floor(0.5 + (127 * Sin( radac - radam )));
}
EDIT: fixed a few things in the code (redundancies, useless lines, and some errors), and changed all the variables to single precision floating points. YETANOTHEREDIT: Finally! smoothed out all the bugs. Mario goes straight towards the destination (destx, desty), which in this case, is the origin, then acts weirdly, which is what is expected. here is the file to use in MHS: IMPORTANT: IF YOU WANT TO MAX A TAS OF SM64, USE THIS FILE. It has never been easier to travel in a perfectly straight line, and requires much less effort than any other method. To use this script: 1. load in MHS and open the mupen 64 process. 2. right click on "anlgx", chose "modify address", click on the "script lock" tab, and where it has the lines: desty = 0; destx = 0; change the 0's to your destination. i.e., walk to your destination, when you get there, look at mario's x and y, and then input them here. 3. do the same for "anlgy" 4. right click on "anlgx" and select lock address, then do the same for "anlgy" 5. mario should now travel in a perfectly straight line towards the destination point. http://cid-de1e7fef4aaf7e0d.skydrive.live.com/self.aspx/.Public/sm64.lssave?lc=3081
Measure once. Cut twice.
Former player
Joined: 12/1/2007
Posts: 425
This is awesome, great work. No more need for monitoring Mario's speed to find the optimal angle for every frame manually.
Mitjitsu
He/Him
Banned User
Joined: 4/24/2006
Posts: 2997
GMan wrote:
andymac, it was a joke. Calm down.
I could tell by the nature of his post it was light hearted. I was away last week, but still had my laptop with me. So there was no way I could tell him even if I wanted to. I'm pretty sure Bisqwit said somewhere that when requesting something it's more important to say why you need or want to know something. Unless the reason is already immeadiately obvious. But it's better to make a direct request than an indirect request even if you or others think it comes across as rude or arrogant.
Joined: 10/31/2005
Posts: 329
Location: The Netherlands
maybe my eyes are deceiving me (headache), or that language works different, but it seems like you have a duplicate if-statement in your code. where you set radam to 90 and the else if sets it to 270 but it's the same if-statement so that is unreachable code? looking at the same bit where you set radac, I suppose the < should be > in the first if-statement.
Joined: 7/26/2006
Posts: 1215
andymac wrote:
if (dltmx == 0 && dltmy < 0) {            //avoiding any div0 errors
	radam = 90;
}
else if (dltmx == 0 && dltmy < 0) {
	radam = 270;
}

else {                              //do the actual calculation
	if ( dltmx > 0) {
		radam = ATan( dltmy / dltmx );
	}
	else if ( dltmx < 0 ) {
		radam = 180 + ATan( dltmy / dltmx );      
	}
}   

if (radam < 0) {
	radam += 360;
}   
// up to here is good, below here, a lot of assumptions
if ( dltcx == 0 && dltcy > 0 ) {         // have been made that could compromise the code.
	radac = 90;
}
else if ( dltcx == 0 && dltcy < 0 ) {
	radac = 270;
}
else {

	if ( dltcx > 0) {
		radac = ATan( dltcy / dltcx );
	}
	else if ( dltcx < 0 ) {
		radac = 180 + ATan( dltcy / dltcx );
	}
}

if (radac < 0) {
	radac += 360;
}
An arctangent function that doesn't have div-by-zero problems was put into most math libraries to avoid messiness like this. :) The following could probably replace the above. (assuming % works on the variable. fmod() should do the trick otherwise)
radam = (ATan2(dltmy, dltmx)+360)%360;
radac = (ATan2(dltcy, dltcx)+360)%360;
As an aside, I'm not surprised he acts crazy once he gets to the destination since your code doesn't initialize radac or radam when the deltas of the x and y are both zero. Not really important though since the TASer probably has other plans than just letting this script run once the destination is reached :P
Experienced player (642)
Joined: 11/30/2008
Posts: 650
Location: a little city in the middle of nowhere
The library that you have to use for this code requires you to input a single expression as the input. there was no Atan2 function. The mod idea is a good one though. Also, you will never actually get to your destination, you pass through it with 99.999 percent probability. Who cares? you got to your destination, by that stage, you would have changed destx and desty anyway. @johannes, you watch speed for direction? I watch direction to find the direction, there are two values which you can use. @wouter, whoops. EDIT:nvm you can't use ASin without making the code more complicated.
Measure once. Cut twice.
Kaylee
She/Her
Editor, Active player (434)
Joined: 9/29/2008
Posts: 706
Location: Canada
Experienced player (584)
Joined: 2/23/2008
Posts: 266
Location: CA, USA
May as well post this new trick. When you blj with mario and he grabs a pole or tree or something, pressing Z+b on the frame mario hits the ground from climbing down the pole will let mario keep either a forwards or backwards speed in slide kick form. Here is a demonstration video I made of the trick.
Editor, Experienced player (860)
Joined: 8/12/2008
Posts: 845
Location: Québec, Canada
Editor, Experienced player (860)
Joined: 8/12/2008
Posts: 845
Location: Québec, Canada
Experienced player (584)
Joined: 2/23/2008
Posts: 266
Location: CA, USA
Joy, we can now get "Into the Igloo" Capless/cannonless/coinless, making 76 ccc-less stars I believe Here's a run of it in 22.7
nesrocks
He/Him
Player (247)
Joined: 5/1/2004
Posts: 4096
Location: Rio, Brazil
Bobmario511 wrote:
Joy, we can now get "Into the Igloo" Capless/cannonless/coinless, making 76 ccc-less stars I believe Here's a run of it in 22.7
O_O This game never stops!
Joined: 6/27/2009
Posts: 7
Location: Zebulon, NC
That leaves Mario wings to the Sky, Wing Mario over the Rainbow, Eye to Eye in the Secret Room and Collect the Caps To be gotten CCless right? Mario Wings to the Sky and Eye to Eye in the secret room may be possible, but I doubt the other two are.
Nothing to be found here.
Kaylee
She/Her
Editor, Active player (434)
Joined: 9/29/2008
Posts: 706
Location: Canada
Idea for MWTTS CCless: Enter BOB on the KTQ star. Get the 3rd and 4th coin by BLJing and using speed off a pole, or maybe jump kicking off hill. Then go to the island and get the first two by jumping off. Then start the KTQ race, BLJ up to the pole, wait for KTQ, ZB into him so you land on the cutscene. After you talk to him, jump and maybe get enough height to get 5th coin.
Experienced player (584)
Joined: 2/23/2008
Posts: 266
Location: CA, USA
Wow, another Route change for Metal head Mario can Move http://www.youtube.com/watch?v=F_yzsvUTqjw&feature=channel_page
Editor, Experienced player (860)
Joined: 8/12/2008
Posts: 845
Location: Québec, Canada
Fantastic work, Bob !
Former player
Joined: 12/5/2007
Posts: 716
Great improvement indeed. My only fear is that as there are so many of them that it may become even harder to complete the new 120 star run, let alone hex in the stars you already finished.
Editor, Experienced player (860)
Joined: 8/12/2008
Posts: 845
Location: Québec, Canada
Is Mario hex editing easy ?