Wonky

People are still making stuff for the Sinclair related machines. Tell us about new games and other software that runs on the Spectrum, ZX80/ZX81, Pentagon and Next.
User avatar
Ersh
Manic Miner
Posts: 480
Joined: Mon Nov 13, 2017 1:06 pm

Re: Wonky

Post by Ersh »

Had a great run! :D Only one tiny mistake on level 4. Used some safe strats on level 3 and 5 and the time could be further improved with optimal movement, but I'm pretty satisfied with this; around 2:24! Check it out here.

Fantastic game! :)
User avatar
R-Tape
Site Admin
Posts: 6406
Joined: Thu Nov 09, 2017 11:46 am

Re: Wonky

Post by R-Tape »

Tsk—1 missed jump on level 4. Disappointed :-p

You've made me realise how lucky I got to finish any of the later levels. I didn't really know where I was going to appear next.

Peter, where are the P?s? jars? It's time for Ersh's drug test.
User avatar
Ersh
Manic Miner
Posts: 480
Joined: Mon Nov 13, 2017 1:06 pm

Re: Wonky

Post by Ersh »

R-Tape wrote: Tue Feb 26, 2019 1:06 pm Tsk—1 missed jump on level 4. Disappointed :-p

You've made me realise how lucky I got to finish any of the later levels. I didn't really know where I was going to appear next.

Peter, where are the P?s? jars? It's time for Ersh's drug test.
:lol: and probably the easiest jump in the game as well! Just glad I'm beginning to nail that first pixel perfect jump on level 4 though, lost a lot of good runs there.

I hope [mention]dfzx[/mention] doesn't change the levels too much. The shortcuts require some skill to take so I think they should be there as an option. As for the rest of the game, there's nothing random, only a timer and your own skill to hold accountable, nothing I would consider unfair. It requires practise and for such a short game I think the difficulty is spot on. :)
dfzx
Manic Miner
Posts: 682
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

Re: Wonky

Post by dfzx »

Ersh wrote: Tue Feb 26, 2019 1:36 pm I hope @dfzx doesn't change the levels too much. The shortcuts require some skill to take so I think they should be there as an option. As for the rest of the game, there's nothing random, only a timer and your own skill to hold accountable, nothing I would consider unfair. It requires practise and for such a short game I think the difficulty is spot on. :)
Ersh, I think we have to consider you a bit of a outlier. :) The fact I've never completed it at full speed myself, when I've had months to practise, probably tells you something. Some people are clearly good at this type of game - it's about timing and coordination, as opposed to puzzle solving or anything else. I think we can assume you're good at these things. :)

It was always my intention that the game was deterministic. I've seen frequent irritated comments on SC forums from players who get frustrated when randomness is added to a game which makes completion or claiming a highest score come down to chance. So I was always happy that the player should need to memorise the level and learn where teleporters, etc., take you. I think that's part of the "one more go and I'll do a bit better" sort of ethos. I don't intend to change the levels other than closing the shortcut holes and making level 3 slightly easier, hopefully just by adding or moving a block or two.

I do intend to work out why the game is faster with the music off though. Given that I use a HALT to lock it to 50fps, and there are no dropped frames, that's a bit of a mystery.
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
User avatar
Ersh
Manic Miner
Posts: 480
Joined: Mon Nov 13, 2017 1:06 pm

Re: Wonky

Post by Ersh »

dfzx wrote: Tue Feb 26, 2019 2:20 pm Ersh, I think we have to consider you a bit of a outlier. :) The fact I've never completed it at full speed myself, when I've had months to practise, probably tells you something. Some people are clearly good at this type of game - it's about timing and coordination, as opposed to puzzle solving or anything else. I think we can assume you're good at these things. :)

It was always my intention that the game was deterministic. I've seen frequent irritated comments on SC forums from players who get frustrated when randomness is added to a game which makes completion or claiming a highest score come down to chance. So I was always happy that the player should need to memorise the level and learn where teleporters, etc., take you. I think that's part of the "one more go and I'll do a bit better" sort of ethos. I don't intend to change the levels other than closing the shortcut holes and making level 3 slightly easier, hopefully just by adding or moving a block or two.

I do intend to work out why the game is faster with the music off though. Given that I use a HALT to lock it to 50fps, and there are no dropped frames, that's a bit of a mystery.
I don't think I'm particularly gifted with timing and/or coordination, just got some patience and if it's a fun challenge I usually stick to it. :)

