Posts for c-square


1 2
12 13 14
26 27
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
DrD2k9 wrote:
Ok, I just set JPC-rr to run instead of doing frame advance. I followed your sequence, and here's what I got.
My apologies. I was doing this after midnight last night and made some mistakes. Please give this a try: 1) Bet 1 -> Eye | Diamond | Eye 2) Bet 1 -> Skull | Cherry | Eye 3) Y-Enter 4) Bet 3 -> Eye | Eye | Eye 5) Y-Enter 6) Bet 3 -> Eye | Eye | Eye 7) Y-Enter 8) Bet 3 -> Cherry | Cherry | Cherry 9) Bet 2 -> Cherry | Eye| Cherry 10) Y-Enter 11) Bet 3 -> Eye | Eye | Eye 12) Bet 3 -> Cherry | Cherry | Diamond 13) Y-Enter 14) Bet 3 -> Diamond | Diamond | Diamond 15) Bet 1 -> Skull | Diamond | Skull 16) Bet 2 -> Cherry | Diamond | Skull 17) Y-Enter 18) Bet 3 -> Diamond | Diamond | Diamond
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
DrD2k9 wrote:
c-square wrote:
But, there is a faster way through the slots: 1) Bet 1 -> Eye | Diamond | Eye 2) Bet 1 -> Diamond | Cherry | Eye 3) Y-Enter 4) Bet 3 -> Eye | Eye | Eye 5) Y-Enter 6) Bet 3 -> Eye | Eye | Eye 7) Y-Enter 8) Bet 3 -> Cherry | Cherry | Cherry 9) Bet 2 -> Cherry | Skull | Cherry 10) Y-Enter 11) Bet 3 -> Eye | Eye | Eye 12) Bet 3 -> Cherry | Cherry | Diamond 13) Bet 1 -> Skull | Diamond | Skull 14) Bet 2 -> Cherry | Diamond | Skull 15) Y-Enter 16) Bet 3 -> Diamond | Diamond | Diamond
This is incorrect at step 13. Also my symbols don't always match yours, perhaps there's something different somewhere that we missed? Is there a reason not to bid 3 on a winning spin? I didn't think the bid amount affected the random seed. EDIT: Using your sequence up through 12, then performing a Y command gets the sequence back onto my original one at seed 14510; however with a higher money value. This results in one less spin on the slots before breaking it.
Hmm... what symbols do you get? If they don't match then I've got something off in my spreadsheet. Also, always be sure to see the losing message on any of the "bet 1s". Choosing that message uses up a random call. A spin that results in just one starting cherry simply gives your money back, so it doesn't matter what you bet. I chose 2 to differentiate between winning spins, losing spins and break-even spins. That, and the number 2 seemed lonely. ;)
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
DrD2k9 wrote:
Update on current WIP.
Nice job! I don't think we need to worry about the skimmer anymore. But, there is a faster way through the slots: 1) Bet 1 -> Eye | Diamond | Eye 2) Bet 1 -> Diamond | Cherry | Eye 3) Y-Enter 4) Bet 3 -> Eye | Eye | Eye 5) Y-Enter 6) Bet 3 -> Eye | Eye | Eye 7) Y-Enter 8) Bet 3 -> Cherry | Cherry | Cherry 9) Bet 2 -> Cherry | Skull | Cherry 10) Y-Enter 11) Bet 3 -> Eye | Eye | Eye 12) Bet 3 -> Cherry | Cherry | Diamond 13) Bet 1 -> Skull | Diamond | Skull 14) Bet 2 -> Cherry | Diamond | Skull 15) Y-Enter 16) Bet 3 -> Diamond | Diamond | Diamond Also, I've pretty much figured out how to add joystick input via keyboard to JPC-rr. Do you want to use it to help you in the tight spots, or are you okay going on without it?
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
FractalFusion wrote:
What are the specifics of joystick input in JPC-rr? Are there commands other than AXISA and AXISB, and if so, what do they do? What are the possible values for AXISA and AXISB? Did you try a number at the top of its possible range?
I figured it out. The starting value (center) for the joystick axes is 10,000. Left and up is zero, right and down is 20,000. Of course, when things start looking good, something else comes up: My simple autopilot is still too slow to react after the rock placements are set. You have three frames to get out of the way of a rock. Even with instantaneous movement, that's not always possible. However, my (semi)predictive autopilot is faring better, and is getting out of the way of the rocks.... until the game freezes for some unknown reason and just hangs. Still more to look into...
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
DrD2k9 wrote:
c-square wrote:
Looks like there's no delay for joystick input. It should be easy to update JPC-rr so you can use the number keys to control the joystick, if you'd like.
My first question: Is that much work necessary? What is the potential range of seed changes that can happen through the skimmer sequence?
No, it's not. If we're searching for the perfect run, then we'll have to do that exercise, but it's very possible to get a quick, decent run without it. In the few passes I've done, the skimmer sequence has called random anywhere between 300 and 600 times, making it hard to target a specific range manually. However, if you want to limit the number of random calls, press "up" when you're still. That will prevent the shadow hop random calls. I still want to try to get an autopilot working, as I feel I'm close now. But if you want to go ahead and do the run manually, feel free. You likely have enough info to do a fast run, and I'll be happy to help out if or when you need it.
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
Looks like there's no delay for joystick input. It should be easy to update JPC-rr so you can use the number keys to control the joystick, if you'd like. There is one problem I'm running into: I can send an AXISA command with a positive number, and Roger goes left. Same with AXISB and up. However, I haven't figured a way to go right or down yet. The input doesn't take negative numbers. Anyone else have an idea? I'll play with it more tomorrow.
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
Radiant wrote:
Since randomness advances each frame when you're moving, it should be doable to make all rocks spawn to the side while you stick in the middle.
So far I've been trying to dodge the rocks, to little success. Manipulating the rocks might work, however there are two problems that need to be overcome: 1) Figuring out when we need to manipulate the rocks I've written a function to figure out what the next rocks are going to be, but it's not yet very accurate:
function getNextRock1(rockseed)
	nextrock1 = calcRnd(rockseed, 80, 136)
	return nextrock1
