AI, Players, and Bears Oh My...
by Ben Sparks - Warspawn · in Torque Game Engine · 08/24/2006 (4:12 pm) · 5 replies
Ok, so I saw this Bear in this blog...
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10683
it looked pretty darn cool, so I went ahead and bought it. Since, I've been trying to figure out how to get it into TGE and have it do something. It's turned out to be quite a bear of a project.
This has lead me to several questions that I have been scouring the site for hours looking for the answers to, so I thought it's time to ask them myself.
First, my goal: to get the bear into the game and have it walk around doing its various animations and then begin to learn how to do some basic AI to have it attack, die and whatever I want.
So I found that 95% of any "AI" resources found here are for Kork only or to have just 1 agent running around. The general idea that I get is that I need to create a copy of the PlayerBody datablock and then spawn it as a bot. Well, OK, I tried that, and perhaps this is one of the major hangups I'm having but the bear does not have any eye nodes so I get an error with that. Also the script that sets up the animations appeared to be off, it didn't have the "root" or any of the other default animations, so I changed that so that the animation sequences had the standard names.
-- I might need to stop right here, because the model apparently isn't setup to be a player, perhaps I need to just make it a static... It came with the source files, but they are in .max and sadly I don't have 3ds max.
So there is one question, do I need to stop trying to make a model work with a class that is a subclass of player and requires the "eye" node?
Another question: Is an attempt to subclass shapebase with my own class for animals that won't be players, but have more functionality than statics a step in the right direction?
Another question: even if I did get the bear to work as an aiplayer, how do you tell an aiplayer to run the "extra" animations, I noticed that in the player class there was an allotment of like 512 for extra anims, how do I run those? And in script when people are using AiPlayer:: functions does that mean that all agents no matter what they are will operate using the same behavior? (going back to me maybe needing to subclass)
From what I've read so far, it seems like there is a lot of confusion when it comes to setting up other characters and different AI behaviors, but I'd appreciate any help on this. I know that it's possible when I see cool stuff like Stefan's upcoming animal pack: www.garagegames.com/blogs/8239/11070
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10683
it looked pretty darn cool, so I went ahead and bought it. Since, I've been trying to figure out how to get it into TGE and have it do something. It's turned out to be quite a bear of a project.
This has lead me to several questions that I have been scouring the site for hours looking for the answers to, so I thought it's time to ask them myself.
First, my goal: to get the bear into the game and have it walk around doing its various animations and then begin to learn how to do some basic AI to have it attack, die and whatever I want.
So I found that 95% of any "AI" resources found here are for Kork only or to have just 1 agent running around. The general idea that I get is that I need to create a copy of the PlayerBody datablock and then spawn it as a bot. Well, OK, I tried that, and perhaps this is one of the major hangups I'm having but the bear does not have any eye nodes so I get an error with that. Also the script that sets up the animations appeared to be off, it didn't have the "root" or any of the other default animations, so I changed that so that the animation sequences had the standard names.
-- I might need to stop right here, because the model apparently isn't setup to be a player, perhaps I need to just make it a static... It came with the source files, but they are in .max and sadly I don't have 3ds max.
So there is one question, do I need to stop trying to make a model work with a class that is a subclass of player and requires the "eye" node?
Another question: Is an attempt to subclass shapebase with my own class for animals that won't be players, but have more functionality than statics a step in the right direction?
Another question: even if I did get the bear to work as an aiplayer, how do you tell an aiplayer to run the "extra" animations, I noticed that in the player class there was an allotment of like 512 for extra anims, how do I run those? And in script when people are using AiPlayer:: functions does that mean that all agents no matter what they are will operate using the same behavior? (going back to me maybe needing to subclass)
From what I've read so far, it seems like there is a lot of confusion when it comes to setting up other characters and different AI behaviors, but I'd appreciate any help on this. I know that it's possible when I see cool stuff like Stefan's upcoming animal pack: www.garagegames.com/blogs/8239/11070
About the author
I'm a web developer by day, hobbyist game developer by night.
#2
Well, I think I would need to ask the author if this is OK first I wouldn't want to break any EULA agreements. Although if you have some scripts or engine changes that I need you could just give them instead. I think that besides the node adding, my confusion might be lessened if I saw some working animal code. And yes, I can compile the engine too.
Plus, from looking at the forums and such I think that a lot of people would want this kind of thing as a resource.
I think that at least some of my questions have been answered though, if the eye node is the only thing holding me back from this working as an animal npc.
08/25/2006 (7:21 pm)
Thanks for the response...Well, I think I would need to ask the author if this is OK first I wouldn't want to break any EULA agreements. Although if you have some scripts or engine changes that I need you could just give them instead. I think that besides the node adding, my confusion might be lessened if I saw some working animal code. And yes, I can compile the engine too.
Plus, from looking at the forums and such I think that a lot of people would want this kind of thing as a resource.
I think that at least some of my questions have been answered though, if the eye node is the only thing holding me back from this working as an animal npc.
#3
08/25/2006 (7:57 pm)
The artist is problem going to tell you no but I have done this for other people. To keep from get them in trouble I did not keep a copy of it. So it is very important if you do send it to make a disc copy when you get it. If some goes wrong I would have to start all over. The code will not work with out the nodes in the dts model also it must be export with cfg file to use as player. You will need to add cam, eye, mount and etc. I dont know what all the nodes is need until I look at the resource file but that is up to you. I would be glad to do it for you. The code I use is AIGuard then taylor that to my needs. That is probably why you have trouble with it there no nodes. If you decide to send it just email me. In about month I think about purchase it, I am kind waiting to see if other people have brought it and what problems they where having. Plus I am waiting to see what animal pack has in it and how much that will cost. If you add mount node for ridding position you can have your player ride the bear around.
#4
Encouraging other users to break EULA agreements is not a very good thing to do...
08/31/2006 (6:41 pm)
@MichaelEncouraging other users to break EULA agreements is not a very good thing to do...
#5
08/31/2006 (6:50 pm)
I am just try to help someone out, I seen other do it. I like said I dont keep copies of people stuff they have brought. I just export that it. Everybody dont have the money to buy 3ds max. If I it want I go buy it. I am try to be nice to people.
Torque Owner Fucifer