New Game: Zooming Secretary

Use this forum to share and discuss Uzebox games and demos.
User avatar
D3thAdd3r
Posts: 2422
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: New Game: Zooming Secretary

Post by D3thAdd3r » Wed Nov 01, 2017 12:34 am

Forced it to 0 and all the symptoms you say are reproduced, with Earth 100% of the time. It makes sense the bonus crashes(I assume it doesn't immediately, but after you approach a phone for the second time), since when it teleports a phone it generates random numbers until it gets one that is a different position from it's current one. The first position is hardcoded at table 5, then PRNG rolls 0 so it goes there, then it cannot leave 0 since it can't generate anything but that and it is stuck in a while() trying to get a good value.

So I think it is safe to assume in these cases the PRNG was seeded with 0. Going forward, it seems like it is a reasonable idea for games to not directly use the entropy but instead to add it to some known decent seed. Then at least if it returns 0, things wont unexpectedly get wonky(I never did get this to happen until I forced it to 0).

Then I wonder, if this only happens on hardware for you(or maybe just *that* specific Uzebox), is the internal RC timing for your Uzebox so close that simply not enough entropy is generated? I never did extensive randomness testing on my machines. What happens if you put it in the freezer for a while before playing? :lol:

User avatar
uze6666
Site Admin
Posts: 4448
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: New Game: Zooming Secretary

Post by uze6666 » Wed Nov 01, 2017 4:48 am

I will check, but I think a 0 seeded PRNG in the current code will continually output 0, I think you just confirmed that in your post
Yeah, zero is the only value invalid in LFSRs (at least the type used in the Uzebox kernel).
BTW is this on hardware or emulator too?
Been happening my hardware...the oldest I have so far (V1.1 pcb) beside the prototype!

It works most of the time really, but I've had the snag 3 times already..sheer badluck? I don't know the cause of this, but for sure the entropy generator code should be fixed to retry again if it gets zero, well, it can happen!

For most use cases I recon the plain old "accumulator-in-the-start-menu-wait-loop" trick should be good enough. And you'll save a couple bytes of flash too. This thing was really implemented for programs like Buddah where you don't type anything or want a different Uzebox logo everything you boot type of things. Also, it was pretty cool to generate truly random number on an otehrwise deterministic MCU. :P

User avatar
D3thAdd3r
Posts: 2422
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: New Game: Zooming Secretary

Post by D3thAdd3r » Wed Nov 01, 2017 5:39 am

Thinking you are right, especially if I don't do an attract mode. If I do an attract mode, if I am honest with myself, I will likely give it minimal effort and just a few demos for which a non-random order wouldn't matter anyway. I'll stick with the simple approach here.

User avatar
Jubatian
Posts: 1355
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: New Game: Zooming Secretary

Post by Jubatian » Wed Nov 01, 2017 9:00 am

uze6666 wrote:
Wed Nov 01, 2017 4:48 am
I will check, but I think a 0 seeded PRNG in the current code will continually output 0, I think you just confirmed that in your post
Yeah, zero is the only value invalid in LFSRs (at least the type used in the Uzebox kernel).
I have a PRNG which has similar randomness to LFSR's (I did extensive testing on this), and doesn't have this limitation. It is used in FoaD for example: here. A limitation of this PRNG compared to LFSR's is that it is very difficult to find constants for it which allow it to generate a full cycle (all the 65536 possibilities for 16 bits), but I ran a brute force method on this sometime in the past, so now I have a table of all the possible constants for 16 bits. Of course it isn't such a big thing, but sometimes might be useful.

User avatar
Jubatian
Posts: 1355
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: New Game: Zooming Secretary

Post by Jubatian » Fri Dec 29, 2017 11:52 am

A few of us came together, and again, I had a real HW Uzebox at hand to play around with. We tried this game, however while it works fine, we found an issue with it: It seems very cumbersome to play it with the real SNES controller as it is quite difficult to align with the ladders. Now at home I am realizing that it works well if you try to push Up / Down along with Left / Right while walking towards a ladder, but due to the geometry of the controller, this isn't something very ergonomic to do with it (in FoaD I assigned look / fire upwards with left shoulder as well for this reason: it is easier to hold down the shoulder button while moving). It would be nice if the ladders had a wider access area.

User avatar
D3thAdd3r
Posts: 2422
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: New Game: Zooming Secretary

Post by D3thAdd3r » Fri Dec 29, 2017 11:52 pm

Still need to wrap up a couple loose ends on this one, so I will smooth it out a bit to address that issue. Thinking to just adding a whole extra tile width, since there is no downside to it really. Thank you for the gameplay feedback.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests