supplierdeeply

Improved Reversi

  • 3 Replies
  • 475 Views
Improved Reversi
« on: 28 / September / 2018, 06:58:01 »
Advertisements
Hey!  I'm new here.  But I've been messing with CHDK on my own for a while.  I've worked on improving the gui_reversi.c game to become familiar with game programming on the camera.

What I've done to it is:
* Removed the A...H and 1...8 position indicators
* Changed the board colors
* Increased the board size
* Removed (almost) all flicker
* Made the AI more interesting, and maybe smarter
* Cleaned up the source code

It also compiles to a smaller binary and runs faster.  I'd love if people would try it out and comment.  The code is at:

https://github.com/glurk/chdk-reversi

For anyone to try out.  I'm hoping to start on a "Checkers" game based on some of this work.  Any comments appreciated, thanks!

*

Offline srsa_4c

  • ******
  • 3695
Re: Improved Reversi
« Reply #1 on: 29 / September / 2018, 16:56:11 »
I'm okay with most of the changes, except for the following:
- The status display is not placed correctly on DIGIC 6 cameras (see attached screenshots). The overlay on these is either 640x480 or 720x480, when using the LCD. Unlike on previous cameras, the pixels are square.
  I'm not sure what would be the best way to support 640x480 - either shrink the grid or modify the arrangement of the status display.
- It would be preferable to avoid drawing in gui_reversi_kbd_process(). This function is called from the keyboard task (physw), usually 100 times per second.
  Drawing should take place in gui_reversi_draw() which is called from spytask at a much lower frequency. Physw and spytask are independent tasks, running in parallel.

Re: Improved Reversi
« Reply #2 on: 02 / October / 2018, 06:42:13 »
@srsa_4c

Thanks for the feedback.  I've implemented your suggestions but I only have a SD1000 (360x240) to work with.  Please take a look at my updated code on GitHub and see what you think.  Are 360x240, 640x480 and 720x480 the only possible resolutions, or are there others?

It appears that to do things "right" will require editing the language / translation files.  I don't know how to even try to do that...

Also, the AI is still work-in-progress and right now it's bad.  Working on it.  I tried to focus on fixing the display issues mostly.

Thanks for your time.

*

Offline srsa_4c

  • ******
  • 3695
Re: Improved Reversi
« Reply #3 on: 02 / October / 2018, 17:42:25 »
I've implemented your suggestions but I only have a SD1000 (360x240) to work with.  Please take a look at my updated code on GitHub and see what you think.
I think the reworked status display looks even better than the original. 
Quote
Are 360x240, 640x480 and 720x480 the only possible resolutions, or are there others?
IIRC, some older models may have a bit less horizontal resolution (352x240), but that should not be a problem with the current layout. There are a few models with a wide LCD, 480x240.
I think that's all. There are some newer models with different/higher resolution LCD (or EVF?), but those have not been ported. The overlay becomes significantly larger when a HDMI monitor is used, but I don't think anyone would want to play games like that.

Quote
It appears that to do things "right" will require editing the language / translation files.  I don't know how to even try to do that...
core/gui_lang.h, CHDK/lang/*.lng
You could probably reuse the string IDs that are no longer necessary (159, 160, 162). 161 should probably lose the padding spaces. The white and black strings can be copied from 162 for all languages. Alternatively, you could use actual colors rather than printing their names.


 

Related Topics