Welcome, Guest. Please login or register.


Author Topic: Use of character modes for games? (Read 6256 times)

Offline ssr86

  • EP user
  • *
  • Posts: 355
  • Country: pl
Use of character modes for games?
« on: 2015.September.21. 21:11:20 »

Just a rant I guess. Maybe someone has some experirnce with these topis and could share...

Unfortunately I don't find the modes very useful for an ingame engine for a more graphic game...

The problem for using the character modes in games is the unfortunate lack of hardware sprites... This narrows the possible uses for the modes. That's because you have to share font matrices with sprite-building blocks. This way you limit the number of different objects/animation frames that can be used...
And you would need to constantly copy another animation frame's building-block to the font memory (but good only for the main character; when more enemies and every object in a different animation frame then you run out of characters... could not true for smaller sprites I guess).

There are games like Astro Marine Corps or Invasion of Zombie monsters for other z80 computers that "emulate" a character based mode. However this "emulation" takes down the limit of possible font sets per line etc. But this is not as fast and optimal as a real character mode could be.

Offline endi

  • EP addict
  • *
  • Posts: 7298
  • Country: hu
  • grafikus, játékfejlesztõ, programozás, scifi, tudományok, vallás
    • Honlapom
Re: Use of character modes for games?
« Reply #1 on: 2015.September.21. 21:34:55 »
did you read the hungarian topic "Karakteres grafikus módok"?
I have some demos with character modes (bit only the 2 color mode), but in that topic I try to make something in little used "4 colored character" modes

your questions: I think 256 character is enough to make fake sprites but you need to make very complex code
Vigyázat! Szektás vagyok! :)

Offline endi

  • EP addict
  • *
  • Posts: 7298
  • Country: hu
  • grafikus, játékfejlesztõ, programozás, scifi, tudományok, vallás
    • Honlapom
Re: Use of character modes for games?
« Reply #2 on: 2015.September.21. 21:35:52 »
from the other topic, a little graphics in basic + the strange char mode :)
Vigyázat! Szektás vagyok! :)

Offline ssr86

  • EP user
  • *
  • Posts: 355
  • Country: pl
Re: Use of character modes for games?
« Reply #3 on: 2015.September.21. 22:13:15 »
did you read the hungarian topic "Karakteres grafikus módok"?
I have some demos with character modes (bit only the 2 color mode), but in that topic I try to make something in little used "4 colored character" modes
Will take a look:)
Quote
your questions: I think 256 character is enough to make fake sprites but you need to make very complex code
Could you write some more about the needed code mechanism?

Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14722
  • Country: hu
    • http://enterprise.iko.hu/
Re: Use of character modes for games?
« Reply #4 on: 2015.September.22. 09:03:44 »
Look the Panic Man from geco. And Boulder Dash conversions from IstvanV (these are the non Spectrum versions).

Offline geco

  • EP addict
  • *
  • Posts: 7082
  • Country: hu
    • Támogató Támogató
Re: Use of character modes for games?
« Reply #5 on: 2015.September.22. 15:22:33 »
And you can use more character map for a character game, for example 1st third of the screen uses 1 character map, 2nd third of the screen another character map, and 3rd third of the screen a third version of character map, in this case you have 3*256 (or 3*128, or 3*64) characters based on the definitions, even there is a crazy solution, every character row has it's own character set :D

Offline ssr86

  • EP user
  • *
  • Posts: 355
  • Country: pl
Re: Use of character modes for games?
« Reply #6 on: 2015.September.22. 22:09:45 »
The problems I see are:
- ep characters are only 1 byte in width (?...or so I think I remember reading) so only 2 pixels in pixel-16; you'd need at least two chars to get a standard 4x8 font - this somewhat halves the number of chars in a set
- you'd need to reserve some chars in every set for each character-sprite, so that you can copy the needed sprite blocks in them (so for example you use quarter/half a set for background tiles and the rest is reserved for sprite-tiles)
- managing the sprites and font sets would be hard and a lot of data moving invloved... or so I think

for smaller sprites maybe that'd not be all that bad but for more and bigger sprites...quite problematic I guess... Although I'm very curious how much better (if any) it would be than pixel modes speed- and memory-wise

Quote
did you read the hungarian topic "Karakteres grafikus módok"?
I have some demos with character modes (bit only the 2 color mode), but in that topic I try to make something in little used "4 colored character" modes
I have big problems understanding what the google translator is trying to tell me.:(
Most of the time I just skim through most of them and run all attached files...:oops:

Look the Panic Man from geco. And Boulder Dash conversions from IstvanV (these are the non Spectrum versions).
beautiful press fire/hiscore table screen
« Last Edit: 2015.September.22. 23:10:10 by ssr86 »

Offline geco

  • EP addict
  • *
  • Posts: 7082
  • Country: hu
    • Támogató Támogató
Re: Use of character modes for games?
« Reply #7 on: 2015.September.23. 10:29:58 »
The problems I see are:
- ep characters are only 1 byte in width (?...or so I think I remember reading) so only 2 pixels in pixel-16; you'd need at least two chars to get a standard 4x8 font - this somewhat halves the number of chars in a set
- you'd need to reserve some chars in every set for each character-sprite, so that you can copy the needed sprite blocks in them (so for example you use quarter/half a set for background tiles and the rest is reserved for sprite-tiles)
- managing the sprites and font sets would be hard and a lot of data moving invloved... or so I think

1st point: there are 4 pixels in one character, because in character mode 4 colours/character available in 160x200 resolution, and if I remember well maximum 8 colours can be used in the same time in a character row in CHR64 mode.
2nd point: yes :)
3rd point: if the screen is splitted to 3 part, it can be managed easily.

