Gods improved by 150 frames. That's special to me.
Here's the new thing:
There's a place where Hercules can jump and hit his head on a certain moving platform so that he falls through a floor. If the timing is correct, the trick saves 6 frames:
Together with some older findings, the improvement was 20 frames. Finally, this was enough to make a difference in the end. Even better, it started rolling like a snowball. Luckier randomness was achieved at the snakes near the end of the second level (~0.5 seconds saved) and at the second boss (another ~0.5 seconds saved).
I also found a faster technique for the shop cursor. All shops except the first one (due to bad enemy randomness) are improved. There are some other minor changes too, but they are mostly unnoticeable.
Boss health can be viewed here: 00FFEF1E

Thanks to Gens coders for a pleasant tasing experience.
Special thanks to Ideamagnate for giving some effective feedback a long time ago.

Bisqwit: Submission file updated. The author says it became 60 frames faster.

Aqfaq: The real length of the movie is 07:31.93, not 07:32.93. What's going on?

Truncated: Accepted, assuming Aqfaq makes no improvements in the immediate future (which is quite an assumption).


TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15544
Location: 127.0.0.1
This topic is for the purpose of discussing #1446: Aqfaq's Genesis Gods in 07:31.93
Joined: 12/26/2006
Posts: 256
Location: United States of America
YES vote for improving the existing movie, although I had trouble spotting the difference...
Senior Moderator
Joined: 8/4/2005
Posts: 5777
Location: Away
The game with awesome music returns. :D I already see Guybrush having nightmares about it.
Warp wrote:
Edit: I think I understand now: It's my avatar, isn't it? It makes me look angry.
Mitjitsu
He/Him
Banned User
Joined: 4/24/2006
Posts: 2997
Voting yes, couldn't really fault it, although I tried to do the glitch at the end in real time but I wasn't able to do it, it has nothing to do with 30hz button bashing but more of a frame precise rhythm which is equally as hard.
Former player
Joined: 11/13/2005
Posts: 1587
O_o Oh noes...
Post subject: Re: #1446: Aqfaq's Genesis Gods in 07:33.0
Player (81)
Joined: 3/11/2005
Posts: 352
Location: Oregon
NesVideoAgent wrote:
Special thanks to Ideamagnate for giving some effective feedback a long time ago.
You're welcome. I wouldn't call the feedback effective except that it got you to find an optimization near the one I thought I'd found. Even a broken clock is right twice a day. I'll give it a yes just because you found a way to improve a game that was already so tightly optimized. You're much more patient than I am.
ideamagnate| .seen aqfaq <nothing happens> DK64_MASTER| .seen nesvideoagent * DK64_MASTER slaps forehead
Editor, Expert player (2477)
Joined: 4/8/2005
Posts: 1573
Location: Gone for a year, just for varietyyyyyyyyy!!
Heh... Ideamagnate, that one place is quite annoying. I just improved it another 26 frames. I need to play the rest of the game again to see how much of it can be carried to the end. There's hope for a few frames.
Guybrush wrote:
O_o Oh noes...
Please forgive me Gyubrush. --- EDIT: 28 frames improved! More may be possible, so I'm not sending this to Bisqwit yet.
Joined: 12/26/2006
Posts: 256
Location: United States of America
Is a tool-assisted speedrun truely ever finished? : )
Editor, Expert player (2477)
Joined: 4/8/2005
Posts: 1573
Location: Gone for a year, just for varietyyyyyyyyy!!
If it's up to me, Gods will be finished eventually. But it probably isn't. :) Anyway, there's some party stuff to do now... and vine to drink... wine... fine... whatever...
Post subject: Re: #1446: Aqfaq's Genesis Gods in 07:32.93
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Aqfaq wrote:
The real length of the movie is 07:31.93, not 07:32.93. What's going on?
Good question. Can someone fix this code?
function FormatMovieLength($length, $show_subsec = false)
{
  if($length < 1) return 'unknown';
  $i = (int)($length + 0.5);
  $res = sprintf('%02d:%02d', (int)($i/60)%60, ($i % 60));
  if($i >= 3600) $res = sprintf('%d:%s', (int)($i/3600), $res);
  if($show_subsec)
    $res .= preg_replace('@^[0-9]*(\..+)0*$@U', '\1', sprintf('%.2f', $length));
  return $res;
}
It is supposed to format the movie length (indicated as number of seconds, a decimal number) into hours, minutes and seconds. If the movie length does not include hours, hours are omitted. If the $show_subsec parameter is given, subsecond value is also attached to it. If $show_subsec is not given, the value should be rounded towards the nearest full second. [Edit: Already fixed it, but does someone still want to take a try? :)]
Post subject: Re: #1446: Aqfaq's Genesis Gods in 07:32.93
Player (198)
Joined: 12/3/2006
Posts: 151
  $i = (int)($length + 0.5);
