Posts for Randil

Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
I made a Super Mario Bros dancing script! It's not very advanced, but it works and looks pretty funny. Just run the script while recording a movie, and Mario will start dancing!
while true do

local function displayer()

movetime=3

music1 = memory.readbyte(0x0F7)
music2 = memory.readbyte(0x0F8)
music3 = memory.readbyte(0x0F5)

if m1~=music1 then change1=1 else change1=0 end
if m2~=music2 then change2=1 else change2=0 end
if m3~=music3 then change3=1 else change3=0 end

if change1==1 then d1=movie.framecount() end
if change2==1 then d2=movie.framecount() end
if change3==1 then d3=movie.framecount() end

diff1=movie.framecount()-d1
diff2=movie.framecount()-d2
diff3=movie.framecount()-d3


if      diff1<movetime and diff2<movetime and diff3<movetime then joypad.set(1, {right=true, left=true, A=true}) 
elseif  diff1<movetime and diff2<movetime then joypad.set(1, {right=true, left=true}) 
elseif  diff1<movetime then joypad.set(1, {right=true})
elseif  diff2<movetime then joypad.set(1, {left=true})
else    joypad.set(1, {}) end

end

gui.register(displayer)

m1=music1
m2=music2
m3=music3

   FCEU.frameadvance()
end
Those of you who are more skilled than me at making Lua scripts might be able to come up with pretty hilarious dancing scripts. Anyone else wanna give this a try? :) EDIT: Changing the value of "movetime" will modify how long Mario will perform each "dance step". If movetime=5, then each input will be held down for 5 frames before releasing, resulting in some different dancing.
Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
Nice to see this published, will download and show to my friends. :) I went to look at how this movie made in the Movie statistics section, and it scored really high: It has by far the highest average rating and entertainment rating, and it placed second on technical rating, just below King's Bounty. Congratulations!
Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
Truly an awesome run. Entertaining from start to finish. My favourite part was Wood Man's stage. :) I think I'll give this 8.9/9.3. A question though: What's up with the missed shot on frame 61660? The shot goes above the enemy and doesn't seem to hit anything. Is it to manipulate luck? And did anyone else have the problem that the movie kept on playing even after it should have finished? For me it did, while still holding down the B button. I think this is a TAS movie editor bug, I believe I've encountered it myself before. If others get this problem too, it should probably be fixed. EDIT: klmz reported this while I was writing this post, so it seems that the .fcm really is bugged. It shouldn't be hard to fix, luckily. :)
Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
Here's what I think (I haven't played the game before): First of all, could you explain how the L/R and U/D trick works? It seems like it just teleported you around the screen randomly. It looked pretty cool, I just don't get how it works exactly. In terms of quality, it looked very optimized. In the "collecting clocks" parts I didn't spot any lag, and I think you did as well as you could entertainment-wise on the levels. The bar sections looked optimized too. The "collecting clocks" parts of the run got a little repetitive after a while. The L/R trick is nice and adds some entertainment, but I still didn't find them very exiting. They're not terribly boring, just nothing special, in my opinion. The "bar" scenes were pretty entertaining, more entertaining than the clock collecting parts in my opinion. Nice accuracy, and pretty entertaining, but I think the scenes lasted for a little too long, but that's the game's fault, not yours. :) To sum things up, the run seemed like a very high quality run, but even with the L/R glitch I found the game choise a little meh. I found myself tapping the turbo button during some of the autoscrolling sections of the run. If I were to rate it entertainment-wise I'd give it a 5/10. I think the game is a little too long to keep the viewer interested the whole time. Perhaps someone who has played this game will find the run more entertaining than I did. I hope to see more work from you in the future, for a first TAS this holds very high quality.
Post subject: Error messages in SNES Tin Star topic
Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
When I enter the Tin Star topic in the SNES section I get these error messages at the top of the screen:
Warning: mysql_query() [function.mysql-query]: Unable to save result set in /home/tasvideos/nvsite/forum/db/mysql4.php on line 118

Warning: Cannot modify header information - headers already sent by (output started at /home/tasvideos/nvsite/forum/db/mysql4.php:118) in /home/tasvideos/nvsite/forum/includes/page_header.php on line 483

