4.5.6 Inertia not quite right

Post Reply
WillElm
Posts: 116
Joined: Wed Mar 20, 2019 3:56 am

4.5.6 Inertia not quite right

Post by WillElm » Wed Aug 12, 2020 5:07 am

Anyone notice that when you have a low acceleration speed, your acceleration completely inverts when you change direction? so you don't have to slow down first and you just maintain the same speed you had before you turned around. This doesn't give you the feeling of inertia. I loaded my 4.1.5 project just to double check that that wasn't normal behavior. I tried different movement scripts, but that didn't help anything. Anyone here know where to look? Any help is appreciated. Oh yeah, I've tried in both the arcade and the scrolling module.
User avatar
mouse spirit
Posts: 893
Joined: Tue May 12, 2020 1:13 am
Location: Ohio,North America
Contact:

Re: 4.5.6 Inertia not quite right

Post by mouse spirit » Wed Aug 12, 2020 5:19 am

Maybe dohandlephysics? Maybe Object_hspeed_lo?
I am guessing.

I do know what you are saying. It is true for me also.
I am game, hear me blip.

WIP my game Almika The Star Rider Densetsu Gaiden
https://www.mediafire.com/file/phef252j ... p.zip/file
Forum link viewtopic.php?f=51&t=5278
WillElm
Posts: 116
Joined: Wed Mar 20, 2019 3:56 am

Re: 4.5.6 Inertia not quite right

Post by WillElm » Wed Aug 12, 2020 3:51 pm

Below is the code for oStartMovingInADirection, which gets JSR in the StartMoving macro. It has this comment, which is the exact behavior that I want. I'm gonna poke around here, but it's definitely just poking around.

STA temp ;; temp now blanks out the direction that the object is moving, either h or v
;; and turns off acceleration in the opposite, while preserving the "direction"
;; of inertia, so that it may still deccelerate in that direction.
;; This is important for anything that isn't an abrupt direction change, but rather
;; has acceleration / decceleration

Like maybe the wrong direction is getting loaded into temp1 here:

LDA Object_direction,x
AND temp
ORA arg1_hold
ORA temp1
STA Object_direction,x

Here is the macro:

I think it and oStartMovingInADirection compare the object's direction from the movement input scripts to...the object's current direction?

Code: Select all

MACRO StartMoving arg0, arg1
	;arg0 = object
	;arg1 = direction

	TXA
	PHA
	
	LDA arg0
	STA arg0_hold
	LDA arg1
	STA arg1_hold

	
	JSR oStartMovingInADirection
	
	PLA
	TAX
	
	
	ENDM


Code: Select all

oStartMovingInADirection:
	LDA arg0_hold
	TAX

	;;;;;;;;;;;;;;;;;;;;;;
		LDA Object_direction,x
		AND #%00001111 ; these bits need to be preserved
		STA temp1
		
		LDA arg1_hold
		AND #%10000000
		BEQ notChangingDirectionH
			;; is changing direction H
			LDA #%00011111
			JMP gotChangDirectionBlankout
		notChangingDirectionH:
			;; is changing direction V
			LDA #%01001111
		gotChangDirectionBlankout:
			STA temp ;; temp now blanks out the direction that the object is moving, either h or v
					;; and turns off acceleration in the opposite, while preserving the "direction"
					;; of inertia, so that it may still deccelerate in that direction.
					;; This is important for anything that isn't an abrupt direction change, but rather
					;; has acceleration / decceleration
			
		LDA Object_direction,x
		AND temp
		ORA arg1_hold
		ORA temp1
		STA Object_direction,x
		
		
		
		
	;;; right now, speed argument is unused,
	;;; as in default physics, max speed is maintained
	;;; in LUTs, and acceleration to that value
	;;; determines the speed.
	RTS
WillElm
Posts: 116
Joined: Wed Mar 20, 2019 3:56 am

Re: 4.5.6 Inertia not quite right

Post by WillElm » Sat Aug 15, 2020 12:44 am

**UPDATE** As per Joe's post on facebook, this issue has been fixed and will go live at some point soon.

oops didn't mean to bump, I thought I pressed edit and not quote.
User avatar
Siris Dracken
Posts: 31
Joined: Sat Aug 08, 2020 9:34 am

Re: 4.5.6 Inertia not quite right

Post by Siris Dracken » Mon Aug 31, 2020 11:45 pm

What is the fix for this? It still happens in my game, so I guess I dont have the latest version of something and I would like to know what changed. Also what facebook post are you referring to, I searched the group and wasn't able to find anything related to this at all.
Post Reply