Development Forum |
|
|
Malkin Manager
|
11/20/2013 | |
What are the basics of creating an agent that moves by itself, using the timer script? (not simply in reaction to in-game physics.)
For swimming agents, you'd often check the room type to make sure they're still in water, and then make them dive using accg 5 or something, but how do you get them mobile in the first place? What do you need to consider before 'the turtle' can move?
My TCR Norns |
Moe
|
11/20/2013 | |
You'll need to have it decide what direction it needs to go, whether that's by CA values or a random generation. Sometimes simple agents can just pick a random series of numbers and decide on a direction from that. More complex agents will check CA values and decide where they should go from there. Or, they may follow other agents such as when hunting or mating.
If it's an agent with gravity and friction, you need to give it a slight "bump" to get it off the ground, otherwise friction will often nullify any movement. Usually a force equal or slightly more than it's accg value will suffice. That's why a lot of agents "hop" when they move, because it's easy, it works, and it gets them over hills in metaroom maps.
If it's a flying or swimming critter, you need to account for it's "drift" and air resistance. And it'll probably have a very light accg value...until it needs to land.
So basically,
1. Pick a Direction or a Target
2. Modify your X and Y velocities accordingly |
|