A life of their own
mouldysoul
Member Posts: 8
Hi
Just getting into this stuff and having a lot of fun exploring, was made a few coloured squares move around in set motions at different speeds and gravity all good fun!
I was just wondering about how one would think about implementing AI in an actor, maybe it's not AI and you can go about it differently, very new to this so bare with me... What I want is for one actor to act autonomously ie not just move in one constant direction but wonder about or try to move towards another moving actor.
I've look at accelerate towards but wasn't the thing I need.
Any help would be greatly appreciated!
Comments
well what you could do is study the random function. Use it combined with the move to. that should give you random character movement.
AI can get pretty complicated. I would say start with a very easy concept game. Build it. Learn form building that and add what you have learned to your tool kit. Wash, rinse repeat.
It does't take much to implement a pseudo-random movement in GameSalad, just throw a needlessly complicated equation into the direction part of a move behaviour and watch your actor meander around the screen.
Thanks guys that's perfect! Am going to have a play now. And study the random function!
And socks that did occur to me, what kind of equation something like dividing or multiplying irrational numbers? Not really sure about how to write an equation to output randomness! I shall investigate!
Had a play ignore what I just said, random (min,mix) = fun.do
I have a way point tutorial you might find interesting. It's not random motion, but more of a predetermined path.
http://www.jamie-cross.net/?portfolio=gamesalad-recipe-008-enemy-behavior-waypoints
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Here is a different kind of AI movement. This is a basic model of chemotaxis -- the way single cell organisms, like e-coli, seek (or avoid) things. The basic idea is that the organism always continues in its current direction until it senses that it is getting further away from the desired object. Then it randomly tumbles and starts off in a new random direction. It is amazing how efficient random-walk chemotasis can be, given the fact that it's umm -- random.
For background on chemotaxis, see: http://www.mit.edu/~kardar/teaching/projects/chemotaxis(AndreaSchmidt)/index.htm
Here is the file:
http://www.mediafire.com/download.php?7jp43yvo3auxq8e
Note: The above was recycled from something I posted back in 2012.
OMG guys if this program wasn't already the greatest thing I've stumbled upon all year, the response from this forum has been outstanding. Thank you so much for the direction and support, I was up till five last night making boxes bounce around off four sides and destroy different coloured boxes when they met, it was like the windows bouncing screen saver thing in death mode!
So much fun from such simple things, this is truly immensely satisfying stuff.
And thankyou RThurman, that would be perfect to implement although I have a fear I may just end up watching computer simulations of bacteria move about for hours on end; better make some popcorn!! Sorry for having to make you repeat yourself I will go to the effort of learning how to search the forum before I post next time! I think a theme for my game is emerging if I use the bacteria movement, I'm making it for my music project "Mouldy Soul" and think it would work beautifully!
@mouldysoul
Here are a few example files of random (or pseudo-random) paths, includes such hits as:
Broken Steering Wheel
Curley Wurley
Curved grid
Dancing Bees
Doughnuts
Etch-a-sketch
Lost Ant
Nodules
Occasional Bump
Perm Machine
Rising
Smooth lumps
Spaghetti
Sudden Turn
Wobbly Signature
Zig-Zag
Link: https://www.mediafire.com/?p920m99b6pz2v9q
WOW @Socks thanks so much just d/l'ed and will check out now! That chemotaxis thing is mint, and makes the game so hard now!!
Can't wait to try the wobbly signature!
@Socks, want to see random? Then take your daughter clothes shopping!
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
That would be very random, especially as I have no daughter !