News:

11 March 2016 - Forum Rules

Main Menu

Question on Sprite on Screen? **SOLVED**

Started by justin3009, July 27, 2014, 03:15:43 PM

Previous topic - Next topic

justin3009

I'm having a bit of a problem when it comes to how this game, maybe even the SNES(?), handles it's sprites.

- There's only 4 sprites loaded for the PC's which is fine, but there's two other PC's BELOW Rambard there.  I set the settings to 6 PC's, set their X/Y coordinates.. only to find out that the sprites actually sort of loop through the entire screen.  The max X/Y coordinates ends up being 212 which isn't enough to go beyond and load the next 2 PC's in the slots below. (It loops pretty clearly by a pixel if set higher than that).

I ASSUME it's a hardware limitation to have coordinates on the screen like that.  I'm guessing each game has a specific way to handle updating sprites and moving them around and such?
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

magno

Quote from: justin3009 on July 27, 2014, 03:15:43 PMI set the settings to 6 PC's, set their X/Y coordinates.. only to find out that the sprites actually sort of loop through the entire screen. 

What do you mean "loop through the entire screen"?


Quote from: justin3009 on July 27, 2014, 03:15:43 PM
I ASSUME it's a hardware limitation to have coordinates on the screen like that.  I'm guessing each game has a specific way to handle updating sprites and moving them around and such?

In fact, usually the sprite engine creates the sprites and update their information in OAM depending if they are shown on screen or not. So you don't put any sprite "off-screen", you just update its OAM data when it comes on screen.
I'm programming a sprite engine based on Treasure Hunter G, which allows to create 32 sprite characters on screen (made of several sub-sprites). At the beginning of each frame, each created sprite is analyzed to check if it appears on screen, and if so, updates OAM data with on-screen coordinates.

justin3009

The problem has been fixed using some means by setting the PC's X/Y coordinates OFF screen a bit.  The problem I meant though was after a certain amount of X or Y coordinates, it'd loop.  So if you went really far to the right, they'd appear on the left.  Vice versa with up and down.

'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'