Page 1 of 1

CraPONG! v1.1 Experimental software in BASIC compiled

Posted: Tue May 28, 2019 7:44 pm
by eurocamsuite
CraPONG! arises from an idea that occurred to me recently while I was in bed trying to sleep, or rather, thinking how I could animate the pixel a tennis paddle to mount a simple pong in the Spectrum BASIC with pixel by pixel shift, Knowingly, that all the original PONGs were developed in assembly code in its entirety, or even, in plates without a processor using electronic components and logic circuits in the first generation. Finally, on the night of May 26, I got to it and what I am presenting to you is the fruit of my digital lucubrations and also of my insomnia.

I must confess that with this simple development I have removed a thorn that I have always had nailed and also, a strong curiosity to know if something similar to a PONG could be done, probably the most relevant game in the history of the game, using only the BASIC of the ZX-Spectrum. Development still has a path of optimization because the code is primordial, but according to the result obtained it seems that it is possible, although the last word is yours.

Image

When I came up with the idea, I must admit that I had some doubts about BASIC's ability to achieve the goal but I was also convinced that this was the only possible way to move the palettes (blocks) pixel by pixel. Then, as far as the physics of the ball and the logic of the game are concerned, the native compiler MCODER3 and its succulent vitamin contribution did the rest.

The project is super basic, simple, spartan and probably very boring to play, but you will see that the purpose was not to create a video game itself but to experiment with a new technique and the code, still unpolished, does not allow for more. Not in vain, the version I am posting is compiled with our beloved MCODER3 and runs even in a 16K. The font occupies about 2KB and once compiled with the code added by the compiler its memory weight barely exceeds 7KB.

Web del proyecto #5 in ZXOPENSOURCE (SNA, TAP, Z80, source, manual, etc...) :
https://calentamientoglobalacelerado.ne ... rce/#prj05

Re: CraPONG! v1.1 Experimental software in BASIC compiled

Posted: Wed May 29, 2019 1:33 pm
by zxbruno
This is very interesting, thank you!

There are a few Sinclair Basic demos on YouTube that show pixel scrolling but I've never seen the listings and don't know how it's done. I also remember seeing topics demonstrating horizontal text scrolling in Basic. I may have seen UDG pixel scrolling as well, and in all these cases the listing was never compiled. The only problem is that I can't find any of those topics right now. :| I read SCF and WOS forums but also follow the Spectrum Basic Facebook group. It's getting increasingly difficult to remember where something was posted.

Re: CraPONG! v1.1 Experimental software in BASIC compiled

Posted: Wed May 29, 2019 3:43 pm
by Joefish
Is that done with UDGs or with pixel plotting?

Vertical pixel movement with UDGs is a fun one. I've seen something similar with a rotating counter effect.

For the counter, you define your UDGs as the numbers 0-9 and then 0 again. So when you print the first one you get a 0.
Then you POKE the UDGs system variable to one byte higher, and when you print it again it appears to have scrolled up 1 pixel. Keep going and it scrolls through the digits 0..9 and round to 0 again.

For small characters, you define the first, third, etc. as empty. Then you print character 'B', with 'C' underneath. Your image appears in the 'B' space and the 'C' under it is empty. Then you subtract one from the UDGs system variable and print them again. The image in 'B' will have moved down a pixel into the 'C' space. The top of 'B' is filled in with a blank line from the empty 'A' UDG. So you're printing 'B' and 'C', but after 8 steps 'A' and 'B' has slid down into the 'B' and 'C' position.

It means POKEing the system variable every time you want to print a character, but you can make it easy on yourself by moving it to a 256-byte boundary so you only have to adjust the lower byte of the address.

To pixel scroll left/right you need multiple copies of the graphic, pre-shifted left to right in 1 or 2-pixel steps, just as you would in machine code. You can combine this with the previous trick to get anywhere-pixel-positioning, but it wastes a lot of memory on all those empty spaces.

Re: CraPONG! v1.1 Experimental software in BASIC compiled

Posted: Wed May 29, 2019 8:52 pm
by eurocamsuite
This technique is totally innovative, at least it is certain that I have not seen it before. It occurred to me a few days ago.
This technique does not use GDUs to achieve vertical movement of the rackets or free movement of the ball, so the size of the BASIC source code does not exceed 2 KBytes. I only use high resolution BASIC native commands and you can download the program without compiling from my zxopensource website.

Soon I will publish a document to explain in detail this simple technique, although at the moment it will be in Spanish only, but you can always use an automatic translator;)

regards 😃

Re: CraPONG! v1.1 Experimental software in BASIC compiled

Posted: Thu May 30, 2019 12:43 am
by ZXDunny
It's pixel plotting (or rather, DRAW using INVERSE to un-draw the top/bottom lines as the paddles move vertically) and using CIRCLE (with INVERSE again to remove the ball as it moves) it's compiled so it does move smoothly though.

The small m/c stub at the end appears to modify the font.

Image

Re: CraPONG! v1.1 Experimental software in BASIC compiled

Posted: Tue Jul 02, 2019 6:28 am
by d2010
eurocamsuite wrote: ↑Tue May 28, 2019 7:44 pm CraPONG! arises from an idea that occurred to me recently while I was in bed trying to sleep, or rather, thinking how I could animate the pixel a tennis paddle to mount a simple pong in the Spectrum BASIC with pixel by pixel shift,
The main problem , is speed-of-Ball to high w/ith speed-of-racket. How to speed-up the speed of Racket?
:P

Re: CraPONG! v1.1 Experimental software in BASIC compiled

