Jump to content
IGNORED

Cubiks (Rubik's Cube)


Andrew Davie

Recommended Posts

I've added a "flattened" view - accessible by press/release of the button.  The transition between screens is a bit flakey; I'll fix that soon.  Seems to be an issue with the double-buffer flipping, which is also possibly evident when rotating whole cube.

 

Controls: button press/release = toggle between iso and overview 

button held/LEFT-RIGHT = rotate whole cube

LEFT-RIGHT = rotate current layer

UP/DOWN = change selected layer

 

1617610291_ScreenShot2021-12-03at3_04_45pm.thumb.png.4340082ad2f238064a7d4766bd4282a2.png

 

 

 

cubiks20211203b.bin

 

 

Edited by Andrew Davie
  • Like 3
Link to comment
Share on other sites

For the most part this version fixes the glitches in toggling between flat and isometric views.

I also found/fixed the "shear" when you rotated the whole cube. There are still a few issues but I think you'd be hard pressed to spot them.

 

cubiks20211203c.bin

 

Updated:

cubiks20211203e.bin

Edited by Andrew Davie
Link to comment
Share on other sites

I had a bit of fun doing a 'transition' between isometric and flat mode. Just because.

Works pretty well; I think it's kinda cool.

 

 

cubiks20211204.bin

 

Edit: Minor update making the particles originate closer to the big cube center...

 

 

 

cubiks20211204c.bin

Edited by Andrew Davie
  • Like 7
Link to comment
Share on other sites

13 minutes ago, Andrew Davie said:

I had a bit of fun doing a 'transition' between isometric and flat mode. Just because.

Works pretty well; I think it's kinda cool.

Very cool looking effect! It reminds me of the animations of technical diagrams that go into exploded views.

 

Link to comment
Share on other sites

5 hours ago, Andrew Davie said:

I had a bit of fun doing a 'transition' between isometric and flat mode. Just because.

Works pretty well; I think it's kinda cool.

 

Very cool effect. It is those, seemingly unnecessary, "fun bits" that add personality to a game and playing it an experience. ?

Edited by r_type2600
Link to comment
Share on other sites

I had many hours of frustration trying to find simple bugs. Eventually I tracked it down to C-variables being "stomped on" by assembler variables. Or more to the point I had overlapping variable areas and thus modifications to one set corrupted another set. The symptoms were bizarre and took me a long long long long time to find/fix.  All good now.

 

So, I thought "what if you could also control/rotate faces in flat view?"  SO I had a go at implementing that and although this is just a very early prototype, I think it looks good.  Essentially I start with the big cube, then get to the flat view (button press/release) and then wait for all the facet to move into place (I have this slowed down so I can clearly see what's happening).... once that settles down, then...

 

I press LEFT, to rotate the leftmost face (group of 9 facets) anti-clockwise.  You can actually see it rotating all the facets into the new orientation - on ALL of the faces. It's weird how it all moves around, but that's what happens on an actual cube. This is all hardwired for just a single turn at the moment, and only on that first face.  But now I now it's working I can get all the other combinations working OK. Will take a lot of fiddling, but should be good.  

I'm particularly impressed with how the rotating looks, given it's extremely low resolution and only a few playfield pixels across.  Although it doesn't keep perfect "square" shape, I'm really quite happy with the effect/visuals here.  To give a good look at what's happening in the video, I repeated it all a number of times (iso view-> flat view-> wait for a bit -> rotate face left).
 

 

cubiks20211206.bin

  • Like 3
Link to comment
Share on other sites

I got my actual hardware setup up and running again, and plonked the binary on a HarmonyCart to see how it would look.  I had a fair expectation that it would run OK, as I trust emulator accuracy - particularly Gopher - which said it was fine. Anyway, it runs and I'm quite pleased at how the cube still looks like a cube on the TV; and it takes up most of the screen. Stable picture.  The colours are different, which has me a bit stumped.  No doubt we'll find the reason in versions to come.

 

IMG20211206173221.thumb.jpg.071b0f251be4ecc53076dc772bda589f.jpg

  • Like 1
Link to comment
Share on other sites

3 hours ago, Andrew Davie said:

I got my actual hardware setup up and running again, and plonked the binary on a HarmonyCart to see how it would look.  I had a fair expectation that it would run OK, as I trust emulator accuracy - particularly Gopher - which said it was fine. Anyway, it runs and I'm quite pleased at how the cube still looks like a cube on the TV; and it takes up most of the screen. Stable picture.  The colours are different, which has me a bit stumped.  No doubt we'll find the reason in versions to come.

 

IMG20211206173221.thumb.jpg.071b0f251be4ecc53076dc772bda589f.jpg

I can post a picture from a PAL Atari 2600 displayed on a real CRT if that helps?

Link to comment
Share on other sites

4 minutes ago, Bomberman94 said:

I can post a picture from a PAL Atari 2600 displayed on a real CRT if that helps?

Thanks, but my TV is smart enough to let me set the colour signal type (2xNTSC variants, or PAL), and I'm definitely passing it a NTSC signal on a NTSC machine... so I think a PAL picture won't be too diagnostic. However, having said that I aways like seeing pictures of my software running on others' hardware!  Just don't go out of your way :)

 

  • Like 1
Link to comment
Share on other sites

3 hours ago, Andrew Davie said:

I got my actual hardware setup up and running again, and plonked the binary on a HarmonyCart to see how it would look.  I had a fair expectation that it would run OK, as I trust emulator accuracy - particularly Gopher - which said it was fine. Anyway, it runs and I'm quite pleased at how the cube still looks like a cube on the TV; and it takes up most of the screen. Stable picture.  The colours are different, which has me a bit stumped.  No doubt we'll find the reason in versions to come.

 

IMG20211206173221.thumb.jpg.071b0f251be4ecc53076dc772bda589f.jpg

On reflection, the colours are actually correct -- see emulator snapshot below in the same orientation.

It's just that the TV is showing them much much more washed out and brighter.  I need to tone down/adjust the colours a lot.

 

570389988_ScreenShot2021-12-06at9_05_01pm.thumb.png.ae9d8e436fa80bfab3ed41665642e0d8.png

 

Link to comment
Share on other sites

Here is a hardwired PAL version that looks OK on emulators. It will be switchable soon - this is just a quick'n'dirty.  Untested on hardware as I don't have a PAL machine setup right now.  Although the frame rate is lower (50Hz vs 57Hz for NTSC), the animation is faster because the draw systems have more spare time to do things in "idle" time. It looks pretty good to me!

 

2133098803_ScreenShot2021-12-06at11_15_23pm.thumb.png.6be9dde704990aa6878c2294a471aa2a.png

cubiks20211206PAL.bin

  • Thanks 1
Link to comment
Share on other sites

38 minutes ago, Andrew Davie said:

Here is a hardwired PAL version that looks OK on emulators. It will be switchable soon - this is just a quick'n'dirty.  Untested on hardware as I don't have a PAL machine setup right now.  Although the frame rate is lower (50Hz vs 57Hz for NTSC), the animation is faster because the draw systems have more spare time to do things in "idle" time. It looks pretty good to me!

 

2133098803_ScreenShot2021-12-06at11_15_23pm.thumb.png.6be9dde704990aa6878c2294a471aa2a.png

cubiks20211206PAL.bin 32 kB · 2 downloads

Many thanks - will test/check for sure (even if Thomas is faster ?). 

  • Like 1
Link to comment
Share on other sites

The faster I can draw the whole cube, the faster I can do the animation (rotations). The cube is drawn in lots of little bits, and with as many little bits drawn per frame as possible.... so the smaller the bits and the faster I can draw those bits, the faster I can animate in terms of FPS. This is an optimised version running significantly faster - I removed wasted space in the "bits" to make them smaller, which in turn allows me to reduce the minimum time needed when deciding if I can draw a "bit" or not.  That time used to be 15 "units" (TIM64 cycles).  Now it's down to 11 "units".  It's all very complex... that doesn't mean it's running 11/15ths faster. It just means that statistically it's much more likely that it will draw one or two more "bits" per frame. The cube rotation is starting to look "smooth" rather than clunk... clunk... clunk.

 

 

 

cubiks20211207.bin

  • Like 4
Link to comment
Share on other sites

I've now removed the "hardwired" colours of the faces, and this version has an internal "cube". When you rotate layers/faces the facets all move to the correct positions, as can be seen when you switch to flat view (button press/release).  Of course it's all a bit boring right now because you can only rotate layers in the horizontal. So now I need to work on the other two axes, knowing that the basic functionality of cube rotation is working.

 

In the background, some of the '2600's high tension thinkers are working on CDFJ support for the PlusCart.  I hope to be able to release a version that will run on PlusCart in the not too distant future.  You can follow the progress on that in this thread: 

 

 

 

Meanwhile, as you can see in that thread... I've made the full source code of Cubiks available.

see https://github.com/andrew-davie/Cubix

 

 

 

cubiks20211209.bin

 

 

 

  • Like 3
Link to comment
Share on other sites

I increased the gap between the layers just one ChronoColour(TM) pixel, to make the cube less vertically squashed-looking.

I think it's an improvement. Image shows side-by-side comparision, in Gopher on the left, and Stella on the right.

Also a good comparision of the colour usage of the two emulators.  Stella is a fair bit more saturated, it seems.

 

1138444671_ScreenShot2021-12-10at12_49_51am.thumb.png.09c368fe4e01c8f3beb6f380b8a86c3f.png

cubiks20211210.bin

  • Like 6
Link to comment
Share on other sites

@Thomas Jentzsch has made the necessary changes to the build process, and Stella, and @JetSetIlly has done some amazing upgrades of the Gopher emulator to support diagnosing CDFJ issues.  So it looks at this point that @Al_Nafuur's PlusCart now supports CDFJ.  But there's a "gotcha!" and that is that the PlusCart and the Harmony Cart use different ARM processors, and the physical memory location of code and variables is different on each of these.  So, a CDFJ game can either be written for the ARM LPC2000 (Harmony Cart) or for the ARM STM32F408VGT6 (PlusCart). Not a single binary for both. The capability of the CDFJ appears to be identical - that is, the same game can run on either - but the code needs to be recompiled by the author to switch between the two different ARM processors. There is no automatic converter available at this stage.

 

So, that's a bit of a dilemma - literally, two options. I could provide two versions every time I release a binary (one for the Harmony Cart, another for the PlusCart).  That's a bit of a pain. Or, I could stick to just one (which will run by newer versions of both Stella and Gopher emulators) and one of Harmony Cart or PlusCart. I'd be inclined to stick to the PlusCart, in that case.  

 

Along the way, though, some standardised header files were produced by @Thomas Jentzsch, and the principles of writing "cross-platform" code established. So it should be much easier for those using CDFJ from now on to produce binaries for both cartridge/processor types.

  • Like 3
Link to comment
Share on other sites

2 minutes ago, Thomas Jentzsch said:

I vote for Harmony, just because Stella support for STM32F has not been released yet. And it will probably take some time until it is.

 

I agree.

 

Also, it would be nice to come up with a build system that produced both binaries at the same time.

  • Like 3
Link to comment
Share on other sites

Just now, JetSetIlly said:

Also, it would be nice to come up with a build system that produced both binaries at the same time.

Yup. And someone should look into my headers and find out how to switch builds for a CPU at one central place. Currently you have to edit 3 files, IMO a central setting should be part of the makefile.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...