I might actually finish this one

Страница 8/9
1 | 2 | 3 | 4 | 5 | 6 | 7 | | 9

By Sharriff001

Rookie (31)

Аватар пользователя Sharriff001

13-02-2021, 16:25

Good work! Hopefully the music in the game might allow the use of the FM-PAC attachment as well as PSG.

By Bengalack

Champion (425)

Аватар пользователя Bengalack

13-02-2021, 18:18

@Daemos: Yup!

The current jump is like this (pixel-add to players y-value, per frame):
g_sPlayerJumpPath = { { 6, 5, 4, 3, 2, 2, 2, 1, 1, 1, 1 }

Once you hit the top (or an obstacle), the player enters falling-mode, and this mode is constant=3 (pixel-sub from y-value, pr frame).

This might be a bit brutal, yes Smile

By Bengalack

Champion (425)

Аватар пользователя Bengalack

13-02-2021, 18:18

Sharriff001 wrote:

Good work! Hopefully the music in the game might allow the use of the FM-PAC attachment as well as PSG.

My audio-expertise is not the greatest, but my initial thoughts are PSG for sound-effects, and MSX-Music for music.

By Daemos

Paragon (1955)

Аватар пользователя Daemos

13-02-2021, 19:56

Try these remember that these are @30 fps so use half the values and make the tables twice as long so replace 1 with 0,1 and for example 12 with 6,6 and tweak from there.

db 12,10,9,8,7,6,4,3,2,1,1,1,0,0,0,0 ;Jump up normal
db 0,1,2,4,5,6,7,8,9,10 ;fall from highest point

Though its more complicated than that. Its still a fairly good start. These tables are used when not running so there are tables for running and even faster running but as you can see you are pretty darn close.

By Bengalack

Champion (425)

Аватар пользователя Bengalack

13-02-2021, 20:43

Thanks, @Daemos!
Do you use normal fall (the values above) when hitting head in a brick/obstacle as well?

By Daemos

Paragon (1955)

Аватар пользователя Daemos

13-02-2021, 20:44

yes. No faster falling after hitting bricks. Only running has effect. If you want I can post the full tables but a specific word will be censored out. All lines are commented.

By Bengalack

Champion (425)

Аватар пользователя Bengalack

13-02-2021, 20:54

And, oh, I forgot something crucial here!

I actually have a little "spin" effect added to the curve, which means that, as long as you hold the button down, the first value is repeated up to max x times. In the video this x is 5. So as long I held the button down in the video (which one always do to some extent - a frame goes fast, at least in 60 Hz), the curve

g_sPlayerJumpPath = { { 6, 5, 4, 3, 2, 2, 2, 1, 1, 1, 1 }

will in practise often look like this:

g_sPlayerJumpPath = { { 6, 6, 6, 6, 6, 6, 5, 4, 3, 2, 2, 2, 1, 1, 1, 1 }

Given that, I was not so close to your numbers - after all. Obviously, I wanted a feature where one can jump at various heights Smile

Hmm, I guess this explains things Smile

By Bengalack

Champion (425)

Аватар пользователя Bengalack

13-02-2021, 21:00

Daemos wrote:

If you want I can post the full tables

Nice! I'll need to get the feeling of this myself, and I have some good pointers now, so I guess I will start without. But I might get back on this offer if things doesn't work out though. Thanks!

By Daemos

Paragon (1955)

Аватар пользователя Daemos

13-02-2021, 21:01

yes that explains alot. You can make this actually work by creating 3 pointers. You have 1 table but the pointer stops quicker and continues longer as you keep the jump button pressed. Your jumps will start to feel reeeeeealy smooth.

If you have good success I really am curious how it worked out so I am waiting for videos Smile Wink

By Bengalack

Champion (425)

Аватар пользователя Bengalack

16-02-2021, 16:58

In general, there will still be a lot of tuning wrt to player-movement. In my code, this part is still done in C ("optimized C", but still C), which is good as there will be many (quick) iterations. But player-movement is quite big. There is detection of solids/edges, hit-block-effects, we have jumping/falling, entering lethal areas, detecting ladders/moving in ladders, pushing crate, moving platforms, etc (holding sprite-to-sprite collision detection aside). I.e. quite "flexible" or big chunk of code. And right now, all of this is costing me 1300-7000(!) per frame. Just too much. Need to optimize, and move all or parts into asm. But the thing here, I should not pre-optimize, I should get things "prototyped" right first, before I do the opts.

But I'm impatient Smile Smile

Страница 8/9
1 | 2 | 3 | 4 | 5 | 6 | 7 | | 9