Warning: Cannot modify header information - headers already sent by (output started at /home/tasvideos/nvsite/forum/db/mysql4.php:118) in /home/tasvideos/nvsite/forum/includes/page_header.php on line 485

Warning: Cannot modify header information - headers already sent by (output started at /home/tasvideos/nvsite/forum/db/mysql4.php:118) in /home/tasvideos/nvsite/forum/includes/page_header.php on line 486

Warning: Cannot modify header information - headers already sent by (output started at /home/tasvideos/nvsite/forum/db/mysql4.php:118) in /home/tasvideos/nvsite/forum/includes/template.php on line 131
... and this general error at the bottom of the screen:
Could not obtain post/user information.

DEBUG MODE

SQL Error : 1194 Table 'pt' is marked as crashed and should be repaired

SELECT u.username, u.user_id, u.user_posts, u.user_from ,u.user_website, u.user_email, u.user_icq, u.user_aim ,u.user_skype ,u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail ,u.user_rank, u.user_sig, u.user_sig_bbcode_uid ,u.user_avatar, u.user_mood_avatar, u.user_avatar_type ,u.user_allowavatar, u.user_allowsmile, p.* ,pt.post_text, pt.post_subject, pt.bbcode_uid FROM posts p, users u, posts_text pt WHERE p.topic_id = 7642 AND pt.post_id = p.post_id AND u.user_id = p.poster_id ORDER BY p.post_time ASC LIMIT 0, 20

Line : 453
File : viewtopic.php

