Page 1 of 1

making AI for enemys and helpers & pause menu & level switch

PostPosted: Sun Mar 29, 2009 8:17 pm
by Darc
I'm making a game that requires AI and level switching and a pause menu and I need a easier way of changing the levels

any one know how to do any of this? or advice?

Re: making AI for enemys and helpers & pause menu & level switch

PostPosted: Sun Mar 29, 2009 8:49 pm
by jimmynewguy
what kind of AI what do you want it to do?
plenty of demos on level switching and pause menus try searching :D

Re: making AI for enemys and helpers & pause menu & level switch

PostPosted: Mon Mar 30, 2009 7:33 pm
by Darc
jimmynewguy wrote:what kind of AI what do you want it to do?
plenty of demos on level switching and pause menus try searching :D

like a helper that follows the player and fights with and jumps when needed/
and for enemy jumping dodging and stuff attacking,I haven't been able too find any pause menu demos or code sources

Re: making AI for enemys and helpers & pause menu & level switch

PostPosted: Mon Mar 30, 2009 11:55 pm
by BlarghNRawr
like ice climbers in melee?

Re: making AI for enemys and helpers & pause menu & level switch

PostPosted: Tue Mar 31, 2009 2:46 am
by jimmynewguy
well for attacking it depends on shooting or melee
melee = harder
shooting = hard but easier

Re: making AI for enemys and helpers & pause menu & level switch

PostPosted: Tue Mar 31, 2009 6:14 pm
by jimmynewguy
the best answer and advice i can really give you is to fiddle around. Just use what you know and fit it together, it might not end up being exactally what you wanted, but it's better than nothing. If you just have someone tell you how to do it, you won't learn and you will keep having to ask for help. Once you find out you can do it, you will be a better problem solver, and will be able to make a full game and expand on your first AI script to make it how you wanted to. So, just try first, and if you run into bugs or are completly stuck, then ask. You will get alot more help alot faster if you have started the script and we just have to tweak it a little. Just trust me on this one if you ever trust me at all. That's how i got to be a "C+" student at GE :lol:

Re: making AI for enemys and helpers & pause menu & level switch

PostPosted: Tue Mar 31, 2009 8:51 pm
by Darc
BlarghNRawr wrote:like ice climbers in melee?

egg-zactly

Re: making AI for enemys and helpers & pause menu & level switch

PostPosted: Tue Mar 31, 2009 9:02 pm
by Darc
jimmynewguy wrote:the best answer and advice i can really give you is to fiddle around. Just use what you know and fit it together, it might not end up being exactally what you wanted, but it's better than nothing. If you just have someone tell you how to do it, you won't learn and you will keep having to ask for help. Once you find out you can do it, you will be a better problem solver, and will be able to make a full game and expand on your first AI script to make it how you wanted to. So, just try first, and if you run into bugs or are completly stuck, then ask. You will get alot more help alot faster if you have started the script and we just have to tweak it a little. Just trust me on this one if you ever trust me at all. That's how i got to be a "C+" student at GE :lol:

Well I guess I have away that includes more actors when I was making a Pikmin game but that game went down hill I'll use some of the sources though

Re: making AI for enemys and helpers & pause menu & level switch

PostPosted: Tue Mar 31, 2009 11:23 pm
by skydereign
Depending on the complexity of the AI, it can be done with relative ease. The harder and more versatile the AI, the harder it will be to make. The basic structure of it is you are feeding the actor a bunch of triggers. It should know how to handle them. One case is to dodge. If you want it to dodge when an enemy attacks, one way of doing it is to tell it to jump. This also depends on how many enemies and players. But you should start with a basic idea and build from that.
Code: Select all
if (player.x-x<200 && ATTACK==1)
{
    // your dodge script... an example being
    //ChangeAnimation(jump);
    //yvelocity-=5;
}

This is not the best way of doing it, but it is one of the easier ways. To make this better, you would need to set up a pretty complex system that when used, the AI can determine what to do. As I said before, this is the basics. You can also throw in rand or other factors to make the AI less smart. That way it will only get it sometimes, or if you get farther into it, it has a choice and will pick, whether it is best or not. Level switching I am fairly certain there are demos on this. If you can't find any I can point you in the right direction. As for pause menus, I am not sure there is a built in way, but all you would need to do is disable the actors, either by the disable event or through your own means. The only actor that should receive events would be the menu. You could do it this way, though I hope there is a better way. In all actors you wish to pause, put an if statement in all of there events that allows them to move only when the menu is not up. I can explain further if need be.

Re: making AI for enemys and helpers & pause menu & level switch

PostPosted: Tue Mar 31, 2009 11:28 pm
by jimmynewguy
pause = PauseGameOn();
unpause = PauseGameOff();

but if you want a pause menu make a variable pause and for all actions on anything that will be paused use
if(pause == 0)
{
//actions
}
so it will only go it pause is off

Re: making AI for enemys and helpers & pause menu & level switch

PostPosted: Wed Apr 01, 2009 9:23 pm
by Darc
thanks now I think I have a better Idea of it