end

function getNextRock2(rockseed)
	nextrock2 = calcRnd(rockseed, 20, 70)
	return nextrock2	
end

function getNextSeed(seed)
	return slotRNG[seed]
end

function getNextRocks()
	v0 = 240153
	seedAddr = 246039
	rock1 = jpcrr.read_byte(v0 + 30)
	rock1Countdown = jpcrr.read_byte(v0 + 34)
	rock2 = jpcrr.read_byte(v0 + 32)
	rock2Countdown = jpcrr.read_byte(v0 + 35)
	rockseed = jpcrr.read_word(seedAddr)
	if (rock2Countdown > rock1Countdown) then
		if rock1Countdown > 1 then
			rockseed = getNextSeed(rockseed)
			nextrock1 = getNextRock1(rockseed)
		end
		if rock2Countdown > 1 then 
			rockseed = getNextSeed(rockseed)
			nextrock2 = getNextRock2(rockseed)
		end
		if rock2Countdown > 1 and 5 >= rock2Countdown - rock1Countdown then
			rockseed = getNextSeed(rockseed)
			nextrock1 = getNextRock1(rockseed)
		end
		if rock1Countdown > 1 and  rock1Countdown - rock2Countdown < 5 then
			rockseed = getNextSeed(rockseed)
		end
	end
	if rock1Countdown <= 1 then
		rockseed = getNextSeed(rockseed)
	end
	if rock2Countdown <= 1 then
		rockseed = getNextSeed(rockseed)
	end
	if rock1Countdown == 0 and rock2Countdown == 0 then
		countSeed=jpcrr.read_word(seedAddr)
		countSeed=getNextSeed(countSeed)
		count1 = calcRnd(countSeed,3,30)
		countSeed=getNextSeed(countSeed)
		count2 = calcRnd(countSeed,3,30)
		rock1Pos = jpcrr.read_byte(v0+31)
		rock2Pos = jpcrr.read_byte(v0+33)
		if (rock2Pos < rock1Pos  and count1 <= count2) or (rock1Pos < rock2Pos and count2 <= count1)  then
			rockseed = getNextSeed(rockseed)
			nextrock1 = getNextRock1(rockseed)
			rockseed = getNextSeed(rockseed)
			nextrock2 = getNextRock2(rockseed)
		else
			rockseed = getNextSeed(rockseed)
			nextrock2 = getNextRock2(rockseed)
			rockseed = getNextSeed(rockseed)
			nextrock1 = getNextRock1(rockseed)
		end
	elseif rock1Countdown <= 1 and rock2Countdown <= 1 then
		if rock1Countdown <= rock2Countdown then
			rockseed = getNextSeed(rockseed)
			nextrock1 = getNextRock1(rockseed)
			rockseed = getNextSeed(rockseed)
			nextrock2 = getNextRock2(rockseed)
		else
			rockseed = getNextSeed(rockseed)
			nextrock2 = getNextRock2(rockseed)
			rockseed = getNextSeed(rockseed)
			nextrock1 = getNextRock1(rockseed)
		end
	elseif rock1Countdown <= 1 then
		rockseed = getNextSeed(rockseed)
		nextrock1 = getNextRock1(rockseed)
	elseif rock2Countdown <= 1 then
		rockseed = getNextSeed(rockseed)
		nextrock2 = getNextRock2(rockseed)
	end
	return rock1, rock2, nextrock1, nextrock2