Adding a restart key would also be a nice idea!
User avatar
djnzx48
Manic Miner
Posts: 730
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: Wonky

Post by djnzx48 »

Nicely done Ersh, it looks like you're well ahead of me! Now try running it with sound turned off as well to save time on the teleporters ;)
dfzx
Manic Miner
Posts: 682
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

Re: Wonky

Post by dfzx »

djnzx48 wrote: Tue Feb 26, 2019 8:58 pm Nicely done Ersh, it looks like you're well ahead of me! Now try running it with sound turned off as well to save time on the teleporters ;)
Aw, cr@p... That never occurred to me either!
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
User avatar
djnzx48
Manic Miner
Posts: 730
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: Wonky

Post by djnzx48 »

;)

I found a shortcut to save a couple of seconds on level 5: you can jump off the side of the screen from the rightmost spring and land on the exit platform, instead of going back through the teleporter. But it's easy to mess it up.
dfzx
Manic Miner
Posts: 682
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

Re: Wonky

Post by dfzx »

I've been trying to reproduce the "it runs faster with the music off" issue. Fail. I'm running Fuse 1.5.7; I don't have real hardware.

I load the game and on the intro screen I use a hand held stopwatch to time how long it takes him to run from one side of the screen to the other. The answer is 4.7 seconds with music both on and off. I can reproduce that quite accurately (to within a few hundredths), and it's completely repeatable.

I start the game and time how long it takes him to run along the bottom of the screen. He picks up a slowdown pill three quarters of the way along which obviously slows him down. From one side to the other takes him 6.0 seconds, music both on and off.

Can someone who sees the speed slow down when the music is on run those 2 timing tests and tell me what difference they see with the music on and off? If so, can you tell me what hardware or emulator you're using? I'd be much obliged... :)
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
User avatar
Ersh
Manic Miner
Posts: 480
Joined: Mon Nov 13, 2017 1:06 pm

Re: Wonky

Post by Ersh »

djnzx48 wrote: Tue Feb 26, 2019 8:58 pm Nicely done Ersh, it looks like you're well ahead of me! Now try running it with sound turned off as well to save time on the teleporters ;)

...

I found a shortcut to save a couple of seconds on level 5: you can jump off the side of the screen from the rightmost spring and land on the exit platform, instead of going back through the teleporter. But it's easy to mess it up.
Thanks! ;)

That's a mighty sweet skip! Risky though, I reckon one would have to get dead consistent with the rest of the game before daring the attempt so close to the finishing line.

If one would turn off the music & sound effects, use all shortcuts, no safe strats and optimal movement I think it would be possible to get pretty close to 2 minutes. Would be a pretty batty undertaking though. :P
dfzx wrote: Wed Feb 27, 2019 10:39 am I've been trying to reproduce the "it runs faster with the music off" issue. Fail. I'm running Fuse 1.5.7; I don't have real hardware.

I load the game and on the intro screen I use a hand held stopwatch to time how long it takes him to run from one side of the screen to the other. The answer is 4.7 seconds with music both on and off. I can reproduce that quite accurately (to within a few hundredths), and it's completely repeatable.

I start the game and time how long it takes him to run along the bottom of the screen. He picks up a slowdown pill three quarters of the way along which obviously slows him down. From one side to the other takes him 6.0 seconds, music both on and off.

Can someone who sees the speed slow down when the music is on run those 2 timing tests and tell me what difference they see with the music on and off? If so, can you tell me what hardware or emulator you're using? I'd be much obliged... :)
I recorded two RZX (with and without music) while letting the little guy run back and forth on the titlescreen, then replayed the recordings side by side in two windows of ZXSpin. They run at the same speed there. Then recorded two RZX while having the guy run inside the cradle (middle of the screen) over and over on the first level. They get desynchronised after a while. Also did the same on level two only this time going right while jumping on the first spring to spring section and they get desynched much faster there. Seems to fall noticeably faster as well. Maybe it has something to do with your jump routine, since they don't seem to get desynched on the titlescreen and first level if you only run on the bottom.
User avatar
Ersh
Manic Miner
Posts: 480
Joined: Mon Nov 13, 2017 1:06 pm

Re: Wonky

Post by Ersh »

