Author Topic: The chain shot challenge  (Read 14249 times)

0 Members and 2 Guests are viewing this topic.

JRS

  • Guest
Re: The chain shot challenge
« Reply #15 on: December 20, 2014, 02:13:35 PM »
Quote
I was just curious to see such problems solved in languages as basic/C/Fortran/Pascal etc ...

You might get more mileage if you also create a http://rosettacode.org/ task (Charles is active there.) to expand your reach. I don't think a project like this exists there at the moment.

Charles Pegge

  • Guest
Re: The chain shot challenge
« Reply #16 on: December 21, 2014, 02:52:07 AM »

Here is my o2 16 x 16 chain shot, with red,blue, gold and silver balls.

It is not intended to be a game of frustration, and is best played intuitively to get the lowest clicks and the least spheres left over.  I managed, by sheer luck, and a little strategy, to eliminate all 256 spheres in 66 clicks! :)

included source codes and binary:


.

RobbeK

  • Guest
Re: The chain shot challenge
« Reply #17 on: December 21, 2014, 10:57:47 AM »
Hi Charles,  :)

Maybe a version to play with 3 (4 ?)  -- to the left , to the right (up ? )
A 3D model is also easy to make (only 2 directions extra ) - but the interface has to be smart to look through the cube/pyramid.

good show,

Rob

RobbeK

  • Guest
Re: The chain shot challenge
« Reply #18 on: December 21, 2014, 11:02:07 AM »
ChainShot XMas style now  ::)

It can be used to play - the same board can be reloaded (in case others want to try) , and Lisp also plays the game
-- I found a very deep profound algorithm   (that plays worse than one iteration deep  ;D   

Maybe updated if I find something better ...


best Rob

.

Charles Pegge

  • Guest
Re: The chain shot challenge
« Reply #19 on: December 21, 2014, 12:44:04 PM »
Yes, the 3-dimensional game is fun too.  :)

I'm using OpenGl's pick system - any visible named object can be identified. So interior balls can be picked if you can see them through the gaps. The whole block rotates slowly about the vertical axis.




.

Charles Pegge

  • Guest
Re: The chain shot challenge
« Reply #20 on: December 21, 2014, 05:31:37 PM »
Chain Shot 8 x 8 x 8

Left-click  for vertical compaction
Right-click for compaction in the xz plane

Best scores so far:

67 clicks 1 ball remaining
43 clicks 3 balls remaining


Binary and source code included:

.

Mike Lobanovsky

  • Guest
Re: The chain shot challenge
« Reply #21 on: December 21, 2014, 07:31:40 PM »
Charles,

That last one is ... gorgeous! :D

Thanks a lot!

.

Mike Lobanovsky

  • Guest
Re: The chain shot challenge
« Reply #22 on: December 21, 2014, 07:49:58 PM »
Rob,

Your Xmas one is very, very cool as well! You've been restricted just a little bit by this multi-language mess that distracts you from the presentation side of this otherwise very entertaining challenge. Thank you for your submission too! :)

Mike Lobanovsky

  • Guest
Re: The chain shot challenge
« Reply #23 on: December 22, 2014, 04:25:25 AM »
Hi Charles,

That JPEG picture above looks like your 3D scene has a pronounced DOF (depth of field) blur effect. If that's true then why don't I see the same in the game proper?

Charles Pegge

  • Guest
Re: The chain shot challenge
« Reply #24 on: December 22, 2014, 05:19:10 AM »
Hi Mike,

Congratulations on your excellent score of 43 :)

The image is a 50% quality jpeg snapshot (Ctrl-P) - naturally blurry when taken from a small window.

I think focal blur would be very expensive - even with graphics hardware support.

RobbeK

  • Guest
Re: The chain shot challenge
« Reply #25 on: December 22, 2014, 06:56:08 AM »
Thanks Mike,

Looking great Charles (slow on my pc, but then everything is slow there).
What's that Chaos lib ?
Starting something similar now -- the problem is the coordinate picking (but asked Petr in the mean time)  -- think i'm going to work with wireframed and solid objects at the same time....

best Rob

Mike Lobanovsky

  • Guest
Re: The chain shot challenge
« Reply #26 on: December 22, 2014, 08:34:10 AM »
@Charles:
Quote
I think focal blur would be very expensive - even with graphics hardware support.
IIRC it needs 3 or 4 render passes per frame. So, if the scene isn't overpopulated (and that one certainly isn't), the FPS rate will still be very high even in the full-screen mode.


@Rob:
Quote
slow on my pc, but then everything is slow there
That's most probably because your PC is using Windows original software OpenGL renderer. If your computer isn't an old-fashioned laptop, then perhaps you could find and buy yourself a cheap second-hand nVidia graphics card for some 10 to 15 euros that would suit perfectly your existing low-frequency CPU. nVidia still offers quite satisfactory hardware-accelerated OpenGL drivers for its old lower-end products under Windows 7.

RobbeK

  • Guest
Re: The chain shot challenge
« Reply #27 on: December 22, 2014, 10:12:12 AM »
Hi Mike,

It's on old Intel Card (64 Mb iirc) - no drivers for Win7 , but I installed a hack from the XP drivers.
My wife has an Hp Pavilion -- mainly for Twitter and facebook ;D

best Rob ( c new post)

Mike Lobanovsky

  • Guest
Re: The chain shot challenge
« Reply #28 on: December 22, 2014, 11:16:06 AM »
Rob,

That Intel is certainly a no-go. I'd be surprised if it would launch an OpenGL application at all.

You can keep an eye on these pages at eBay and find yourself a low-cost add-on nVidia (better) or ATT (worse) card istallable in an expansion slot of your motherboard. Naturally you will have to first find out exactly what kind of extension slots are available on your motherboard.

If you can post here a clear picture of your PC innards here so that its motherboard slots are seen, then perhaps I will be able to advise you on what particular nVidia card makes you should be looking for.

Charles Pegge

  • Guest
Re: The chain shot challenge
« Reply #29 on: December 22, 2014, 12:34:04 PM »
Hi Rob,

Picking involves interleaving a special render, with a very small viewport at the mouse position, then collecting all the labelled (glLoadName) objects whose surfaces appear within this view. The object with the nearest (lowest depth)  surface, is the one chosen.

All this stuff is deployed in inc/openglsceneframe.inc. If I had to do it again from scratch, I would struggle like a complete novice :). But you are welcome to use it in any shape or form. Pick is the integrating keyword to look for.




inc/chaos.inc contains pseudorandom, chaotic, interpolation and noise frequency functions.