end
(I apologize for the lack of comments.) It works fine if the rock countdowns are both large, but has trouble once they're 1 or 0, which is why there's so much code trying to adjust it. Feel free to check it out and correct it. 2) Manipulating seeds on the frames we want to It's possible to use up or down to enter a direction without actually moving the skimmer, so manipulating seeds is possible while staying in one place. The problem is that because we're using text input, although it's possible to stop moving on a desired frame, you then have to wait a number of frames before the engine will pick up your command to start moving again. This makes seed manipulation unpredictable. I'm wondering if joystick input is instantaneous and gets around the keyboard input limitation.
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
I just had another thought: how about using joystick input to get around the clunky frame limitation of typing? It could well make for better routes, and may make tackling the skimmer sequence easier.
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
Unfortunately, I haven't been able to come up with a predictive way of determining the next rock positions and have the skimmer move in time to avoid them. There's a lot of randoms going on that have nothing to do with the rock placement, and it's been very difficult taking them all into account. I'll try using automated saving and loading of save states next to find a way, but I'm starting to think this may not be doable.
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
Here, let me give you something so you can do it yourself
roomAddr=240153
seedAddr = 246039
oldSeed=jpcrr.read_word(seedAddr)
oldTick = -1
slotRNG = {}
for i=0,65536 do
	slotRNG[i] = (i*31821+1)%65536;
end

while true do
	a, b = jpcrr.wait_event();
	if a == "lock" then
		nowTick = jpcrr.clock_time()
		if nowTick ~= oldTick then
			seed = jpcrr.read_word(seedAddr)
			if oldSeed ~= seed then
				if nowTick > oldTick then
					changes=0
					while oldSeed ~= seed do 
						oldSeed = slotRNG[oldSeed]
						changes = changes+1
					end
				else
					changes = "Reload!"
				end
				room = jpcrr.read_byte(roomAddr)
				print("Time: " .. nowTick .. " Room: " .. room .. " Seed: " .. seed .. " Number of Changes: " .. changes)
				oldSeed = seed
			end
			oldTick=nowTick
		end
		jpcrr.release_vga();
	end