I did some further testing. Like mentioned, when the guy runs on the titlescreen the game seems to move at the same speed regardless if music is on or off. However, if you start the game and let the runner go back and forth on the bottom of the first level (picking up the pill as you go) without pressing anything the two recordings will eventually desynch, but it takes quite a while. And like stated earlier; on level 2 while jumping from platform to platform without music you'll pull away with several seconds in a short span.
dfzx
Manic Miner
Posts: 682
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

Re: Wonky

Post by dfzx »

Ersh wrote: Wed Feb 27, 2019 5:17 pm I did some further testing. Like mentioned, when the guy runs on the titlescreen the game seems to move at the same speed regardless if music is on or off. However, if you start the game and let the runner go back and forth on the bottom of the first level (picking up the pill as you go) without pressing anything the two recordings will eventually desynch, but it takes quite a while. And like stated earlier; on level 2 while jumping from platform to platform without music you'll pull away with several seconds in a short span.
Thanks [mention]Ersh[/mention], I'm seeing it now. It's most obvious on the level with the red and yellow brick walls. There's a loop there, from the top, long drop, along the bottom, back again, then teleport up to repeat. With the music on he runs that loop in 14.5 seconds. With the music off it's 11.0 seconds.

At first I thought this must be due to contended memory being used somewhere I didn't think it was, but after a code review I couldn't find any such problem. So I recompiled my local Fuse build with contended memory turned off and that doesn't fix it, so it must be something else. I'll find it. :)
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
User avatar
Ersh
Manic Miner
Posts: 480
Joined: Mon Nov 13, 2017 1:06 pm

Re: Wonky

Post by Ersh »

Could it be that the game is running at 50hz without music but misses an occasional frame from time to time with music on? Have you timed it?
dfzx
Manic Miner
Posts: 682
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

Re: Wonky

Post by dfzx »

Ersh wrote: Thu Feb 28, 2019 9:38 am Could it be that the game is running at 50hz without music but misses an occasional frame from time to time with music on? Have you timed it?
I have quite extensive tracing in the code which builds trace tables and acts much like a "flight recorder" allowing me to see what's happening. It's skipping every 4th frame, which makes perfect sense because the music plays a note every 4th frame. :) I took out the music player routine and replaced it with a HALT, and the behaviour is exactly the same, so that confirms it. In fact, if you look at the timings I reported last post, 11.0 seconds is pretty much exactly 75% of 14.5 seconds - it's losing a quarter of its frames. The fact it's very regular made it non obvious, which is why I didn't spot it. I've seen occasions in development when it misses one frame intermittently, and that's fairly obvious because it hiccups as he moves.

Clearly I've added something to the main loop such that the normal processing, plus the music note, now consistently takes longer than 20ms. The fact it doesn't do it on the first 2 levels or the intro suggests it's to do with the doors or the keys, or maybe the teleporters. More interesting to me at this point is why my tracing didn't reveal it.

If it's a simple fix I'll do it for v1.0.1. I suspect, however, it's going to require quite a bit of optimisation, so I'll probably just leave it as it is.
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
User avatar
Ersh
Manic Miner
Posts: 480
Joined: Mon Nov 13, 2017 1:06 pm

Re: Wonky

Post by Ersh »

dfzx wrote: Thu Feb 28, 2019 12:02 pm I have quite extensive tracing in the code which builds trace tables and acts much like a "flight recorder" allowing me to see what's happening. It's skipping every 4th frame, which makes perfect sense because the music plays a note every 4th frame. :) I took out the music player routine and replaced it with a HALT, and the behaviour is exactly the same, so that confirms it. In fact, if you look at the timings I reported last post, 11.0 seconds is pretty much exactly 75% of 14.5 seconds - it's losing a quarter of its frames. The fact it's very regular made it non obvious, which is why I didn't spot it. I've seen occasions in development when it misses one frame intermittently, and that's fairly obvious because it hiccups as he moves.

Clearly I've added something to the main loop such that the normal processing, plus the music note, now consistently takes longer than 20ms. The fact it doesn't do it on the first 2 levels or the intro suggests it's to do with the doors or the keys, or maybe the teleporters. More interesting to me at this point is why my tracing didn't reveal it.

