|
Post by bartyrocks3 on May 8, 2016 12:36:00 GMT
Is there someway i can set the ai to chase but as a flying airplane? Can i add an ai to the airplane demo or something?
|
|
|
Post by WhyNot on May 8, 2016 13:14:27 GMT
|
|
|
Post by cypermethrin on May 8, 2016 15:03:22 GMT
I find this idea interesting, if you were to try it I would be happy to help with logic/code
|
|
|
Post by Das Uberstein on May 8, 2016 18:32:26 GMT
In order to tell, I am not very good at plane games but this might help you:*A voracious amount of scripting.
Well, why do you switch out of racing and post questions that are already answer like the perfect shading thing, that could be achieved but it takes SO MUCH TIME and switch to a plane game, Ace Combat perhaps or you played X-Plane or FSX or even YSFlight. Hmm... But cypermethrin is a scripting pro, AngelScript is very similar to C# and Cypey would be here to help you out and BTW, in the 3DFoundry days. I ever wanted to create a fighter jet game but canceled it because it is too hard. I could help you on racing games perhaps.
|
|
|
Post by cypermethrin on May 8, 2016 19:10:35 GMT
Don't be put off BartyRocks, all scripting is just logic, get that bit right and its easy from there. Its only hard to script when you haven't thought through what you want to do first. It would probably be a bit difficult to make AI to control the plane demo plane, but you only need to move a SM/RB around under computer control like a plane so you don't *need* to use it. Let me know if you want to give it a try, my Angelscript is rusty, but its all the same tune, just different lyrics (and luckily RAD has a built in song book called "the help button" which we shouldn't be afraid of)
And just to be clear, as anyone who knows me knows, I won't do this for you, but if you stick with it I'll make sure that you can
|
|
|
Post by bartyrocks3 on May 9, 2016 2:30:50 GMT
100% interested and I would LOVE for you to help!
|
|
|
Post by bartyrocks3 on May 9, 2016 2:31:48 GMT
Plus your script is better than mine. I know almost NOTHING about angel script...
|
|
|
Post by bartyrocks3 on May 9, 2016 14:10:59 GMT
I don`t want it to follow a path, I want it to follow the player. I will record and upload an example when you ask.
|
|
|
Post by NicusorN5 on May 9, 2016 14:16:25 GMT
You can use Pathfinder+Some Airfoils activator script (kind of)... PathFinder will follow the player, and Airfoils will make the AI plane fly... Tell me plz if im wrong.
|
|
|
Post by cypermethrin on May 9, 2016 18:23:24 GMT
OK then, so first things first, what do you *really* want it to do?
You say - Chase the player
I say - Follow till it crashes into it, or something different, like follow to a certain distance then circle, or veer off to make another attack run, or something else? Does it take the most direct path, does it have any randomness on the approach path, can it miss like a person or is it perfect like a computer? Does it have to take off or land, or is it always in the air? does it have to avoid anything? Can it fly upside down or does it need to stay the right way up, does it have guns to aim, or missiles to lock? - you get the picture, there are a lot of different "chase the player" scenarios!
Define the end result *exactly* then we can move to the next step
|
|
|
Post by NicusorN5 on May 9, 2016 19:21:03 GMT
LOL i didn't think at that.
|
|
|
Post by bartyrocks3 on May 9, 2016 20:56:26 GMT
I will upload that video...
|
|
|
Post by cypermethrin on May 9, 2016 21:16:38 GMT
By all means upload the video so we can work through it together, what is shown in the video must then be converted to descriptions of behaviors, then to logical statements, then to code...
|
|
|
Post by cypermethrin on May 9, 2016 21:24:21 GMT
LOL i didn't think at that. Think of the process as a journey and the computer as a taxi driver with the script as your instructions to the driver...if you live at 99, Any Street, Gamestown, USA, then saying "drive me to the USA" won't get you home, it may get you close, or it may get you hundreds of miles from where you want to be...the more specific you are the closer the end result will be to what you want, the driver doesn't know what you meant, only what you said
|
|
|
Post by bartyrocks3 on May 10, 2016 13:50:40 GMT
you are the yellow ship. I want the ai to do EXACTLY what the red ship did with the shooting and everything. THANKS!
When I press the buttons hard, that is when I am shooting. LISTEN WITH SOUND PLEASE. Thanks again!
|
|
|
Post by cypermethrin on May 10, 2016 18:10:42 GMT
Ok, so I think we need to recap a little.... you say "I want the ai to do EXACTLY what the red ship did with the shooting and everything"
so that means you want the AI to accelerate, climb slightly, head toward the player, shoot and miss whilst spinning, veer off to the right climbing slightly, then loop to the left, fly down toward the player shoot and miss again then stop.
AI stands for artificial intelligence, this means giving a set of rules for what the program should do when things happen or conditions are met, like how you think when you do something - this is what you should define EXACTLY
a few very simple example rules -
if the player is further away than 200m then aim directly at the player and accelerate if the player is less than 50m away then slow down, aim and fire if the player is less than 20m away then avoid player and accelerate away
These should all be reactions to a situation if....then.... in this way we build a framework for the AI to function under different situations, the more conditions the AI has a response to the more interesting it will be. Hope that makes it a bit clearer for you to define the solution a bit more, if not let me know and I'll try to explain differently
|
|
|
Post by TinSoldier on May 10, 2016 21:08:00 GMT
Have you looked at this message thread - 3drad.boards.net/thread/527/car-path?page=3Look down to find my reply and a link to a project, it's a custom AI script i created. I cant say if it will work for you, but i think it mite work for the airplane objects.. cant hurt to try. It can be customized, it has descriptions in the script object to guide you to what each settings does.
|
|
|
Post by cypermethrin on May 10, 2016 21:58:22 GMT
Tin - Not seen that before, I'll take a look, always interested in how other people implement things. My idea of this was more as a learning tutorial on how to design and implement a script, thought it may be useful here EDIT - Downloaded it now - great idea, incredibly simple which is always best and a novel way of implementing the targetting, I like it. This could be modified with a rotation based on velocity to keep the visuals in order and work well as a simple chase and shoot aircraft AI
Barty - if you want to go with Tin's and it does what you need just let me know and I'll leave you to it
|
|
|
Post by bartyrocks3 on May 11, 2016 1:31:21 GMT
I want it to come at the yellow ship which will be moving, and I want it to shoot and get close, then pull up, and try again.
|
|
|
Post by cypermethrin on May 11, 2016 17:18:44 GMT
OK so, details....
"I want it to come at the yellow ship which will be moving, and I want it to shoot and get close, then pull up, and try again."
Break it down, like I said, a set of instructions and conditions...if...then....
"I want it to come at the yellow ship"
If enemy is further away than xxx then point toward enemy and accelerate
"and I want it to shoot"
If enemy is in front of AI and distance is less than XXX then reduce speed and fire guns
"then pull up"
if enemy is closer than XXX then increase altitude and turn away from player and accelerate until distance is more than XXX
"and try again"
If enemy is further away than xxx then point toward enemy and accelerate (back to first condition)
Coding is logic, logic is specific, there is no interpretation, your statement has nothing specific in it so cannot be converted to code
This is the work flow, description to psuedo code to angelscript for example:
If enemy to player distance is less than XXX then reduce speed and fire guns
to psuedocode (words in a scriptlike structure)
if (magnitude of(enemyposition-playerposition) < XXX) then enemyspeed reduced by xxx start projectile object}
to Angelscript
if (iVectorCompare(TargetPosition,EnemyPosition,AttackDistance)){ if (OUT_24 > 100) IN_24 -= 1; // reduce force iObjectStart(OBJ_66); // start projectile object }
As I said before I won't just write you a script, I'll lead you through writing a script...if this isn't what you wanted then no problem we can stop, otherwise have a go at creating some descriptions of all the conditions you want, the more conditions the more varied and interesting the AI will be
|
|