AI scripts?

Hi,

So what would be the path to take for AI?

It’s been a long time since I did any AI (I wrote AmigaDraughts many many years ago, still available on Aminet).

However, the AI I did relied on a LOT of recursion, and I’m not convinced that the level of recursion required is possible in python.

You could do pseudo AI, where you have scripted responses selected according to various triggers, but true AI in blender python would be practically (if not actually) impossible.

I didn’t mean anything that fancy. Just like for example walking people or a robot.

Python can get it’s dirty little mits into C hooks, and pass pointers to C hooks,

Python is not the hammer, it is the manager ordering the hammer to put in the nail.

if you need brute force import a module that uses a compiled C lib.

‘However’ - True AI is not needed 95% of the time.

What type of behaviors are you attempting to describe?

You can get away with -> If idle, pin navtarget to object following pre planned route OR if idle pin Navtarget to random item of intrest, on navmesh etc, and have a ability to sense a valid player or target and change to a combat state or??

Actor = a dynamic cube physics bound containing a armature or other method of animation
NavTarget = a item unique to each actor that the Steering actuator or NavMesh.findPath() is targeting

From these you can approximate most AI types
But games like streetfighter etc need a different type of system*

Erm, I’m just trying to either get a person or a robot to avoid or follow cube.001.

I’m still trying to work out the moving tread tracks problem. I’ll need to parent the pieces together with the exception of the treads for animating I think or ‘drivers’.

How ever, I’ve seemed to of had a problem with the 3D pointer, other objects seem to move with it, like a circle captures other objects whilst moving one selected object?

Could you give us some idea of what kind of AI you are looking to develop?

What kind of game is this?
How much does the AI need to figure out for itself, and how much will be instructed in level-design (if any)?
Any other possible details?

that is the steering actuator,

Try and keep questions about animations in their own thread- Right now your asking about AI, try and stick with that in this thread.

I used to confuse my own threads, and still do, but try and focus on one problem at a time and solve it,

steering + playing a animation thats speed matches the moved distance will be next after getting the steering working**

Unfortunately, I’m going nowhere fast to the point where I might just release what I’ve done and let someone else make something of it.

Okay well the treads move, sliding everywhere, but with my other objects, parenting or joining the rest doesn’t move along with it.

The robot I have would need a skeleton for some other movements, like a weapon movement, and some claw instruments.

most actors are a physics bound, with a armature, with objects bone parented to the armature bones for robotics, for organics you usually use a armature modifier to use a mesh as a skin for a armature.

the armature is then parented to the physics bound object,
(which is a invisible object with a simple physics bound)

then in conjunction to moving the physics bound you must play a animation at the same rate the physics bound moves.

You mean the armatures would need to be animated too using keyframes?

Well, I think for a test, just getting the whole thing with the treads moving is the key. So what do I do for that to work. I tried joining and parenting that doesn’t work.

I would make a animation, that is the whole tread advancing exactly 1 track section width forward, and not really rotate the whole thing.

using the 1 track width forward animation played over and over can be made to look like it’s turning,

This is another problem, I can’t get the light to move whilst the rest of the Robot’s body moves with it.

Attachments


I will make a tutorial that includes 1 3rd person rig, and a simple robotic enemy.

Tank tracks are something I may need in my own game, so I will investigate a smooth workflow for that.

You may recognise that from somewhere.https://www.youtube.com/watch?v=gIQG85nn7is

So far I haven’t achieved any of my objects, no working doors, as for characters, well that proves to be a problem, the character doesn’t display correctly in the game, and the texturing is another mess altogether.

But yes, the robot is something I wanted to get moving around, preferably activated out of the storage.

Lost in space?

Yep, Stephen Hopkins end of the century film, filmed in Herefordshire county, pinewood studios. It had a couple of English actors, and the rest were American, obviously since the 1965 tv series was American produced, unlike the film was more of a English based production.

I have thought in recent years, I wanted to play a game with a LIS theme to it, even if I couldn’t get the cast in with may be one or two. I’m attempting Major West, as for Penny, well that task is scrap.

So the robot, I have also some brief audio clips for the Robot, that of course being the one from another time. But yeah, the voice is fine for any robot.

Attachments



For simple AI, I just use states (logic bricks)
I put the state machine on the object that moves my character; and inter connect
to the armature, ray for eyes, and whatever else I need.
Works good for me, and I can spawn it if I need to.

always-------and (state 1 - idle)--------idle animation
always-------and(state 2 - walk)--------Motion Y whatever walk animation
always-------and(state 3 - run)--------Motion Y whatever, run animation
always-------and(state 4 - turn left)---------Motion Z
always-------and(state 5 - turn right)--------Motion -Z
always-------and(state 6 attack)----------steering, and animation
always-------and(state 7 death)-----------death animation

and so on.

you can replace the always with a delay, or whatever. The state will shut off all other sensors not on that state.

As for tank tracks, you don’t need an armature. Just move each track tread one place. So press “I” to insert a key on frame 1, move to frame 2, move each tread one place forward. press “I” to insert a key. Moving each tread around the drive gear. On the treads that aren’t going to go around the drive gears, join them, so you cut down on the amount of actions.
And just loop the “tread_action” fr 1 to fr 2. it will look as if the track is rotating, even though it isn’t. Not perfect, but it’s OK.

I just got finished doing a set of bulldozer tracks.

I’ve moved the robot to another location, and have done some texturing as when I joined everything, that messed it up a bit. I parented the transparent head part.

Notsure if parenting was better than joining.

As for the treads, I have texure some more, but that isn’t too much of a problem, I can do the same for the next. But that aside, the treads are joined, for getting them to revolve around the round pieces, they would need to be seperate, I would of guessed.

But actual seperate pieces of faces? Or one whole object just looks like it is moving?

You can easily separate the treads. In edit mode, select the treads you want to separate, and press “P”. or is it ctrl P? can’t remember.

And yeah, my treads are “alt-D” copies of one tread.
on the flat part of the track, (top and bottom) they are joined, but around the drive and driven gears they are seperate, and each tread would have it’s own action.

The tracks then need to be parented to an empty, (child of the empty) and the empty a child of whatever you use for movement. It was time consuming. :slight_smile:

Oh, and all the treads, gears, bogies, frame, are grouped.

Check out the tank tracks in X-27’s “Arctic Drones” game. Mine are almost like his, except mine are what’s called “street pads” I think his would be called “swamp pads”