avatar_cpcitor

Educational C project: CPCRetroDev or not CPCRetroDev, that is the question.

Started by cpcitor, 18:19, 27 October 17

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

cpcitor

Hello.

A modest retrodev project.

I have a project that was not meant to be submitted to CPCRetroDev and am considering submitting it.

It's a simple board game.

So far, so good.

Contest rules.

Official rules mention "Games will be evaluated in these aspects":

Quote

  • Fun, engagement and playability
  • Technical quality
  • Artificial Intelligence
  • Music and sound effects
  • Graphical and artistic quality

Things that suggest not to submit project.

Current state of the project:


  • Fun, engagement and playability: the game is somehow a fun puzzle game, but takes a number of games to master, and currently requires playing against a human opponent.  A human next to you, no network game.  So, no instant fun, and to have fun, Bring Your Own Friend! (You have friends, do you? ;-)
  • Technical quality: it has interesting technical qualities inside (more on that below).
  • Artificial Intelligence: none here, yet it would make sense for a one-player variant like already exist on Android and desktop.
  • Music and sound effects: none, that was not the focus on the project.
  • Graphical and artistic quality: ergonomics will be good, no artistry, that was not the focus on the project.

Temporary screenshots, ergonomics will be better in final game.
[attachimg=1]
[attachimg=2]
[attachimg=3]


So, what's the point of the project? What is interesting in it?

Educational: open-source

Code is meant to be released as open-source on github, most certainly with MIT license.

Educational: uses one of the recommended C toolchains

Game is built upon cpc-dev-tool-chain and should build easily on your PC, produce CDT, DSK etc without manual step.  Just type code, compile and run.

Disclosure: I wrote cpc-dev-tool-chain and am grateful to Francisco Gallego (lronaldo) for taking is as a starting point to develop CPCTelera.

Educational: fully written in portable C code, project structure segregates platform-specific areas

Game is fully written in portable C.  The project can be equally compiled for the CPC or a modern platform.

No platform mix mess! There's not even a platform-related #ifdef. (Actually, there used to be one that I ditched today with a simple refactoring as it was not necessary.)

This works by writing only portable code in main project, then segregating a few ad-hoc platform-specific functions into platform-specific subdirectories.  Some low-level, some high-level, as needed by the simple project.  The result is clean, lean, fast, and educational.

The original motivation is clean code and ease of debug.  I actually ran it and debugged it on my local 64-bit OS with modern tools.  Note that current modern-platform runtime is not intended to be pretty-looking, only to work enough to be used for a debug session, and for that printf and scanf are the base.  One could port it to SDL or whatever.  When compiled on CPC, printf and the like are not called, firmware and write to screen memory instead. Again, educational value.

Makefile and project structure is very simple and pragmatic.  Only there are still one or two hacks.  I'm considering improving the build system by introducing clean out-of-source build (for example https://stackoverflow.com/questions/39015453/building-c-program-out-of-source-tree-with-gnu-make ).

Also, by default make builds on both platforms, so any time you mix non-portable code in portable area, you get an immediate compilation failure and fix your code to keep the pattern. (This happened to me when preparing the screenshots  :laugh: ) Again, educational value.

Educational: clean, minimal, readable C source code.

