Adjusting animations between NTSC and PAL/Dendy...

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

User avatar
Broke Studio
Formerly glutock
Posts: 181
Joined: Sat Aug 15, 2015 3:42 pm
Location: France
Contact:

Re: Adjusting animations between NTSC and PAL/Dendy...

Post by Broke Studio »

A lot of interesting things here.
For information, and if it can help anyone, I'll explain what I'm doing in Twin Dragons since Derek (Gradual Games here) asked me on Twitter.

I'm using two arrays where I store all my speed and acceleration values (16 bits). One for NTSC and one for PAL.
Something like that :

Code: Select all

actorsPalSpeeds:
    .word PLAYER_WALK_X_ACCEL
    .word PLAYER_WALK_X_DECEL
    .word PLAYER_WALK_MAX_X_SPEED
    ........

actorsNtscSpeeds:
    .word PLAYER_WALK_X_ACCEL*50/72       
    .word PLAYER_WALK_X_DECEL*50/72       
    .word PLAYER_WALK_MAX_X_SPEED*50/60   
    ........

actorsSpeeds:
    .word actorsNtscSpeeds, actorsPalSpeeds, actorsPalSpeeds ; NTSC, PAL, DENDY
Then I'm using constants for the values :

Code: Select all

PLAYER_WALK_X_ACCEL      = $0040
PLAYER_WALK_X_DECEL      = $0080
PLAYER_WALK_MAX_X_SPEED  = $0220
........
And finally, I got other constants to index everything :

Code: Select all

PLAYER_WALK_X_ACCEL_IDX      = $00
PLAYER_WALK_X_DECEL_IDX      = $02
PLAYER_WALK_MAX_X_SPEED_IDX  = $04
........
Then in my boot code I'm doing this :

Code: Select all

    jsr detectTVsystem ; 0 : NTSC / 1 : PAL / 2 : DENDY

    asl
    tax

    lda actorsSpeeds+0,X
    sta ptrActorsSpeeds+0
    lda actorsSpeeds+1,X
    sta ptrActorsSpeeds+1
And finally when I need to update speed :

Code: Select all

    ; X = actor index

    ldy #PLAYER_WALK_X_ACCEL_IDX
    lda actorSpeedLo,X
    clc
    adc (ptrActorsSpeeds),Y
    sta actorSpeedLo,X

    iny
    lda actorSpeedHi,X
    adc (ptrActorsSpeeds),Y
    sta actorSpeedHi,X
(I'm actually using a variable to store the speed index used with Y).

It may seems heavy, but it works pretty well so far, and the difference between the two console is totally acceptable, even hardly noticeable I would say (at least for me).

I'm doing the same thing for frame counters (PAL_SPEED*60/50 in this case); when I need timers, or for cutscenes for example.
Fun fact : I'm always testing the game using NTSC settings, and once in while using PAL to check that everything is working the same.

I'm not saying here that it's THE way to do thing, or the BEST way, it's just the way I'm doing it for Twin Dragons, and I'm happy with the result. Every game is different and may need a different approach. However, I think that offering (quite) the same gameplay on PAL or NTSC consoles is a plus and a good way to add polish to a game. I don't understand why PAL users shouldn't be considerate, I know that it's more work to do on our games but it's not like people here are trying to release new games every 6 months.

Well, that was just my point of view :)
My first game : Twin Dragons available at Broke Studio.
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Adjusting animations between NTSC and PAL/Dendy...

Post by tepples »

rainwarrior wrote:On a side note, what about PAR? Tepples has a theory that Dr. Mario's magnifying glass title screen is supposed to be a perfect circle at the standard NTSC PAR.
Putting actual numbers on this: The ring at the lower left corner during gameplay has an outer diameter of 72x80 pixels (9:10) and inner diameter of 64x72 pixels (8:9) on NES. On Super NES, it has an outer diameter of 70x80 pixels (7:8) and inner diameter of 50x60 pixels (5:6). All these appear to approximate 7:8 (inverse NTSC PAR) closer than 13:18 (inverse PAL PAR).

