Posts for Amaraticando


1 2
10 11 12
26 27
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
I am starting an Oddworld Exoddus - Lua script. It turns out I know almost nothing about the RAM in this game. Besides the (x, y) position of Abe, is anything documented?
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Isn't it possible to cheat in this problem? Or maybe it's not clear to me the whole situation... I mean: carry 1000 bananas and walk 0.999 miles. Since the camel will eat a banana after an entire mile (carrying at least one banana), it won't eat this time. Go back and take another 1000 bananas. Repeat the process another time. So, you just took 3000 bananas 0.999 miles away and none was eaten. Repeat this whole process until 1000 miles is traveled. If it's not considered valid, we have to know if we can travel only an integer number of miles or if the camel memorizes and accumulates the miles. Or maybe, he eats at the beginning of each mile.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
RainbowSprinklez wrote:
I essentially want to do something specific WHEN a save state is loaded. How can I make an if statement out of this? Or do I need to instead call a function?
e.g.:
Language: lua

local function LoadStateCallback(...) print("State loaded", ...) -- the vararg is just because I don't know if there're arguments here -- there WAS a bug: paint callback was called before loadstate callback local someAddress = mainmemory.read_u8(0x00f0) if someAddress == 0 then print"address is zero" end end event.onloadstate(LoadStateCallback, "optional name or id")
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
BizHawk: event.onloadstate string event.onloadstate(func luaf, [string name = null]) Fires after a state is loaded. Receives a lua function name, and registers it to the event immediately following a successful savestate event Lsnes: on_post_load Called if loading savestate or movie succeeded. Parameter: String name Parameter: boolean is_state. The name of savestate/movie is name. is_state is true if savestate, false for movies. Snes9x 1.51: function savestate.registerload(function func) Registers a function to be called when a state is loaded. Function can be nil. The previous function is returned, possibly nil. The function is passed parameters, if any, returned from a function registered from registersave.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
To be sure, I've only investigated DKC2 and seen the script of DKC3. I have to verify the 1st game.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
While I'm not familiar with the hack, its popularity, difficulty level and design seem good to me. The rule is: Non-official games (hacks, homebrews, etc...) Non-official games are allowed for submission. However, they go through more scrutiny than other games. This is because the game itself also becomes a subject to judgment, so it must be a high quality and notable hack or homebrew with a strong following. The TAS should be high quality on its own merit, and must also show something interesting compared to other game(s) made on the same game engine, if applicable. Reviews and some screenshots: http://www.smwcentral.net/?p=section&a=details&id=13512
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
HHS wrote:
Amaraticando wrote:
What is the smallest natural number n such that n has some power whose the last trillion decimal digits are all ones? i.e., nk ends in 111....111 (a trillion 1's) ( ͡° ͜ʖ ͡°)
I suspect that the answer is some ridiculously huge number with more than 300 billion digits in it? I have no idea how to even begin to compute this.
This was answered by FractalFusion, the value is surprisingly 71. A small variation of this problem (2015 digits) was in a mathematical olympiad here. In fact, powers of 71 will end with arbitrarily many 1's in the decimal system.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Hitboxes can be inferred from the game code in the ROM. Sometimes, the x offset, y offset, width and height are written in the RAM (e.g. SNES' The Flintstones), but not always. Sometimes, there's a pose address that can affect the dimensions (SNES' The Mask, DKC). Really depends on the game. What's it?
"Also, are hit boxes unique to a particular enemy? For example, is EVERY koopa a separate address?"
Usually, if the sprite type is the same, the rules are equal.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Munhuggas wrote:
Thanks for the help! So I take it lsnes is not quite made for casual gaming, i.e. has no support for setting a path where saverams should always be stored and loaded so I don't have to go through these steps the next occasion?
lsnes doesn't have a GUI for that. It can be scripted to do something like this. If you just wanna play, without TASing or investigating the game, you can use Higan, because each game has its own gamepak philosophy.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Creating a movie that starts with a given SRAM: 1) On the window menus, go to File > New > Movie 2) In the SRAM srm field, select the srm file. e.g. Donkey Kong Country 2 - Diddy's Kong Quest (U) (V1.1) [!].srm Saving your own SRAM: 1) After you save the progress in-game, save a state (e.g. File > Save > State) 2) Open this saved file with 7-Zip or any zip program (after all, lsnes movies and states are zip) and extract the member sram.srm. PS: the member moviesram.srm is the initial state, not what you want.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Niamek wrote:
I am not sure to understand these lines from the code. Could you explain these lines?
Language: lua