If it's a simple fix I'll do it for v1.0.1. I suspect, however, it's going to require quite a bit of optimisation, so I'll probably just leave it as it is.
Ah! :) It also does it on level 2. Timed from the first jump it takes ~00:33 to complete with music on and ~00:25 with music off, that conforms with what you found as well. However I'm pretty sure level 1 also drops frames, maybe not as frequent though, as in my 2 RZX experiments it takes quite a few seconds before they are out of synch. Only the titlescreen doesn't seem to drop any at all.

Yeah, if it's a consistent drop of 1 frame every fourth, it's still smooth in my book, I never noticed it anyway.
User avatar
Pegaz
Dynamite Dan
Posts: 1210
Joined: Mon Nov 13, 2017 1:44 pm

Re: Wonky

Post by Pegaz »

dfzx wrote: Sat Feb 23, 2019 10:41 am I wrote a game! Compared to most of the stuff that's released these days it's pretty awful, but I'm quite proud of it because it's the first Spectrum program I've completed since my Computer Studies O'Level project in 1985. In fact, come to think of it, it's only the second Spectrum program I've ever completed, the other one being my Computer Studies O'Level project in 1985.

It's called ZX Wonky One Key, and it's a little platformer, written in C using Z88DK and the SP1 library. It's key points:

* it's 48K only, tested under Fuse on Linux and Speccy on Windows 7 (via a virtual machine)
* it only has one control key: space, and no, you can't redefine it
* there are no baddies, mostly because I don't know how to do collision detection in SP1
* it has background music, which you'll turn off almost immediately
* it runs at 50 frames per second, achieved by virtue of there being no baddies
* it's open source, free software, licenced under GPL

There's only 5 levels, so if it takes you more than 15 minutes you're not really trying.

The pre-built TAP file is here.

The project, including source and a Wiki which other C developers might find useful, is here

Perhaps I should make clear (getting my excuses in early) that this is the only Spectrum game development project I've ever undertaken. I'm not exactly experienced at this. :) It's been a great learning exercise, and I'm looking forward to trying something else. Also, I'm not sure how well Github works as a distribution point. Any problems getting, building or playing the game, please ask.
Brilliant game, idea and execution, perfect gameplay.
You literally steal the show, with this game. :)
Great job, really.
User avatar
Morkin
Bugaboo
Posts: 3274
Joined: Mon Nov 13, 2017 8:50 am
Location: Bristol, UK

Re: Wonky

Post by Morkin »

R-Tape wrote: Tue Feb 26, 2019 1:06 pmPeter, where are the P?s? jars? It's time for Ersh's drug test.
Haha yeah, was going to say [mention]Ersh[/mention] needs to record an rzx of Rally Driver while he's 'in the zone'... :lol:

Given that there must be a few non-superhumans out there managing to complete the game, I gave it another try, and managed to reach level 3 (OK, so with a bunch of snapshots on level 2). But stupidly I didn't twig that the timer doesn't reset for each screen... Doh..! :o
Spoiler
Image
It's an addictive game though, it would be nice to finish it... And on a completely unrelated subject, 6 pages of comments and no infinite time/slowdown POKE yet? (hint, hint) ;)
My Speccy site: thirdharmoniser.com
dfzx
Manic Miner
Posts: 682
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

Re: Wonky

Post by dfzx »

Morkin wrote: Thu Feb 28, 2019 8:04 pm It's an addictive game though, it would be nice to finish it... And on a completely unrelated subject, 6 pages of comments and no infinite time/slowdown POKE yet? (hint, hint) ;)
It's compiled C. It's obviously just a Z80 program at the end of the day, but I'm not sure how easy people find unravelling the output of a compiler.

Of course, it's also open source so anyone who builds it themselves gets a copy of the symbol table. :lol:
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
User avatar
djnzx48
Manic Miner
Posts: 730
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: Wonky

Post by djnzx48 »

Try POKE 37793,24.
User avatar
Morkin
Bugaboo
Posts: 3274
Joined: Mon Nov 13, 2017 8:50 am
Location: Bristol, UK

Re: Wonky

Post by Morkin »

Nice.! Will give it a try later :D
My Speccy site: thirdharmoniser.com
User avatar
Ersh
Manic Miner
Posts: 480
Joined: Mon Nov 13, 2017 1:06 pm

Re: Wonky

Post by Ersh »

Morkin wrote: Thu Feb 28, 2019 8:04 pm Haha yeah, was going to say @Ersh needs to record an rzx of Rally Driver while he's 'in the zone'... :lol:
Yeah, had a look at that, no bloody way. :P
Post Reply