Real-time sprite scaling

Started by ervin, 18:32, 26 June 21

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

andycadley

Yeah, that looks impressively quick for what it is doing.

ervin

#51
Yes, they are 16x16 sprites in mode 0. However the sprites are then stretched to be 32 rasters tall (everything is doubled when drawing the screen, otherwise it would be too slow). It's a compromise I've had to accept for performance reasons. Based on some basic calculations, I think I'm getting 15 to 20 fps, but that will go down a bit with game logic put in. 😊

sigh

That is just simple gorgeous!

I have to say - despite not being a fan of FPS shooters, I would seriously welcome one on the CPC rather than a 3D bounder.
I can just picture a Doom game in my head right now! Or even a 3D racing game, or even a game that involves a 2D sprite you control in a 3D world which would make for an interesting third person game!

ervin

Thanks  ;D
I agree, something like the games you suggested would indeed be incredible, but I don't have the skill to implement any of those sort of games.
Maybe one day I'll try to adapt this sprite scaling idea into something else.

Small update: The program is now around 5% faster due to vastly improved division and modulus calculations.

sigh

Have you seen this 48k first person shooter spectrum game? I think it's using scaling too...


https://www.youtube.com/watch?v=12mYShb_VD4&t=234s

ervin

Yeah that's a mighty impressive game for sure.
However it looks as though it is using pre-defined tiles for everything rather than scaling.
Regardless, it looks absolutely brilliant.

ervin

#56
Hi folks.

I had a surprising amount of trouble getting this just right.
But I'm finally happy with how it works.

Bouncing!

At the moment, you can't fall through a floor layer, as the collision is based on hitting a layer.
The next step is to narrow down collisions to tiles.
When I've got that working it will be possible to fall through the empty parts of a floor layer.

The white square is a placeholder for the player sprite.
I find that concentrating on the player sprite enhances the sense of 3D, which I'm very pleased about.


https://www.youtube.com/watch?v=NU_etWgXkAE

Nworc

Quote from: ervin on 04:00, 28 May 22However it looks as though it is using pre-defined tiles for everything rather than scaling.

Definitely! In order to fill a screen like that you just need to move 32*24 bytes on the spectrum for the shapes plus the same amount for the colors, as everything is based on a characters. On the CPC we have to move 8 times the total amount of bytes to do the same! So that's not a fair comparison.

Nworc

Quote from: ervin on 14:37, 21 June 22I had a surprising amount of trouble getting this just right.
But I'm finally happy with how it works.

Looks impressive. Thumbs up!

ervin

#59
Hi folks.

I now have the most basic foundations of a game, as tile-based collisions are working!
It's now possible to fall past an object if your sprite doesn't touch it.
Touching a tile (even a little) will still cause a bounce.
8)

Next task... implementing different types of tiles, that will have different effects on the player sprite.

ervin

Hi folks.

New features:
Capacity for 16 block types and 8 food types.
Food can be "eaten" (i.e. collected) upon landing on it, to reveal the block underneath.
All blocks and foods can do different things, simulated here with the change of border colour.
The player (represented here with a white square) can touch up to 4 blocks at a time, and the effects of all 4 blocks (whether food or floor) can be applied at the same time.


Jean-Marie

I want Space Harrier !  :)

ervin

Me too, but that's a whole new level of challenge.
:)

The current engine doesn't implement sprite clipping, which would be required for a game like space harrier.

roudoudou

Quote from: ervin on 08:03, 26 July 22Me too, but that's a whole new level of challenge.
:)

The current engine doesn't implement sprite clipping, which would be required for a game like space harrier.
if there is only clipping missing, go for it, clipping will be for final release :P
use RASM, the best assembler ever made :p

I will survive

ervin

I would love to do a game like that, but there is so much more that would need to be added to the engine.  :(
Especially enemy sprites, bullets, explosions etc (in addition to sprite clipping!)

Sykobee (Briggsy)

Looks good! 

I can see a Bounder style game working here, or a puzzler (rotate/move the blocks to get the bouncing ball to the exit).

Devlin

Quote from: ervin on 12:08, 26 July 22I would love to do a game like that, but there is so much more that would need to be added to the engine.  :(
Especially enemy sprites, bullets, explosions etc (in addition to sprite clipping!)
Have you considered making a game similar to Blob on the Amiga?
http://hol.abime.net/148
Amstrad fan! | CPC464 + USIfAC II | Administrator of Amstrad Discord : https://discord.gg/ksWvApv

ervin

Quote from: Sykobee (Briggsy) on 16:30, 26 July 22Looks good!

I can see a Bounder style game working here, or a puzzler (rotate/move the blocks to get the bouncing ball to the exit).

Yep, Bounder is the main inspiration.

ervin

Quote from: Devlin on 16:45, 26 July 22
Quote from: ervin on 12:08, 26 July 22I would love to do a game like that, but there is so much more that would need to be added to the engine.  :(
Especially enemy sprites, bullets, explosions etc (in addition to sprite clipping!)
Have you considered making a game similar to Blob on the Amiga?
http://hol.abime.net/148
I actually remembered Blob about 3 weeks ago (I played it back in the day).
It did occur to me how similar the viewpoint is, but the main difference is that Blob's playfield scrolls in all directions, but mine will only scroll "into" the screen.
It may have be an subconscious inspiration... dunno.

sigh

This looks great!

IndyUK

@ervin - Well done! Very impressive. Reminds me of Mode 7 on the SNES. Not sure how much juice would be left in the CPC if this was to ever make it into a game but, as a technical achievement, fanstastic bit of development.

ervin

Quote from: IndyUK on 23:20, 01 August 22@ervin - Well done! Very impressive. Reminds me of Mode 7 on the SNES. Not sure how much juice would be left in the CPC if this was to ever make it into a game but, as a technical achievement, fanstastic bit of development.
Thanks!
It is indeed being used for a game, but it's only a very simple game with no enemies or bullets.
I can imagine that it would indeed slow down if those sorts of things were added.

sigh

The white square that you have on the screen - have you tried playing an animation of it rotating to see the impact of the speed it would have?

 It would probably be best to make it a sprite animation (8 frames) rather than an actual calculation.

ervin

The player graphic is now something other than a white square.
;D

sigh

Quote from: ervin on 16:34, 02 August 22The player graphic is now something other than a white square.
;D
Does it animate? If so - is there a hit to the speed?

Powered by SMFPacks Menu Editor Mod