Phyu (# of physics updates) is bad word, replace with Tick

Started by Simon, June 27, 2023, 10:50:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Simon

Hi,

Phyu in Lix is a contraction of "physics update", and denotes the number of physics updates that have passed since 4 seconds before the spawn of the first lix.

Phyu is a bad word:
  • It's a made-up word that appears nowhere else but in technical discussions of Lix.
  • It's nondescriptive, you don't necessarily guess that I use it as a measuring unit.
  • It's a contraction of a verb (we're advancing physics), not of a noun (we have updated physics this often).
  • It's annoying to pronounce.
Replacement ideas:

Frame: I don't like frame because we can confuse physics frames with graphics frames. Lix runs at 60 fps, these frames are graphics frames, and we update physics at normal speed 15 times per second, 15 fps. I'd like two clearly different words instenad.

Age: I like this best. We're at age 100, and soon we'll be at age 101, very nice. Still, it leaves a sour taste: We update at 15 age/s, age(s) per second, huh? Age sounds like it must be far longer than a second.

IGT: An acronym for In-Game Time, as opposed to real time. Lix runs at 15 IGT/s? Sounds strange.

More proposals or arguments please, otherwise I'm sticking with age.

I'm even open to redefine age (or how we call it) to start at the first spawn, not at 4 seconds (= 60 physics updates) before the first spawn. I'll still write replay files as if the first spawn were at phyu 60, not at age 0. The 4 seconds are because networking games, and even singleplayer in old (2007-2010) versions of C++ Lix, start 4 seconds before the first spawn, and blissful teenage 21-year-old Simon immediately baked it into the replay files.

-- Simon


WillLem


Forestidia86

Quote from: Proxima on June 27, 2023, 11:13:37 PM
Tick?

I would support Tick as substitute for phyu as well. Age sounds weird in this context.

geoo

Frame is the obvious choice given its common usage for the purpose, but there is the ambiguity between graphics and gameplay frame, and being explicit would be cumbersome I guess.

Tick is a good suggestion, still somewhat common for this kind of usage, and concise as well.

Age and count I would never guess that they could refer to ingame frames, they have so many other stronger associations.

Ramon

I agree with "Tick" sounding the most appropiate (from the suggestions so far).

WillLem

Tick is used in the NL/SLX codebase along with Count, as in "GetTickCount" (I think it's used for milliseconds in this context, though). "GetTicks" would also be fine though, for concision.

Simon

It will likely be Tick.

Like NL, I use the name Tick internally for the unit of a timer. Mine runs at 1/60 seconds. It's Allegro 5 functionality, and the A5 documentation occasionally calls the units Ticks, but the API consistently calls the units "timer count". Thus, in the long term, I can refactor away from my usage of Tick (for the A5 timer unit) to Tick for number of physics updates.

The word Tick is nowhere exposed in the UI, and thus would be fresh, no popular prior meanings. And Tick is certainly not the rendered graphics frame.

Frame: Has the benefit of existing other words, e.g., framestepping. Tickstepping is made-up. I like to say "rewind" for framestepping backwards, nice and short, but many people say framestepping, too.

Step: Possible, but dangerously ambiguous because walking lix also step forward. "Assign basher after the next step" is ambiguous.

Count: Alone, it's too nondescriptive. Count of what? Physics count seems longer than necessary, Phycount has the same problem as Phyu.

Move: I don't like it much. There is no user input in most physics updates. Move would rather be what players do, and I use Ply internally for a player action, which is either assignment or nuke. The replay tweaker is a ... replier. >_>;;

Generation: It's the common word in cellular automata for the result after a physics update, but that's because cells appear and die, whereas lix would exist across thousands of generations.

-- Simon

Simon

The more I think about it, the better Tick sounds to me.

Frame is graphics frame, and it's also frame of an animation. A stunner can show the same frame for several ticks.

-- Simon

Dullstar

In most discussions "physics update" is probably the best choice if only because it's extremely clear. But looking at where "phyu" is used in the code I could see that making for some lengthy variable names.

As an internal name, while "phyu" is unusual, I don't think it's too bad. It has a cost as a bit of codebase specific terminology that has to be learned, but it's consistent -- it's not like you're going to get it mixed up with some other thing "phyu" could potentially refer to -- and it's used in enough locations throughout the code that it's pulling its weight fairly well: it's not like it's some obscure variable that you only see when you delve into the internals of some cursed function nobody-knows-what-it-does and everyone is scared to touch it and doesn't know what any of the 30 badly named local variables does. Rather, it's a term you learn once and then is constantly reinforced by the fact that it's used basically everywhere, and it's clear what the connection is between "physics update" and "phyu" once you learn what a "phyu" is. If you have a ton of these, your codebase will be super inaccessible to new eyes. But if you only have a few and a nice getting started guide that explains some of the terminology, I don't think that's too bad. Probably anyone who gets confused by "phyu" for more than about 5 minutes for any reason other than "where is this terminology introduced" isn't going to be learning much from reading the code no matter how good the names are.

The only real advantage of "tick" over "phyu", in my opinion, is that it's more "standard" but I'm also not quite convinced that it's standard enough (particularly considering other possible meanings of "tick") to say "yeah, this is definitely the word to use for physics updates." But "tick" is definitely a reasonable choice. That said, I'm not sure I'd use "tick" in user-facing discussions where you don't expect people to know the codebase, or that it's worth the effort to migrate from "phyu" to "tick" (if only to make sure that none of the documentation rots as a result).

Simon

Thanks! I agree that the codebase should continue to call it Phyu.

Tick would be the short word in the UI. Age, generation, move, turn, count, they're all less clear. Frame is the strongest candidate beside tick, despite frame's imprecision (can mean graphics frame). PhyU with capitalized U maybe, but it's not clear.

I agree that forum discussions should call it physics update, or physics step, or similar, for maximum clarity.

-- Simon