Page 1 of 1

Pseudo pixel game prototype.

Posted: Sun Nov 06, 2022 11:16 pm
by rax
After making the font, i decided to try if it could also be a game with these 16 characters.
it's just a prototype, I don't know if it will become a finished game

Here is the result:

Sprites:
sprites.png
sprites.png (11.4 KiB) Viewed 3755 times

Level:
levelMap.png

Code:
https://github.com/raxrax/oricOsdkPseudoPixelsGame

Game:
alt4x4GameProto.tap
(8.99 KiB) Downloaded 97 times

Re: Pseudo pixel game prototype.

Posted: Mon Nov 07, 2022 7:37 pm
by ibisum
At first I was like, "wtf rax, you turned my Oric into a ZX81" but then I was like .. 'but you could add colour!' :)

Cute graphics, neat engine and some interesting potential .. curious to see about that colour, though.

Re: Pseudo pixel game prototype.

Posted: Mon Nov 07, 2022 11:18 pm
by rax
Yes! The desired effect was close to the ZX81.

Here's a pathetic attempt at coloring. I think it can be a hundred percent better, but it needs a lot of work .
(there are also glitches that I couldn't easily fix).

Re: Pseudo pixel game prototype.

Posted: Tue Nov 08, 2022 11:08 am
by ibisum
Well, it ain't no SWIV, but its surely something that I could see evolving to be a very playable shooter... whats with the top-line character mess, though?

Re: Pseudo pixel game prototype.

Posted: Wed Nov 09, 2022 10:32 pm
by rax
ibisum wrote: Tue Nov 08, 2022 11:08 am Well, it ain't no SWIV, but its surely something that I could see evolving to be a very playable shooter... whats with the top-line character mess, though?
Top-line character is a glitch. I didn't have time to fix it.

I'll never be able to do anything like SWIV. I had started something similar and never finished it.

Re: Pseudo pixel game prototype.

Posted: Thu Dec 22, 2022 10:03 am
by jbperin
Thank you very much Rax for the realease of this source code.

As usual with your code I find it is neat, inspiring and so smartly designed that it is enjoyable to read.

Big Up !!

I made a little screencap of the color version with my new friend the Oric 2.5 animated gif feature :
2022-12-22-09420068.gif
2022-12-22-09420068.gif (246.17 KiB) Viewed 2311 times

Re: Pseudo pixel game prototype.

Posted: Fri Dec 23, 2022 6:38 pm
by applepie
Very very cool demo ! So 8bitish ;-)

There's magic in LORES 1, might inspire me !

