Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: michaelwwswr on October 21, 2012, 08:15:18 PM
-
Hello--- Are there any tutorials on setting up the enemy to shoot at and damage or kill the player?
-
Hi,
maybe not tutorials as is as far as I know, but I have worked on a very powerful solution, called targetPro. it might be something you would be interested in. I have created a playmaker set of custom actions and proxies for you to work with this system right within playmaker.
https://hutonggames.fogbugz.com/default.asp?W993 (https://hutonggames.fogbugz.com/default.asp?W993)
This will give you already 99% of what you need to set up shoots, damage, ennemy detections and firing behaviors. It's very impressive.
Bye,
Jean
-
Hi,Jean
I saw TargetPro That's not what i need I am working on a fps with third person characters that will be shooting handguns , rifles and rocket launcher at the player.
thanks
-
I sort of did that when starting with Playmaker. Some tips:
Store the player GameObject reference in a global var.
Health: Create a manager that handles that issue, only for player (therefore, player HP should be a global var). Each foe should manage it's own HP.
Shoot: I made 3 states for my foes: Idle, Following, Attacking. When in 'atk' state, they SmoothLookAt the player and instantiate a bullet object, applying velocity on Z axis. Obviously, the look at action will proceed as well while in 'follow' state.
Dealing damage: Have the bullet tell the manager how much damage it'll deal to the player. Detect collision between player and bullet, and send events as needed to deal the damage (that's why the player HP being global is useful). If player is intended to damage, and kill, foes, the same. I'd recommend having a bullet prefab that deals damage only to player, and one only to any foe. I had problems using a shared bullet.
Note that you, most surely, will need about 4 FSM on each character.
Hope that helps you.
-
DARK_ETERNAL Thanks but do you have a screen shot of your FSM setup
-
I'll make them for you. Since my foe and player FSM setup is similar, I'll only pass you my player's Setup. You should be able to adapt the foe's from it. Just give me a second.
-
Here you go. I added screenshots for my player setup, 4 FSM in total, managing position update (so foes know how near are from it), shooting and such things; the health manager that will reduce player health if hit, and a game manager that will response if player kills all foes or gets killed. Any questions, feel free to ask.
-
Nope. Foe's FSM is lightly different from Player's, so let me add screenshots for my setup. Again, feel free to ask anything you don't get from it, although I don't think those screenshots are self-explanatory by themselves, but you'll do better if you try to figure out the FSM flow from them.
-
Thanks.
-
Thanks DARK_ETERNAL I am new to playmaker I see your flow charts but I cant figure ot the actuall set up.
-
Hi michaelwwswr
The turret example of targetpro might be misleading indeed for your case. It's totally capable of doing any kind of shooting, be it your ennemies firing anything to your player. You simply define targets, firing entities, you also define what they fires and how it damages affect the target when hit, etc etc. I would strongly suggest you get in touch with targetPro guys and ask about your needs.
bye,
Jean
-
Thanks Jean
-
Hello, michaelwwswr.
Basically, the foe FMS has this flow:
- FSM: Manages attack states, starting from Idle, goes to Following, if player is near (you have to define how many distance there should be between player and foe to have the enemy follow the player, then, if foe catches it, goes to attack mode (I use a lesser distance than the follow one)
- FSM 2: Will compare current FOE distance to player's (which is a global var), then send a CompareDistEv to FSM 3
- FSM 3: Receives CompareDistEv from FSM 2, then sends events to FSM to set the action state for Foe.
- FSM 4: Checks for Foe's HP, managing when is dead. Activates when it gets the ApplyDmgEv, from the bullet (the same for Player's FSM 4)
You might not be able to catch from it, because I didn't send the state actions. Take these references to set up your foe, have a player dummy and make, at least, the distance thing work. If you still don't get this, do come back and I'll prepare an export of my scene so you have complete access to the events, actions and such things. Be warned, this logic is based in sending events through FSMs, so, if you follow this approach, you WILL use pretty often the 'Send Event' action with Broadcast All or GameObject FSM targets.
-
Thanks, DARK_ETERNAL Jean told me about target pro I checked it out , it's a good product. But I would like to use playmaker this is why I purchased playmaker to avoid buying more shooting assets. I can set up the Idle and all the Animations. I searched every where for shooting tutorials on the Foe set up there are none. I got the distance and follow. I see your fsm set up, I do not know what variables, you used though.
are these events or variables -CompareDistEv, ApplyDmgEv,
-
Events. I use a convention that, everything that is an event, should have an "Ev" suffix. Variable names don't really matter, as long as you understand where are needed. I use a follow distance and an attack distance variable to tell how NEAR should be the player from the foe to follow/attack it. Those vars are local to each foe instance, so you can create different patterns.
Maybe you would rather having me to prepare an export of my scene?
-
No you do not have to do that, I am thinking about purchasing TargetPro. it would be good if there were more tutorials. What about a youtube Tutorial I know a lot of people are having the same problem look at the views.
-
Hi,
there are not screencasts of tutorials per say right now, but the port I did is covered by a working sample, that is a good starting point for you to get acquainted with target pro.
as always, do not hesitate to come back on this forum to get help, I'll happily answer all your questions if you have problem with targetpro port to PlayMaker.
bye,
Jean
-
Thanks Jean
I am going to Purchase the Action Game kit it has all the Features I need and more.
-
Hi,
you mean targetPro right? Excellent move. Be sure to get in touch with the guys at path-o-logical, they are very helpful if you have any questions about feasibility and patterns with the tool itself, then for playmaker implementation, do not hesitate to ask question on this forum, I'll make sure to reply and help you.
bye,
Jean
-
No Jean ,I mean Action Game kit with AI it seem to offer more than TargetPro.
-
Hi,
ok, Indeed it sounds packed with features! tell us how it goes with this, always interesting.
bye,
Jean
-
Jean I decided to just use C# For Shooting.
-
Hey,DARK_ETERNAL
do you have any tutorials on you tube?
-
I don't, unfortunately. What I did I did based on Hutong tutorials, then I just remade an old project I worked in with Playmaker, and I would take a long time to prepare a video, for now, since I'm finishing my studies for this term... May I help you some other way until I can prepare a video?
-
Dark_Eternal I recall you mentioning a example of your scene.
-
Ah, yeah, an export. Let me prepare it. I will include only the scene and such things, so I don't have to include Playmaker, which I suppose you already have. Give me this weekend so I can separate it from another tests I've been doing lately and you'll get that next week.
-
Thanks Dark_Eternal
-
Hi, Jean I just realized that you had made custom actions for Targetpro, I missed it in your reply . I am going to purchase Targetpro
Thanks
-
Hi,
Don't forget to use the special PlayMaker coupon on the targetpro wiki page.
bye,
Jean
-
Hey, michaelwwswr.
I've got your port "ready". And I mean "ready", because I've got this issue: When I make an export, I lose every reference to public variables and events. I would have a txt with the names of the vars and public events so you can quickly setup my export. This week I'll be doing this and posting it to you. Note that you will need to have Playmaker already imported in your project.
Greetings.
-
Thanks, DARK_ETERNAL
My playmaker is already loaded and updated to version 1.4.4
-
Hi,
for global vars, you have to first use "PlayMaker/Export Globals" and include the new asset created and include it in your package, but for global events it should all be there.
bye,
Jean
-
Thanks Jean. Will try that. I actually had a painful time exporting a test scene to one of my coworker because of that.
-
I'm having troubles uploading the package. Any email I can send you that?
-
m
-
Hi all,
Just thought I'd add a quick note: I purchased Target Pro last night... it's a great tool.
I'm also interested in hit points, health etc.. so am following along as I hope to gain some insight.
The following AI video tutorials really help in regards to line of sight, cone of vision & hit points.
http://www.youtube.com/playlist?list=PL64E6680ACC6040EB&feature=plcp
-
mickman keep us posted
-
Hi,
yes, keep us informed of your progress, and don't hesitate to come back on this forum if something in TargetPro is not available within my port. I'll happily do my best to cover it.
bye,
Jean
-
Dark_Eternal I used javascript to have the enemy shoot player.
-
That's a quicker way, I think, since I'm a programmer.
Setting the FSM is quite difficult. Or rather than setting the FSM, taking all the logic to an FSM. As an algorithm it should be easier to understand for a programmer, I think
-
Hey mickman how's things going with target pro