Posts for Pokota

1 2
7 8 9 31 32
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
My first brush with emulation would probably be Comix Zone on my cousin's computer, if there wasn't an official PC port - otherwise it would have been an old version of Ages on some other friend's computer. The first emulators I deliberately sought out would have been DOSBox and an old GBC emulator called DreamGBC.
Adventures in Lua When did I get a vest?
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
With all that said, make it anyway - and post it to the game's thread first to gauge reactions and get ideas. You don't have to submit it to the workbench to share it with us.
Adventures in Lua When did I get a vest?
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
Basic Bot isn't a learning bot. It just tries random permutations of inputs until the condition you set is met. It's not even an exhaustive brute-force attack, it's just random permutations weighted by the percentages you set. It's kinda meant for attacking RNGs.
Adventures in Lua When did I get a vest?
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
Why not just go 100% glitchless?
Adventures in Lua When did I get a vest?
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
Question. what does NG+ bring to the table that a fresh game doesn't? I know cards and levels carry over but why do NG+ since we already would need a verification movie that gets those cards and levels for it?
Adventures in Lua When did I get a vest?
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
Because there's no official process or real requirements for temp encodes - it's up to the person doing the temp encode. I just use the same settings that I use for my LP projects. It's optimized for my needs, and that's really all I care about. If it works better for you then feel free to use it. You'd have to ask the Publishing team why they do things the way they do. It might be optimized for something I don't take into consideration.
Adventures in Lua When did I get a vest?
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
We don't actually need AviSynth for single dump temp encodes since FFmpeg has a scalar that accepts Nearest Neighbor. We do still need AviSynth if the dump created multiple files (any PSX dump) or if it's DS Footage (see SpikeStuff's above post on the matter), but if we can cut out Avisynth's processing that saves save time on the encode. Stovent's AVS Script:
AviSource("movie.avi")
ChangeFPS(30)
PointResize(width * 4, height * 4)
return last
First - this forces 30 FPS by deleting frames. Not necessarily a good thing, though if the game is native 30 FPS I guess there's no loss of fidelity? Second - this will not give Youtube HD for GBx footage. Also, we can upscale using FFmpeg - see my batch file at the end of the post. Third - You do not need return last, since avisynth is weird and doesn't require return last if the last line of your script is a clip and isn't a variable declaration. Stovent's Batch File:
@echo off

echo.
echo -------------------------
echo -   Encoding HD audio   -
echo -------------------------
echo.
:: Audio ::
 ".\programs\avs2pipemod" -wav temp.avs | ".\programs\venc" -q5 - ".\temp\audio_temp.ogg"
echo.
echo -------------------------
echo -   Encoding HD video   -
echo -------------------------
echo.
:: Video ::
".\programs\x264" --qp 5 --crf 20 --output ".\temp\video_temp.mkv" temp.avs
echo.
echo -------------------------
echo - Muxing HD video+audio - 
echo -------------------------
echo.
:: Muxing ::
".\programs\mkvmerge" -o ".\output\temp_encode.mkv" --compression -1:none ".\temp\video_temp.mkv" ".\temp\audio_temp.ogg"
Fourth - there is no programs subfolder in the rar file, so this will not work for anyone other than yourself. Ohh I see, it's supposed to be run from the MeGUI folder. Still won't work for me though. Fifth - Since you're already running from the command line, grab FFmpeg and try my batch script for comparison (You'll want to pass it the avi dump directly, not the avisynth script)
@echo off
set /p fn="Filename? "
@echo.
set /p src="Source? "
@echo.
set /p scale="Scale value? (common values are 2, 4, 8)"
@echo.
choice /m "Are there subtitles?"
@echo.
IF errorlevel 2 goto Encode
IF errorlevel 1 goto Subtitle

:Subtitle
set /p sub="Subtitle file name? "
goto Subencode

