• AI Iteraction
    13 replies, posted
greatly enhance the AI animals if two concepts are applied in them: A) interaction with environment als collect entities in proximity (think this already works) and collect calls acting according to the call. Call the perceccion think it's a little complicated. B) herds or groups (some animals travel, live and hunt in groups) if the animal is just less than 5 species: each time call the top members of their species that are relatively close. if the animal receives external stimulus (attacked; unfriendly detects another entity; detects prey) and has any member of the pack near: call members of their species to react the same way to external stimuli. if the animal has just received a stimulus may not receive another stimulus flagpole finish the action of the stimulus received. the animal receptor stimulation. copy the behavior of the transmitter of the stimulus or executes the command of the transmitter. types of stimuli (move, attack, escape the agressor opposite direction) I'm not good in English but I think with some pseudocode I can explain this better. [B]who knows some basic computer appreciate this: D[/B] ------------------------------------------------------------------- [CODE] public class:entity { int status; // -1 = normal, 0 move, 1 atack, 2 escape, 3 alert int radio_call;//area detection int radio_reception;//range achieved perceive people, I will use a function called detect() int proximity; range admited for proximity the herd int category;// 0 human, 1 wolf , 2 rabit , 3 boar, etc.. int coordinate_x;//Current position of the entity int coordinate_y;//Current position of the entity int coordinate_z;// Current position of the entity int point to_x;//posicion target int point_y;//position target int point_z;// position target int category_AI;// 1 predator, 2 prey, 3 autodefence int tolerate; //tolerate simile category_ai 0 no 1 yes public funtion int is_empty();//control if de class is empty void action(entity,int);//realize a action in relation the entity asociate and acction stabilite. int alone();// return quantity entities of simile category are in the proximity range entity detect_e();// Similar detect(entity) but is based on radio_call and detect only igual category. entity detect_pr();// Similar detect(entity) but is based on proximity and detect only igual category. entity detect();//detect entities distinct category icide of the radio_reception considerate the tolerance(tolerate var); } void main() { enity x(0, 30, 15, 1, 23, -18, 3, 0, 0, 0, 1, 1); enity z(); z = x.detect() if (z.is_empty == 0) { x.action(z, x.categoy_AI) call2(x); // active anmiation alert herd XD detect_action(x, -2); // -2 is the action in this case your simile entities imite } if (x.alone() == 0) { call(x); // active anmiation call if exist XD detect_action(x, -1); //-1 is the action in this case call a your simile entities } } void detect_action(entity x, int act) { entity y; // 5 is de max number of the herd int i = 0; for(i=0;i<5;i++) { y = x.detect_e(); if (y.is_empty() ==1) { i=5; } else { y.action(x, act); } } } [/CODE] ------------------------------------------------------------------- [B]If you read everything you'll understand that the code is not perfect I'm sure it will have 1,001 errors but it was just a general idea. Note: GARRY OR YOUR GROUP PLZ READ AND COMMENT ON THIS POST... AND YES THIS IS A PLEA :rolleyes::rolleyes::rolleyes: [/B] TY FOR ALL
seems logical goodwork
I'm sad because i worked so much in this post but a few people coment this. and garry's group full ignorate me -_-'
Maybe they did or didn't. Your english is hard to read, and your code is below your english, so people might have skipped reading the rest of your post after the first few sentences.
I am not sure what the species part is about, but from what I understood from his post it seemed like a pretty solid idea. Basically, if I understood correctly, animal AI would be coded in a way that made them work together as they might in real life. Bear with me as this may be a longer post to explain how it would work. If you attack a wolf (or the wolf attacks you), and there are other wolves nearby, it howls and the other nearby wolves come running to help. Code wise, it would work off a certain radius around the initial wolf that enters combat, then nearby wolves would be given the location and action to take. The wolves being called to help do not call out for help of their own, or else you might end up with every wolf on the server coming to help. Additionally, if a wolf is currently being called to help, it will ignore additional nearby calls for help until it is done helping the first call for help. This could work the same for bears as it does for wolves, but maybe not. I know at least some wolves hunt in packs and respond when other wolves howl. I do not know much about bears, if they travel in packs, or if they respond to other bear growls. Someone with more knowledge in the matter might clarify for us. For the deer and boars, it works similar, except when they hear their counterparts cry out they run away instead of come to help. Its a call out to other deer/boars that danger is near and you should run away to a safer location. Although I think a boar under attack would probably try to fight back instead of run away, I don't think other boars would come to help it. A deer on the other hand would probably just try to run away. This could be used to make AI interact with other AI, adding to the immersion of the game. If a bear wanders too close to a wolf, they detect each other and attack. The wolf could then let out a howl for help and other nearby wolves would come help attack the bear. This would give the wolf a better chance of survival against its much larger, tougher, and harder hitting opponent. I suppose this would work the same with bears if they do indeed respond to other bears calls for help. So you may end up with a couple of bears against a pack of wolves (if they are nearby) instead of just a 1v1, bear usually wins. If a hostile bear/wolf attacks a deer/boar, the attacker would not need to call out for help, but if the deer/boar happens to run away into another similar hostile, it gets tag teamed. If the deer/boar runs into an opposing hostile, the original attacker forgets about the deer/boar and focuses on the bigger threat, calling out for help (if they do such things). Again, I think the boar might try to fight back if attacked, while the deer would try to run away. You could make the deer/boar cry out for danger to any nearby deer/boar and have them run away, but I am not sure its necessary for AI attacks as the view/attack distance for AI is much shorter than for players. Imagine being nearby as a fresh spawn and watching the chaos unfold before you. Carefully biding your time, watching out for other players sneaking up on you. Waiting for the battle to be over so you can go harvest what is left and/or try to kill off any survivors in weak condition for their resources. Counting your lucky stars that you happened upon this scene as a fresh spawn and got a little free resources instead of getting attacked by the bear/wolf pack yourself. I have played other games where the AI interact with each other. I always find myself sitting there watching to see what happens next and thinking, damn these developers did a nice thorough job on this game.
For readability's sake: [CODE] public class:entity { int status; // -1 = normal, 0 move, 1 atack, 2 escape, 3 alert int radio_call;//area detection int radio_reception;//range achieved perceive people, I will use a function called detect() int proximity; range admited for proximity the herd int category;// 0 human, 1 wolf , 2 rabit , 3 boar, etc.. int coordinate_x;//Current position of the entity int coordinate_y;//Current position of the entity int coordinate_z;// Current position of the entity int point to_x;//posicion target int point_y;//position target int point_z;// position target int category_AI;// 1 predator, 2 prey, 3 autodefence int tolerate; //tolerate simile category_ai 0 no 1 yes public funtion int is_empty();//control if de class is empty void action(entity,int);//realize a action in relation the entity asociate and acction stabilite. int alone();// return quantity entities of simile category are in the proximity range entity detect_e();// Similar detect(entity) but is based on radio_call and detect only igual category. entity detect_pr();// Similar detect(entity) but is based on proximity and detect only igual category. entity detect();//detect entities distinct category icide of the radio_reception considerate the tolerance(tolerate var); } void main() { enity x(0, 30, 15, 1, 23, -18, 3, 0, 0, 0, 1, 1); enity z(); z = x.detect() if (z.is_empty == 0) { x.action(z, x.categoy_AI) call2(x); // active anmiation alert herd XD detect_action(x, -2); // -2 is the action in this case your simile entities imite } if (x.alone() == 0) { call(x); // active anmiation call if exist XD detect_action(x, -1); //-1 is the action in this case call a your simile entities } } void detect_action(entity x, int act) { entity y; // 5 is de max number of the herd int i = 0; for(i=0;i<5;i++ { y = x.detect_e(); if (y.is_empty() ==1) { i=5; } else { y.action(x, act); } } } [/CODE]
[QUOTE=KingLiro;46194418]I'm sad because i worked so much in this post but a few people coment this. and garry's group full ignorate me -_-'[/QUOTE] It's only been 14 hours; they're busy making Rust, they don't have as much time to read the forums as you do. Plus, they have other forums to pay attention to as well, like Reddit and their Facebook page and Twitter and their bug tracker and the playrust blog comments.
Your post suggests some good points on it's own without the need of the pseudocode. Not to come off as rude, but the pseudocode feels largely unnecessary and doesn't really serve in giving any general idea at all which the text doesn't already achieve. Other than that, it would be especially great to see the deer group up into small herds and flee together when one of them goes down. Small additions like that can really add towards the overall immersion of the game.
Not sure I agree. He has taken that extra step unlike most of us to show how he thinks his idea could be implemented. Not a coder, assuming you are sean, does his code 'shorthand' present a basis of what he describes?
[QUOTE=elixwhitetail;46195290]It's only been 14 hours; they're busy making Rust, they don't have as much time to read the forums as you do. Plus, they have other forums to pay attention to as well, like Reddit and their Facebook page and Twitter and their bug tracker and the playrust blog comments.[/QUOTE] Hehe I like how you didn't point out the Rust steam forums :D.
[QUOTE=KingLiro;46194418]I'm sad because i worked so much in this post but a few people coment this. and garry's group full ignorate me -_-'[/QUOTE] i guess they read it but they dont always reply to it
KingLiro, It is a good description, but the terms used make it quite hard to read. I think, that they will implement their own version of this, probably ignoring good aspects as in 'herding', and fall back to a very simplistic AI. Would surprise me if they actually added an AI at all.. (which is more than.. walk randomly + attack nearby entities)
Thanks for your comments suggestions and improvements, I guess I put off seeing my post in less than 12 hours to move in the direction of the following forum pages. clarify a couple of details: to express an idea that is not really necessary, but I decided to add the pseudocode because my English is very bad, so maybe the pseudo code to generate a better imput the idea) thank you very much for the transcript of the code [utilitron] and clarification of [UneManArmy] express what I was trying to say (with good English) I would love to see this kind of AI implemented, if any of you have better skills (English and programming) reformulate a proposed adding their own ideas and logic.
I did ask Andre about this sort of thing via twitter a while back: [url]https://twitter.com/andererandre/status/474599273229975552[/url] [QUOTE=utilitron]@andererandre Are the aggressive AI going to switch to a preservation mode when significantly damaged?[/QUOTE] [QUOTE=andererandre]@utilitron I'll try it out and if it feels nice it'll stay in. That's pretty much the policy for all AI behaviours at this point.[/QUOTE]
Sorry, you need to Log In to post a reply to this thread.