Go Penguin WIP platformer for MSX 1

Página 10/15
3 | 4 | 5 | 6 | 7 | 8 | 9 | | 11 | 12 | 13 | 14 | 15

Por theNestruo

Champion (296)

Imagen del theNestruo

10-06-2021, 15:10

santiontanon wrote:

Simulating gravity using fixed-point arithmetic as you suggest is a fine approach that is better than the fixed speed jump, but I find it's often hard to finetune the physics constants to get jumps that are not too "floaty". So, in my experience, just using jump tables (precalculated jump arcs, with an "escape options" in case you want to allow to control the jump height) are much easier to finetune to get the right "feeling", and is also much faster CPU-wise Smile

I agree with Santi. For reference, here is Stevedore delta-Y table:

; Delta-Y (dY) table for jumping and falling
PLAYER_DY_TABLE:
	db	-4, -4			; (2,-8)
	db	-2, -2, -2		; (5,-14)
	db	-1, -1, -1, -1, -1, -1	; (11,-20)
	.TOP_OFFSET:	equ $ - PLAYER_DY_TABLE
	db	 0,  0,  0,  0,  0,  0	; (17,-20)
	.FALL_OFFSET:	equ $ - PLAYER_DY_TABLE
	db	1, 1, 1, 1, 1, 1	; (23,-14) / (6,6)
	db	2, 2, 2			; (26,-8) / (9,12)
	db	4
	.SIZE:		equ $ - PLAYER_DY_TABLE

; Terminal falling speed (pixels/frame)
	CFG_PLAYER_GRAVITY:		equ 4

Bonus point: vertical movement with this table always crosses tile boundaries aligned to the tile (that gives some optimization opportunities, and helps preventing the "foot stuck 1px deep" problems)

Por Grauw

Ascended (9904)

Imagen del Grauw

10-06-2021, 15:17

theNestruo wrote:

Bonus point: vertical movement with this table always crosses tile boundaries aligned to the tile (that gives some optimization opportunities, and helps preventing the "foot stuck 1px deep" problems)

Ah, that seems smart Smile.

Por santiontanon

Paragon (1418)

Imagen del santiontanon

10-06-2021, 20:12

Yeah good point theNestruo! In addition preventing such bug, you can make the jump so that its height is exactly also aligned with tile boundaries if so desired, or aligned with any other values that would make level design easier.

Por Grauw

Ascended (9904)

Imagen del Grauw

10-06-2021, 22:12

theNestruo wrote:

Bonus point: vertical movement with this table always crosses tile boundaries aligned to the tile (that gives some optimization opportunities, and helps preventing the "foot stuck 1px deep" problems)

Could also be a good way to work around the line 217 issue with sprites on the V9938. Choose the deltas so that it always skips the 9th line out of every 16 lines (assuming 16x16 tiles).

Por ~mk~

Champion (298)

Imagen del ~mk~

11-06-2021, 23:48

Not focused on optimizations, but nice document about simulating gravity: gravidade_en.pdf

Por AnsiStar

Expert (76)

Imagen del AnsiStar

12-06-2021, 22:35

Spectacular! Waiting for the result...

Por thegeps

Paladin (828)

Imagen del thegeps

16-06-2021, 00:31

It deserve to be a hit Wink

Por jltursan

Prophet (2520)

Imagen del jltursan

16-06-2021, 08:27

Indeed, it's a very promising development!. About its jump mechanics, Malaika shows the same gameplay basics and a nice and smooth jump, it's a good example to follow.

Por albs_br

Champion (296)

Imagen del albs_br

24-06-2021, 00:15

I noted something strange: the game runs smooth on MSX 1, but slows down on 2+ or even worse on Turbo R.
I took a screenshot of OpenMSX running the game on the same screen on 3 machines, and this is the result:

Indeed, there are a few lines of difference from one machine to another.
Why that happens? Is there something to do with how the interruption routines are implemented on each machine?

Página 10/15
3 | 4 | 5 | 6 | 7 | 8 | 9 | | 11 | 12 | 13 | 14 | 15