Doodle

Anything QL Software or Programming Related.
stevepoole
Super Gold Card
Posts: 716
Joined: Mon Nov 24, 2014 2:03 pm

Re: Doodle

Post by stevepoole »

Hi Folks,

Here are the final Doodle updates, now I have returned from summer vacation. Hope you enjoyed them, as I will have little time for programs for some months.

Pise_bas and Skew_Whiff_bas: use MODE 4 only. Eyefull2_bas now worls fine on QLs, in MODE 8, with QDOS overflows CLEARed.

So there you have it : All Doodles now tested on QPC2 v 5.00, on three PCs with different clock rates, and QL SGC, under QDOS and SMSQ/E.

Perhaps I should aquire another Emulator too for completeness. Does anyone know How many users have QPC2 or other emulator systems ?

Steve.
Eyefull2_bas.zip
(604 Bytes) Downloaded 83 times
____________________________________________________________


stevepoole
Super Gold Card
Posts: 716
Joined: Mon Nov 24, 2014 2:03 pm

Re: Doodle

Post by stevepoole »

Hi Folks,

Just decided to do a little Doodle before the end of my holiday break. A simulation of blowing Soap Bubbles.....

Unzip, LRUN and watch, or ESCape !

Regards, Steve.
Bubbles.zip
(1.11 KiB) Downloaded 69 times


stevepoole
Super Gold Card
Posts: 716
Joined: Mon Nov 24, 2014 2:03 pm

Re: Doodle

Post by stevepoole »

Hi, Here's a couple of screen-shots : Steve.
Capture d’écran (98).png
Capture d’écran (95).png


stevepoole
Super Gold Card
Posts: 716
Joined: Mon Nov 24, 2014 2:03 pm

Re: Doodle

Post by stevepoole »

Hi Again,
Here is a much more fluid version, after simplifying and removing quite a few lines of code....

This will probably be the final version. Should work on most platforms. (Tested under QPC2).

Regards, Steve.
Bubbles2.zip
(1.05 KiB) Downloaded 74 times


stevepoole
Super Gold Card
Posts: 716
Joined: Mon Nov 24, 2014 2:03 pm

Re: Doodle

Post by stevepoole »

Hi,

Just managed to reduce the code from 3ko down to 2ko, by compacting the bubble-loop from 28 lines down to a mere 4 lines....

The original 7 bubble stream may now be up to 28, so the animation is even more realistic. (Hit ESCape to halt).

It is surprising what can be done using the much underrated but very versatile Turtle graphics !

So I will continue experimenting with them, and see what I can discover ?

Regards, Steve.
Bubbles3.zip
(993 Bytes) Downloaded 70 times


stevepoole
Super Gold Card
Posts: 716
Joined: Mon Nov 24, 2014 2:03 pm

Re: Doodle

Post by stevepoole »

Hi Folks,
Just been thinking about how many 'sprites' can be manipulated simultaneously under QPC2.

So I cobbled together a quick program which can handle at least 64 at once.

Not yet tried on my JS QL or SGC, but I will have a go later today...

The routine began as a simulator of Brownian motion, but changed somewhat as It went along....

Modify the 'sprites' using different font designers, and concatenate them for bigger units ?

Regards, Steve.
Brownien.zip
(1.05 KiB) Downloaded 56 times


stevepoole
Super Gold Card
Posts: 716
Joined: Mon Nov 24, 2014 2:03 pm

Re: Doodle

Post by stevepoole »

Hi again,
Just tested the Brownian 'sprites' program on SGC under Qdos & SMSQ/E, with a monochrome monitor.

Some changes were necessary, so here is a version which works, (allbeit slowly on SGC).

On SGC, use less sprites, on line 170 let Q=RND(1 to 16)*2, and line 840 (n+32) instead of (n+21). Chr$ from 21 to 191 are mostly printable

You can reduce screen size on line 140 p= 1 up to 8... for faster conclusion sequences.

This version has got rid of flickering, and I will try to condense code, if possible, but collision testing slugs things a lot !

Possible use : a screen-saver. Regards, Steve.
Brownien2.zip
(1.05 KiB) Downloaded 54 times


User avatar
dilwyn
Mr QL
Posts: 2761
Joined: Wed Dec 01, 2010 10:39 pm

Re: Doodle

Post by dilwyn »

Nice work Steve. Runs nicely on QPC2, I like the circular 'explosions' when the objects collide.

I tried this version on Q68, in QL screen modes (high colour modes would have been slower). It ran, but slowly. Even with the SGC mods it was still a little short of acceptable speed with any decent number of objects.

Is it meant to always show just 2 objects when you first run it? If I run it a second time, I get many more objects.

Some years ago, I tried to write a set of text sprite routines in BASIC, as procedures so that it was possible to write your own animation routines using redefined text font characters as sprites. It took longer than I expected, and struggled to make it fast enough in BASIC. And it allowed far fewer moving objects. Like you I remember that the collision detection took a lot of time. I'd gone as far as to use layers or 'planes' so that only objects on the same 'plane' could collide, the others simply passed in front of or behind each other depending on the depth.

After a while I realised I was over-complicating it and gave up, intending to pick up on it later when I had more time. Trouble is, I never got more time! I'll see if I can find it and have another go to see what I can do this time, if you don't mind me possibly learning from your program to improve mine.

Screen dump of Brownien2 running on my QPC2 in high colour mode (only using mode 8 colours). Anyone who hasn't tried it, all those text characters are 'objects' that are moving around the screen at the same time. With a font of redefined characters you could make very basic sprites. Especially if you used CSIZE 1,1 where you could use 8x9 pixel objects instead of the usual 5x9 characters in other CSIZEs.
Brownien2 on QPC2
Brownien2 on QPC2
Brownien2.jpg (9.32 KiB) Viewed 2396 times


stevepoole
Super Gold Card
Posts: 716
Joined: Mon Nov 24, 2014 2:03 pm

Re: Doodle

Post by stevepoole »

Hi Dilwyn,
Firstly, regarding slow operation on SGC, collision detection is the main hurdle.... and could no doubt be improved upon.

On my QPC, I don't get the 'only 2 objects at startup' problem. Perhaps including RANDOMISE in 'init' might help on your setup ?

As for using planes, version3 now simply uses OVER 1 to avoid printing on strip, and hence reduces sprites hiding each other...

Any CSIZE can now catered for, although I prefer 0,0 which reduces screen clutter.

Please feel free to do what you like with the program, as it is only an experimental prototype, intended for optimisation.

Postings about sprites on other topics got me to start wondering if using QPC2 potential might open new posssibilities.

Regards, Steve.


stevepoole
Super Gold Card
Posts: 716
Joined: Mon Nov 24, 2014 2:03 pm

Re: Doodle

Post by stevepoole »

Hi again Dilwyn,
The code has now been considerably optimised for speed : In fact I had to add a pause on line 790 to slow it down...

for SGC, change the Pause to 0, and modify line 170 so Q is in the range of (1 to 8)*2 sprites only.

On SGC under QDOS it runs much better when compiled.

On SGC under SMSQ/E, some horizontal sections of the screen are blank... needing a fix !

Regards, Steve.
Brownien3.zip
(973 Bytes) Downloaded 67 times


Post Reply