Bubble Universe - incredible 16 line demo - needs porting!

bbc micro/electron/atom/risc os coding queries and routines
Movie Vertigo
Posts: 12
Joined: Wed Sep 27, 2023 11:48 am
Contact:

Re: Bubble Universe - incredible 16 line demo - needs porting!

Post by Movie Vertigo »

I thought I'd have a go at writing this in ARM code for RISC OS...
thumb.png
On a 200MHz StrongARM Risc PC, it manages to simulate 16384 particles at 93 frames per second in 480x352 256-colour mode.

Video of it running here...
https://www.youtube.com/watch?v=VxGOBxy6oAY

It should run on any RISC OS machine, from an original Archimedes to a Risc PC. It even runs on a Raspberry Pi with RISC OS 5.28 installed!

If you want to try it out on your own machine, you can download it here...
https://movievertigo.github.io/download ... euniverse/

Source code to follow once I've done a few more tweaks and optimizations.
Movie Vertigo
Posts: 12
Joined: Wed Sep 27, 2023 11:48 am
Contact:

Re: Bubble Universe - incredible 16 line demo - needs porting!

Post by Movie Vertigo »

Movie Vertigo wrote: Mon Oct 02, 2023 10:36 pm Source code to follow once I've done a few more tweaks and optimizations.
Source code now available...
https://movievertigo.github.io/download ... ceCode,ffb
User avatar
BigEd
Posts: 6261
Joined: Sun Jan 24, 2010 10:24 am
Location: West Country
Contact:

Re: Bubble Universe - incredible 16 line demo - needs porting!

Post by BigEd »

That's great, thanks - and great porting job! (How did you tackle the trig functions of large numbers?)
Movie Vertigo
Posts: 12
Joined: Wed Sep 27, 2023 11:48 am
Contact:

Re: Bubble Universe - incredible 16 line demo - needs porting!

Post by Movie Vertigo »

BigEd wrote: Tue Oct 03, 2023 9:57 pm That's great, thanks - and great porting job! (How did you tackle the trig functions of large numbers?)
The trigonometry is all done with a pre-calculated lookup table. I ensure that the table is a power of 2 entries long. That way I can ensure the look up is within the table by clearing the appropriate number of most significant bits.
Movie Vertigo
Posts: 12
Joined: Wed Sep 27, 2023 11:48 am
Contact:

Re: Bubble Universe - incredible 16 line demo - needs porting!

Post by Movie Vertigo »

I wrote a version in WebGL that you can run in your browser. Try it out at...
http://movievertigo.com/bubbleuniverse/
User avatar
BigEd
Posts: 6261
Joined: Sun Jan 24, 2010 10:24 am
Location: West Country
Contact:

Re: Bubble Universe - incredible 16 line demo - needs porting!

Post by BigEd »

Thanks for that - it's very big, and fast, and smooth, and makes it possible to watch the evolution and trajectory of some of the patterns. Not sure I understand things any better yet!

There's a discussion over on retrocomputing forum which includes some findings on the history of this algorithm - there's an interactive and adjustable version of the code on p5 linked in this post.
User avatar
IanJeffray
Posts: 5963
Joined: Sat Jun 06, 2020 3:50 pm
Contact:

Re: Bubble Universe - incredible 16 line demo - needs porting!

Post by IanJeffray »

Movie Vertigo wrote: Sun Oct 15, 2023 11:27 pm I wrote a version in WebGL that you can run in your browser. Try it out at...
http://movievertigo.com/bubbleuniverse/
Nice. I like the chunkier pixels of the MODE 13 version though.
shifters74
Posts: 433
Joined: Mon Mar 04, 2019 9:44 am
Contact:

Re: Bubble Universe - incredible 16 line demo - needs porting!

Post by shifters74 »

Movie Vertigo wrote: Sun Oct 15, 2023 11:27 pm I wrote a version in WebGL that you can run in your browser. Try it out at...
http://movievertigo.com/bubbleuniverse/
I spent some time watching this - mesmerising that such complexity comes from such simple code!

Shifters
Movie Vertigo
Posts: 12
Joined: Wed Sep 27, 2023 11:48 am
Contact:

Re: Bubble Universe - incredible 16 line demo - needs porting!

Post by Movie Vertigo »

BigEd wrote: Mon Oct 16, 2023 8:05 am There's a discussion over on retrocomputing forum which includes some findings on the history of this algorithm
Thanks for sharing that. I suspect yuruyurau might be the person who came up with it... ...but I've asked both yuruyurau and Cliff Pickover to confirm if either of them are the original creators. Will report back if I get a definitive answer.
User avatar
scruss
Posts: 653
Joined: Sun Jul 01, 2018 4:12 pm
Location: Toronto
Contact:

Re: Bubble Universe - incredible 16 line demo - needs porting!

Post by scruss »

BigEd wrote: Mon Oct 16, 2023 8:05 am There's a discussion over on retrocomputing forum which includes some findings on the history of this algorithm - there's an interactive and adjustable version of the code on p5 linked in this post.
I see that the Apple II nerds have got onto writing a fast 6502 version, mentioned here: deater: "finally got bubble universe go…" - Mastodon
Movie Vertigo
Posts: 12
Joined: Wed Sep 27, 2023 11:48 am
Contact:

Re: Bubble Universe - incredible 16 line demo - needs porting!

Post by Movie Vertigo »

I wrote an eZ80 version for the Agon Light which manages around 7 FPS rendering 16384 particles...
maxresdefault.jpg
https://www.youtube.com/watch?v=c4m5R5tDXSE
Post Reply

Return to “programming”