I don't consider redrawing everything to be quite as necessary in games that don't use real-time scaling and/or rotation as in games that do. Correct vertical stretching would improve something like On the Ball, a racing game that rotates the entire background every frame using the Super NES's affine mode. The same is true of anything using the Neo Geo-style sprite shrinking method I prototyped earlier.
FrankenGraphics wrote:In performed music, you need to transpose a piece to fit the optimal range of instruments used.
Case in point: The SN76489 in the Game Gear is missing the bottom octave of the 2A03's pulse channel. This means it can't play notes lower than what NerdTracker II and FamiTracker call A-1 or LilyPond and Pently call a,. This led the team porting Zoop to Game Gear to transpose the BGM "Uptown Meeting", which is in C on 16-bit platforms, up a major third to E in order to move the subdominant up from F to A. (It also affected the Game Boy version, as presumably the LR35902 and Z80 code bases were similar enough.)
User avatar
Bregalad
Posts: 8055
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re: Adjusting animations between NTSC and PAL/Dendy...

Post by Bregalad »

FrankenGraphics wrote: In performed music, you need to transpose a piece to fit the optimal range of instruments used.
As a player you don't need to transpose anything - the arranger does. You play your music sheet as the aranger decided to. That's what a PAL NES is supposed to do - if the game says "I want to play an A note" then it should play an A note, not a G note.

I see rainwarrior's point in that by adjusting the pitch table it can still sound a little different than the NTSC original - however by not transposing it it will also sound different due to lower pitch, so it's a matter of preference. Guaranteeing music to sound 100% identical across versions is basically impossible.
User avatar
rainwarrior
Posts: 8731
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Adjusting animations between NTSC and PAL/Dendy...

Post by rainwarrior »

Bregalad wrote:
FrankenGraphics wrote:In performed music, you need to transpose a piece to fit the optimal range of instruments used.
As a player you don't need to transpose anything - the arranger does. You play your music sheet as the aranger decided to. That's what a PAL NES is supposed to do - if the game says "I want to play an A note" then it should play an A note, not a G note.
As a professional musician, having to transpose at sight is actually a very common request. Especially if you play accompaniment for a vocalist, very frequently they will need it transposed to fit their range, and they would almost never have a copy of the music already transposed for you. (For the most part, a vocalist transposing is as easy as just giving them another starting pitch, a consequence of most people not having absolute pitch.) It also comes up a lot if you play in a pit orchestra where very often you don't have the same set of instruments as it was originally written for, and when you substitute one instrument for another it's often written at a transposing pitch.

Of course, as an amateur there is not much compelling you to learn to do this. It's just as easy to refuse the task of transposing at sight if there's no job on the line for it. Similarly if you're writing music for amateurs to play, you really shouldn't expect them to have this skill, because most won't.
FrankenGraphics wrote:Those with absolute pitch may experience the transposition of a whole song as a bit "painful" because they've gotten used to hearing it in a certain key, and may need time to digest the change.
Or worse, imagine having absolute pitch and be singing in the choir - those, especially amateur choirs, are very prone to slowly and steplessly falling or rising in pitch without the aid of instruments.
Yep. As someone with absolute pitch, I was used to relying on it for performance for a long time (I started with piano), but over time I experienced a lot of situations where I had to learn to "turn it off" and go 100% by relative pitch. For instance, if a piano hasn't been tuned in a while and its overall pitch has sunk, it's not like you can just tune it back up on the spot- you gotta deal with it. I tried learning the saxophone and was initially shocked that C actually made the sound of B flat. Joining a choir and learning to sing was a huge transformative experience too, because yeah they drift all over the place! (I can think of more than one person in my music program who had absolute pitch and dropped out of choir because of that problem.) Not to mention learning about other tuning systems, etc. where there's not even 12 notes per octave anymore... at this point absolute pitch is only useful to me for kinda specific situations, and relative pitching skills are the default thing and much more useful to me as a musician.

It's not just amateur choirs, by the way. People seem to have an idea that a "good" choir will not drift, but drift is actually a natural function of certain kinds of harmonic motion. Because of the disparity between just intonation and equal temperament, e.g. a modulation that proceeds one way by a major third but returns by a sequence of fifths must naturally drift to accommodate the tuning of that major third. The ideal choir performance will still shift, just less than the weak choir, and in a more predictable and repeatable way.

