Posts for Randil

Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
I am late to the party, but just got around to watching this now. Really great job! Brings back old memories.
Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
Cool! It's been a long time since I did the Deja Vu 2 TAS (15 years! time flies by fast...) so this brings back memories. It's also interesting, at least for me, to see a TAS of Deja Vu 1 on GBC, since the graphics and interface is a bit different. Yes vote from me, nice to see a new TAS for one of the storybook games.
Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
I realize I am late to the party, but I just wanted to say great job with this :) the run looks really nice, and 33 seconds improvement is quite a lot. I'm very happy to see all the old NES games I TASed back in the day still getting some love.
Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
Nice job! I'm glad to see that this game is still getting some love :) Yes vote from me.
Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
The Pokemon Essentials toolkit (that you mentioned) is a good add-on for RPG maker when making a pokemon game. I think that if you used the default settings from that toolbox your game would look a whole lot more pokemon-ish. I've played a few good RPGmaker-pokemon games made with Essentials, such as Reborn and Godra. You should take a look at those two if you haven't already. When you download these games you also get the all RPG maker files, so maybe you can draw inspiration from thos games, and learn some useful and nice RPG maker functions by looking at the files and maps from respective game.
Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
It's not too hard to show that for any irrational number there exists two values x1 and x2 such that |s(x2) - s(x1)| > M for any M, i.e. the "span" of the function is arbitrarily big. Since pi is irrational, every finite decimal sequence will appear in it (right? correct me if I'm wrong here), therefor there will appear a decimal sequence that increases the function value by (at least) M after the sequence is finished (in its simplest form something like 9090909090909...). But I haven't been able to show that this means that s(x) is unbounded, since we don't know the values of s(x1) and s(x2). Interesting results about its connection with normal numbers, I didn't think about that. And a nice unbounded normal number construction, OmnipotentEntity!
Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
Here's a problem I thought up some time ago: Consider the function p(n) = (-1).^(n-1) * "the n:th decimal of pi". So for example, p(1) = 1, p(2) = -4, p(3) = 1, etc. Now consider the cumulative summing function s(n), which is the sum of the first n terms of p. So s(1) = 1, s(2) = -3, s(3) = -2, etc.. My questions are: 1. s(n) > 0 for a few values up to n=13, after that it seems to stick to negative values. My question is, which is the smallest n>13 such that s(n)>0? It has to be pretty big, I tried the first 10 000 digits of pi and didn't reach it. This fact is interesting since the function shouldn't "prefer" negative values over positive ones. But s(n) seems to "get stuck" in the negative numbers and has a hard time getting out of there. 2. Is s(n) bounded above or below? My intuition says no, but I cannot formally prove it. 3. Consider the histogram of the values s(1), s(2), ..., s(n), for ever increasing n. I suspect this should converge to a normal distribution, but again I cannot formally show this. If it does converge to a normal distribution, what are the parameters of said distribution? 4. (bonus question): can you generalize your answers to questions 2 and 3 to any irrational number? For that matter, are the answers to questions 2 and 3 always the same for all irrational numbers?
Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
Any news on this?
Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
I have another math problem that I encountered in a project at work. I haven't been able to solve it in an elegant way (I've made a pretty ugly pragmatic solution, see below), but I would like to present the problem to you in the hopes that you may have an elegant and clever way to solve it So the situation is that I have a set of point x1, x2, ..., xn and y1, y2, ..., yn. I want to fit a polynomial of degree n to these points (n is usually in the range 2-5, but it can vary, so don't necessarily limit yourself to these values). The "normal" way to solve this would of course be to just make a least squares fit and get a polynomial y=p(x). However, I have certain requirements of the polynomial p(x) I require it to be non-decreasing between values x_lower and x_upper (formally p'(x)>=0 for x_lower <= x <= x_upper). One valid subset that would work is when all the coefficients are >0, but this would be too limiting. My own solution to this was to a apply a general optimization method and simply punish the fit measure if the polynomal was decreasing in this interval, making it want to avoid any such polynomal. But I'm sure there is a better way to approach this. And thoughts on this?
Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
Nice work! I agree with you that maximum likelihood should be the best (or at least one of the best) ways to go. I'm impressed that you halved my number of tries for 0.55/0.45. What I'm wondering now is whether the maximum likelihood approach is better than the bayesian approach thatguy mentioned. What do you guys think? I suspect that the bayesian approach might be better if you have a very small dataset and when p_wrong and p_right are close (and of course a good a priori distribution), but that's just a theory...
Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
That is awesome. I feel like this could probably be used for a similar "teleport to last room" trick as in Shadowgate. If you can't find any such trick, the thing that comes to my mind would be to simply set the necessary flags for beating the game through this trick (by picking up items that set specific bits a la Shadowgate style) instead of actually doing anything, and then maybe even teleport to the police station (if that is faster than actually going there, I'm not sure). Keep me updated and let me know if you need something from me! I still keep my old Excel sheet with notes and some RAM address info.
Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
Amazing! A very impressive improvement indeed. Yes vote!! :)
Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
Amazing job deconstructing this game to this level. And I really enjoyed watching this. Easy yes vote!
Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
I made an algorithm that completes this in the following average number of tries (average over 500 monte carlo simulations): p_right = 0.95, p_wrong = 0.05: 13 tries p_right = 0.80, p_wrong = 0.20: 22 tries p_right = 0.60, p_wrong = 0.40: 181 tries p_right = 0.55, p_wrong = 0.45: 506 tries Quite a good improvement from the original 5000. When p_right = p_wrong the average numer of tries was approximately 5000. Here's how I did this: For each 4 digit number I just checked each digit's "probability weight" (that I made up myself) to p_right. High value = closer to p_right. I summed the values 100 / (1 + 100*abs(p_right - p_now)) where p_now is the current ratio of times that the green light has lit up for this digit on this position. So if the current digit has a ratio close to p_right. I will add a high number. I all 4 digits have a ratio close to p_right this number will be even higher. I then pick the 4 digit number with the highest value of this (after having removed the 4-digit numbers I have picked previously). If anyone is interested I can upload my Matlab code. Note that this algorithm does not care about p_wrong. So as you can see, the average number of tries is low if and only if p_right and p_wrong are far apart.
Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
Interesting approach, thatguy. I also thought that some kind of bayesian approach should work well here, since basically we are updating our believes in the light (no pun intended) of more and more data. Though I haven't worked out the exact equations, but it seems that neither have you :) (or maybe you have but are keeping them secret!) It would be awesome if you could get a working script for your idea so we can see how much better than the brute force's 5000 average guesses it is. I had the following thought: you run the 10 values 0000, 1111, 2222, ..., 9999 many times each (maybe 100 times each, giving 1000 guesses total), and note the probability of green for each of the 4 lights and 10 runs, giving you a total of 40 probability values. We know that 4 of these will approximately be p_right, and the remaining 36 should be close to p_wrong. Our goal would then be to identify which belongs to which group. I haven't worked out the details here, but maybe it's a possible approach. Of course you could halt this routine early if you are confident that you found the answer before getting to 9999.
Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
Yes, I thought about the case p_right = p_wrong myself. If I'm thinking correctly, for all cases where p_right = p_wrong the lights will give no additional information. If you were to construct an algorithm and plot the average number of attempts on a 2D-plane with p_right on the x-axis and p_wrong on the y-axis, I think it will have the value 5000 along the line y=x (since here the lights don't provide any information). Right? Oh, and as for cracking the code, as soon as you type in the correct code you will be notified (in some way). So when writing your code you should have a variable containing the correct 4-digit combination (that the algorithm of course doesn't have access to), but you use it to check if your guess is correct. Once you guess correctly your algorithm will stop. Maybe that wasn't clear. Or maybe I'm misunderstanding what you're saying. :)
Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
I have another math problem I thought up today. I don't know how complicated it is, maybe you can shed some light on it: Imagine that there is a 4 digit code that you have to break. Once you hit the correct code, the lock opens up, so there is no doubt when you found the correct code. You have an unlimited number of tries, but you still want to minimize the average number of tries you have to make. Of course one possible brute force method is to start on 0000 and increase by 1 each time, giving an average number of tries of 5000. However, this setup has an additional feature: below each digit is a light that can be either green or red. If you have entered digit i (i=1,2,3,4) correctly, light i turns green with probability p_right (and red with probability 1-p_right). If the digit is incorrect, the light can still turn green, but does so with probability p_wrong (and red with probability 1-p_wrong). One situation could be where p_right =0.95 and p_wrong=0.05, i.e. each light is "probably" green if you entered the digit correctly, and "probably" red if it is not correct. In this case you can most likely get away with less than 5000 guesses. Your task is to construct an algorithm that uses this light information in order to minimize the average number of tries you have to make. For some reason you know the values of p_right and p_wrong (but of course you don't know the correct code). I'm interested in what you can come up with, and how the average number of attempts your algorithm has to make depends on the values of p_right and p_wrong. (I don't know any smart solution to this myself, I just propose the problem to you in the hopes that you find it interesting!)
Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
Thanks a lot, Bobo and FractalFusion. Bobo, a small question on your solution, would an equivalent (and in my eyes simpler) description of the routine be to start with your string |||*** and then look for the rightmost instance of the string |* and replace it with *|? The routine would stop when the string |* is not found. It seems to me that this will generate the same solution as you presented.
Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
What is the formula (or a piece of pseudocode would work just as fine) for creating all the possible ways of sorting k objects into n bins (with no regard to the order they are placed)? For example for k=2 and n=3 I want to generate the matrix 0 0 2 0 1 1 0 2 0 1 0 1 1 1 0 2 0 0 I found it quite easy to find the solutions with a brute force method for small n and k, but when n and k get large it gets trickier. Note that I'm interested in the indivudal solutions, and not just the number of solutions. I feel like there is an easy solution to this that I can't see/remember clearly...
Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
Sure, here is a dump of my addresses (I made this list back in 2009... I'm getting old). Maybe someone can add some more? Please don't ask me too difficult questions about these, it's been many years since I looked at them :) 04D0 X|pixel|pos 04E0 X|subp.|pos 0500 Y|pixel|pos 0510 Y|supb.|pos 0520 X|pixel|speed 0530 X|subp.|speed 0540 Y|pixel|speed 0550 Y|supb.|speed 8a Screen|ready|3 0490 Form 0699 Animal|fed 0697 Animal|time 0600 Jump|land|wait 0610 Candy|on|0 4d3 En|x|pos 04D1 Animal|X|pos 04D2 Enemy|1|X|pos 04D3 Enemy|1|X|pos 0055 Death|spawn 04DE Candy|1|X|pos 050E Candy|1|Y|pos 051E Candy|1|Y|subp 58 Big|scr|y 59 Pix|scr|y
Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
Very nice indeed! This brought by some fond memories for me. You made very good use of damage boosting, I think. Yes vote! :)
Post subject: Re: Mickey Mousecapades
Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
Alyosha wrote:
EDIT: oh yeah, also I'm pretty sure Randil's run starts from a savestate, so I didn't get the same spawns in room one. Seems it suffers from the same problem as Arc's ghosts and goblins run.
If I remember correctly we used a soft reset somewhere at the start of the run to manipulate RNG.
Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
Frame 8200: "What? I can't walk through flames? I don't deserve to continue this quest! *thrusts spear through heart*" This is a beautiful piece of work that I think really shows what gems you can find if you dig deep enough into the game's mechanics and how it shuffles memory in the RAM. As I've said before, really great work on this, I'm very happy that new people show interest in storybook TASing :) Yes vote, of course. Deja Vu next? I wouldn't be surprised if the bullet underflow trick can be used in a similar way (I know I've been able to teleport back to the first room in the game, so there are some major stuff that can happen).
Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
Amazing. I have a hard time seeing how this can be significantly improved (unless you find something new).
Experienced Forum User, Published Author, Skilled player (1900)
Joined: 4/20/2005
Posts: 2160
Location: Norrköping, Sweden
I'm glad to hear that you're still working on it, I was just about to ask how you were progressing :) Keep it up, I look forward to the finished product!