end
Throw this in a text file in the JPC-rr lua directory, and use the Lua window to run that file. Note, the addresses are the ones from the movie file you sent me that got up to the slots. If your save is starting from scratch, it's possible the addresses will differ depending on when you started the actual game. Give it a shot and let me know if it works! EDIT: If you want to try a more direct route of playing with the spider droid's timer, you can poke seed values with the following:
seedAddr1 = 246039
seedAddr2 = 1294615
jpcrr.write_word(seedAddr1, [value to poke])
jpcrr.write_word(seedAddr2, [value to poke])
Note there are two addresses that hold the seed value. Again, you need to put that in a file to run it.
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
DrD2k9 wrote:
So was the initial seed value set at room 2, or at room 4?
The initial seed value is set after name input but before any room appears on the screen. It could be in the initialization code of room 2.
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
I ran through your run up to the slots and had JPC-rr dump the number of changes per room. Here's what I got (in csv format): Room-Visit,Seed Changes,Total 2-1,0,0 1-1,0,0 4-1,1,1 3-1,0,1 4-2,1,2 2-2,3,5 5-1,3,8 6-1,0,8 7-1,1,9 9-1,0,9 8-1,0,9 10-1,0,9 8-2,0,9 12-1,0,9 10-2,0,9 13-1,0,9 30-1,0,9 14-1,0,9 30-2,2,11 21-1,1,12 22-1,1,13 23-1,1,14 20-1,1,15 24-1,0,15 20-2,1,16 23-2,1,17 20-3,2,19 19-1,5,24 18-1,2,26 15-1,0,26 16-1,9,35 17-1,9,44 32-1,0,44 25-1,0,44 26-1,0,44 27-1,52,96 28-1,0,96 27-2,22,118 26-2,0,118 29-1,6,124 31-1,7,131 78-1,0,131 33-1,444,575 35-1,0,575 34-1,0,575 35-2,0,575 70-1,11,586
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
Radiant wrote:
Arcada control room. (1) Push these out of the airlock. (2) The press is all that is left. (3) A little push for me, old sir, right? (4) Rob is flashing another sarien uniform. (5) A little swipe now at the translator. Shuttle bay (1) Push for third base now, I guess. (2) I stand now under the little rocket. (3) Push me over to the second power. (4) First from the press, autopilot is in. (5) Shut up, out of the door with you! (6) The buckle is flashing on that belt. (7) Move now to throttle me for a second. Kerona (1) Will you pick me for a little survival. (2) Another open second, out of supplies. (3) Get down for the belt will please you. (4) Get off first, craft a little for you. (5) I pick up that hunk from the mirror.
<claps> Ha ha ha! Well done! These are going to be great. I look forward to what else you find.
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
Looks like I'm not going to have time to work on this until the weekend, but I'll keep you posted. Or feel free to go ahead without me if you don't want to wait. Though it looks like you may have some tasks on hand already polishing your SQ2 run, which was great BTW.
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
Nice run, DrD2k9! Looking forward to the updated one.
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
Radiant wrote:
c-square wrote:
As for the v6 issue, it'd be helpful to know when the Ticks happen. I'm pretty sure it's not one Tick each frame. Is there a variable that can be used to track Ticks?
Each tick is one frame of updating the game state, yes.
Hmm... I was playing the game in JPC-rr on slow, keeping the skimmer still, and watching the rng seed value. It took numerous frame advances for the game to change the seed (I.e. call random). When I was talking about a frame, I meant the JPC-rr frame. Do you mean the same thing? If not, is there a way we can know when what you're referring to as a frame is going to happen next?
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
Ha ha ha! That's hilarious! That would certainly add to the entertainment of the run. As for the v6 issue, it'd be helpful to know when the Ticks happen. I'm pretty sure it's not one Tick each frame. Is there a variable that can be used to track Ticks?
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
Can you search for an increment or decrement to v6? Also, how do you search in multiple files?
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
DrD2k9 wrote:
HOWEVER, pressing '5' on the number pad halts Roger's movement on the frame pressed and doesn't wait for the 3 frame cycle to end. Thankfully this trick also works in the skimmer sequence, allowing you to stop motion at any desired frame.
Sweet! With being able to make small adjustments, I've written a lua bot to autopilot the Skimmer sequence. The goal here is to have a deterministic run of the skimmer so we can guarantee the number of rng-seeds that are spent in this part. Link to video Unfortunately, it only works up to 'Fast'. At 'Fastest', the rocks come too quickly to dodge. Tomorrow I'll work at upgrading it to look at the upcoming rng seeds to anticipate the rocks instead of just looking at the existing rock positions. The hardest part of that will be figuring out when the random in this bit of code is called:
if (v6 == 0) {
  if (!isset(f32)) {
    random(2,10,v38);
    if (v38 == 5) {
      set(f32);
      v37 = 3;
      v36 = 0;
      reposition(o1,v36,v37);
    }
  }
  else {
    reset(f32);
    v37 = 253;
    v36 = 0;
    reposition(o1,v36,v37);
  }
}
I haven't been able to find when v6 gets set and when it gets changed. If someone has time, could you find out what causes v6 to become 0?
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
Radiant wrote:
Tap the direction button once to start moving, once more to stop. Do not hold it down.
Hmm... I tried that and it doesn't seem to work. The skimmer registers the first keypress and starts to move, but it gets to the other edge of the screen before it registers the second keypress.
FractalFusion wrote:
Assuming I understand how the random() calls work, I found a strategy that costs only 32 frames:
00272 30384 99 2
00273 62193 04 3 bet 3 (DDD)
00274 52862 77 0
00275 09191 97 0
00276 45180 05 0
00277 09549 05 0 bet 3 (EEE) +10f
00278 33834 75 2
00279 06307 88 3
00280 23816 86 1
00281 56169 79 2 bet 1 (SSE) +8f
00282 55958 77 0
00283 26399 21 0
00284 02132 93 0
00285 12613 17 0
00286 15810 56 3
00287 35675 09 0
00288 65120 59 2
00289 00737 28 3
00290 55726 20 3
00291 49495 51 2 Y-enter +7f
00292 19244 04 3 bet 3 (DDD)
00293 60477 10 1
00294 39514 93 0
00295 01299 23 2
00296 47800 03 2 bet 3 (EEE)
00297 18777 17 0
00298 11206 38 1
00299 04751 58 1
00300 55556 22 1 Y-enter +7f
00301 13877 04 3 bet 3 (DDD)
(first number is index but is different from yours; mine has 0 at index 0)
Nice find! Unfortunately, the early index numbers are very hard to hit because once the rng generator hits a seed of zero, it reseeds the game based on the clock value, it's rare that it's reseeded in the first few thousand numbers. If you can find a way to get it to reseed early enough, that'd be great. Otherwise, I encourage you to keep searching for good combinations. I just searched for instances with four DDD values. Three DDD and two EEE values works too, and there's likely another better combination out there.
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
Wow.. I have even more respect for your run now, DrD2k9. That skimmer sequence is a real pain! I've made it through a couple times, but sometimes get stuck in situations where, no matter what I do, I get hit by a rock. One thing I noticed was that in your run, you were able to do small movements and stop in the middle. How did you do that? I'm finding I can only go all the way over to one side or all the way over to the other. I can't stop in the middle or do short adjustments.
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
Radiant wrote:
On loading, random() is called twice to set v34 and v35 between 5 and 30. v34 is the delay until the next rock appears. It decrements, when it gets value 1 a rock is spawned. ... While the player is not moving sideways, random() is called each tick; there's a one-in-nine chance of something happening with your shadow. This doesn't otherwise affect anything.
Okay, I think we can work with this. Initially I thought this was bad because the rock countdowns are random, meaning when the next random call is made is random. However, that second part saves us because we can control whether or not random gets called for the shadow, simply by choosing to move or not move. I'll try another POC with the skimmer to see if it's possible to target ending at an exact seed value.
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
DrD2k9 wrote:
I don't think it's worth trying to manipulate initial seed to land on a good number when entering the slots.
I want to give it a try before writing it off. Since most random events are set, it should be fine. The big unknown is the Skimmer sequence.
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
You might also consider using the dos version. ;)
Experienced Forum User, Published Author, Active player (372)
Joined: 9/25/2011
Posts: 652
Okay, I've got my first proof of concept done. I set the seed value to 33416 before starting the slots. The result is breaking the machine in under 2 seconds: Link to video Doing this requires three extra slot pulls and six 'Y-enter' rng skips. It takes 8 frames for a losing slot pull, 10 frames for a winning slot pull and 7 frames to do a 'Y-enter' skip. In the end, this route costs 70 frames in RNG manipulation: There may be better starting seeds out there. I'll look tonight to see if I can find a better one. The big trick now is, how can you do the run to ensure you get to the slot machine with the right seed value loaded up?
1 2
12 13 14
26 27