FrankenGraphics wrote:
rainwarrior wrote:Since PAL has a different colour gamut, should PAL versions also adjust their palettes to match the artists original intentions?
Should is a strong word in this context - but just sometimes maybe that could be beneficial. But palette data changes are probably going to differ more than gamut differences, so it'd be if the new colour was somehow closer to what the artist had in mind or would find favourable than was made available in the NTSC version.
Like everything I've said here, I think what's appropriate to do is not a one-size-fits-all situation. I posed the question of palette to stimulate the discussion, the difference in colour is immediately obvious if you play an NTSC and PAL game side by side, but the question for the developer is whether that change is a problem. In almost all NES cases you probably just want to leave the shifted colours where they are, preserving all the existing relative colour relationships more or less? I'm sure there are exceptions, though.

Of course, even without changing region there's a huge range of gamma/hue/brightness/tint/contrast settings across TVs of the same type and trying to be precise is pretty much a lost cause, but you still have people arguing to this day about whether Super Mario Bros. sky is "purple" or not.

FWIW I believe it was somewhat common to have a separate set of PAL palettes for PSX/PS2, where it was more practical to do so (and things like human looking skin tones were more critical), but eventually correcting the colour just became the hardware's job and it's thankfully not really an issue the developer has to deal with anymore.

(It's very analogous to the pitch question... actually just as well it's pretty normal for a graphic artist to do "colour correction" as a final step on a project too, similar to that late transposition thought.)

Same deal with the PAR thing, as tepples has pointed out here and more directly in other threads a square PAR makes rotational symmetry much easier to attain, and otherwise you get some warping effect across the rotation. That's potentially a good reason to compensate for the PAR difference, but it's still a trade-off against other factors. The rotation would need to be a very strong part of your game to want to start taking those trades. Like I doubt anyone would care about Castlevania's gears being elliptical rather than circular, it doesn't negatively affect the game even though it's not "perfect". (And yet again, emulators will give you square PAR, some people play with the image stretched to widescreen, NTSC, PAL, all sorts of factors here make relying on it very impractical.)
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: Adjusting animations between NTSC and PAL/Dendy...

Post by lidnariq »

FrankenGraphics wrote:It seems to me resistors wouldn't degrade by much at all in normal ambient temperatures. On the other hand, storage time is constantly ticking.
Resistors seem to mostly drift with use/when warmed up, especially when excessively heated. In other words: leaving your nintendo on overnight repeatedly might be mildly bad for your resistors.
Hence my comment about "any NESes that were stored in an attic"—they were quite probably exposed to 50-60C temperatures for many years.
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: Adjusting animations between NTSC and PAL/Dendy...

Post by FrankenGraphics »

Wait... all attics i recall, whether in houses or apartment buildings are often below room temperature even during summer, except perhaps locally near the funnel, as the isolation between the attic and the story below keeps the heat locked to save energy and costs warming the house. Sure, Gothenburg is half-cold with moderate summers and more or less constantly moist, but still.

I realize now this might not be the case in places where commonly hot summers and -i guess- other construction principles collide. Googled a bit and saw one who gave an example of 32 degrees outside, a whopping 60C in the attic. That's almost a free sauna, depending on where in the attic that was measured...
Bavi_H
Posts: 193
Joined: Sun Mar 03, 2013 1:52 am
Location: Texas, USA
Contact:

Re: Adjusting animations between NTSC and PAL/Dendy...

Post by Bavi_H »

I agree that for listening to music, only the relative pitches matter. But if you consider that someone might want to play along with your game's music or transcribe it, then you might want to ensure it's in A440 tuning and in an easy-to-play key.
  • I remember reading a post somewhere by a person who was transcribing video game music. One thing he found was that the music in Super Mario games was always in the key of C. I figure the composer might have done that to make it easier for people to play along with the music if they want to.

    I remember one time my cousin was playing a Sonic game on his Genesis, I played along with some of the game's music notes on a small keyboard. I remember the game pitches being slightly out-of-tune with respect to the keyboard's pitches. The game's pitches were something like 1/4 or 1/3 of a semitone higher or lower than the keyboard's pitches -- each of the game's notes fit between two keys on the keyboard without matching either of them, but was closer to one than the other. It took me a while to figure this out, because I had assumed the notes would match one of the keyboard keys exactly. (This happened in the US, so in this case, I doubt the tuning mismatch was because of an NTSC-to or from-PAL conversion without music adjustment, it could have just been the keyboard didn't use A440 tuning. But I can imagine a similar problem encountered by a keyboardist playing along with a NES PAL game containing NTSC music that wasn't retuned for PAL.)
