Posts for Ramzi

1 2
18 19
Experienced Forum User
Joined: 3/25/2004
Posts: 459
> Can a sprite sheet be created in Photoshop, or does anyone have more knowledge on this topic? I know this post is like two years old now, but here you go: https://youtu.be/jedilHUPO7c?t=46 ------------------------------------------- I'm a Java programmer. I've been working on a 3D raycasting renderer. I got some source from Github. I'd like to add textures to the sky and floor, (and then do some other things.) Are there any Java programmers here who would be willing to work with me in a more involved way, (screen sharing / pair programming), rather than just communicating on the forum? It helps to see the IDE and actual source. Thanks.
Experienced Forum User
Joined: 3/25/2004
Posts: 459
Hi. This isn't really a math "challenge", so much as a straightforward math question. I think the answer is some basic linear algebra, but I am ignorant of linear algebra. https://i.imgur.com/yaFXZzw.png If anyone can point me to the right vocabulary, I'd appreciate it. More specifically, I'm trying to implement this in Java. I already created the source to produce image #2, and now I am trying to produce image #3 from it. Thanks.
Experienced Forum User
Joined: 3/25/2004
Posts: 459
I am a member of these forums, but I'm not a member of Discord. I'm conversing and asking questions. You say "arguing" as if it were a hostile activity, but I'm merely trying to collaborate. I'm not trying to act like I know better than experts, but I am a computer programmer, and in my experience programs can give very surprising output even for simple programs which I wrote in their entirety. It is not obvious from code alone what output can occur. Game companies have game testers because they find glitches which occur with elaborate setups, which the developers couldn't anticipate from unit tests alone. Do you think things like the bottle glitch in Ocarina of Time, door warping in GoldenEye, fast pauses in GoldenEye, screen warping in the 2D Zeldas, or sliding through walls in the Super Mario Bros. 1 and 3 could have been anticipated through code alone, even if the original source code was available? Do you think something like a Glider in Game of Life could have been anticipated from the simple functions that comprise Game of Life alone? You say everything I can think of has likely been tested extensively, but from what I've been made aware of, only the first 50 frames have been faithfully reproduced, and I haven't been told that more frames have been reproduced. I have read that exhaustive fuzz testing has been applied without success, but that doesn't clearly tell me that the rest of the frames were reproduced. If this problem hasn't been solved in 5 years, then progress on it is going nowhere regardless of what medium conversation about it is held in. I'm asking the same questions here as I would there, for anyone who would want to answer them here. I haven't been bolding asserting, "The number of analog inputs is small enough to brute force!" or, "A genetic algorithm will solve it!" I have been asking questions like, "How many possible analog inputs are there per frame?" and, "Would a genetic algorithm be a novel approach to this problem?"
Experienced Forum User
Joined: 3/25/2004
Posts: 459
> The upwarp video you posted in a romhack is completely irrelevant because that upwarp was programmed in intentionally by the romhack creator to prevent softlocks Can you explain this a bit more? What causes the softlock, and why would an upwarp be the mechanism to fix it? And does that method of softlocking occur in vanilla, even if a level editor was used to create a custom environment to allow it? > Also, trying to replicate frames is kind of pointless because small variations in joystick inputs are often much smaller than a single pixel. Combined with DOTA's low stream quality, it makes it mostly impossible to conclusively determine exactly what DOTA inputted and exactly where the upwarp occurred. I'm thinking that the input doesn't need to be EXACT to replicate it, just close enough. Also, how many "analog" inputs are inputtable? My idea of the genetic algorithm on the "matching" inputs would test precisely this. Since there may be multiple inputs which produce identical or near-identical frames, some kind of intelligent search on those inputs might yield a result or a set of results which replicate the glitch.
Experienced Forum User
Joined: 3/25/2004
Posts: 459
Am I correct that Dane only replicated the first 50 frames? https://ukikipedia.net/wiki/History_Of_The_TTC_Upwarp#August_8.2C_2016 https://www.youtube.com/watch?v=TD1-b3-60xY The description says: "Currently 50/300 frames have been TASed, but those where the easy ones. Once Mario is free to move, TASing is much more difficult since we include analog inputs." If that's true, wouldn't it be fruitful to try to attempt to replicate more frames past the 50th?
Experienced Forum User
Joined: 3/25/2004
Posts: 459
I don't know how the colors from a real N64 compare to the colors from the emulator. Unfortunately, I only found a low quality YouTube video for DOTA's video. I downloaded it in Mp4 format. VLC's frame extraction tool apparently wasn't working on Mp4s. My Windows 10 had some strange Read-Only folder bug which wouldn't let me gain write access. It took me a while to fix this as most solutions didn't work. I wrote a Java program to take 300 fullscreen screengrabs while I played the video in fullscreen in VLC. Hopefully this captured every frame available, but maybe there are missing frames uncaptured. I looked up edge detection algorithms. There is Canny's and Sobel's. Sobel's looked to give better results, so I went with that one. The original results returned black images with white edges. I found an inversion algorithm to return white images with black edges. I produced the inverted edges images for the 300 frames I screenshotted. I don't know if it would be wiser to compare colors from the original video, to colors from the outputted screenshot from the emulator, or if it would be wiser to compare the colors of the edges from the original video and the outputted screenshot from the emulator. My hope in creating the black-and-white edge images would be to make it easier to write an algorithm to compare a frame from the original video with an outputted frame from the emulator. Going one frame at a time, we need to store the set of inputs which yield a match of the edges for that frame, given the input sequence up to that frame. Also, thoughts about running a genetic algorithm keep popping into my mind. Rather than just fuzz-testing with random inputs, or inputs that match the images or image of the edges, I'm thinking we give a fitness value to how close the images match, and a gigantic boost to the fitness value if the upwarp occurs. That is, between the frames where Mario is on the lower platform to when he is on the higher platform, if those inputs can yield a match, then we have a winner. I guess if we have a winner we don't need to assign a fitness value and evolve the inputs any more, because we would already have a faithful replication of the glitch. Anyway, I'm just trying to think of ways of fuzz testing this more intelligently than random inputs. My ideas have been around simplifying the frame comparisons, and also using genetic algorithms to evolve the inputs more intelligently toward finding the solution. Because I posted this video without the hanging ceiling: https://www.youtube.com/watch?v=VV1dzNzRYkU I am inclined to think this is a replicable glitch, even though I know that video was taken of a ROM hack. I would post all the inverted edge pics somewhere, but all 300 of them come out to around 180mb. Here is a frame to show the kind of results I got. I think the effect of a disappearing coin (after Mario touched it) is visible in it near the platform. https://i.ibb.co/f2gThDn/frame099.png If I had a higher quality original video than the one downloaded from YouTube, I would expect the edges to come out crisper.
Experienced Forum User
Joined: 3/25/2004
Posts: 459
> we've exhausted any possibility of this happening without external influence How? > because if it could happen with the processor doing what it was supposed to, the game would do exactly what its code says to, which leaves no possibility for any type of glitch like this I am presuming the processor works correctly and it does exactly what the code says to, but there is an explanation in the code which causes the upwarp. I'm not convinced the code has been analyzed and internalized by human minds comprehensively enough to rule out the possibility that this is a "legal" result following the code's proper execution. > The only way I can think of something like what you're describing is a design flaw in the processor, instances of which do exist (early N64 processors had a bug when two multiply instructions were executed consecutively), but this is extremely unlikely. It is more unlikely that cosmic rays modified the hardware in his favor in this manner. > Even if another CPU flaw did exist, to be completely undetected until now is ludicrous. It is more ludicrous to think cosmic rays modified the hardware in his favor in this manner. > The N64's CPU was marketed as a PC processor, and for such a serious design flaw to go completely undetected throughout all the factory testing, home and console usage in the 90s, all the way up to 2020 with the sole exception of one speedrunner in one race, is really ridiculous. It has happened before: https://en.wikipedia.org/wiki/Pentium_FDIV_bug That article says: "The severity of the FDIV bug is debated. Though rarely encountered by most users (Byte magazine estimated that 1 in 9 billion floating point divides with random parameters would produce inaccurate results)" So it would be very rare, especially in a video game where you are not programming a custom math program to run against the processor. The article goes on to give an example of the math error: 1.333820 vs. 1.333739 saying: "the value returned by a flawed Pentium processor in certain situations is incorrect at or beyond four digits". So were there such a minor flaw in a video game, it would be unlikely to be detected. Personally, I don't think it's a flaw in the processor, and I don't think it is a minor math error. I think it is a deterministic glitch that is replicable given certain legal inputs and proper code execution, which causes a large change in a value, not a minor one. > It should also be noted that DOTA's N64 was purchased and no abnormalities have been found in its processor's execution, which rules this out pretty conclusively. Then what alternative explanation is there? Cosmic rays? Doubtful. I've heard a lot of talk about crooked cartridge, but I've also read that no one has been able to replicate the glitch with crooked cartridge. Contrast this with the Ocarina of Time crooked cartridge glitches, which were easily replicable.
Experienced Forum User
Joined: 3/25/2004
Posts: 459
> without either his velocity actually being 2000 How do we know there isn't some glitch which causes his velocity to be 2000 for a frame? That wouldn't be readily easy to detect in the code. Like if the Bob-omb explodes and Mario is directly above it, some wonky addition occurs. I'm not seriously suggesting that; I'm just trying to be illustrative. > or some external corruption inside the processor. How do we know that such a corruption isn't deterministic? That is, it's not due to cosmic rays, but would occur faithfully in any emulation of that processor?
Experienced Forum User
Joined: 3/25/2004
Posts: 459
> Bytes changing aren't bitflips. The instruction that decrements a byte is very different to the instruction required to flip a particular bit in a floating-point number, just because they both involve bytes changing doesn't mean one can lead to the other Then how do we know that the upwarp requires a bitflip rather than a byte change? Sure, he replicated it with a bitflip, but couldn't a byte change cause the same value in memory? > There is no possible way for this code to affect any area of memory other than gMarioState->action without external forces acting on the console. Of course THAT code would be known not to explicitly change a memory value, but if there is some kind of game loop which checks Mario's position on each tick and updates memory accordingly, then jumping of course modifies memory.
Experienced Forum User
Joined: 3/25/2004
Posts: 459
From what I've seen, only one person attempted a frame-by-frame recreation, and only got 30 frames in, out of 300, and that was years ago. So I'm skeptical that DOTA's entire run was replicated. > Controller inputs don't cause bit flips. Of course they do. Just think about how any game works. If you have 4 bombs in Zelda, and you press B, suddenly you have 3 bombs. That caused a byte to change. > The people who decompiled the game would've known that a long time ago if they saw any possibility for it in the code. It's hard to read code and to tell how areas of memory can be affected.
Experienced Forum User
Joined: 3/25/2004
Posts: 459
Why do you say "No sequence of inputs alone is going to cause that to happen"? Why couldn't a sequence of inputs cause that bit to flip?
Experienced Forum User
Joined: 3/25/2004
Posts: 459
After rewatching the video you just linked, I'm wondering how faithful of a replication the frames are. The videos look very similar, of course. But even a slight difference in the camera angle could be responsible. I'm researching this now, and I don't think it is a matter of crooked cartridge. This video shows the upwarp without a hanging ceiling: https://www.youtube.com/watch?v=VV1dzNzRYkU
Experienced Forum User
Joined: 3/25/2004
Posts: 459
Another idea I had, instead of fuzz testing, is to replicate the video of the glitch by finding which inputs can frame-by-frame match the one video of the glitch occurring. Sure, there might be some prerequisites for the glitch which might not be met, but I would think there is a fairly good chance of replicating the glitch by matching the frames alone.
Experienced Forum User
Joined: 3/25/2004
Posts: 459
I recently saw this video which offers a $1000 bounty for a glitch replication demo: https://www.youtube.com/watch?v=aNzTUdOHm9A My first reaction was to attempt to fuzz test this to replicate the glitch. If we can put a watch on a height variable, then fuzz test until that height variable is met... Unfortunately, I am unfamiliar with the emulator tools to do this. I would assume the fuzz tester would have to be programmed in Lua, and I'm not a Lua programmer. I also don't know where the height variable is. And even if I had those two pieces of information, I wonder how slow it would be to fuzz test this. That is, does the fuzz testing have to occur in real time, rendering the graphics and everything? Or is it possible to run the game logic way faster than normal execution speed, and even forego rendering the graphics? How hard do you think it would be to claim this $1000 bounty through fuzz testing? Thanks.
Experienced Forum User
Joined: 3/25/2004
Posts: 459
Experienced Forum User
Joined: 3/25/2004
Posts: 459
By making JSON files of game data, we can more easily recreate games within different game engines. And we can more easily run computations on game situations. I got bored encoding this, but here was the start of my encoding of Level 1 from the Legend of Zelda.
{
	rooms: 
	[
		{
			id: "origin",
			left: "room1",
			up: "room2",
			up-type: "locked",
			right: "room3"
		},
		{
			id: "room1",
			enemies: "3 keese",
			item: "key",
			right: "origin"
		},
		{
			id: "room2",
			enemies: "3 skeletons",
			up: "room4",
			down: "origin",
			down-type: "locked"
		},
		{
			id: "room3",
			enemies: "5 skeletons",
			item: "key",
			left: "origin"
		},
		{
			id: "room4",
			item: "key",
			enemies: "5 skeletons",
			left: "room5",
			up: "room6",
			up-type: "bombable",
			right: "room7"
		},
		{
			id: "room5",
			enemies: "6 keese",
			right: "room4"
			right-type: "kill",
			up: "room8",
			up-type: "locked"
		},
		{
			id: "room6",
			enemies: "5 smallZols",
			down: "room4",
			down-type: "bombable",
			left: "room8",
			up: "room9",
			right: "room10",
			item: "map"
		},
		...
	]
}
Experienced Forum User
Joined: 3/25/2004
Posts: 459
I'm just here to not answer Warp's question.
Post subject: When is a game identical to making a TAS of a game?
Experienced Forum User
Joined: 3/25/2004
Posts: 459
a) When the game freezes your character for most of the time, before requiring a simple input to complete the game. b) When the game naturally allows you save and restore functionality, slow down and frame advance, or whatever other TAS tools needed. c) When the levels automatically modify based on past performance. d) Where variables compound such that even with TASes everything is just luck. a) is the trivial case, the base case, the boring case. I just mention it because it comes first. b) makes sense. If you want a game that is indistinguishable from making a TAS of the game, the game needs the common TAS tools like save and restore. c) Rather than the boring game described in a), by having 10 levels which are automatically generated or responsive to previous input, if you complete early levels too quickly, later levels will be longer, and if you complete them too slowly, later levels will be shorter, so that the average game comes out to the same length. d) Maybe d) is like c). If random values assigned to variables can be chaotically dependent on previous choices made in the game... and I'm imagining a factorial explosion of ways to set the seed, then that would exhaust the computational ability of the TASer. Then watching a play through of the game normally would look identical to someone making a TAS of the game. The random paths taken during an uninformed playthrough would look like informed paths with shortcuts. Picking up few power ups for points in the beginning will result in big power ups at the end. Picking up many power ups for points in the beginning will result in fewer power ups at the end. The goal of the game is to really handicap the game or make it longer or more difficult based on how well the player has performed, such that the average end score and end time is always the same regardless of the skill level of the player.
Experienced Forum User
Joined: 3/25/2004
Posts: 459
> In my opinion, keeping yourself busy with hobbies is the most important thing. And then would you fall ill if those hobbies were taken away from you? > Doing often video calls with friends also helps a lot. And then would you fall ill if those friends were taken away from you? > What have you been doing to keep psychological health during the quarantine? Any struggles, thoughts or advice? Learn about Stoicism. Listen to an audiobook from Epictetus, then from Seneca, then from Marcus Aurelius.
Experienced Forum User
Joined: 3/25/2004
Posts: 459
Experienced Forum User
Joined: 3/25/2004
Posts: 459
Here. I just downloaded some screen recording software. I only recorded 5 levels of play because every 5 levels Project Skeletor pops up a file browser window, and I didn't want anything from my file system to make it into the video, even though I don't think anything was exposed. I just didn't want to check carefully. And also, a file browser wouldn't have belonged in a game play video. Levels 11 through 15: https://www.youtube.com/watch?v=-wCq6596WnI Levels 16 through 20: https://www.youtube.com/watch?v=5oK7Xah9Wvg Levels 21 through 25: https://www.youtube.com/watch?v=sJBSvu_NVuQ Levels 26 through 30: https://www.youtube.com/watch?v=4c4ApTXmKjo Level 31 through 35: There is a glitch here where it calls level 31 level 000 at the start and end of the level. The glitch is probably due to me loading to that level from a password. (Because my previous game ended when my computer restarted itself for no good reason.) You can hear a Windows beep sound which belonged to a script error coming from Projector Skeleton. https://www.youtube.com/watch?v=Oj__aELBG9c Levels 36 through 43: Ran into maximum screen recording time in the screen recording software i'm using. At 3:13 you can see a Windows Explorer window, which I had been trying to avoid capturing in the video until this time. https://www.youtube.com/watch?v=vnQEBhKcPEE Levels 44 through 50: Starting at 1:07 a Windows Explorer window can be seen, and again right at the end of the video. https://www.youtube.com/watch?v=47vq6pgFLME
Experienced Forum User
Joined: 3/25/2004
Posts: 459
I have implemented a game which is a close recreation of Blix. Its look and feel is largely almost there, but there are many quirks, and the code base is sloppy. Today I attempted to use Test-Driven Development (TDD) to make a cleaner code base. I wouldn't consider my attempt a success. While what I have so far might be considered cleaner code, I'm struggling to think how I can take what I have and actually implement a game out of it. Tonight I got the idea... If a video is taken from the start of a level with no inputs fed to the level, until the player dies, how hard would it be to auto-generate that level in my new engine? The auto-generation would have to just check that every frame's image matched the image at that frame from the video exactly, and tweak parameters until it did. Otherwise, to code it by hand would take extreme attention to detail, and even then things are likely to still be off in minor ways, like the initial velocities and positions of the balls. In the original Blix, a password is given every 5 levels. I wondered how difficult it would be to hack the binary to add a password for every level, for the purposes of taking a video of every level without having to manually play and complete them. I've been thinking about taking a screen recording of me playing the game just to show the game off, but honestly it would just be easier for anyone to download Projector Skeleton and play the game for themselves. I've also been thinking of uploading my code base to Github and linking it here for collaborative effort and code review, but I keep telling myself that I need to clean up the code more before I commit it. I'd be embarrassed by the state of the code otherwise. That's my update regarding what I've been working on regarding Blix. I've also had the idea, already mentioned in this thread, of incorporating TAS functionality like save and restore, and replaying of keystrokes, right into the remake. I think this is an interesting game for TASing, and maybe mathematical proofs of optimal completion can be given. Oh, one thing more I thought of... I don't like the idea of a TAS being able to click on extreme ends of the game board within a frame, when in reality it takes continuous mouse movement. For this reason I thought about being untrue to the original, such that there is a cursor in the game that requires continuous movement, rather than allowing the mouse cursor to jump anywhere instantly. This would complicate the math proofs for optimal completion. Likewise, depending on how much allowance there is for where in a tile a game piece can be activated would also affect the math proofs of optimality. Again there is a tradeoff in consideration of being exactly true to the original game, compared to making minor tweaks to create some more interesting game. A level editor could go beyond the original limitations of the game, like by having an increased board size. Like Mario Maker or something. Then "cryptographically" difficult custom levels could be created that would be hard to TAS, even with TAS functionality built right into the game, because the difficulty of playing and beating the levels would be a mathematical difficulty, not a technological difficulty.
Experienced Forum User
Joined: 3/25/2004
Posts: 459
Tonight I tried writing a TAS for this game by issuing mouse clicks. It was unsuccessful. Although the logic said to click a location, and although it would work for many of the clicks, for many other clicks they would be unregistered. Also, when the ball destroys a paddle, that usually causes the game to not register a click. Finally, it is very dangerous to put clicking behavior in a loop. If the loop is infinite, it can become impossible to even Control Alt Delete to stop the process. Even if the loop isn't infinite, if it clicks out of the game window, it can start dragging files around in your code base or file system. For these reasons, I think I should first recode the game in a manner that is friendly to TASing, rather than trying to figure out the technical intricacies of why Shockwave doesn't register certain mouse clicks when other events fire.
Experienced Forum User
Joined: 3/25/2004
Posts: 459
I was going to need to record some gameplay footage anyway, so I can see the initial configurations of the levels, because I had wanted to recreate the game, possibly to add TAS functionality. Everything I do is in Java, because I'm a Java fanboy. I was thinking of making a TAS for this using Java robot to issue mouse clicks at certain times and locations. The game appears to be deterministic. So likewise, I don't use a standard screen recording software. I use Java to take screenshots, save them as BufferedImages, and then use a Java library to turn that into a gif. I'll go ahead and try to make a .gif for you tonight, even though it's past midnight and tomorrow is my first day of work at a new job. Shit. There was a delayTime parameter which put a 10ms delay between every frame in the animated gif, so the final product came out looking way slower than the actual game. Nevertheless, here is what I produced: https://imgur.com/a/qpP5d0u
Experienced Forum User
Joined: 3/25/2004
Posts: 459
Wow! It works! I wonder why none of the tutorial sites had mentioned this Projector Skeleton solution! I had to come to these forums to get a solution. Someone tell Ferret Warlord there's a way to play his game.
I tested Blix through level 5.
Wow! Level 5! You're good! Edit: Ugh! I just crashed with a script error on Level 4! Edit: I got past it this time! Edit: Don't you guys think this game would be great for TASing? Edit: I was able to close Projector Skeleton by right-clicking in the task bar and selecting Close, since the red X of the window didn't work.
1 2
18 19