Backtrace:
  includes/functions.php[741]: ErrorPrintBacktrace()
  viewtopic.php[453]: message_die(202, string(39) "Could not obtain post/user information."
, string(0) ""
, 453, {string(42)}, {string(595)})
I don't get any errors in any other thread, so it's something related to that thread only. Just thought I should report it.
Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
Movie-files for SNES9X are saved as .smv-files. So your movie-file is an .smv-file stored in your SNES9X folder. Here's how you upload your movie: Go to the microstorage page (the page that ShinyDoofy linked to). Now, on this page, click the "Browse" button and then select your movie-file. After doing this, click the "Upload" button. A link should appear at the bottom of this page now, leading to your movie file. Putting this link in a forum post will allow others to download your movie. To put the link to the movie in a forum post, it's completely accepted just to copy the link and paste it in a forum post, like ShinyDoofy did with the link to the Microstorage site.
Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
I finished world 3 today. Here's the WIP. On level 3-3, I pushed the right block before the left block at the start of the level. Otherwise the solutions are the same as Ragowit's. On level 3-10, I looked in to how the counter that moves the screen upwards works, and it turns out that it's not affected by anything besides pausing the game, so I don't have to worry about it stopping when a block is falling or so.
Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
Go to "Input"->"Customize Hotkeys" and a box should pop up, telling you what keys to press to perform different actions. The first two are speed + and speed -, allowing you to increase or decrease the emulation speed. You can assign your own hotkeys to these if you want to, by marking the box so it turns green and then press the key you want to assign this to.
Post subject: Missing and broken links report
Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
I just wanted to report that on this page the link for Kid Niki 2 leads to the Kid Niki 3 TAS, while there is no link leading to the Kid Niki 2 TAS on that page.
Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
Here's what I've found for the NES section so far. I hope this helps out. These are the NES movies that are currently missing from the archive page: *8 Eyes *Kid Niki 3 These are the movies that are on the archive page but have been obsoleted: *bluesbrothers-tas-randil.avi should be replaced by this *dejavu-tas-v3-randil.avi should be replaced by this *ducktales2-tasv2-adelikat.avi should be replaced by this *finalfantasy-tas-theaxeman.avi should be replaced by this *jackal-tas-2palone-xipo.avi should be replaced by this *karnov-tas-jeffc.avi should be replaced by this *moaikun-tas-soulrivers.avi should be replaced by this *zelda2-tas-risingtempest-inzult.avi should be replaced by this *zelda-timeattack-2ndquest-sleepz.avi should be replaced by this *uninvited-tasv2-randil.avi should be replaced by this *superspyhunter-tas-genisto.avi should be replaced by this These movies are in the wrong section: *escapefrommarsstarringtaz-tas-emu.avi should be in the Genesis section instead of the NES section. *legendoftoki-tas-highness.avi should be in the Genesis section instead of the NES section. These are the movies that are in the list along with a movie that obsoletes it: *smb1fds-tasv2-phil.avi.avi is obsoleted by smb1fds-tas-happylee.avi, both of them present in the archive list.
Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
Yeah, I noticed this too. I believe I solve it by replacing the line if (condition) then (draw box) end by if (condition) then (draw box) else gui.text(10,10,"") end or something like that. The key is to get the Lua script to do something else, whatever you like, when it's not drawing the box. So basically, that gui.text command works as a gui.clear in this case. Otherwise the script thinks "well, since I don't do anything when I'm NOT drawing a box, I might as well keep the box there". Lazy Lua scripts... With that said, there's probably a better way to solve this, but this is how I solve this problem.
Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
LagDotCom wrote:
Once I get back home to the UK, I will post my movie to see if you can gain anything from it. Oh yes, one other thing... there is a possibly visual bug that occurs if you use L+R. Your previous action appears to repeat, say if you climbed up, you will visually climb up again, then your position will snap back to what it was. If this can be abused to actually do the repeated action, many many shortcuts are possible.
Thanks, I appreciate it. I actually found this L+R glitch myself some time ago, but couldn't find a use for it. As you say, it just seems to visually repeat the last action over and over, so although it's a nice glitch, I don't see how it can save any time. Hopefully I'm proven wrong since it's a cool trick. Nice solution for 2-4, Slotermeyer. :) EDIT: First attempt at 2-10. The solution is a littly ugly, with waiting periods and all, but it's the best I could come up with. I'll try some more today, but now we have something to compare to.
Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
SXL wrote:
let me try : (quite sure it won't work as html code is stripped by phpbb) <embed src="http://www.archive.org/flow/FlowPlayerLight.swf?config=%7Bembedded%3Atrue%2CshowFullScreenButton%3Atrue%2CshowMuteVolumeButton%3Atrue%2CshowMenu%3Atrue%2CautoBuffering%3Atrue%2CautoPlay%3Afalse%2CinitialScale%3A%27fit%27%2CmenuItems%3A%5Bfalse%2Cfalse%2Cfalse%2Cfalse%2Ctrue%2Ctrue%2Cfalse%5D%2CusePlayOverlay%3Afalse%2CshowPlayListButtons%3Atrue%2CplayList%3A%5B%7Burl%3A%27TASVideos%5FSMS%2Fpsychofox%2Dtas%2Dfrenom%5F512kb%2Emp4%27%7D%5D%2CcontrolBarGloss%3A%27high%27%2CshowVolumeSlider%3Atrue%2CbaseURL%3A%27http%3A%2F%2Fwww%2Earchive%2Eorg%2Fdownload%2F%27%2Cloop%3Afalse%2CcontrolBarBackgroundColor%3A%270x000000%27%7D" width="640" height="508" scale="noscale" bgcolor="111111" type="application/x-shockwave-flash" allowFullScreen="true" allowScriptAccess="always" allowNetworking="all" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
Looks very nice indeed, this idea is very interesting. For those who don't know how to get this to work, here's how you do it: 1. Download an HTML page (whichever you want, www.google.com for example) by clicking "File" -> "Save page as" in your web browser and save it as an HTML-page on your computer. 2. Open the HTML-file with a text editor, like notepad, and delete all the text and replace it with the code SXL posted. 3. Open the file with a web browser while connected to the internet and it should work.
Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
I've been working slowly on this, just for fun, and I'm on stage 2-10. Here's the WIP (recorded with 0.98.28). It's a bit faster than my old WIP, but almost all levels are played identical to Ragowit's run. It's hard to compare this to Ragowit's run in terms of speed, since he used the E version, but I use slightly better strategies on some levels. However, due to different timings for the U version compared to the E version, I can't use the same strategy that Ragowit used on level 2-10 (the fires move too quickly compared to how fast I can move). So I have to come up with another strategy for this level, and I haven't had any luck yet. Anyway, I might do some more work on this soon. Please leave a comment if you can spot an improvement somewhere, so far I've pretty much copied Ragowit's run, so a whole new strategy somewhere would be nice. :)
Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
This seems to be a problem for quite a few emulators. The solution is to assign the hotkey to a button on your keyboard, then download JoyToKey and assign that keyboard button to your controller.
Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
"God Jul" (Merry christmas) from Sweden to TASVideos!
Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
I know that you can make a Lua-script that saves and loads savestates for slots 1-9, but is there any way to save or load to a savestate created by the "Save state as..." feature? For example, if I make a savestate named test1.fca for Tetris, can I in some way make a lua script that under some condition loads this state?
Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
While your reasoning is correct, most platformers don't use the pythagorian theorem for calculating speed. In most platformer, your horiztonal speeds are the same when running and when jumping. The most common reason why jumping may be slower than walking is that you stop for one or more frames when starting the jump and/or landing from the jump. In some games, like Batman for NES, it gets a bit more complicated. Although our hero stops for a few frames before each jump, his horizontal speed is actually greater while in air than when he's walking! So if you were to make a long enough jump, it would save time, but normally jumping wastes time. I can mostly speak for NES games though, perhaps there are game for SNES or Genesis that use the Pythagorian theorem when calculating your speed components when jumping.
Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
I don't know if you already have a lua-script for counting steps, but if not, I made one here:
while true do

input = memory.readbyte(0x008)
levelover = memory.readbyte(0x007)

xpos = memory.readbyte(0x06D)
ypos = memory.readbyte(0x06F)

movement = math.mod(xpos+ypos,8)

if movie.framecount()<100 then steps=0 end
if levelover>0 then steps=0 end
if AND(input,16)==16 then steps=0 end
if movement==1 then steps=steps+1 end

gui.text(10,10,"Steps: " .. steps)

   FCEU.frameadvance()
end
The script has some minor inconveniences though: *You can only run the script while playing or recording a movie. *You have to start running the script while the frame count is <100, basically as soon as you start playing the movie. I tried out the script on the published run, and it worked very well. Pressing start button will reset steps to 0. The number of steps also reset after each level. I'm looking forward to your end-result!
Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
Do bullets appear randomly or is there some kind of pattern? Because savestates do not work with the script I'm guessing a tool-assisted run of this game is not possible to make, though I do think it would look pretty impressive.
Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
I think the answer is this. It can probably be simplified (it's a polynomial of degree n of the variable x) but I'm having a hard time calculating a formula for the polynomial. I'll look into this some more...
Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
Xkeeper wrote:
Screw the game, I have Lua! I would probably put this in something else, but honestly FCEUX + Lua just provides way too much ease-of-coding.
Nice job constructing a game solely on a Lua script! Perhaps when the game is complete, you can share the script so we can give it a try.
Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
FractalFusion wrote:
Randil wrote:
Given 4 strictly positive integers a1,a2,a3 and a4 that satisfy a1<=a2<=a3<=a4, how many solutions are there for the equation a1+a2+a3+a4=x for an arbitrary positive integer x>=4?
I know you didn't mean it, but the way you worded it, the answer is always 1. Because, given positive a1, a2, a3, a4, there is exactly one x>=4 such that a1+a2+a3+a4=x. What you meant is:
Randil wrote:
Given an arbitrary positive integer x>=4, how many solutions are there for the equation a1+a2+a3+a4=x for 4 strictly positive integers a1,a2,a3 and a4 that satisfy a1<=a2<=a3<=a4?
Ah, yes. Those were supposed to be variables, not constants. Thanks for clearing it up.
Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
I don't know if anyone's still working on the problem I posted, but here's the solution if anyone's interested. :) (square brackets mean the floor function) This formula can easily be generalized for a sum of n variables.
Experienced Forum User, Published Author, Skilled player (1890)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
I find this idea intriguing too. I too have thought about what it would be like to "speedrun a speedrun". Especially if the competition was for a game not TASed before, even a TAS made in a few days will probably provide a good basis to make an optimized TAS in the future. I might consider joining in on one of these competitions in the future, if it's for a simple enough game.