Posted: Tue Jul 02, 2019 10:00 am
by ZXDunny
Change the LET y=y+1 and LET y=y-1 statements in lines 10 and 20 respectively to add/subtract larger values, but you might find that you get stray lines of pixels above/below the paddles.

Re: CraPONG! v1.1 Experimental software in BASIC compiled

Posted: Tue Jul 02, 2019 10:06 am
by djnzx48
You could also try putting something like FOR n = 1 TO 2: NEXT n surrounding the paddle up/down routines so they execute twice or more in succession. That would avoid problems with the line drawing.

Re: CraPONG! v1.1 Experimental software in BASIC compiled

Posted: Tue Jul 02, 2019 10:30 am
by d2010
djnzx48 wrote: ↑Tue Jul 02, 2019 10:06 am You could also try putting something like FOR n = 1 TO 2: NEXT n surrounding the paddle up/down routines so they execute twice or more in succession. That would avoid problems with the line drawing.
You see here..Your game is very-good.Do you like this sinous-hide?
Thanks for Mr. Beeper sound-Like.
https://youtu.be/fc4W1vBWNqA?t=147

Re: CraPONG! v1.1 Experimental software in BASIC compiled

Posted: Tue Jul 02, 2019 11:29 am
by hikoki
Not a bad idea at all, Mr-Pixel! A Pong based on geometrical theory of gravity and flipping between different non-Euclidean geometries, a sort of Pinball Pong where the player can morph the spacetime maze. Each player could transform just his end or the opponent's one.

Re: CraPONG! v1.1 Experimental software in BASIC compiled

Posted: Tue Jul 02, 2019 1:37 pm
by ZXDunny

Re: CraPONG! v1.1 Experimental software in BASIC compiled

Posted: Tue Jul 02, 2019 3:25 pm
by Ralf
Interesting stuff. It flickers a little but seems smooth anyway.

One comment - PONG isn't first computer game in history. At least Spacewar! (https://en.wikipedia.org/wiki/Spacewar! ) is older and there are probably more.

Re: CraPONG! v1.1 Experimental software in BASIC compiled

Posted: Tue Jul 02, 2019 3:39 pm
by ZXDunny
The first video game came out before there were any computers.

Re: CraPONG! v1.1 Experimental software in BASIC compiled

Posted: Tue Jul 02, 2019 7:22 pm
by hikoki
Nice! Let the player change his racket colour and associate each colour to one of these trajectories
Image
Image
In addition, let these trajectories remain on the screen for a while so the ball gets deflected with ATTR. In practice, a sort of plasmapong-like shooting.
Players could also throw planets to the field, any number up to spending a mass of about seventy suns. Just like this ha!
Spoiler

Re: CraPONG! v1.1 Experimental software in BASIC compiled

Posted: Mon Jul 08, 2019 9:43 pm
by eurocamsuite
The truth is that I've been trying to accelerate the blades by increasing the displacement to 2 pixels, but then a disadvantage of playability arises, the artificial intelligence of the CPU becomes invincible.

Given this situation, I added some elements (defenses and forwards dribblers!!) in each field to get some more uncertainty in the game.
It seems that I have achieved it, but I will continue experimenting soon.

Thanks to everyone for the interest and for your interesting comments!

Image

This project is hosted in:
https://calentamientoglobalacelerado.net/ZXopensource/

Re: CraPONG! v1.1 Experimental software in BASIC compiled

Posted: Tue Jul 16, 2019 6:31 pm
by eurocamsuite
Experimenting with the possibilities of vectorial animation in BASIC-ZX I have managed to move a filled circle to the pixel with relative fuidez.

Image

In fact, this softness is achieved thanks to the combination of the power of the compiler MCODER3 with the technique used in CraPONG that allows to redraw and erase only the contours of the objects that we want to move.

I will document on my website https://calentamientoglobalacelerado.net/ZXopensource/, although it is quite simple.


regards!!

Re: CraPONG! v1.1 Experimental software in BASIC compiled

Posted: Thu Aug 08, 2019 9:22 pm
by eurocamsuite
New experimental software derivative from CraPONG!...

https://youtu.be/TYJFSJHM7UY

[media]https://youtu.be/TYJFSJHM7UY[/media]

Re: CraPONG! v1.1 Experimental software in BASIC compiled

Posted: Thu Aug 08, 2019 9:40 pm
by llewelyn
ZXDunny wrote: ↑Tue Jul 02, 2019 3:39 pm The first video game came out before there were any computers.
What about 'Hunt the Hurkle'? I know that was on the mainframe at the London College of Printing in the late 60's if memory serves? I definitely remember the name but I'm not entirely sure about the date. It was on the Middlesex Polytechnic mainframe in 1980 I do know.

Re: CraPONG! v1.1 Experimental software in BASIC compiled

Posted: Thu Aug 08, 2019 11:12 pm
by ZXDunny
llewelyn wrote: ↑Thu Aug 08, 2019 9:40 pm
ZXDunny wrote: ↑Tue Jul 02, 2019 3:39 pm The first video game came out before there were any computers.
What about 'Hunt the Hurkle'? I know that was on the mainframe at the London College of Printing in the late 60's if memory serves? I definitely remember the name but I'm not entirely sure about the date. It was on the Middlesex Polytechnic mainframe in 1980 I do know.
The earliest video game (because it used a screen to display the action rather than output to blinking lights to indicate a status) was "Tennis for two" and was created in 1958 - and was played on an oscilloscope.

https://www.bnl.gov/about/history/firstvideo.php