:Encode
cls
ffmpeg -i %src% -sws_flags neighbor+full_chroma_inp -c:v libx264 -crf 20 -bf -1 -b_strategy 2 -force_key_frames 00:00:00.000 -pix_fmt yuv420p -c:a aac -b:a 192k -vf scale=%scale%*iw:-1 %fn%
if errorlevel 1 goto :Fail
@echo ----------------------
@echo Encoding complete.
pause >nul
goto :eof

:Subencode
cls
ffmpeg -i %src% -sws_flags neighbor+full_chroma_inp -c:v libx264 -crf 20 -bf -1 -b_strategy 2 -force_key_frames 00:00:00.000 -pix_fmt yuv420p -c:a aac -b:a 192k -vf subtitles=%sub% -vf scale=%scale%*iw:-1 %fn%
if errorlevel 1 goto :Fail
@echo ----------------------
@echo Encoding complete.
pause >nul
goto :eof

:Fail
@echo ----------------------
@echo Encode failed, please review FFMPEG output.
@echo I will go ahead and delete %fn% for you.
pause >nul
del %fn%
goto :eof
Adventures in Lua When did I get a vest?
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
It looks like you're using bus addresses instead of domain addresses. This is fine for most emulators but not for BizHawk, which uses domain addresses for everything except event hooks (which I've griped about this before). In the lua console, run the command memory.getmemorydomainlist() - you'll want to use the one that says Bus, probably the M68K Bus. You should start your script with
memory.usememorydomain("M68K BUS")
In BizHawk, you want event.onframestart(function) if you want a function to run every frame before the frame update. I fully suggest you have the Lua Functions page on hand while you work with your scripts, it's a handy reference. Also, what purpose does the timer serve? You don't appear to compare anything to it or evaluate using it or anything. You just count backwards from 60 by one each frame the script is running...?
Adventures in Lua When did I get a vest?
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
Fun fact - you can't currently draw image files onto a lua canvas, unless you can and I'm just a dumb. The goal is to put these image files onto a separate canvas so that the emulator window remains uncluttered while streaming/recording.
Language: lua

-- pokemon.lua -- Version 1 "Carol" require 'pkmn_g1_data' memory.usememorydomain("System Bus") game_offset = 0 yellow = false pikachu = 0xd46f pikachu_happy = 0 drawSpace = gui.createcanvas(32*6,32*5) controls = forms.newform(160,144, "Pokemon Support Controls") function cleanLog() console.clear() end function discernGame() gameflag = memory.read_u8(0x13c) if gameflag == 0x59 then console.log("Pokemon Yellow detected, using Yellow addresses.") game_offset = 1 yellow = true else console.log("Pokemon Yellow not detected, using Red/Blue addresses.") end end discernGame() function drawArray(array) width = 32 height = 32 row = 0 column = 0 drawSpace.Clear(0xff000000) if array[1].sprite then for k, v in pairs(array) do console.log(v.sprite) if column > 5 then column = 0 row = row + 1 console.log("Row "..row..", Column", column) end --drawSpace.drawImage(v.sprite,width*column,height*row) column = column + 1 end else console.log(debug.traceback()) error("Error in drawArray - target array does not define sprites") end end function generateArray(address) array = { } i = memory.read_u8(address) for j=1,i do array[j] = getPokemonByIndex(memory.read_u8(address + j)) end console.log("Array generated from address ".. address) return array end function updateParty() partyArray = generateArray(0xD163 - game_offset) console.log("Party array populated") if yellow then pikachu_happy = memory.read_u8(pikachu) console.log("Pikachu's happiness is ".. pikachu_happy) end drawArray(partyArray) drawSpace.SetTitle("Party Mode") end function updateBox() box_total = 0xDA80 boxArray = generateArray(box_total - game_offset) box_total = memory.read_u8(box_total) message = "There are ".. box_total .." pokemon in the active box." console.log(message) if box_total > 17 then gui.addmessage(message) end drawArray(boxArray) drawSpace.SetTitle("Box Mode") end manualPartyUpdate = forms.button(controls, "Party", updateParty, 5, 5) manualBoxUpdate = forms.button(controls, "Box", updateBox, 5, 40) manualLogClear = forms.button(controls, "Clear Log", cleanLog, 5, 75) console.log("Controls dialog has been assigned handle "..controls)
Adventures in Lua When did I get a vest?
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
I'm working on a general use lua script for the Gen 1 games, and it just occurred to me that some of the G1 glitch pokemon have valid G2 equivalents. In theory, could a glitchy Gen 1 run be used for an entertaining Gen 2 Catch-Em-All game? Maybe Yellow/Crystal? All of the missing Mons in Crystal can be obtained in Yellow, either through glitch catches or through normal play (Kabuto/Omanyte would be an issue in glitchless yellow, but since the yellow run is being glitched anyway for Crystal's missing ones...)
Adventures in Lua When did I get a vest?
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
If the RNG changes every frame, then it's going to get slowed down since then the script has to be re-run every frame. Including all of the drawing. I'd suggest not using the RNG tab if you don't actually need it (or only using it if you need TAS precision on the RNG which at that point wouldn't you be doing frame-advance anyway?) Can you share the script? I'm curious to know how it works and to see how it runs on my machine.
Adventures in Lua When did I get a vest?
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
Just remember that the event memory hooks use the full bus address, not just the partial domain address. using 0x151ac will give different results than from using 0x200151ac
Adventures in Lua When did I get a vest?
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
Adventures in Lua When did I get a vest?
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
From this other thread
Masterjun wrote:
When create a new canvas you need to save the LuaCanvas it's returning, like so:
Language: lua