if not past_values[address] then print("Address", address) error"is invalid" end
Language: lua

address_name = address_name or string.format("%4x", address)
1) If there's no entry <address> in past_values (or if it's false), then raise an error. It's just a sanity check, in case you didn't write this table correctly. 2) var1 = var2 or var3 is a typical Lua idiom. It's the same of:
Language: lua

if address_name == nil or address_name == false then address_name = string.format("%4x", address) -- i.e., address_name is the hexadecimal representation of address else address_name = address_name -- effectively does nothing end
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
You can do something like this (I've tested):
Language: lua

-- add other entries if you want -- you might want to index by name and use a table of tables: address_name = {address = 0x43c, value = 0} local past_values = { [0x043c] = 0, [0x043e] = 0, } -- IMO, the position of the text as the first arguments is more consistent local function speedtext(whereX, whereY, address, address_name) if not past_values[address] then print("Address", address) error"is invalid" end local current_value = mainmemory.read_u16_le(address) local speed = current_value - past_values[address] past_values[address] = current_value address_name = address_name or string.format("%4x", address) gui.pixelText(whereX, whereY, address_name .. ": " .. speed) end while true do local whereX, whereY = 138, 128 speedtext(whereX, whereY, 0x043c, "1spX") speedtext(whereX, whereY + 8, 0x043e, "1spY") emu.frameadvance() end
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
I translated pirohikos's script http://tasvideos.org/userfiles/info/32864750885547067 Much more should be done.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
I like how it butchers the intended route and how some shortcut are used. Keep on!
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Jba03 wrote:
Ive tried wine, it runs completely fine, but the inputs are crap. When i press up on my controller, it turns out as left right up and a in lsnes... And i have configured the controller right so there is nothing with that.. It doesnt interact the same way as it does with windows
Strange, I've played lsnes with Wine (but on Linux) and such problem didn't happen. Only some minor graphical issues in the widgets, worse performance for Lua and a crash with I try to use the turbo without a ROM loaded.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
The multitap support is only for a few cores (actually, I don't know which ones or if they exist). What's the console of the game?
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Yes vote, of course! And props to Nahoc for the comparison video, it's really useful to see the improvements.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
OmnipotentEntity wrote:
YaLTeR wrote:
What if before it completes the game it finds an ACE and gets stuck in an infinite loop?
While possible, and I'll be the first to admit that I'm not 100% on the ACE vectors in SMW, I don't see any way to trigger ACE from that room given only a cape and cloud.
Neither do I. In SMW, the only known ways to get ACE is with Yoshi. This post has a list of things that crash/softlock/hardlock the game: http://www.smwcentral.net/?p=viewthread&t=72499 (ctrl + F 'Locks and Crashes') But as the situation is a bit different from the normal Bowser fight (with external emulator savestates, not an in-game implementation), maybe something can ruin the loop, I don't know.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Nice, FractalFusion! I saw a solution before, but didn't fully understand it. Here, the major difficulty would be the base step, especially 71250.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
K has to be natural, otherwise all the fun is gone.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
What is the smallest natural number n such that n has some power whose the last trillion decimal digits are all ones? i.e., nk ends in 111....111 (a trillion 1's) ( ͡° ͜ʖ ͡°)
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
I've learnt that Lua is faster than Python. Since we already experience some noticeable slowdown (if the script is complex and the emulator core is slow), would Python scripting be reasonable while TASing?
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
I had fun with this problem: Andrew and Bob play the following game: given a finite set of positive integers A (fixed, which both know), Andrew chooses a number a that belongs to A, but tells nobody the value. Then, Bob can choose a positive integer b (member or not of A). Andrew must tell the number of positive divisors of the multiplication ab. Prove that Bob can choose b in such a way that he can figure out the number a, chosen by Andrew.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Make text local in both scripts.
1 2
10 11 12
26 27