1 2 3 4 5
8 9
Editor, Emulator Coder
Joined: 8/7/2008
Posts: 1156
Oops, I didnt mean replacement. I meant alternative.
Joined: 6/8/2015
Posts: 15
Has anyone thought about using this on Kaizo Mario or any of the other ROM hacks. That would surely be interesting to see how it handles Kaizo
Joined: 6/8/2015
Posts: 15
henke37 wrote:
I did some tweaks on the code: http://pastebin.com/juRnkyEf
  • No support for SMB, only SMW, so all the filename checks are gone.
  • Path for where the files should go.
  • Expose mario's speed and a few more state details as inputs
  • Expose the actual id of the tiles and objects
MOD EDIT: Pastebinned lengthy code segment. -Mothrayas
I tried running it and it gave me errors. I tried fixing it but my lua skills are very lacking.
Joined: 6/18/2015
Posts: 54
N3rdsWithGame wrote:
henke37 wrote:
I did some tweaks on the code: http://pastebin.com/juRnkyEf
  • No support for SMB, only SMW, so all the filename checks are gone.
  • Path for where the files should go.
  • Expose mario's speed and a few more state details as inputs
  • Expose the actual id of the tiles and objects
MOD EDIT: Pastebinned lengthy code segment. -Mothrayas
I tried running it and it gave me errors. I tried fixing it but my lua skills are very lacking.
His code isn't fixable. You're better off trying to read it and get his intentions than to fix it. While my code isn't much better, my pastebin from the last page is actually runnable, so use that as a basis. Also note that the additions to the inputs don't actually work, so you're better off just using the base script.
Joined: 6/18/2015
Posts: 54
Double posts probably aren't allowed, but I just wanted to share with you guys something I've done, i've figured out how we need to add a sprite to the Input array, but i'm afraid to inform you that it will come at a massive cost to performance without some changes. We need to modify the sigmoid function in order for the performance not to kill us, though i'm not sure how we should do it to get what we want. Basically from what I can tell is that the sigmoid function takes the activation of a neuron, * the 'weight' of that neuron and then averages that out to be between -1 or 1 no matter what. That, or I'll have to increase the size of the input array from 169 inputs to 14,656 inputs + 169 + any extra inputs we want to add. This would decrease performance by... a factor of 86 times. That's only getting the 6 by 6 tile range that mario can 'see' already. http://www.smwiki.net/wiki/Sprite
function getSprites()
	local sprites = {}
	for slot= 0, SMW.sprite_max - 1 do
		local status = memory.readbyte(0x14C8+slot)
			if status > 7 then -- 228 + 5320
				spritex = memory.readbyte(0xE4+slot) + memory.readbyte(0x14E0+slot)*256 --5344
				spritey = memory.readbyte(0xD8+slot) + memory.readbyte(0x14D4+slot)*256
				spriteNo = u8(WRAM.sprite_number + slot)
				sprites[#sprites+1] = {["number"]= spriteNo, ["x"]=spritex, ["y"]=spritey}
			end
	end            
	return sprites
end
This would allow him to interact better with the world, and to interact directly with these sprites. The sigmoid function is here:
function sigmoid(x)
	return 2/(1+math.exp(-4.9*x))-1
end
I'm not sure if what I want to do is possible though, because afaict a neuron is either firing or it isn't. EDIT: I'm wrong, in that the number of input neurons does not have to be that much higher. I can convert the hex values into a binary array where each digit represents a neuron. Then, I can be sure that the section of memory actually turns out to be only 8 extra inputs (0 - FF)
Joined: 6/18/2015
Posts: 54
All right! I've made some progress! Mario now can tell the difference between every single normal sprite! Along with that, he now knows the vague direction a sprite is. Despite this, however, we still have one major issue: Mario is getting stuck at walls and cannot seem to figure out he needs to jump around them. This script is 100% incompatible with your other pools. I recommend starting the script on a brand new pool. Also some changes: Timer changes every time mario changes a screen. Along with that, i've reduced default population size by 250 so there is more generational advancement. There is also a strange bug where mario advances in generations of 16. Not sure what's going on there. You'll see mario jump and do crazy smw-bizhawk(required by the script below) mari/o, has a few bugs, see edit for a fix edit: just discovered a bug, go to line 203 in the second pastebin and change: inputs[inputs] to inputs[#inputs] Also, change population to 150 or more, that seems to fix the creation of 16 unnecessary generarions each time we hit the end of the species.
tom_mai78101
He/Him
Player (127)
Joined: 3/16/2015
Posts: 160
Dwood15 wrote:
edit: just discovered a bug, go to line 203 in the second pastebin and change: inputs[inputs] to inputs[#inputs] Also, change population to 150 or more, that seems to fix the creation of 16 unnecessary generarions each time we hit the end of the species.
Wouldn't making a new Pastebin be more efficient than reporting what bugs need to be fixed for others? Just curious, since I'm so used to version controls and the mentality of "it is the responsibility of the author to provide up-to-date codes" somehow stuck with me.
Editor, Emulator Coder
Joined: 8/7/2008
Posts: 1156
why are you still using pastebin anyway, someone make a github already
tom_mai78101
He/Him
Player (127)
Joined: 3/16/2015
Posts: 160
zeromus wrote:
why are you still using pastebin anyway, someone make a github already
That person would have to be either Sethbling himself, or someone who is willing to maintain a couple of derivatives of MarI/O.
Amaraticando
It/Its
Editor, Player (159)
Joined: 1/10/2012
Posts: 673
Location: Brazil
tom_mai78101 wrote:
zeromus wrote:
why are you still using pastebin anyway, someone make a github already
That person would have to be either Sethbling himself, or someone who is willing to maintain a couple of derivatives of MarI/O.
Care to justify why?
tom_mai78101
He/Him
Player (127)
Joined: 3/16/2015
Posts: 160
Amaraticando wrote:
tom_mai78101 wrote:
zeromus wrote:
why are you still using pastebin anyway, someone make a github already
That person would have to be either Sethbling himself, or someone who is willing to maintain a couple of derivatives of MarI/O.
Care to justify why?
Okay, maybe Sethbling doesn't have to make a Github project, but I stand correct with someone maintaining many different editions of MarI/O.
Joined: 6/18/2015
Posts: 54
zeromus wrote:
why are you still using pastebin anyway, someone make a github already
I have pm'ed SethBling to ask permission to set up a public github with no response on Reddit. Until I get permission for doing so, if I do set one up (and I get that I should) it will be private and I'll continue with pastebin. If Seth ever makes a github, I will proudly fork it and add my changes to his. Secondly, I have tried using github, and I hate using it. Almost as much as I hate using lua.
Editor, Emulator Coder
Joined: 8/7/2008
Posts: 1156
the original pastebin was written with a 'please do not redistribute' license which even if its details were clear or made sense would explicitly not be binding. It has since then been distributed in dozens of pastebins and gists and copied onto this website. The ship has sailed. I am going to go out on a limb and hypothesize that sethbling hasn't responded to your request to do X with his code on reddit because he's buried under 100,000 requests to do X with his source code on reddit, a consequence of making the mistake of seeming a little cagey about what people did with his script and folks wanting to do him the courtesy of asking him about tiny unimportant things. Trust me, if you want to do him a courtesy, go immediately kick his script's ass with your own script and write 'based on sethbling's cool work' at the top of it
Joined: 6/18/2015
Posts: 54
zeromus wrote:
Trust me, if you want to do him a courtesy, go immediately kick his script's ass with your own script and write 'based on sethbling's cool work' at the top of it
Thanks for the motivation! Out of respect, until I get a reply it's pastebin for public use of my version of the script. Then again, if he doesn't reply for too long I won't bother. I'm working on kicking his script's ass for sure, haha. I've made some recent kick-ass changes too. Now, Mario has a vague sense of his surroundings. And one more thing I 'spose. So i've increased the number of inputs, now mario has 3500+ inputs. This, this is a problem, because I've hit Lua's memory limit. What does this mean? This mean that Bizhawk(?) is not supplying the amount of RAM that the script needs to run and produce a reliable output. It seems that the libsneshawk is at 114MB. The first generation runs fine, but then when it requests more memory it throws an error. If someone who knows how to fix this could help me out i'd appreciate it. Then again, my script might be having a memory leak... Actually, I may have caused it to leak. dammit. These kinds of things are really hard to track down. Maybe I should just build my own bizhawk and debug that if that's easier. iirc it runs out of memory on a new generation. Edit: yep bizhawk is climbing from 200 MB to 450+ loool.
Editor, Emulator Coder
Joined: 8/7/2008
Posts: 1156
We fixed memory leaks in lua at some point. Probably after 1.9.4
Joined: 6/18/2015
Posts: 54
zeromus wrote:
We fixed memory leaks in lua at some point. Probably after 1.9.4
1.9.4? I'm still on 1.1.0 and the download links are still from the 15th. Edit: oh, i see. (1.10.0 ~= 1.1.0) Yeah, it's definitely the script. After the first generation it seems to spam making generations for a period of time. that has to be fixed. EDIT x 3+: really, really, really, strange bug. The script is adding text into the script:
2
555
500
141
1
1
141
3559
connections
0.3135
step
0.210526
link
1.71
enable
0.315789
bias
0.4736835
node
0.6175
disable
0.4275
done
This is an example backup.state.pool file. All those words in it, you know? Those are supposed to be numbers. Somehow those variables are being set to those words. WTF? how is it that this is happening? I suspect that's the problem in the last code I've posted as well, but just in case it's not, here: http://pastebin.com/eCBRbcMT PLEASE HELP! I have only the slightest clue on how to debug, and I'm running low on time to get this in a working state! On that note, I think it may be best to change from x.xRates["SOMESTRING"] to x.xRates.SOMESTRING.... Edit: changing them to other names doesn't work. I cannot even find those names in the script as strings any more and it's still doing that. wtf? This occurs only after the first (0) generation, so set the population to something low like 10 and you'll see what i mean. then check for the backup state files. Ok, so it's not the text in the script. huh. Well i'm going to have to do a line-by-line comparison i guess....
Masterjun
He/Him
Site Developer, Skilled player (1988)
Joined: 10/12/2010
Posts: 1185
Location: Germany
Dwood15 wrote:
I've hit Lua's memory limit.
Try using Lua's garbage collection every once in a while when the code is running.
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Joined: 6/30/2015
Posts: 7
I've added a lot of features (I'm just doing SMB1), to improve fitness and expose new inputs. But with more inputs, learning gets slowed down. I tried running multiple bizhawk instances and having them communicate with a file-based ipc so that they could split up the genome pool, but the overhead isn't worth it at the moment, as I'm progressing faster with one instance at 600+fps than I do with 4+ instances at 100-150 fps. What I'd love is a way to run bizhawk completely headless, as graphical rendering is the biggest bottleneck, especially with multiple instances. Can one of the bizhawk devs point me in the right direction in the source to start at for removing this? I'd love to get a headless build sent to a couple of my servers and let them help distribute the load as well. I'd also like to increase the 6400x speedup cap when displaying, but I can probably figure that part out :)
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
In "menu | Config | Speed/Skip", disable all throttling options. After loading the game, go to "menu | SNES | Display" and disable everything.
Joined: 6/30/2015
Posts: 7
creaothceann wrote:
In "menu | Config | Speed/Skip", disable all throttling options. After loading the game, go to "menu | SNES | Display" and disable everything.
All throttling is off. I'm running it with SMB1 not SMW, so its NES, and I don't see an option to disable the display completely. I do have it set to 0 sprites and stuff, but I want to completely turn off graphical rendering (and boost emulator speed past 6400%), which is why I'm looking to make a custom build of bizhawk.
Joined: 6/18/2015
Posts: 54
askye wrote:
creaothceann wrote:
In "menu | Config | Speed/Skip", disable all throttling options. After loading the game, go to "menu | SNES | Display" and disable everything.
(and boost emulator speed past 6400%)
Load up cheat engine and use the speedhack on Bizhawk.
Editor, Emulator Coder
Joined: 8/7/2008
Posts: 1156
What's this 6400x speedup cap? I'm not sure where that number would come from. I've seen emulator cores run in bizhawk at 3000s of fps which is only a 50x speedup and I've got a pretty fast cpu...
adelikat
He/Him
Emulator Coder, Site Developer, Site Owner, Expert player (3573)
Joined: 11/3/2004
Posts: 4754
Location: Tennessee
It is the limit put on the speedup/down hotkeys. You can overcome that limit by using lua. If fact, all the speed hacks mentioned in the ui are exposed in lua for exactly this reason.
It's hard to look this good. My TAS projects
Active player (476)
Joined: 2/1/2014
Posts: 928
Doesn't the speed mean framerate times ____? So like 6400 times a game running 30fps is 192,000fps. or does that speed cap number mean something else?
adelikat
He/Him
Emulator Coder, Site Developer, Site Owner, Expert player (3573)
Joined: 11/3/2004
Posts: 4754
Location: Tennessee
6400% speed translates to 3840fps. Good luck finding a core that can run at that speed for you.
It's hard to look this good. My TAS projects
1 2 3 4 5
8 9