The C source code is very educational.


  • It is written very cleanly yet with parsimony as suited for a retro platform.
  • Code uses relevant data structures and types (C struct, signed/unsigned).
  • Code uses relevant C patterns, structured programming, function parameters, etc.
  • Respect the DRY principle (don't repeat yourself): nearly no magic variables or implicit relationships.  Values that depend on other values are nearly always resolved at compile time, allowing static arrays that just fit and won't overflow.
  • Relevant variable usage: local scope, static, const, a few global variables when that makes sense.
  • Relevant usage of assert() to spot bugs early and save debugging time (and it did!).
  • C preprocessor macros (#define mymacro(args) code...) are used when it makes sense due to C limitations with respect to compile-time computation, or to have high-performance generated ASM yet keeping a hihly readable C source code.
  • Anyone can study generated ASM to see that clean C code can produce excellent ASM code (short and to-the-point, high-performance).

Additionally, graphics handling is very simple and conforms to above patterns.

Assert power! When the runtime finds bugs for you.
[attachimg=4]

Educational: not totally trivial game mechanics

At each move, the program performs some kind of area fill, like CPC BASIC 1.1 fill command.

This needs either recursivity or dedicated data structure.  Recursivity yields simplest source code and works flawlessly.

Again, source code reability is favored, and yet runtime performance is excellent.

Future steps


  • One-player mode against AI? Would make the game more fun, not change educational value a lot.
  • Fancy graphics? Would not enhance educational value.
  • Music? Would an 8-bit port of "
    Sail by Awolnation" on a calm board game enhance educational value? ;-)
  • A totally different project with 3D landscape graphics (would not enhance educational value of this project).

Question


  • Does it make sense to submit this to the competition?
  • Rules seem to favor flashy arcade-style games, which is nice, yet this programe would make a humble item.
  • Perhaps wait one more year and submit one with AI (loses one year worth of studying current source code, I might not have time to write an AI for next year)?
  • Perhaps wait one more year and submit one with fancy graphics (loses one year worth of studying current source code, wouldn't that dilute educational value)?
  • It wouldn't even deserve a special mention (no music, not so funny, no AI).  There's not educational mention in the rules.

Perhaps submit to another contest with explicit rules favoring educational value, at least in special mentions?

Thank you for your attention.
Had a CPC since 1985, currently software dev professional, including embedded systems.

I made in 2013 the first CPC cross-dev environment that auto-installs C compiler and tools: cpc-dev-tool-chain: a portable toolchain for C/ASM development targetting CPC, later forked into CPCTelera.

awergh

I would say if you are happy with what you have produced than go for it and submit it.
This assumes that you are not looking to maximise your score in order to be satisfied.


I don't see that a game that has some learning curve and requires a friend to play is less playable however it may not be for everyone.
Which I guess in itself is the problem with trying to distill things like gameplay down to a score because it can ultimately be a bit subjective.


It is true that this would be a fantastic way to address the AI rule however I'm not sure I would wait a year because there is no telling whether the rules will be the same next year.


I am very curious to see your code especially about making it truly portable and using assert().


Are there any other competitions? There is a game I would really like to write (a clone of another game) but it didn't feel like the right place to submit a clone.


Either way I would suggest if you are happy and are not looking to maximise your score (the rules may not go in your favour next year) then submit it and I'm sure people will be able to appreciate what you made.

AMSDOS

Correct me if I'm wrong, though I think the problem is once you've submitted a game, it becomes difficult to submit another version of the same game.

It would be good to know what other contests could have Amstrad programs submitted. Apart from this one I'm only familiar with the BASIC 10-Liners Competition.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

cpcitor

Thank you awerg, AMSDOS, for your replies.

If I know that students find some interest in reading its source code and make better code themselves, that is fine with me. With that mindset, submitting to the contest is mainly useful to bring visibility to the project to maximize educational value.

Quote from: AMSDOS on 03:08, 28 October 17
Correct me if I'm wrong, though I think the problem is once you've submitted a game, it becomes difficult to submit another version of the same game.

I've seen that CPCRetroDev rules have relaxed a bit over the years regarding what we can publish about the project without disqualifying it, and that's a very good evolution of the rules.

Yet indeed, it would be a pity if I submit the two-player version without AI and next year I cannot e.g. submit a more powerful one-player-vs-AI version because the appearance of the game feels déjà-vu enough to disqualify it.

I'm gonna ask Francesco.
Had a CPC since 1985, currently software dev professional, including embedded systems.

I made in 2013 the first CPC cross-dev environment that auto-installs C compiler and tools: cpc-dev-tool-chain: a portable toolchain for C/ASM development targetting CPC, later forked into CPCTelera.

ronaldo

Well, @cpcitor, this is more a set of deep thoughts than a question :) . As always, your view is really interesting.

#CPCRetroDev was not thought to be educational in the sense you are thinking in this post. It was thought initially to motivate students and community members to create games. Educational part comes from the experience in game development: project management, low-level understanding and coding, and so on.

Having source code developed to be educational is deeply interesting, but not only for #CPCRetroDev. I agree with you in thinking that such code deserves "publicity" (increased chance to meet appropriate audience). #CPCRetroDev will give it some promotion, in the same way as it does for all participants. However, I think that will be just a bit of what such development deserves. I would think of other ways to promote it, beyond #CPCRetroDev.

In essence, I think:

       
  • It is worth considering submitting such a project to #CPCRetroDev, in order to bring some public exposure.
  • It clearly will be a humble item, as rules have the "game-as-a-product" point of view. However, making clear its focus and contribution as a product will make judges consider its value. It won't probably raise its final result, but it will surely spread a good feeling amongst evaluators and public.
  • AI could be a different point. If there is no AI at present moment, I would rather not make a 3-days effort to add it. I don't think it would raise its value. I would consider AI arquitecture and programming as a different contribution, may be for next year.
  • For fancy graphics I would seek a colaborator. Your focus has a great value and nice graphics can enhance interest in the product. But I won't spend personal time on it. It's better to find some expert in the field to make it more appealing. Same for music :) .
  • Educational mention has been considered by organizing comittee, but not from source-code point of view, but from game-content's. Even interesting, I don't see source-code itself being considered for a mention in the near future.
Why not submitting this year's production and planning another contribution for next year? Building upon results of this contribution is a great way of improving educational impact of future productions. Also, contributing is a way of making other people in the organization considering your point. #CPCRetroDev itself is thought in a different way, but that doesn't mean that your point of view does not help rethinking and improving :) .

Independently of your decission, I would like to personally thank you for your contributions. CPC-dev-tool-chain is an amazing contribution: my students have used it in the past with great success and CPCtelera would probably not exist without its inspiration. Please, continue being so helpful and with that great focus on open-source and education :) .

Powered by SMFPacks Menu Editor Mod