News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

kung fu master - 2 pokes for collision/game improvement

Started by arnoldemu, Yesterday at 13:49

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

arnoldemu

I've been looking into the Amstrad version of kung fu master.

Before it is requested: I am not planning a re-write of it. ;D

There are quite a few differences from the arcade version:
* Knife thrower does not appear on level 1.
(I don't know why yet)

* The enemy spawning is bad and there are many times I can run through most of the level without encountering an enemy.

(Every frame 3 grunt enemies are processed regardless of whether they are active or not. At 7a2e a decision is done to spawn the 'current' enemy if it's not active. d1f is the random number generator  and execution will get to 7a35 if the current enemy is spawned. 7a5a then determines which side and 7a62 the initial position on either edge of the play area. 7a84 onwards will then subsequently update the movement towards player.)

To make the spawning better it needs more than just the random number adjusting I think because it would need to prevent enemies spawning almost at the same time and overlapping.

* The collision is bad.
More on this later in the post. ;)

* Kick and punch are virtually the same whereas on the arcade they have different reach.

The collision range for the punch seems to be the same as for the kick!

See 7B5E. Based on which side of the player the current grunt enemy is on a table of 'pokes' is chosen, either 830a or 82d0. These pokes define the distance ranges for the attack and the comparison types. Poking both comparison and JP instructions. b110 is the distance to the player and is calculated in 7ad8 and results in a range of &1d->&77 with &4a being the mid point/player pos. comparisons at 7b82 which are poked are the ranges for the attack based on the side. I think the comparison at 7bd5 which is poked is the distance at which the characters raise their arms to telegraph their attacks. There are comparisons at 7bf6 and 7bfb which are poked which I believe is for grabbing.

There is no account here for which player move is made. That would need to be taken into account to adjust the ranges for punch and kick.

As a side note, interestingly the game avoids the use of IX and IY for accessing/processing enemy data and instead chooses to copy the enemy data into a buffer, reads and modifies this data in the buffer, and then this is copied back to the enemy data.  See the function at 436. 5ac copies enemy data to buffer. 6a08 is called which runs the enemy update for each enemy. and 5db copies it back. I think in this case the tradeoff might be a slightly faster game because IX/IY instructions can be slower to execute because of taking into account the prefix and offsets relative to IX/IY.

Back to collision. The ranges defined for the attack mean that if an enemy is too close and the kick/punch is done it effectively has no effect and the enemy will grab the player.

Therefore two pokes (made when the game is running) adjust the ranges so that any distance from where the player is standing out to the max attack distance will cause the attack to land.

82da: 4a
8314: 4a

And with that the game is just a little bit more playable and fun.




My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

roudoudou

Quote from: arnoldemu on Yesterday at 13:49I've been looking into the Amstrad version of kung fu master.

Before it is requested: I am not planning a re-write of it. ;D
cool to have some news  :P

obviously, you won't rewrite this game, you are already on that target renegade reboot with sigh right?

right?  ;D

MiguelSky

Hey, it really improves the game playability!! Great work  ;)

Powered by SMFPacks Menu Editor Mod