This line is always executed, meaning the seconds will always be rounded up if the subsecond amount was greater or equal to 50. Even when subseconds are displayed... I think?
Joined: 12/26/2006
Posts: 256
Location: United States of America
Bisqwit wrote:
Can someone fix this code?
Ooh! Ooh! Me! Me! Actually, I've never even touched PHP code (I'm guessing that's what this is) before, but it's enough like C/C++ that I can understand most of it... I'll make comments targeted at non-programmers, since those are the only ones who would need help understanding it anyway. ; ) I notice that the language doesn't seem to enforce data types very much... but anyway...
function FormatMovieLength($length, $show_subsec = false)
{
OK, this defines the that prints the movie length. There are two possible arguments. $length is the memory location of the decimal length in seconds of the movie. Programmers use names for convenience; in this particular programming language, the names must begin with a $ (I guess). The second value indicates whether the programmer wants to show subseconds. The programmer can choose whether to provide a value here or not. If no value is provided, it is assumed that the programmer does not want subseconds displayed.
if(!($length >= 1)) return 'unknown';
If the movie is less than one whole second, the function prints the word "unknown" then exits. This is a logical equivilant of the original code, which I can't post here because Bisqwit has quite a sense of humor! : D
$i = (int)($length + 0.5);
Stores the movie length, rounded up to the nearest whole second, in a new memory location given the very creative name $i. This is a classic and quite clever way for programmers to round numbers. First 0.5 is added to the decimal number. If the number was supposed to be rounded up because the decimal part was greater than 0.5, then this will cause the ones digit to increase. The one's digit will stay the same if the number should not be rounded up. Now here's the clever part: the (int) command (called a "cast") tells the program to convert ($length+0.5) into an integer by simply chopping off anything after the decimal point. This is called "truncation". Thus, the number is rounded.
$res = sprintf('%02d:%02d', (int)($i/60)%60, ($i % 60));
This looks complicated but is actually fairly simple. First the programmer creates a variable, a memory space given a name, named $res (short for $result). $res is going to contain a string of characters, which will be the formatted movie time. sprintf stands for "string print formatted". The first argument '%02d:%02d' tells how the remaining values are to be formatted and breaks down as follows: % tells the program that what follows is formatting information. Otherwise, all other characters would be printed literally. %...d means that the function should insert an integer number into the string. (d stands for decimal, I guess, but the number is actually an integer... numbers with a decimal fraction would be inserted with %f.) The first 0 following % tells the program to format the number with a leading zero. The 2 tells the program that this integer will only have two digits. Thus, %02d tells the program to print a two digit integer with a leading zero if necessary. Because the d ends the formatting information, the next character, :, will be printed literally before the next integer. This should start to look familar as the mm:ss format used for times on the site. The two expressions following '%02d:%02d' tell the program which integers to place before and after the :. We'll see that these expressions indeed calculate the number of minutes and seconds in the movie. (int)($i/60)%60 First the variable $i, which holds the movie length rounded to the nearest second, is divided by 60, then truncated by means of (int). This gives us the whole number of minutes in the movie. The % has a different meaning this time around -- it performs "modulus division", which returns the remainder instead of the usual quotient. Dividing the number of minutes by 60 would usually give us the number of hours in the movie. Modulus dividing the number of minutes by 60 tells us the number of minutes remaining after the hours are subtracted, which is what we wanted here. Edit: I don't know whether the mod division occurs before or after the int cast (order of operations stuff), but it doesn't seem to matter. The same principle of modulus division applies to the second expression, ($i % 60). This time, the number of seconds ($i) is being mod-divided by 60 to give us the number of seconds remaining after the minutes have been accounted for. The character string returned by sprintf, which may look like "07:24", is placed in the memory space used by $res.
if($i >= 3600)
If the number of seconds (%i) is greater than or equal to 3600, i.e. one hour...
$res = sprintf('%d:%s', (int)($i/3600), $res);
... then $res receives a new character string. '%d:%s' tells sprintf to print an integer followed by a : and another character string. The integer is (int)($i/3600), which represents $i (the number of seconds) divided by 3600 (to get the number of hours) truncated to an integer. Thus, so far we might have "2:" as the string. Recall that sprintf was supposed to print another character string after the integer and colon. sprintf simply prints what $res was before receiving the new value, which effectively appends the number of minutes and seconds to the number of hours. The function can do this because $res has not changed. The full string returned by sprintf is then placed as the new value of $res. By this point the string might be "1:07:24". Of course, all of this is ignored if %i was less than 3600.
if($show_subsec)
If the programmer indicated that the function should display the fraction of the number of seconds...
$res .= preg_replace('@^[0-9]*(\..+)0*$@U', '\1', sprintf('%.2f', $length));
Sorry, I can only guess what this one does. I see that preg_replace takes three string values. The first is evidently a GREP expression, which I never bothered to learn. I have no idea what '\1' is for. sprintf('%.2f', $length) returns a string of the original movie length in seconds (neither rounded nor truncated) formatted with two decimal places, but I don't know why $length is not modified here. I think that .= is a concatenation operator but I don't know for sure. However, this is probably where the bug is, although I don't understand the code enough to say any more. Evidently the intent is to append the fractional number of seconds onto the string, but I don't see an if statement that would check whether the number of seconds was rounded up when %i was first calculated. Whether the if statement belongs here or before the $i = (int)($length + 0.5); statement I can't say, because I don't really understand what's going on here. : (
return $res;
}
The value of $res is now returned to the main part of the program. That's it! See, I understood most of it... In C/C++, only integers can be the arguments for the % operator. If PHP allows a floating point value to be the first operand (like in Windows Calculator), the program could look like this...
function FormatMovieLength($length, $show_subsec = false) 
{ 
  if(!($length >= 1)) return 'unknown';
  $to_round = 0;
  if($show_subsec) $to_round = 0.5;
  $i = (int)($length + $to_round); 
  $res = sprintf('%02d:%02d', (int)($i/60)%60, ($i % 60)); 
  if($i >= 3600) $res = sprintf('%d:%s', (int)($i/3600), $res); 
  if($show_subsec) $res = sprintf('%s.%d', $res, (int)(($length%1)*100));
  return $res; 
}
With the idea that $length%1 would return only the fractional part of $length. Otherwise, I would do this...
function FormatMovieLength($length, $show_subsec = false) 
{ 
  if(!($length >= 1)) return 'unknown';
  $to_round = 0;
  if($show_subsec) $to_round = 0.5; 
  $i = (int)($length + $to_round); 
  $res = sprintf('%02d:%02d', (int)($i/60)%60, ($i % 60)); 
  if($i >= 3600) $res = sprintf('%d:%s', (int)($i/3600), $res); 
  if($show_subsec) $res = sprintf('%s.%d', $res, ((int)$length)-(((int)($length))*100));
  return $res; 
}
I may have formatted the sprintf statements wrong with the period. Also, I know that my PHP statements are needlessly redundant because I don't know how the if/else syntax works in that language, or if PHP supports the ternary operator. But you get the idea. I don't see why the code in question needs to be so complicated. But maybe you can enlighten us. ; )
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Deep Loner wrote:
$to_round = 0; if($show_subsec) $to_round = 0.5; $i = (int)($length + $to_round);
Correct. (One of the correct solutions, anyway.)
upthorn
He/Him
Emulator Coder, Active player (391)
Joined: 3/24/2006
Posts: 1802
Deep Loner wrote:
function FormatMovieLength($length, $show_subsec = false) 
{ 
  if(!($length >= 1)) return 'unknown';
  $to_round = 0;
  if($show_subsec) $to_round = 0.5; 
  $i = (int)($length + $to_round); 
  $res = sprintf('%02d:%02d', (int)($i/60)%60, ($i % 60)); 
  if($i >= 3600) $res = sprintf('%d:%s', (int)($i/3600), $res); 
  if($show_subsec) $res = sprintf('%s.%d', $res, ((int)$length)-(((int)($length))*100));
  return $res; 
}
First, shouldn't that
if($show_subsec)
be an
if(!($show_subsec))
Other than that, I'm sure it would work, but why not simply...
function FormatMovieLength($length, $show_subsec = false)
{
  if($length < 1) return 'unknown';
  if($show_subsec) $length = ($length - 0.5); //prevents rounding if subseconds are shown
  $i = (int)($length + 0.5);
  $res = sprintf('%02d:%02d', (int)($i/60)%60, ($i % 60));
  if($i >= 3600) $res = sprintf('%d:%s', (int)($i/3600), $res);
  if($show_subsec)
    $res .= preg_replace('@^[0-9]*(\..+)0*$@U', '\1', sprintf('%.2f', $length));
  return $res;
}
How fleeting are all human passions compared with the massive continuity of ducks.
Joined: 12/26/2006
Posts: 256
Location: United States of America
upthorn wrote:
First, shouldn't that
if($show_subsec)
be an
if(!($show_subsec))
Yes, indeed it should. Funny that our computer software engineer overlooked that. ; )
upthorn wrote:
...;
  if($show_subsec) $length = ($length - 0.5); //prevents rounding if subseconds are shown
  $i = (int)($length + 0.5);
