Perfect Top-Down Camera?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
TIIKKETMASTER
Posts: 32
Joined: Thu Jul 29, 2021 2:02 pm

Perfect Top-Down Camera?

Post by TIIKKETMASTER »

What im looking for is something like the 3rd person camera found in the wiki, but this cannot suffice because of two reasons:

1. Since it is ACS, its refresh rate is 1/35 of a second. this makes it look choppy when walking around.

2. The monsters are rotated to face the camera instead of the player, so a monster looking at the player that is also behind the player will look like it is looking up at the camera, or rather looking back ( V ) instead of ( ^ ).


any idea how these could be fixed? :ugeek:
Jarewill
 
 
Posts: 1853
Joined: Sun Jul 21, 2019 8:54 am

Re: Perfect Top-Down Camera?

Post by Jarewill »

For the first problem, I'm afraid not much can be done about it.
Even most ZScript code operates 35 times a second, because that's how the logic works.
However you can replace SetActorPosition in the code with Warp, which can be interpolated with the WARPF_INTERPOLATE flag.

For the second problem, I'm not sure what you mean.
I assume you mean sprite billboarding, in which case you can force them to be flat using the +FORCEYBILLBOARD flag.
User avatar
TIIKKETMASTER
Posts: 32
Joined: Thu Jul 29, 2021 2:02 pm

Re: Perfect Top-Down Camera?

Post by TIIKKETMASTER »

Jarewill wrote: Mon Oct 02, 2023 5:04 am For the first problem, I'm afraid not much can be done about it.
Even most ZScript code operates 35 times a second, because that's how the logic works.
what about the side scroller thing from nash? it's camera is perfectly smooth. how would i replicate his just top-down instead of side-view?
Jarewill wrote: Mon Oct 02, 2023 5:04 am However you can replace SetActorPosition in the code with Warp, which can be interpolated with the WARPF_INTERPOLATE flag.
If i replace it with warp, then where would i put the WARPF_INTERPOLATE flag? in the camera script?
Jarewill
 
 
Posts: 1853
Joined: Sun Jul 21, 2019 8:54 am

Re: Perfect Top-Down Camera?

Post by Jarewill »

TIIKKETMASTER wrote: Mon Oct 02, 2023 11:00 pm what about the side scroller thing from nash? it's camera is perfectly smooth. how would i replicate his just top-down instead of side-view?

If i replace it with warp, then where would i put the WARPF_INTERPOLATE flag? in the camera script?
Nash's camera also interpolates its movement, but using SetOrigin instead of Warp. SetOrigin is however a ZScript function, so it can't be used in ACS.

If you look at the wiki page for Warp, you can see several parameters to the function, one of which being int flags, that's where you input any flags you want such as WARPF_INTERPOLATE.
User avatar
TIIKKETMASTER
Posts: 32
Joined: Thu Jul 29, 2021 2:02 pm

Re: Perfect Top-Down Camera?

Post by TIIKKETMASTER »

Jarewill wrote: Mon Oct 02, 2023 5:04 am For the second problem, I'm not sure what you mean.
I assume you mean sprite billboarding, in which case you can force them to be flat using the +FORCEYBILLBOARD flag.
for the second problem, i do not mean sprite billboarding. i mean that the enemies are rotated to face the camera, not where the player is. that means that an imp that is behind the player will not be seen from it's back, but from the front, because the sprite is facing the camera that is in the air. i need the imp to face the player so that the imp(or any other enemy) looks like it is attacking the player, and not the air.

picture for reference below. ignore the invisible player as i dont have the sprites for that.
this is my last problem with the camera too and it is very blatant and annoying. thanks to anyone who can help me with the fix <3
Attachments
dsafaw.png
dsafaw.png (51.15 KiB) Viewed 542 times
Post Reply

Return to “Scripting”