Best way to acchieve 2d scrolling

Graphic based area of development (Graphics Processing Unit), including the Geometry Transform Engine (GTE), TIM, STR (MDEC), etc.
Post Reply
zolost
Interested PSXDEV User
Interested PSXDEV User
Posts: 6
Joined: Feb 21, 2022
Location: Sweden

Best way to acchieve 2d scrolling

Post by zolost » August 2nd, 2022, 7:32 am

I have a top down zelda clone, i have mapped tiles to individual sprites using GsSortFastSprite to render them. The problem I have is that I dont have a proper way to move around in the world. Workaround so far has been to split the world into individual frames matching the size of the screen. Was playing around with GsBG for a while but heard that it was very resource heavy.

So what is the best way to achieve this?
* GsBG?
* moving the individual sprites?
* Using libGTE (I suck at math)?

I can move the sprites but I have a feeling there is a smarter wat to do this.

Any help would be greatly appreciated!
Thank you

zolost
Interested PSXDEV User
Interested PSXDEV User
Posts: 6
Joined: Feb 21, 2022
Location: Sweden

Post by zolost » August 6th, 2022, 11:29 pm

Some quick updates, found that besides using a BG theres is (duh!) functions like GsSetOffset and GsSetDrawOffset. However they don't seem to do what they're supposed to or I'm reading it the wrong way. A quick workaround for this was to set the global libGS POSITION struct directly, or by modifying the GsDRAWENV offs member and then calling GsSetOffset with those values. I don't think I'm doing it as intended but seems to work and I dont have to compose a BG file.

zolost
Interested PSXDEV User
Interested PSXDEV User
Posts: 6
Joined: Feb 21, 2022
Location: Sweden

Post by zolost » August 7th, 2022, 12:13 am

Ok scratch that, GsSetOffset works just fine without having to modify the DRAWENV offset directly, guess I just called it at the wrong time :)

User avatar
MottZilla
Verified
Serious PSXDEV User
Serious PSXDEV User
Posts: 88
Joined: Jul 04, 2015
Location: North America

Post by MottZilla » August 21st, 2022, 3:36 pm

Feel free to share your future progress on your project. Top down Zelda-like games are interesting.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest