Go Penguin WIP platformer for MSX 1

ページ 10/16
3 | 4 | 5 | 6 | 7 | 8 | 9 | | 11 | 12 | 13 | 14 | 15

By theNestruo

Champion (323)

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)

By Grauw

Ascended (10175)

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.

By santiontanon

Paragon (1526)

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.

By Grauw

Ascended (10175)

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).

By ~mk~

Champion (303)

~mk~ さんの画像

11-06-2021, 23:48

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

By AnsiStar

Expert (101)

AnsiStar さんの画像

12-06-2021, 22:35

Spectacular! Waiting for the result...

By thegeps

Paladin (895)

thegeps さんの画像

16-06-2021, 00:31

It deserve to be a hit Wink

By jltursan

Prophet (2561)

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.

By albs_br

Champion (343)

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?

ページ 10/16
3 | 4 | 5 | 6 | 7 | 8 | 9 | | 11 | 12 | 13 | 14 | 15