beautiful press fire/hiscore table screen
The truth is that, the character set is from Sub hunter, and I used the bubbles which I made also into Sub Hunter based on C64 version.

Offline ssr86

  • EP user
  • *
  • Posts: 355
  • Country: pl
Re: Use of character modes for games?
« Reply #8 on: 2015.September.23. 20:40:47 »
1st point: there are 4 pixels in one character, because in character mode 4 colours/character available in 160x200 resolution, and if I remember well maximum 8 colours can be used in the same time in a character row in CHR64 mode.
"In the character modes, LD2 points to a character font and LD1 points to the character codes to be displayed. One character code is read, and the font byte for it fetched, in each slot, allowing up to 42 characters per line. VRES should always be clear for character modes. The three character modes vary only in the number of characters in the font, and therefore the amount of RAM required for the font. Ch128 will be used as an example in this description, the other two modes follow trivially."
oops:oops:
The note about vres is just so that you don't draw only the first line, right?
But it says that all three char modes differ only in the required memory for the matrices... Are there no other features?
« Last Edit: 2015.September.23. 20:47:51 by ssr86 »

Offline geco

  • EP addict
  • *
  • Posts: 7082
  • Country: hu
    • Támogató Támogató
Re: Use of character modes for games?
« Reply #9 on: 2015.September.24. 09:03:57 »
The note about vres is just so that you don't draw only the first line, right?
But it says that all three char modes differ only in the required memory for the matrices... Are there no other features?
Yes, because in this mode the character map is read from the memory for each scan line it is the same, and the pointer is changing in the character set.
Yes,
in CH256 mode you can use color0,color1 pair from the palette
in CH128 mode you can use color0,color1, and color2,color3 pair from the palette
in CH64 mode you can use color0,color1, color2,color3, color4,color5, and color6,color7 pair from the palette
in 2 colour mode.

There is a feature also, in 2 colour graphics mode you can use more colours by using MSBALT, LSBALT bit of margin bytes, and if I remember well ALTIND0/1 has also effect, but may be i have wrong.

Offline ssr86

  • EP user
  • *
  • Posts: 355
  • Country: pl
Re: Use of character modes for games?
« Reply #10 on: 2015.September.26. 09:55:24 »
Watched "invasion of zombie monsters" for the msx.
https://www.youtube.com/watch?v=_tOdSysOyy4
(Ep could pull a perfect msx conversion with its character modes in 2color lpixel.
I wonder if the authors would kindly share the source code with the person who would want to do such conversion...)

The game has "small" sprites - they're max 3x3 chars (excluding the bosses). And the variety of the enemies per level is small too. So it'd be easier to "manage" the character sets I guess... But what about a game with sprites at least 2 times bigger (the main character) and say - also more variety in the enemy sprites (although already having them bigger would already make it more difficult I guess)...

Unfortunately (?) the character modes are the next best thing (?) for fast games (although jerky) when no hardware sprites are available... However the best is to have both;P... like the c64 scene shows.

 

Offline endi

  • EP addict
  • *
  • Posts: 7298
  • Country: hu
  • grafikus, játékfejlesztõ, programozás, scifi, tudományok, vallás
    • Honlapom
Re: Use of character modes for games?
« Reply #11 on: 2015.September.26. 10:12:30 »
wow that msx game is amazing!
and as I read, msx has z80 too. so we dont need the source codes
Vigyázat! Szektás vagyok! :)

Offline IstvanV

  • EP addict
  • *
  • Posts: 4822
Re: Use of character modes for games?
« Reply #12 on: 2015.September.26. 11:28:56 »
in CH256 mode you can use color0,color1 pair from the palette
in CH128 mode you can use color0,color1, and color2,color3 pair from the palette
in CH64 mode you can use color0,color1, color2,color3, color4,color5, and color6,color7 pair from the palette
in 2 colour mode.

It is actually possible to use ALTIND0/ALTIND1 in all video modes, including even PIXEL modes. Unlike LSBALT and MSBALT, these do not clear the bits they use, so it is possible to have 4 pairs of colors in 2-color CH256 mode:
- characters 0 to 63 will use colors 0 and 1
- characters 64 to 127 will use colors 4 and 5 (ALTIND0)
- characters 128 to 191 will use colors 2 and 3 (ALTIND1)
- characters 192 to 255 will use colors 6 and 7 (ALTIND0+ALTIND1)

Offline endi

  • EP addict
  • *
  • Posts: 7298
  • Country: hu
  • grafikus, játékfejlesztõ, programozás, scifi, tudományok, vallás
    • Honlapom
Re: Use of character modes for games?
« Reply #13 on: 2015.September.26. 13:59:55 »
including even PIXEL modes.

hm I must try this
Vigyázat! Szektás vagyok! :)

Offline Mobsie

  • Beginner
  • *
  • Posts: 27
  • Country: de
Re: Use of character modes for games?
« Reply #14 on: 2015.September.27. 14:45:57 »
My Scramble Demo on the Creativision with Scrolling use also a Char-Mode because the TMS9928 chip, same as in MSX I and Colecovision, has no hardware scrolling.

https://www.youtube.com/watch?v=lvdcr4mt8jU

In my Shamus game i use also a Char-Mode, also for the shot etc.

https://www.youtube.com/watch?v=1zuG2HPaL2k

Mobsie