New cross-platform game: H-Tron

Other misc things
Post Reply
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

New cross-platform game: H-Tron

Post by RobertK »

I have now released the first cross-platform version of my little game "H-Tron" that I had initially ported to the ZX81 (from Borland Turbo C on DOS):

https://sourceforge.net/projects/h-tron/

Currently ten target systems are supported:

Sinclair ZX81
Jupiter Ace
Mattel Aquarius
Philips P2000
Philips VG5000
Robotron Z 1013
Robotron Z 9001 (KC 87)
Tandy TRS-80
EACA EG2000 Colour Genie
VZ 200 / Laser 310

As you can see, I prefer rather obscure machines. :) Other criteria were the availability of blocky low-res graphics and either ANSI or native console support.

Usability of the two-player-mode is currently very limited on all systems other than the ZX81 because the status of two buttons cannot be checked simultaneously. This is why an in_KeyPressed() function would be nice to have on at least some non-Sinclair Systems as well.

I hope that my source code will help other newcomers making their first steps into z88dk programming (I have learned a lot from other people's programs). I have also included a "simple source" version (non-portable for ZX81 only) that is much easier to read than the portable one.

Here are a few screenshots:

Image
Sinclair ZX81


Image
Jupiter Ace


Image
Philips P2000


Image
Philips VG5000


Image
Tandy TRS-80


Image
EACA EG2000 Colour Genie
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

well done, it is nice to see some of the single machine 'style' emerging among the ports :)
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

Nice work! I think there's in_KeyPressed for Jupiter Ace and VZ200. I've been planning to do VG5k for a while as well.
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Post by RobertK »

Great, I have updated my game, so now the Jupiter Ace and VZ200 versions also have a useable 2-Player mode.

Just keep us informed when the VG5000 or maybe some other systems get their in_KeyPressed() function.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

I've just committed VG5k support. I've updated the joystick() function to use the actual joysticks as well (https://github.com/z88dk/z88dk/issues/779)
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

Other criteria were the availability of blocky low-res graphics
Well...

I just added c_plot, c_unplot, c_xorplot and c_point functions that emulate the low-res graphics on platforms that have a higher resolution. It's a bit of a cheat since it actually plots 16 underlying pixels, but it might allow you to run HTron on other machines - your test program runs on the Colecovision for example.
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Post by RobertK »

I have just updated the Sourceforge project and uploaded a new release of my game:

2018-07-10:
- New targets supported:
Casio PV-1000
ColecoVision
Exidy Sorcerer
Mitsubishi Multi 8
Samsung SPC-1000
Triumph Adler Alphatronic PC
- VG5000, TRS-80, EG2000, Aquarius: new keyboard input method makes the two-player mode usable
- VZ 200 / Laser 310: "Visible Cursor Problem" (that occured occasionally) hopefully solved
- Bugfixes: correct random seed initialization, automatic round restart (on some systems, without space or 0 pressed) fixed

On the SPC-1000, the speed of the game is unfortunately quite erratic, the game is not really playable like that. I am not sure if this is maybe a feature of the Takeda emulator. Fans of that system are of course invited to improve my source code. :)

@dom: in the ColecoVision and Multi8 versions you can see how c_plot() performs. This is indeed a very useful addition, with only a few additional lines of code we can port a low-res game to a high-res system.
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Post by RobertK »

New release is out:

2018-07-22:
- New targets supported:
Bandai RX-78
Casio PV-2000
Nascom (*)
Sinclair ZX Spectrum


(*) The Nascom is not powerful enough for this game, only two-player mode runs at decent speed.
Fabrizio
Member
Posts: 115
Joined: Tue Jul 11, 2017 9:28 pm

Post by Fabrizio »

Cool project!

Consider supporting 6809 and 6502 architectures with CMOC and CC65 compilers.
CC65 now supports low res graphics on all Commodore systems.
CoCo/Dragon have pseudo-graphics characters to implement low res graphics.

Maybe something can be done about the Nascom target. Is it much slower than the ZX81?
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Post by RobertK »

Thanks! I was already thinking about using cc65 too because I will soon run out of Z80 targets. :-) So far I have only made a little C64 hi-res graphics test with cc65, but nothing else.

What would be the right place to ask cc65-related questions? Is there a cc65 forum like this one?

Maybe I didn't search for it properly, but the documentation for cc65 is a little confusing for beginners...
A systems overview list as we have it for z88dk would be nice to have.

> CC65 now supports low res graphics on all Commodore systems.

What is the low-res equivalent for our plot() function? Let's say on the VIC20?

The first step will be to get my plot test (see here for an older version) running on the CC65 systems.

> Maybe something can be done about the Nascom target. Is it much slower than the ZX81?

Now I am no longer sure whether the Nascom is really such a so slow machine. Maybe the z88dk display routines for that target still have potential for optimization? We had a similar problem with the Camputers Lynx: first it was running very slowly, but then Dom was able to dramatically improved the display routines, resulting in more speed than I need for my game.
The Nascom is a really interesting target that would deserve its z88dk code to be revisited...
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

I've had a look at the Nascom and can see the following:

- Printing text is really fast (it pretty much just appears)
- Demo mode Htron is a little sluggish

I've changed the graphics handling to go via gencon rather than have a separate bit of code and graphics appear to be a little faster - the demo mode is now a bit more fluid. The fact that the target is a 3x2 in each character block does make things a bit slower than than the 2x2 targets, but the display routine is so simple that it should make up for it!

However, by the sounds of things I don't think what I'm seeing is representative of the experience that you're seeing - it seems like the emulators (or builds of) both of you are using are significantly slower than one I'm using.

It's probably time for video clips to see if there is a difference!
Post Reply