Posts for BadPotato

1 2
22 23
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
I don't known much about the "In Game Time" for this run. Tho, I see the framecount is currently 704236, which seem much lower than other submissions. How can you check the actual in-game time? Do you have a memory address about it? Does the game auto-save? In any case, as said in the previous message obviously the GBA controller with Dolphin is gonna get better in-time. So better not deal with additional complexity of these early emulation while waiting sound more reasonable. Getting to enjoy the summer too should be the way to go.
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
zggzdydp wrote:
Maybe I'll consider about that.
I would be looking forward to it. You'll need a setup for lua script, so it get much easier to manipulate luck, if you were doing it manually. Or if you already have lua scripts, it could be worth to share it, same goes for omni if he has any(sadly mine got lost in a hard drive failure). On another note at some point, getting a subtitle/audio commentary in order to explain the technical aspect, plot or explaining the original story about "Water Margin"as well would be awesome, since it's quite a long run to watch.
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
First off, thanks zggzdydp for doing this! I should mention back in October, zggzdydp and I did exchange a couple privates messages, since I used to TAS this game and maybe I could be helpful. Contacting Omnigamer or posting on the forum would have been helpful, yet I was quite busy IRL at the time(I had an important injury and even now I may have an another operation later). Also, I'm not fully up-to-date with all the time-saver on this game. Some other consideration to think about: wouldn't it be more entertaining by not going thru with the early Matilda glitch as opposed to other ideas which might be more enjoyable to watch? This is certainly questionable as the former seem to loose of time in exchange for security in battle(being over-level). Omnigamer technical mention are on-point. There's definitely several good chunk of optimization for this run, as some mistakes could be prevented with better planning, research or redoing parts to skip an event, etc. Stilll, diving in a long RPG isn't easy task. It take a lot of determination. Now, IMHO sometime I would rather see a RPG TAS made with a naive/simple/decent route first while being clean enough on the "overall execution", then see how it can be massively improved afterward.
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
Well, I'm a bit surprised by this, how did the code was leaked online? I guess MS can't simply open-source their early version of their system(such as Windows NT 3.5) over security concern with some of their oldest contractor... so there could be shenanigan some going on? How can we be 100% sure the piece of source code is from the actual implementation and not some fake source code generated by a bot? Well at least, while it's a bit early to claim a bot being able to produce this kind of code, but it may hold up in a few years... Does the source code produce a way to build the actual binary to compare against a rom? If there's no real evidence yet about the correlation between the binary and source code, well a bout it? Did Microsoft claimed themselves they own this piece of source code, on what base? Further more, projects like Wine/ReactOS may get so close in term of precision of actual development over the years, at least some part of their project would be 100% identical, at this point would they get sued?
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
Looks good, but I guess adding a description such as "Uses a level password" could be a better fit... yet it's interesting how this "sequence skip" was only recently found.
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
Yes, this a very interesting video to show off what's possible. Yet, deep learning require quite a bit of setup and processing power. Since "one episode=one entire game", it would be wise to choose a simple game with precise objectives from state A to state B, or maybe a game which aim for the highest score and define when to end the game. An another issue: the current emulator used for TASing may not be optimized to generate sequences about "high volume of quick games" or use parallelism to exploit the GPU. Maybe one of the easiest way to get started is to start simple. Check project like atari_py and see if the atari binding are good enough to setup a test environment inside a Jupyter Notebook.
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
I just stumbled on this video. Does any of our published run has this "special/best ending" with the Running Man using the bunny hat? This info made me realized there's run like this one or this one claiming 100% completion while not getting this "special/best ending".
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
You mean using the bwapi to TAS all the campaign? I guess that's possible, but I'm not sure if we could get this to sync on more than one computer. If I recall correctly, the bwapi use dll injection. So in order to sync the game, the bot need to setup a consistent RNG, consistent lag, consistent loading time, etc. Yet, I'm unsure how big of a problem this is. Given such environment, it's sound far easier to simply TAS SC64 first, since better tools for emulator are available such as savestate, etc. But on the other hand, someone could do a proof of concept by playing through some of the first mission and see how well his bot sync.
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
Beefster wrote:
There's going to have to be two-way communication somehow, as some work will have to be done by Lua (disassembly and event hooks) Does Lua's popen allow r/w pipes, because that would be, by far, the simplest way to handle 2-way talking. I know you can do read-only and write-only pipes, but it isn't very clear in the documentation. (Also, does BizHawk even support popen?)
I believe the pipe api doesn't really work well on the Windows platform. But there are workarounds that may suit your need. First, I guess pipes could work with a custom version of lua on a console application, but that won't do it with Bizhawk. At this point, you may as well ask for the BizHawk dev to directly add some way to IPC with Bizhawk... I guess such feature would be awesome. Meanwhile, you can lookup the named pipe from the lua winapi library. I'm not sure how well it runs if you intent to make a lot call between the emulator and your python program. But this might just be the easiest solution. Another idea is to checkout for a message queue library. The zeromq lua client library with a zeromq python server might work out. If you want to practice a bit, before attempting this, I'll suggest trying out some tutorials with rabbitmq for a single client/server with python, since the tutorial is a bit more user-friendly than zeromq. Yet, another alternative idea is to use the luasocket library, but it can a challenge in itself. One last idea if you are not a fan of async with lua, involves using the file system directly to send your data and simply poll for a last change on your files to get notified, yet this is definitely not an efficient solution.
Beefster wrote:
Probably Numpy since I'm mostly just doing analysis right now (the class is more focused on big data analysis than actual ML).
Ok, then maybe you should simply look for a basic algorithm such as: KNN, Bayes, Decision Tree, Random Forest or SVM. You should be able to find a couple basic examples on the web about how to write those with only a couple of lines of code from scratch.
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
First, what kind of output do you want to get? Should this problem be solved with classification or regression? Classification would imply to define some categories such as: this byte(the value of an address) is being labeled as "some-behavior/relationship". A regression would be more specific about his confidence level. For instance, on a scale from -1 to 1 how likely does a byte is correlated to X? Where X is a RNG or the actually seed or any specific thing(a "counter", a "constant", a variable from the "physics-engine", etc). Since there's a decent database of labelled memory for the NES collection, in order to do actual training, you will probably have to record some gameplay session, then dump the ram data while filtering useless data(such as constant). Here's some suggestions how you could approach the problem. Getting the data is a problem. How much time can you afford just to collect data? If you can get data on different games, then you might get the best results while avoiding overfitting. Building and formating your validation/test sets correctly can be quite slow. I'll suggest recording session of 1 to 5 minutes for at least 20-30 games or more with some RNG action during the gameplay. There should be enough candidate for this(Tetris, Final Fantasy 1, etc...). This way you can at least define 10 games+ as your train/validation set and 10 other for your test sets. Once you get the data, as you said filtering is important to avoid large complexity. You can probably filter out things such as constants. Filtering periodic data is possible as well, if you can detect a cycle repeating over and over, but be extra careful how you handle those. On another note, as feos point out, the ram data alone might not be enough to find the RNG. With disassembly/debugger info, you can get quite a lot of valuable data and basically solve RNG problem in a manual fashion(using breakpoints). Or by extracting particular metrics from the tracelog such as the number of "writes for a single frame" a byte can get(on an average number of frames) and filter out the lowest number of other bytes, but this might be too specific for a game... Thing is, if you use such data, then maybe you are out of scope of your initial proposal which is something along the line of labelling memory addresses by finding abstract patterns over fuzzy data(the ram) that human have no clue about. Another almost completely different idea(maybe easier to do): Right now, with our current tools we don't even know right away if a set of consecutive byte is actually a long, int, short, word, byte, etc(well, despite you check directly how the disassembler write his info), does a byte is signed or unsigned? Maybe it would be easier to simply tag what kind of data bytes any given byte is. Also, to do this you may not need a large dataset as input(number of columns), you simply need some of the adjacent bytes. Then, for F numbers of frames(of actual gameplay) you can try to predict the datatype for a byte. That being said, what kind of ML frameworks did you intend to use?
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
This project use a DNN to upscale 16x16 images by a 4x factor. So the output is 64x64: https://github.com/david-gpu/srez Similar experiments could be made with low resolution games. That being said, I'm not sure what could be used to train a model for these games. Maybe feeding random NES games picture as input and expecting for random SNES quality picture as output could lead to something interesting.
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
Yes, Mesen NetPlay feature doesn't require a third party server, so it's good a baseline. First, I guess a client-spectator feature could be done in Lua as well. Once the client is connected, the server shall send a savestate to his client, then the server should send his input for a specific amount of time to the client.
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
Well, looking at the Kaillera case, I believe the first action you get while using the client is to contact a "main server" which return the list of other servers. I guess this main server can also help to do a handshake with other servers/clients to ease support for dynamic ip. Now, a new interesting project could be to implement a custom lobby for a chat client. Ultimately, it could be possible to join a chat room from the Kaillera server with a bit of reverse engineering, but since the project is so old, I don't think it's worth it. Maybe there are other netplay projects such as MAMEHub which could be used as a baseline for this kind of project.
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
Try the following steps: -Download the latest release of BizHawk, unzip the archive somewhere -Delete the "Lua" folder bundled with BizHawk, so we can avoid confusion about the location of the socket folder -Create a "socket" folder next to EmuHawk.exe with the following files inside. You can also get these files from this archive. -Add lua5.1.dll next to EmuHawk.exe. You can also get this file from "Lua 5.1 for Windows"(you can get an installer here). -Create a lua script "test_lua_socket.lua" and put it next to EmuHawk.exe with the following code:
Language: lua

