Page 1 of 1

AI Controlled Vehicles (sort of)

Posted: Mon Dec 29, 2003 4:03 pm
by bertgoldstein
As far as I know I haven't seen this done. I've figured out a way to do AI controlled vehicles, even though it looks kind of goofy.

At first I had the idea to create an uniqueother actor and use the vehicle sprite for it. This made a vehicle that could sit there and spin in place. I figured this was because the animation was called something different than StandWalk.

I opened up the file in the hex editor and tried renamed driving to StandWalk, but that didn't fit. However reversing and standwalk have the same number of letters. I changed that and that did the trick.

So now there raiders can tear ass around the wasteland in dune buggies with the wheels going backwards. I need to do more testing though.

Posted: Mon Dec 29, 2003 6:57 pm
by Forty-six & Two
Woah there bucko.

You say you got AI vheicles working? Teach me! :D

Very bad side effects though? :?

Posted: Mon Dec 29, 2003 7:10 pm
by requiem_for_a_starfury
Pity spray can't handle the vehicle sprites then all we'd need to do is reverse the animation sequence and we'd be laughing. I'm assuming you're editing the buggy sprite?

I don't know anything about Hex editing but perhaps you might be able to swap the driving and reversing sequences and then change the header?

Posted: Mon Dec 29, 2003 7:52 pm
by bertgoldstein
I'm not really that good at hex editing beyond finding a text string and replacing it. But that could work. Or if there was a way to change the length of the headers. Red would probally be able to figure it out if anyone.

It works for all of the vehicles I've tried so far (Buggy, APC, hummer). No crashes or major bugs. I haven't tried it with the tank yet, but I doubt the turret will show up on it. The vehicles follow waypoints well and look pretty good doing it at least over long distances. I haven't figured out how to get them to fire yet.

They also leave blood splatter when you shoot them, but that's what you get for driving with the windows down.

I'll post sprites and entities when I get home from work.

Posted: Mon Dec 29, 2003 7:54 pm
by Kashluk
Aren't there different kinds of "splatters" available? I mean, you could make the vehicle a "robot" so it would hit sparkles or something...

Posted: Mon Dec 29, 2003 8:02 pm
by requiem_for_a_starfury
If you change the race to Robot you'd probably have to rename the sprite to replace one of the robots. Not a problem if you are using it under a path.

Personally I'd prefer an AI controlled Buggy to the tank bot anyday of the week. :)

Bert if you want to get them to fire you're probably going to have to equip them with a kick weapon (like the non-humanoid robots have) then they should fire if they've got ammo and are hostile.

Posted: Mon Dec 29, 2003 8:14 pm
by bertgoldstein
requiem_for_a_starfury wrote:If you change the race to Robot you'd probably have to rename the sprite to replace one of the robots. Not a problem if you are using it under a path.
yeah that did the trick. I think when I tried that the first time I just tried changing the sprite in the editor and not actually replacing the original sprite.

Posted: Mon Dec 29, 2003 10:24 pm
by requiem_for_a_starfury
Yeah it works, I don't think the tires are that noticeable though :) but as there's no dust animation it doesn't appear to be going very fast. :(

Anyone who does know something about Hex editing, can you implement the StandRun sequence as well, because if you set the movement priority above 8 the vehicle(actor) will just keep turning in place and as I said it doesn't appear to be travelling very fast. :(

I doubt you will be able to get the vehicles to attack though, as none of them have an attack animation sequence. They won't even be able to ram people. :(

Posted: Tue Dec 30, 2003 4:27 am
by Red
that's interesting... So the engine accepts the sprite having 32 frames? Does it use them, or just 16 of the 32?

I don't get that whole turning around thing.

As for strings, there are two types used in the headers: 0 ended (normal C strings wich end with the value 0x00) variable length strings which start with a number specifing it's length (nowadays this is a long - eg 4 bytes) followed by the characters. Obviously you'll need to update the length of the string if you shorten it. And until I make an editor of some kind it'll be quite difficult to make them longer since that'll screw up the rest of the data.

Posted: Tue Dec 30, 2003 5:35 am
by requiem_for_a_starfury
Red wrote:that's interesting... So the engine accepts the sprite having 32 frames? Does it use them, or just 16 of the 32?
Well it appears to, but it's hard to tell.
Red wrote:I don't get that whole turning around thing.
Well the turning around thing is what entities do when you try to get them to do something they can't, for instance I've just buggered the stairs, in my map, I widened them (and updated the tiles) but now the actor won't go up them it'll just turn in place. Same goes if you try and make the actor travel across a gap in the tiles or past the camera boundry.

RE

Posted: Wed Dec 31, 2003 12:46 pm
by PaladinHeart
I've noticed the same phenomenon on caps before.

Posted: Sun Jan 04, 2004 8:38 am
by bertgoldstein
requiem_for_a_starfury wrote:Yeah it works, I don't think the tires are that noticeable though :) but as there's no dust animation it doesn't appear to be going very fast. :(

(
really the only thing I plan on using these for are escort missions convoy attack where you escort or convoy attack missions with APCS, which move pretty slow anyway