Posts for Amaraticando


1 2
18 19 20
26 27
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Using a Lua IDE is pretty much useless for debugging, since you can't use the emulator functions in the process... Or can we? I use Notepad++ plus the following Lua function parser:
Language: xml

<association langID="23" id="lua_function"/>
[...]
Language: xml

<parser id="lua_function" displayName="Lua" commentExpr="((--\[=*\[.*?)\]=*\]|(--.*?$))"> <function mainExpr="function\(\s*(([_A-Za-z][\w_]*|\.\.\.)\s*,?\s*)*\)|function\s+([_A-Za-z][\w_]*\.\s*)*([_A-Za-z][\w_]*[\.:]\s*)?[_A-Za-z][\w_]*\s*\(" displayMode="$className->$functionName"> <functionName> <nameExpr expr="function\(\s*(([_A-Za-z][\w_]*|\.\.\.)\s*,?\s*)*\)|\s([_A-Za-z][\w_]*\.\s*)*([_A-Za-z][\w_]*[\.:]\s*)?[_A-Za-z][\w_]*\s*\("/> <nameExpr expr="function\(\s*(([_A-Za-z][\w_]*|\.\.\.)\s*,?\s*)*\)|[_A-Za-z][\w_]*\s*\("/> <nameExpr expr="function\(\s*(([_A-Za-z][\w_]*|\.\.\.)\s*,?\s*)*\)|[_A-Za-z][\w_]*"/> </functionName> <className> <nameExpr expr="function\(\s*(([_A-Za-z][\w_]*|\.\.\.)\s*,?\s*)*\)|\s([_A-Za-z][\w_]*\.\s*)*([_A-Za-z][\w_]*[\.:]\s*)?[_A-Za-z][\w_]*\s*\("/> <nameExpr expr="function\(\s*(([_A-Za-z][\w_]*|\.\.\.)\s*,?\s*)*\)|\s([_A-Za-z][\w_]*\.\s*)*([_A-Za-z][\w_]*[\.:]\s*)?"/> <nameExpr expr="function\(\s*(([_A-Za-z][\w_]*|\.\.\.)\s*,?\s*)*\)|([_A-Za-z][\w_]*\.\s*)*([_A-Za-z][\w_]*[\.:]\s*)?"/> <nameExpr expr="function\(\s*(([_A-Za-z][\w_]*|\.\.\.)\s*,?\s*)*\)|([_A-Za-z][\w_]*\.\s*)*[_A-Za-z][\w_]*\s*[\.:]"/> <nameExpr expr="function|([_A-Za-z][\w_]*\.\s*)*[_A-Za-z][\w_]*\s*"/> </className> </function> </parser>
If someone happens to know a better parser, please share :p
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
I'm getting a little pissed off by this. Everyday my account is logged out. It used to happen only after some months... :(
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
This was a bit hard to find, because I was searching only in the usual domains! At first, I thought this was stored at the SA-1 chip, but I couldn't find any address in it too. This actually is in the domain/area CARTRAM (also known as SRAM in lsnes). 0xf30: internal timer that decrements itself each frame 0xf31: Hundreds 0xf32: Tens. 0xf33: Ones. This is the same relative address of most hacks in the WRAM. So, a cheat could be: Address: 000F30 Value: 151587081 Domains: CARTRAM Size: 4 bytes Display as: unsigned
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
jlun2 wrote:
Amaraticando wrote:
Well, those are questions that only SethBling can answer for now, because no one here has read the whole script carefully (I guess). The Yoshi thing in an imperfection. And some levels require waiting for a platform or a layer, so the bot won't be able to complete them.
Makes me curious how many stages can it complete, and can any boss stages be done. lol Same with that stage with the dinos that you're supposed to beat under a certain time to get a secret exit or something.
Any level that requires going to the left is impossible. If the route is complicated, needs some item or strategy, the odds of the bot suceeding are neglitible, even after billions of years playing.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
MarI/O bot partially adapted for the Snes9x rerecording emulator. Test it yourself! http://pastebin.com/YbL3zGd1 Start it slightly before Mario can move in a level.
1) TimeoutConstant=20 (line 41) Is that 20 millisec? It seems the game waits longer than that when Mario is against a wall or just stopped. More like3 sec. Obviously I am missing something.
Seems more like a number of frames, the decrements itself when Mario is not advancing.
I do not understand the syntax of using the number sign in a for loop. Why not use getn function? This discussion about the '#' suggests there is more depth to the choice of using this syntax: https://stackoverflow.com/questions/2705793/how-to-get-number-of-entries-in-a-lua-table
If this table is an array, the # is enough to get the size. In other cases, one would need to iterate over the whole table.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Well, those are questions that only SethBling can answer for now, because no one here has read the whole script carefully (I guess). The Yoshi thing in an imperfection. And some levels require waiting for a platform or a layer, so the bot won't be able to complete them.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
skypickle wrote:
OK, I can start the MarIO script and get a dialog window named Fitness. When I hit the restart btn, I get an 'unhandled exception' A .Net exception occured in user code' LuaInterface.LuaScriptException: [string "main"]:829: A .NET exception occured in user-code
The same as before: there's no 'DP1.state' file in the same folder of the script. By the way, while testing, I saw that if you get an error and then fix the conditions that cause this error, then restarting the emulator isn't enough. So, I had to restart BizHawk. EDIT: even so, clicking on "restart" is causing problems, but the bot is working.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
I wrote a small tutorial for those having problem with MarI/O bot. http://pastebin.com/NbeiibxT
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
This is Pasky13's script Super Mario World.lua, that comes with BizHawk. It only shows the hitbox of Mario vs Sprites and Mario vs some extended sprites. That is, ideally, if some rectangle goes onto another rectangle, then there's contact. For a more suitable script for TASing in BizHawk, try my script (though it is pretty good for lsnes and Snes9x, I haven't updated BizHawk's script, because people didn't seem to use it).
Post subject: Re: MarI/O thread
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Arie2002 wrote:
New question: I get an error when I try to load a backup.
LuaInterface.LuaScriptException: C:\Users\User\Desktop\neatEvolve\neatevolve.lua:1054: attempt to index local 'file' (a nil value)
(I think this is the best topic to ask this question?)
This happens because the file from line 1099 doesn't exist/can't be opened.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
This script is not working for me, not even after renaming "Super Mario World (USA)" to the name of my ROM (inside the script). Worked for somebody here?
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Have you installed the prereq installer?
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Alex76FR wrote:
OK... So how to calculate the time of the TAS?
The emulator usually displays it somewhere and you don't need to make any calculation. The movie format can register the time too. But if you need it anyway, here is how you do: seconds = frames/framerate Be careful. If you use the European version of a game, the framerate can be lower. Example: frames = 25400 system = SNES NTSC Therefore: seconds = 25400/60.0988138974405 = 422.637 secs = 7 mins and 2.637 secs
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
I can't think of a hack right now.. But that's the spirit: new bugs being used in new games. :)
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
I don't think it's useful in the original game, but pit hacks can abuse this fact. But maybe, there's some application, in a case where Yoshi shall not be hurt.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Pokota wrote:
Amaraticando, what are you working on and does it still go slowly at a simple 1x or 2x size?
I'm working on a Super Mario World script. In fact, if the size is 1,the slowdown is small. However, there's no way to show all the info in such a small resolution. In higher sizes,the slowdown is very noticeable. Therefore, I'll have to accept that and include less functionality than the lsnes script... :(
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Damn, this gui.DrawNew("native") makes the gui.drawText look decent and work in the lateral black space. However, it makes the emulator quite slow. To me, it goes from 50-ish fps to 35...
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Yet another trick. Link to video
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
WTF means Yes vote here.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
An easy way to verify this is by doing the finite sum first: S(n) = 1 + 2x + 3x^2 + ... + nx^(n-1) xS(n) = x + 2x^2 + 3x^3 + ... + nx^n S(n)-xS(n) = 1 + (2x-x) + (3x^2 - 2x^2) + ... + (nx^(n-1) - (n-1)x^(n-1)) - nx^n (1-x)S(n) = 1 + x + x^2 + ... + x^(n-1) - nx^n But 1 + x + x^2 + ... + x^(n-1) is a geometric series, whose result is pretty known: (1-x)S(n) = [(1 + x^n)/(1-x)] - nx^n S(n) = [(1 + x^n)/(1-x)^2] - (nx^n)/(1-x) , valid for all naturals n and all reals x, except 1. The infinite sum is lim(n->inf) of S(n). Since lim x^n = 0, x < 1 and there's no indeterminate form, we can substitute: S(inf) = [(1 + 0)/(1-x)^2] - 0/(1-x) = 1/(1-x)^2 EDIT: You right, marzojr. "Canceling" in this case is so automatic that I forgot about the indeterminacy.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
I approve too. Though, translating a movie into another format is not just a matter of computing lag correctly...
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Userfiles error 1) uploading an anchored lsnes movie results in the following message: <<< Can't parse movie (error from format parser) >>> Errors from the movie parser: LSMV error: Movie is incorrectly savestate-anchored (zero length) LSMV error: Movie is incorrectly savestate-anchored (zero length) LSMV error: Movie is incorrectly savestate-anchored (zero length) 2) uploading a lsnes savestate results in the following message: <<< The filename: lacks an extension >>>
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
I didn't even know there was a Tony Hawk for GBA. Nonetheless, easy yes vote. Not for the vault, please.
Post subject: Our users have posted a total of 400000 articles
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
I'm just posting this record here! Long live TASVideos!
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
AFAIK, Ilari doesn't use this forum anymore. Try to contact him using IRC, that he is online regularly.
1 2
18 19 20
26 27