package.cpath = ";./?.dll;" package.path = ";./socket/?.lua;" socket = require('socket') print(_G.socket) print("luasocket is loaded!")
-Start EmuHawk.exe -Drag "test_lua_socket.lua" inside the BizHawk instance. At this point, it should work.
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
Sorry for the late reply. Dynamic ip aren't required to communicate across the world if you can setup a VPN. If you need a free VPN you can probably get a free one such as Hamachi or anything else.
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
Doing a quick search, I doubt there's anything done about luasockets at the moment that couldn't be done directly in lua. As zeromus said on stackoverflow+feos, you can checkup this project(thread). This project should support local connection and exchange of messages. If you need help with something in particular, we can probably help, but please give us more details about what you are trying to do.
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
If you don't like moving your mouse around or you prefer to keep to your hand on the keyboard, then I guess I have no choice but to suggest Vimperator for Firefox(or one of his lightweight/optimized fork). Quick tips: -Press "t"+url to open a tab -Press "f" then a chain of keyword+number and you can go to pretty much anywhere on the page with much less effort than the regular way. Of course, you I believe can customize every hotkey as well. -Press shift+escape if you need to temporarily disable vimperator to move around -Press f1 to read more vimperator docs(learn how to customize your hotkey, etc)
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
One advantage of python 2/3 over lua is the amount of library available. So, I strongly encourage your current experimentation with a scriptable python interface. Thought, if LuaJIT could get implemented, so FFI call can be used as well, this could definitely offer a new kind of usage for people who dislike dealing with lua directly.
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
Look like it's a bit tedious to deal with these kind of animation according to the right "layer". Thought, maybe there could be an use for machine learning, if you can train a robust model. So you don't have to manually fixes all games with custom settings.
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
Still unsure what you are asking about, but this guy started to code a N64 emulator in Rust: https://www.youtube.com/watch?v=Fsi9HPcyrU8 You can find related N64 literature on his github repo.
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
Did you tried making your own cardboard? edit: Or buying one?
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
Honestly, I'll rather see a TAS with arbitrary rules than waiting for an optimal run that may "never happen"(despite a huge personal/community effort). Why? Well, the process of getting everything optimized is always bound to create a need to redo previous part of the game as new technique could be uncovered only at later part of the game... So keep up the good works and have fun! Even if you attempt to run a RNG script to escape all battle, this will probably be tedious and may even kill your motivation if you have to redo important parts of the game for unpredictable reason. As for the publication value of the run, wait why does anyone care about the publication? Anyway, I guess there's always the vault... (tip: describe the arbitrary objectives more as "possible improvements" in the improvement section in your submission text) Thought, even if this gets completely rejected, I believe your run shall definitely help to build a second run with sane base. That being said, why do you want to do a "no slots" run?
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
feos wrote:
We need people to actually test it over web! (I have a dynamic IP via router so I can't.)
Yes, it should work over the web if both clients have static IP. Maybe a free alternative that can replaces DynDNS such as noip could work. I guess it would be worth a try.
feos wrote:
Also, mention Bizhawk in to the thread title?
Right now, the UI is handled with the BizHawk forms, since I preferred to use as few libraries as possible for the project needs. Thought, the script could be adjusted to support the UI with the IUP library alone.
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
WST wrote:
I have no idea what I could do, and I am very sorry to not had told her that I enjoyed her Pucca’s Kisses TAS
Yes, also last time I checked the topic I believe Rachel had a special interest about a Harvest Moon TAS. So, not sure how relevant it is here, but few years ago I started a "one-day" TAS about "HM:Back to the Nature"(on PSX). I was interested to see how much money you could exploit with the "in-door time" feature and get as much money as possible with "a single in-game day"(basically using in-door mining) rather than a typical complete 3 years run. I believe that kind of "challenge" would be more interesting and shorter than what the game expects you to do. Sadly, recently I lost the movie due to hard disk failure, so the idea may not happen. Yet I guess someone else could come up with specific challenges about those kinds of games. Another idea I can throw here: Get someone to play or TAS a game that Rachel liked on livestream(or anyone missing here, on TASVideos) to raise funds for charity/special cause...
Post subject: Networking with lua: chat client
Experienced Forum User
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
I believe there aren't many projects which uses lua with sockets. So far, there's this project by XKeeper that implements a netplay feature for Tetris, but looking at what the source may look like, things seem to get messy quick. There's also my attempt at using remote calls over sockets, but this I guess it may not be easy to use in practice. That being said, there are certainly other projects with networking features in "real time" in lua related to emulators, but I didn't find source code about it. Anyway, while it's definitely not easy to debug what's going on a network, I believe there are a couple of ways to reduce the overhead, such as:
  • Avoid blocking calls which depends on emu.frameadvance
  • Make a minimal script version that can run directly into the native lua console, for debug/testing purpose
  • If you use a particular resource, make sure you control access in a mutual exclusive way
  • Make modular code, favor good idiom, use message queue, etc
So, where's to begin? Well, I just made a simple chat client. So maybe this can be used as a start point for something more complex. The chat client is made in MoonScript. Basically, this can be "recompiled" to Lua 5.1 and run in BizHawk without issue. MoonScript works the same way as C++ can wrap C... or just as "CoffeeScript/TypeScript/ES6/..." can wrap JS. I figured this worked well and syntax reminds of python. Also, it's kinda easier to write modules and you can use fancy features such as "continue"(for the "for" loop), "switch" feature, etc. Also, there's a plugin available with Atom to provide a nice lint. Here's the code. Couple of technical note:
  • The Luasocket library is used for udp sockets with another client. At some point, the script could be extended to connect with other multiple clients in a P2P fashion. Other improvements that I'm still thinking is adding a TCP mode, since it can often be easier to connect with anyone on the web using TCP without packet loss, etc. Furthermore, sometimes it can also be a bit easier to tunnel an app with TCP across the web.
  • The iup library is used as a "timer", which is basically the only way to interrupt the code flow of the application, since lua is single threaded. As long, as there's no native timer functionality in the lua API, a library such as iup is being required. Without the timer, the application will have to depend on emu.frameadvance and can cause much annoyance while receiving packets,etc.
  • Currently the UI makes use of the forms library in BizHawk, so you can configure your address/ports to connect to. This means, you'll probably need to change what's going in the formConnect module, to get this working with other emulator.
  • As alternative functionality, you can also use the lua interpreter in the LuaConsole window(example: say "ohoh!")
  • For testing purpose, you can run client_udp.lua from the command line as well if you don't want to start another instance of BizHawk.
Other thoughts:
  • Despite using Lua/MoonScript to directly handle sockets in BizHawk, I guess one easier way to handle complex case would be to directly make a lua library dll in C and works from there.
  • If someone really doesn't want to have any relation to lua, etc. Well, I guess it's always possible to hack directly in the emulator and add a web/HTTP API inside BizHawk and have fun from there.
Couple of screenshots: Usage:
  • Drag the startServer.lua into BizHawk.
  • Type the udp port and ip and press connect
Troubleshoots:
  • If you have dll issues, you may have to put the dll the socket folder next to EmuHawk.exe
  • If you can't connect, make sure you can ping the remote machine and verify your firewall accept the port used.
Possible improvements:
  • Support more than 2 clients
  • Find and support a free service to tunnel message
  • Improve the serialization/deserialization
  • Support Joystick input
That's about it, let me know if you have any questions or interested in any project related.
1 2
22 23