Forums » Themes » Proposed changes to TimingData functions

1
This topic is to get an idea of what themers use the functions that will be affected. If you use any of the functions listed at the bottom in your theme, respond.
Several functions in TimingData return tables of strings of the form "beat=value". I think it would be more useful if they returned tables of tables, of the form "{beat, value}".
So instead of needing to use split() to split the string into the beat and value, you'll just access the first and second elements of the table.
Example:
Old code:

local bpms= timingData:GetBPMsAndTimes()
for i, bpm in ipairs(bpms) do
local data= split("=", bpm)
local beat= data[1]
local value= data[2]
-- ...
end

New code:

local bpms= timingData:GetBPMsAndTimes()
for i, bpm in ipairs(bpms) do
local beat= bpm[1]
local value= bpm[2]
end

I'm going to make a pull request that changes all the TimingData functions that return tables in this style because it shouldn't be necessary to parse a string when you could have been given the numbers directly.
List of affected functions:

GetBPMs()
GetBPMsAndTimes()
GetCombos()
GetDelays()
GetFakes()
GetLabels()
GetScrolls()
GetSpeeds()
GetStops()
GetTickcounts()
GetTimeSignatures()
GetWarps()
< cybik> til Kyzentun fixes bugs for breakfast
--
< maxvg1> shakesoda: then why do i still play lol
<@shakesoda> because you're an ITG player. And thus, a masochist
--
<@shakesoda> Kyzentun: I think you might need to put down the meshes for a bit
Reply
From a cursory search of my theme folder, at least these themes would need changes:

* default
* Default More
* NAKET Coder Revolution X (possibly isn't compatible with latest SM5 anyways)
* SOMS2 (unsure if this code is actually USED or if it was me just testing the functions)

and likely any theme that has a song meter with timing data display.

Last edited: 8 March 2014 12:07pm

Reply
I plan to update default and any others that are in the stepmania repository as part of my pull request when I make it.
For the rest, hopefully they have active authors that read this forum. If they do things similarly to default, it's probably a minor change to update them.
< cybik> til Kyzentun fixes bugs for breakfast
--
< maxvg1> shakesoda: then why do i still play lol
<@shakesoda> because you're an ITG player. And thus, a masochist
--
<@shakesoda> Kyzentun: I think you might need to put down the meshes for a bit
Reply
I'm in support of this change.
Reply
Patching it for people who don't want to redo their code would be a matter of adding a bunch of functions like
do

local old_fn = TimingData.GetBPMs
function TimingData:GetBPMs()
local data = old_fn(self)
for _,t in pairs(data) do
t[1]=t[1].."="..t[2]
end
return data
end
end
in some Scripts file, so I don't see much issue with this.

But I still think it should wait until after 5 comes out.

Last edited: 10 March 2014 11:15pm

Reply
Between here and the Simulation forum on ZIV, I have counted 10 SM5 theme threads, three of them by Lirodon.
In addition, I know that dbk2 and Mad Matt are working on SM5 themes actively. I don't know where freem got the themes in his list, so I can't go there to count how many themes there are.
That's a total of 13 SM5 themes, by 11 people. All of the people appeared active enough to update based on their last post in their thread, or posts in general. Based on this, I think that if all those people could be informed of the change, it wouldn't be substantial work for them to update their themes and rerelease. It took me ~5 minutes to find the one place in default that used the functions and update it.
If the explanation of how to update a theme to fit the change that is in the first post isn't clear enough, then suggest a more clear explanation or ask for clarification on specific points.

Also, I haven't posted this thread on ZIV yet because I want to limit the number of people who get confused into thinking the change has already happened.

shakesoda, djpohly, and roothorick have all expressed unambiguous veto of this for SM5. This change will not be in any version of SM5.

Last edited: 11 March 2014 10:52am

< cybik> til Kyzentun fixes bugs for breakfast
--
< maxvg1> shakesoda: then why do i still play lol
<@shakesoda> because you're an ITG player. And thus, a masochist
--
<@shakesoda> Kyzentun: I think you might need to put down the meshes for a bit
Reply
shakesoda, djpohly, and roothorick have all expressed unambiguous veto of this for SM5.
Well that sucks.
Reply
I am very much in support of this change, but I also feel it's (probably) unwise to break the existing API for SM5 at this point. Yes, it's trivial to update one's theme/content to incorporate these changes, but it complicates things and possibly turns away the few themers/content developers we've got.

For example, I know the Taronuke expressed disinterest in developing more content for SM5 because he did, once, and then the API changed and things broke.

SM 5.1 maybe?
Reply