Creating a complicated AI

EastboundEastbound Member, BASIC Posts: 1,074
edited November -1 in Working with GS (Mac)
Is there any way in GameSalad to do actual coding, as to make a complicated AI? Like for a fighting game or an overhead shooter?

And if you can't code what is the best method for going about this?

Comments

  • ORBZORBZ Member Posts: 1,304
    i would like to know if this is possible too..
  • ktfrightktfright Member Posts: 964
    it depends how much you put into it...

    For my upcoming shmup game, my enemies were gonna fly straight, but with some sines and math, they swerve and move in a pattern, just to make things more interesting for the user.
  • quantumsheepquantumsheep Member Posts: 8,188
    ktfright's right.

    Additionally, I personally believe that what you really need to do is make your opponents give the illusion of being smart.

    For example, in one of my upcoming games, the enemies fly straight then randomly pick up or down and move forward in that direction.

    When you shoot at them, and they avoid your bullet, it looks as though they've done it on purpose when in fact they're just following the very basic rule I described.

    It's a bit like the SWAT guys in the original Half Life. They weren't doing anything special, but the comm chatter you could hear gave the illusion that they were really smart!

    Of course, if you actually wanted to give them 'proper' AI you could use a whole list of conditions that would dictate their behaviour.

    If their health was low, for example, move away from player. If it's high, move towards player. If player has no ammo, or is reloading, move in. If player is not visible, move in random direction.

    Or you could put put in invisible waypoints. This way, enemies could patrol along paths.

    Move enemy towards waypoint 1.
    When waypoint 1 is reached, stop for 2 seconds. Then move to waypoint 2 etc etc

    Within those rules you could have 'If enemy spots player, move towards player and shoot every 3 seconds'.

    It really depends on what you want. But using logic and a little imagination, you could pretty much do anything with the behaviours we have at the moment.

    Or not! YOU BE THE JUDGE!

    Hope that helps,

    QS :)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • EastboundEastbound Member, BASIC Posts: 1,074
    Well since I have since downloaded the program since I made this thread, I can now answer my own question!

    To answer my original question forwardly: No, you cannot make complicated AIs. I don't consider enemies moving in arcs and such as complicated AI.

    For instance if you wanted to make a 2D fighter (such as Street Fighter) with a somewhat believable AI it would be nearly impossible.
  • quantumsheepquantumsheep Member Posts: 8,188
    Now there's a challenge! :P

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • EastboundEastbound Member, BASIC Posts: 1,074
    And now that I say that I actually think that I could make one, but it would look so messy I don't really want to think about it :p
  • quantumsheepquantumsheep Member Posts: 8,188
    Heh. You've really got me thinking about it now! Damn you, sir!

    :)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • KamazarKamazar Member Posts: 287
    Not impossible, but there's just so much more flexibility and better handling of math and variables in pure programming that it would seem more straightforward if you were coding in Obj-C. In GameSalad, though, simplicity is key. Creating a complicated AI with GS is like building the Eiffel Tower out of legos.
  • quantumsheepquantumsheep Member Posts: 8,188
    "Creating a complicated AI with GS is like building the Eiffel Tower out of legos."

    Yeah, but how COOL would that look? :)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • quantumsheepquantumsheep Member Posts: 8,188
    I was thinking it would be bigger? :)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • JGary321JGary321 Member Posts: 1,246
    It's not the size that matters.... It's what you do wit....

    Bah, who kidding.

    It IS the size that matters.

    And that Lego Tower is SMALL
  • VmlwebVmlweb Member Posts: 427
    I had an AI idea for a character in my game that has a rocket launcher. I make a long stick actor and made it invisible. Then constrained the co-ordinates so the stick was always pointing strait out of his head in the direction he was facing. Then I set it to fire whenever the stick collided with a man.
  • JGary321JGary321 Member Posts: 1,246
    VMLweb, that WILL work sorta. However you will find that once the enemy has already collided & is still overlapping with the invisible range actor, it will not keep firing. The overlap/collide rule only works once. I tried this for a cartoon wars style game. The way I got around this was not very memory efficient, but it worked. I spawned & deleted the range actor every sec, so that it would constantly refresh.

    I even tried throwing the whole collision rule in a timer & that did not work either. Maybe it was a bug, I don't know. Have you had any luck thus far with it? I put that game on hold for a while, b/c of many issues, but the range thing was one. Now that I know about the whole magnitude thing, I reckon that could solve the range attack issue.... I haven't tried it again yet.
  • VmlwebVmlweb Member Posts: 427
    GameSalad should provide tools for creating your own behaviours really. Maybe using the language GameSalad was created in so we could extend the possibilities. We could make our own behaviour that does just what we need.
  • KamazarKamazar Member Posts: 287
    I'm guessing once GameSalad reading start gaining momentum, progress and additions like you're hoping for, Vmlweb and Eastbound, will pop up. It just takes a while. We haven't even reached version 1.0 yet, but we're getting there.
  • urhungryurhungry Member Posts: 112
    I hope not, just because I can not program with code at all. Thus, it would put me at a disadvantage.
  • VmlwebVmlweb Member Posts: 427
    If code is implanted into gamesalad at any time it will not change the way non-coders do things. It will be added as an extra not a replacement. I reckon it might be added as a code behaviour and you type the code into the behaviour window.

    So it probably won't change non-coders.
  • ktfrightktfright Member Posts: 964
    Just remember the whole point of GS is to simplify making a game. I'm not saying don't ask to have the option to code your game, but let's assume their priority is to make everything simpler for the non devs. It's not a complete replacement to things like cocos2d.
  • VmlwebVmlweb Member Posts: 427
    Putting code in wouldn't complicate the process of making games it would just extend the complexity of games.
  • ktfrightktfright Member Posts: 964
    Yeah your right, it will eventually get to a point where if you do want to take your game to the next level, then you should code that in.
Sign In or Register to comment.