News: 11 March 2016 - Forum Rules

Author Topic: Question on Sprite on Screen? **SOLVED**  (Read 2265 times)

justin3009

  • Hero Member
  • *****
  • Posts: 1660
  • Welp
    • View Profile
Question on Sprite on Screen? **SOLVED**
« on: July 27, 2014, 03:15:43 pm »
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?
« Last Edit: September 11, 2014, 02:47:19 pm by justin3009 »
'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

  • Full Member
  • ***
  • Posts: 157
    • View Profile
    • Traducciones Magno
Re: Question on Sprite on Screen?
« Reply #1 on: August 29, 2014, 02:35:47 am »
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. 

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


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

  • Hero Member
  • *****
  • Posts: 1660
  • Welp
    • View Profile
Re: Question on Sprite on Screen?
« Reply #2 on: August 29, 2014, 06:07:12 pm »
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.'