...
That works. If PHP supported the C-style ternary operator (I don't know if it does or it doesn't), then I'd write this:
...
  $i = (int)(($length + ($show_subsec ? 0 : 0.5))); 
...
or:
...
  $i = (($show_subsec) ? ((int)($length)) : ((int)($length + 0.5)))
...
upthron wrote:
...
    $res .= preg_replace('@^[0-9]*(\..+)0*$@U', '\1', sprintf('%.2f', $length));
...
Am I correct that the first argument to preg_replace is a GREP expression? I can't possibly imagine that a complex pattern-matching routine is the most efficient solution for the simple operation that we're trying to do here. It's kind of like using a flamethrower to kill a common housefly. It's fun, it's cool, and you can brag about how you did it. But there will always be the person who asks, "Wouldn't it have been quicker and easier just to..." Bisqwit's little practical joke was a good one. I was scratching my head for quite some time. Here's my practical joke on top of that one. <Where> you ask? It's a secret to everybody. ;p
Active player (437)
Joined: 4/21/2004
Posts: 3517
Location: Stockholm, Sweden
Improved run; naturally voting yes.
Nitrogenesis wrote:
Guys I come from the DidyKnogRacist communite, and you are all wrong, tihs is the run of the mileniun and everyone who says otherwise dosnt know any bater! I found this run vary ease to masturbate too!!!! Don't fuck with me, I know this game so that mean I'm always right!StupedfackincommunityTASVideoz!!!!!!
Arc wrote:
I enjoyed this movie in which hands firmly gripping a shaft lead to balls deep in multiple holes.
natt wrote:
I don't want to get involved in this discussion, but as a point of fact C# is literally the first goddamn thing on that fucking page you linked did you even fucking read it
Cooljay wrote:
Mayor Haggar and Cody are such nice people for the community. Metro City's hospitals reached an all time new record of incoming patients due to their great efforts :P
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Deep Loner wrote:
Yes, indeed it should. Funny that our computer software engineer overlooked that. ; )
The idea was right, although there was a bug in the implementation. What practical joke were you referring to? I did not make the mistake in my original code intentionally. Oh, and the regexp... it's there in order to strip unnecessary trailing zeros from the decimals (but leave still at least one, mandated by .+) . I couldn't think of a better way to do it. (Such as a more suitable sprintf formatting.) Note that Upthorn's idea, sprintf("%s.%d", $x*100), does not do right, because x.05 formatted as x.5 equals wrong.
Joined: 12/26/2006
Posts: 256
Location: United States of America
Bisqwit wrote:
What practical joke were you referring to?
On this thread, anything between these two symbols: <> gets erased when the message is posted. So whenever someone posts the code, if they don't replace the first less-than sign with "not greater than or equal to", the code doesn't display correctly. My intended joke on top of that was to put a bunch of lorem ipsum spam in between the <>, counting on the fact that it's still there on your server even though nobody sees it. : ) Are you saying that you didn't do the <> thing on purpose?????
Bisqwit wrote:
Note that Upthorn's idea, sprintf("%s.%d", $x*100), does not do right, because x.05 formatted as x.5 equals wrong.
I think that was my idea. : ( You're probably right, though. A long time ago I self-taught myself C++, so I'm more accustomed to the iostream library. I only know a little bit about the C-style printf functions, which is why I figured that something was probably wrong in my code. Anyway, that's why you're a computer software engineer and I'm not! ; ) Edit: it looks like you turned the joke feature off or removed it. But upthron and I both knew it was there. You overlooked the Preview button. : )
Senior Moderator
Joined: 8/4/2005
Posts: 5777
Location: Away
Deep Loner wrote:
Are you saying that you didn't do the <> thing on purpose?????
I always thought that was because the forum software interpreted the text between <> as HTML code, or something like that. Disable HTML, and everything should get displayed correctly (I'd also suggest using &lt; and &rt;, but they don't seem to work).
Warp wrote:
Edit: I think I understand now: It's my avatar, isn't it? It makes me look angry.
Joined: 12/26/2006
Posts: 256
Location: United States of America
I feel about THIS SMALL right now...
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Deep Loner wrote:
Bisqwit wrote:
What practical joke were you referring to?
On this thread, anything between these two symbols: <> gets erased when the message is posted.
Oh, sorry, I ignored this thread for a while, didn't see your reply. On this (off)topic, you should set it in your profile so that "disable HTML" is on by default, and uncheck "disable HTML" only if you're going to post HTML code that requires the browser to interpret it as HTML. I recommend this to everyone else, too. Don't enable HTML markup in your posts unless you're actually going to use, HTML tags. Otherwise you will indeed experience the kind of phenomenon you described, because HTML tags begin with < and end with >.
Joined: 12/26/2006
Posts: 256
Location: United States of America
Funny that I had just PM'd you before you posted that. Oh, by the way, good work Aqfaq! ; )
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Deep Loner wrote:
Funny that I had just PM'd you before you posted that.
Yeah, you reminded me of this thread, making me realize I had asked a question and not actually read the answer.
Post subject: Movie published
TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15544
Location: 127.0.0.1
This movie has been published. The posts before this message apply to the submission, and posts after this message apply to the published movie. ---- [812] Genesis Gods by Aqfaq in 07:31.93
Joined: 11/11/2004
Posts: 400
Location: ::1
I think the zipfile for the published movie's broken.