Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Path Following example utilising the multi-thread capabilities of Box2D

Author
Message
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 30th Dec 2021 20:57 Edited at: 1st Jan 2022 09:10
The title says it all.
After a discussion on discord I knocked this quick example together.


I should credit Virtual Nomad with the idea for this. I didn't realise how much advantage could be gained by misusing Box2D like this.

[Edit] Minor update. You can now press the up arrow to increase the number of 'blobs'
[Edit2] Another small update to toggle collision on/off
ando
4
Years of Service
User Offline
Joined: 21st Feb 2020
Location: Australia
Posted: 30th Dec 2021 23:07
That's pretty good.
They all do the same thing but seem to have a mind of their own.
BASIC appeared in May 1964. Lightning flashed, the wind roared and the Earth moved.
And nine months later I was born.
So here I am.
I am Basic.
Code is in my genes.
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 31st Dec 2021 14:11
It's pretty cool isn't it?
In the update above I've given them all a different turn rate a well as a different speed so the 'emergent behaviour' is even more pronounced
ando
4
Years of Service
User Offline
Joined: 21st Feb 2020
Location: Australia
Posted: 31st Dec 2021 21:11
I was staring at your program for a while and so many ideas come to mind.

At first it looked like an AI race.
Then it looked like a crowd behaviour sim. Like when there is a big sale on with the faster ones pushing the slower ones out the way.

Then I thought it could be herbivores running from a carnivore with the slower one getting caught.
You could even throw in a final waypoint for one or two of them to go and hide behind something.

This could be used in so many ways limited only by imagination. I like it!
BASIC appeared in May 1964. Lightning flashed, the wind roared and the Earth moved.
And nine months later I was born.
So here I am.
I am Basic.
Code is in my genes.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 1st Jan 2022 09:10
I held at a steady 350 fps until I got to about 500 blobs. But it's more than just path following, each blob is aware of the others
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Login to post a reply

Server time is: 2024-04-25 03:20:04
Your offset time is: 2024-04-25 03:20:04