User avatar
Bregalad
Posts: 8055
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re: Adjusting animations between NTSC and PAL/Dendy...

Post by Bregalad »

It also comes up a lot if you play in a pit orchestra where very often you don't have the same set of instruments as it was originally written for, and when you substitute one instrument for another it's often written at a transposing pitch.
Then you're basically compensating for your transposing instrument -exactly what I advocate the PAL NES (which is basically a transposing instrument like your saxophone) should do.
User avatar
rainwarrior
Posts: 8731
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Adjusting animations between NTSC and PAL/Dendy...

Post by rainwarrior »

Bregalad wrote:
rainwarrior wrote:It also comes up a lot if you play in a pit orchestra where very often you don't have the same set of instruments as it was originally written for, and when you substitute one instrument for another it's often written at a transposing pitch.
Then you're basically compensating for your transposing instrument -exactly what I advocate the PAL NES (which is basically a transposing instrument like your saxophone) should do.
Well, yes it is a similar situation in one way, but if we continue this analogy in the pit orchestra if you don't do the transposition you aren't in the same key as all the other players (critical fail). There is an external frame of reference here, which would not be important if playing alone. If you have a DPCM orchestra playing along, on the other hand...

Anyhow, sorry to have gone this far out on the topic of the meaning of transposition, all I'm trying to express is that just transposing a tune down a half step doesn't really make it worse or wrong or bad. I think it's a very reasonable thing to do for a PAL version of a game in a lot of cases, and often the best option. (Nothing applies in all cases, though!)
Bavi_H wrote:But if you consider that someone might want to play along with your game's music or transcribe it, then you might want to ensure it's in A440 tuning and in an easy-to-play key.
I don't think it's really the goal to help other people play along with it, but it certainly does help for composing if e.g. your piano is tuned the same as your other instruments (like your NES) and you can jump back and forth between them and play together, so that's definitely a good reason to use A-440 tuning while working at least.
Bavi_H wrote: The game's pitches were something like 1/4 or 1/3 of a semitone higher or lower than the keyboard's pitches -- each of the game's notes fit between two keys on the keyboard without matching either of them, but was closer to one than the other.
Yep! That's something you have to learn to account for if you do transcription. That's actually one of the reasons I had to learn to be able to ignore my sense of absolute pitch, so I could transcribe stuff that was in between the tones.
na_th_an
Posts: 558
Joined: Mon May 27, 2013 9:40 am

Re: Adjusting animations between NTSC and PAL/Dendy...

Post by na_th_an »

How about leaving the user decide if they want to repeat every fifth frame in NTSC or get a faster experience? It's flicking a switch, no much hassle.

I usually code my games for PAL then adjusto to NTSC, most of the time "the cheap way". I do this mainly 'cause I'm from a PAL region, my consoles are PAL, my TVs are PAL, my friends' systems are PAL, etc. But if I'm planning to release physically and my main target audience is NTSC, I will make the NTSC the main version, of course.

I tend to do everything every frame but update the game state, which I do the first 5 out of 6 frames in NTSC. Most of the time, it works. Specially if the games are non-scrolling. In scrolling games, it doesn't look too jerky if the screen isn't continuously scrolling all the time.
User avatar
orlaisadog
Posts: 166
Joined: Thu May 31, 2018 11:12 am
Location: Bristol, England

Re: Adjusting animations between NTSC and PAL/Dendy...

Post by orlaisadog »

DRW wrote: And today, if people still use that stupid European console, there's nobody to blame but themselves.
https://en.m.wikipedia.org/wiki/File:PAL-NTSC-SECAM.svg
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: Adjusting animations between NTSC and PAL/Dendy...

Post by lidnariq »

... C'mon, don't necrobump just to pick a fight.

1- DRW's complaint was about the idiosyncrasies of the 2C07 specifically. A geographic map of area is wholly irrelevant.

2- That map is astoundingly misleading as pertains to 2C02 vs 2C07 vs UA6538 anyway.

The last time feos posted that misleading crap, I wrote:Argentina (50Hz, 3.6MHz PAL) and Brazil (60Hz, 3.6MHz PAL) got their own special PPUs from UMC. Programs that run on Brazil's standard are definitely closer to 2C02 than UA6538.

Comparisons of geography are misleading. Better comparisons would involve cartograms by population or ideally (and unavailable) by total numbers of relevant consoles (i.e. with a cart slot) sold.
Post Reply