local myCoolCanvas = gui.createcanvas(640,480)
As to things you can do with that, looking at the code for the LuaCanvas, you can use SetTitle(), Clear(), Refresh(), DrawRectangle(), and DrawText(). So like:
Language: lua

myCoolCanvas.DrawText(10,50,"sup") -- default color is white so might be hard to see myCoolCanvas.DrawRectangle(64,32,16,16)
brunovalads wrote:
Masterjun wrote:
default color is white so might be hard to see
Language: lua

-- Background colour in 0xaarrggbb format, use it first before drawing anything myCoolCanvas.Clear(0xFFE9C662) -- Setting a title for the window with any string myCoolCanvas.SetTitle("My Cool Canvas!!!") -- Refreshing to be able to draw each frame (or amount of time your loop takes). -- USE IT AFTER ALL CANVAS DRAWINGS myCoolCanvas.Refresh()
Also, you can print text with different sizes and fonts, just like gui.drawText
DrawText(int x, int y, string message, Color? color = null, int? fontsize = null, string fontfamily = null, string fontstyle = null)
Try different font sizes to see which draws your info better without taking too much space. And try fonts that come with Windows, but not all of the works so you have to test (is nothing is printed, then the font doesn't work here). Finally,
Language: lua

left_gap = 144 right_gap = 100 top_gap = 20 bottom_gap = 50 client.SetGameExtraPadding(left_gap, top_gap, right_gap, bottom_gap)
creates these gaps used in the Super Mario World script. You can fit a lot of info there, specially for seeing sprites before they enter the screen or a map of the level, for example.
Adventures in Lua When did I get a vest?
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
PikachuMan wrote:
My computer has a USB 3.0 port, but it doesn't work. Maybe it's because of a wiring fault.
Mine has a similar problem; if you're using a desktop computer then I'd suggest opening it up and seeing if your 3.0 ports are on a PCI or PCI Express slot. If you are and they are, reseat them and (re)install drivers for it.
Adventures in Lua When did I get a vest?
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
So I grabbed the AWDS Tasbot for reasons and found that the first line of the script is
require 'resources'
what 'resources' are required? I didn't see anything additional in the thread or in Alk's userfiles...
Adventures in Lua When did I get a vest?
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
What game are you TASing that can't get published under the current content guidelines? If you're not personally affected by the content guidelines, why is this such an issue for you? As has been stated before, this is an American-hosted site, so we follow American-based conventions (since we fall subject to American-based laws, and there's very little that can be done about that)
Adventures in Lua When did I get a vest?
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
For the purposes of TASVideos in particular, userfiles is the suggested method, as then the uploads are both on the site directly AND are connected to your name (so that if I were to take your BK2 and make changes to it without completely rerouting it, it's easy to know who needs to be credited).
Adventures in Lua When did I get a vest?
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
StarvinStruthers: You don't need to submit a run to the workbench to share the BK2. Posting it to userfiles is more than sufficient, and doesn't carry the stigma of submitting a sub-par run to the judging queue. Since, y'know, it doesn't get judged.
Adventures in Lua When did I get a vest?
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
My two cents on the issue is to have a simple age check for encode links for games rated M - this is what Valve does, and is in practice the same as what outlets such as GameStop or Funcoland or $videoGameRetailer_Local do by asking to see ID before selling M-rated games. It doesn't need to be overly complex, just a simple "enter age to proceed" dropdown. I Specify "encode links" since someone who wants to watch the movie file itself already has the game.
Adventures in Lua When did I get a vest?
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
There was at one point a puzzle game for MS-DOS that was similar to Brix and Puzznic, but you couldn't directly move the blocks - you had to manipulate stage objects in order to unite the blocks properly. I want to say it was ported from an Amiga game given what I remember of the game's flavor.
Adventures in Lua When did I get a vest?
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
Language: lua

address = 0x09c75c memory_bank_offset = 0x80000000 character_offset = 0x84 files = { [0]=io.open("cloud.txt", "w+"), io.open("barret.txt", "w+"), io.open("tifa.txt", "w+"), io.open("aeri.txt", "w+"), io.open("nanaki.txt", "w+"), io.open("yuffie.txt", "w+"), io.open("reeve.txt", "w+"), io.open("vincent.txt", "w+"), io.open("cid.txt", "w+") } function setAeri() value = mainmemory.read_u8(address) if (value >= 0x100) then value = value % 256 elseif (value >=0) then timer = bit.band(value,1) if timer == 0 then mainmemory.write_u8(0x09C8D8, 0x54) mainmemory.write_u8(0x09C8D9, 0x48) console.log("Aerith") elseif timer == 1 then mainmemory.write_u8(0x09C8D8, 0x53) mainmemory.write_u8(0x09C8D9, 0xFF) console.log("Aeris") else console.log("Value is neither odd nor even") end else console.log("I was passed a negative value") end writeKillCountToFile(0) end function writeKillCountToFile(index) f = files[index] location = address + (character_offset * index) result = mainmemory.read_u8(location) f:seek("set") f:write(result) f:flush() end event.onmemorywrite(function() setAeri() end, memory_bank_offset + address, "setAeri") for i=1,8 do event.onmemorywrite(function() writeKillCountToFile(i) end, memory_bank_offset + address + (character_offset * i), "charIndex"..i) end
This appears to work as I need it to. There may be issues with the file not getting clobbered correctly when a kill count exceeds 255 (since I'm only doing a read_u8 and I'm not actually clobbering the file after initialization), but that's a simple fix. Please note that there is a flaw with this script - as it stands, it is a full battle behind. I'll do some science this coming week to see if I can fix that.
Adventures in Lua When did I get a vest?
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
The first few missions are based around waiting out timers - for example, in the second mission so many rounds after you build a slab of training room, the Dwarves on the right side of the map spawn. After mission 4 (I think) the only time you really need to wait for before the assault is the Bridge research. Though in fairness, I haven't personally completed the second leg of the campaign (the ice stages) so I don't know for certain. I keep getting stuck in the "here's your dungeon, survive for twenty waves" one where you get a tiny pre-built dungeon and practically no room to expand.
Adventures in Lua When did I get a vest?
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
FerretWarlord: None of them, if I'm reading the notes right. This was an A/V Hijack rather than running SMB on Pokemon Yellow. See the "Goal Choice" and "The Payload: How Gameboy Graphics Work" sections again.
Adventures in Lua When did I get a vest?
Pokota
He/Him
Experienced Forum User
Joined: 2/5/2014
Posts: 779
Quick question, what framework differences are there between OSX and linux builds?
Adventures in Lua When did I get a vest?
1 2
7 8 9 31 32