What tool did you use to convert the png files to .c data (https://github.com/raxrax/oricOsdkPseud ... ster/res.c) ?

Re: Pseudo pixel game prototype.

Posted: Wed Dec 28, 2022 7:46 am
by jbperin
applepie wrote: Fri Dec 23, 2022 6:38 pm
What tool did you use to convert the png files to .c data (https://github.com/raxrax/oricOsdkPseud ... ster/res.c) ?
I don't know what tool master rax used to convert PNG into .c array. But I can show you some similar things written in Python.

https://github.com/oric-software/castor ... ure2buf.py

With the code generator being here:

https://github.com/oric-software/castor ... codegen.py

If ever it can help.

Re: Pseudo pixel game prototype.

Posted: Wed Dec 28, 2022 8:10 am
by coco.oric
on my side, i've discover this lores mod with Rax post.
Then going deeper on the subject, based on std alt set, i've created an excel file to draw a lores pic, and generate some basic lines & c description of the screen

Re: Pseudo pixel game prototype.

Posted: Wed Dec 28, 2022 8:54 am
by jbperin
In case it can help, I had made a little tool to generate alternate charset from images.

It take an area from a black and white image in 240*224 pixel and create a charset to reproduce this image (and optimize the chaset size by reusing already defined characters).


The generated C code uses this function that changes an alternate character in the Oric memory:

Code: Select all

void change_char(char c, unsigned char patt01, unsigned char patt02, unsigned char patt03, unsigned char patt04, unsigned char patt05, unsigned char patt06, unsigned char patt07, unsigned char patt08) {
    unsigned char* adr;

    adr      = (unsigned char*)(0xb800 + c * 8);
    *(adr++) = patt01;
    *(adr++) = patt02;
    *(adr++) = patt03;
    *(adr++) = patt04;
    *(adr++) = patt05;
    *(adr++) = patt06;
    *(adr++) = patt07;
    *(adr++) = patt08;
}
And here's the python script that create an alternate character from a preformatted image and generates the code to put the alternate charset in the memory and displays the image on the screen.
extractAltCharset_example.zip
(4.81 KiB) Downloaded 84 times
From an image below (240*224 px to match Oric screen dimension):
chateau.png
chateau.png (431 Bytes) Viewed 2060 times
it generates the code:

Code: Select all

void screen() {
change_char(33 , 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0);
change_char(34 , 0x0, 0x0, 0x1, 0x3, 0x6, 0xb, 0x18, 0x14);
... Long list of character definition
change_char(61 , 0x0, 0x10, 0x18, 0x2e, 0x1e, 0x1e, 0xc, 0x0);

*((unsigned char *)LORES_SCREEN_ADDRESS+0*40+2)=33;
*((unsigned char *)LORES_SCREEN_ADDRESS+0*40+3)=33;
... Long list of screen writing
*((unsigned char *)LORES_SCREEN_ADDRESS+4*40+11)=33;
}
If it can help ....

Re: Pseudo pixel game prototype.

Posted: Wed Dec 28, 2022 9:00 am
by jbperin
But the most stunning stuff I have ever seen about the alternate charset is master rax's H3 LIB

https://forum.defence-force.org/viewtopic.php?t=2186

Dynamically changing alternate charset to create a graphical area within text screen .. just amazing ..

Re: Pseudo pixel game prototype.

Posted: Wed Dec 28, 2022 9:07 am
by iss
applepie wrote: Fri Dec 23, 2022 6:38 pmWhat tool did you use to convert the png files to .c data ...
The right answer here is pictconv from OSDK ;).

Re: Pseudo pixel game prototype.

Posted: Wed Dec 28, 2022 9:12 am
by jbperin
User manual of Pictconv is here.

Re: Pseudo pixel game prototype.

Posted: Wed Dec 28, 2022 10:59 am
by Dbug
jbperin wrote: Wed Dec 28, 2022 9:00 am But the most stunning stuff I have ever seen about the alternate charset is master rax's H3 LIB

https://forum.defence-force.org/viewtopic.php?t=2186

Dynamically changing alternate charset to create a graphical area within text screen .. just amazing ..
It's similar to what we did in Barbitoric



Basically, each time you see the same effect duplicated on the screen, it's most probably using charsets reconfiguration instead of HIRES

Re: Pseudo pixel game prototype.

Posted: Wed Dec 28, 2022 12:07 pm
by Symoon
... And with Metromov lonnnnng ago ;)
https://www.oric.org/software/metromov-2480.html

Re: Pseudo pixel game prototype.

Posted: Wed Dec 28, 2022 1:39 pm
by jbperin
Well .. yes ... I see what you all mean .. :D

One thing that stunned me in the H3 lib, is the nice packaging behind a very understandable API providing ultra convenient graphical routine (such as circle lines text ...)

But I admit that some nasty demo makers :twisted: had allways made isane usage of this technic. :shock:

Re: Pseudo pixel game prototype.

Posted: Wed Dec 28, 2022 6:34 pm
by Dbug
Well, you don't technically need the API,
my 256 bytes "circles" intro uses CIRCLE to draw things in HIRES, and then it's copied to the charset and displayed in TEXT.

It's not as fast as drawing directly in the charset, but on the other hand 100% of the existing HIRES commands do work.



Re: Pseudo pixel game prototype.

Posted: Thu Dec 29, 2022 10:47 am
by Chema
Also, Oricium is all text mode. All sprite masking & animation is done by redefining characters. Even the pixel scroll in the starfield.

And the radar at the bottom.

The code is in the repo, if you're interested.

Re: Pseudo pixel game prototype.

Posted: Fri Dec 30, 2022 4:40 pm
by jbperin
Dbug wrote: Wed Dec 28, 2022 6:34 pm uses CIRCLE to draw things in HIRES, and then it's copied to the charset and displayed in TEXT.

It's not as fast as drawing directly in the charset, but on the other hand 100% of the existing HIRES commands do work.
Because that's a kind of magic to me, I consider it is witchcraft :lol:

It reminds me of a sophisticated bit alignment tricks in character adressing in the charset that you had talked to me about .. but I can't remember the details. Anyway nice effects

Re: Pseudo pixel game prototype.

Posted: Fri Dec 30, 2022 6:09 pm
by Dbug
The only magic is the system flag that allows the ROM to access to draw the HIRES command despite being in TEXT mode.

After it's just a matter of copying whatever is in $A000 to the charset area.

Re: Pseudo pixel game prototype.

Posted: Fri Dec 30, 2022 7:30 pm
by xahmol
First Dbug, please ignore me reporting your post, answered using the wrong button again. Of course I meant the quote button instead of the report button.

Second: with your explanation it is suddenly so simple.
I am exploring more and more those nice demo techniques in 6502 assembler for different machines (but still seriously lack time to proceed fast in it)

Re: Pseudo pixel game prototype.

Posted: Tue Jan 10, 2023 12:45 am
by Bodhi
Interesting that nowadays people seem to be able to get a lot more out of a wide variety of computers than they did back then. :D

Re: Pseudo pixel game prototype.

Posted: Tue Jan 10, 2023 8:06 am
by Dbug
Bodhi wrote: Tue Jan 10, 2023 12:45 am Interesting that nowadays people seem to be able to get a lot more out of a wide variety of computers than they did back then. :D
No, it's totally logical:
- All the documentation is available
- All the hardware qwirks are known
- There are emulators with built-in debuggers
- Cross compiler/assemblers are much more powerful and faster than original native hardware
- You can brute force a lot of things (color reduction, data compression, ...) using modern computers
- And using cross builds means you can use 100% of the memory of the target computer, you don't have to reserve any memory for your assembler or debugger.

Re: Pseudo pixel game prototype.

Posted: Tue Jan 10, 2023 4:00 pm
by Bodhi
Dbug wrote: Tue Jan 10, 2023 8:06 am
Bodhi wrote: Tue Jan 10, 2023 12:45 am Interesting that nowadays people seem to be able to get a lot more out of a wide variety of computers than they did back then. :D
No, it's totally logical:
- All the documentation is available
- All the hardware qwirks are known
- There are emulators with built-in debuggers
- Cross compiler/assemblers are much more powerful and faster than original native hardware
- You can brute force a lot of things (color reduction, data compression, ...) using modern computers
- And using cross builds means you can use 100% of the memory of the target computer, you don't have to reserve any memory for your assembler or debugger.
Yes, you are right. I did not have this in mind. So I'm looking forward of new games to come. My abilities are limited to a little BASIC. :-)
Now I have to refresh and expand my french I learned at school to read all the magazines ;-)

Re: Pseudo pixel game prototype.

Posted: Tue Jan 17, 2023 4:23 pm
by rax
I missed this discussion.
I will try to explain as soon as possible.

Re: Pseudo pixel game prototype.

Posted: Tue Feb 14, 2023 2:20 pm
by rax
applepie wrote: Fri Dec 23, 2022 6:38 pm Very very cool demo ! So 8bitish ;-)

There's magic in LORES 1, might inspire me !

What tool did you use to convert the png files to .c data (https://github.com/raxrax/oricOsdkPseud ... ster/res.c) ?
I wanted to experiment with 3x4 pixels and see what could be achieved with them.

The tools I use are several. I mostly use Pictconv (as ISS mentioned), TILED, GIMP, and sometimes, if I need to do some quick converts, I write in Bash, Lua, C, PHP

Getting the sprites works like this:
- Define standard sprites that are one character with 2x2 pixels. https://forum.defence-force.org/downloa ... hp?id=3331
- Use sprites to create meta-sprites that are 3x3 sprites, i.e., 6x6 pixels (3x3 chars). https://forum.defence-force.org/downloa ... hp?id=3337

The level is made from the meta-sprites using TILED.
The maps and my various experiments can be seen in the archive below.

(*.tmx *.tsx - these are extensions of the TILED program)

Re: Pseudo pixel game prototype.

Posted: Thu Feb 16, 2023 12:32 pm
by applepie
Pretty cool, thanks for the insights !

I'm on a similar boat with Ldtk, Piskel and Ruby ;-) But not already on the Lores world, trying to figure out how to do !