Page 1 of 1

Adding AI?

Posted: Wed May 29, 2013 6:43 pm
by Eamonn
If I was making a game, how would I add AI to something like an enemy? I've never done it :P
In case AI means something else in LÖVE, I'm talking about artificial intelligence.

Also, would it be illegal to make a snake clone and put it on the LÖVE forums? I was thinking of making one but I'm not too sure... obviously not using a copyrighted soundtrack and just the concept itself!

Thanks! Any help is appreciated! :D

Re: Adding AI?

Posted: Wed May 29, 2013 6:55 pm
by MadByte
Link
Sorry but, try searching things on your own. You created ~20 topics in this short amount of time you are
registeried on this forum. Try harder finding what you wanna know. -.-*

Re: Adding AI?

Posted: Wed May 29, 2013 7:10 pm
by Hexenhammer
Eamonn wrote:If I was making a game, how would I add AI to something like an enemy? I've never done it :P
In case AI means something else in LÖVE, I'm talking about artificial intelligence.
That is a pretty general question. It depends on your engine design. The most basic AI would be some entity having an AI which causes it to chase the player. Assuming the entities in your game world have simple (x,y) positions it would look something like this

Code: Select all

if player.x < self.x then
  self.x = self.x - 1
end

if player.x > self.x then
  self.x = self.x +1
end

if player.y < self.y then
  self.y = self.y - 1
end

if player.y > self.y then
  self.y = self.y +1
end
self (your actor with AI) would now chase the player.. that's some - very basic - AI. There is nothing special about AI code really. Basic principle of a simple AI is that your AI code looks at the world state (here the current position of the player) and reacts to it e.g. by moving the actor the AI controls or making the actor do something else e.g. attack:

Code: Select all

if distance(self, player) == 1 then

 self:attack(player)

end
.. or something like that.
Also, would it be illegal to make a snake clone and put it on the LÖVE forums?
No, game mechanics aren't subject to copyright and there is no patent covering "snake" and there will never be one either (it would be easy to find "prior art").

Re: Adding AI?

Posted: Wed May 29, 2013 7:14 pm
by Eamonn
Hexenhammer wrote:
Eamonn wrote:If I was making a game, how would I add AI to something like an enemy? I've never done it :P
In case AI means something else in LÖVE, I'm talking about artificial intelligence.
That is a pretty general question. It depends on your engine design. The most basic AI would be some entity having an AI which causes it to chase the player. Assuming the entities in your game world have simple (x,y) positions it would look something like this

Code: Select all

if player.x < self.x then
  self.x = self.x - 1
end

if player.x > self.x then
  self.x = self.x +1
end

if player.y < self.y then
  self.y = self.y - 1
end

if player.y > self.y then
  self.y = self.y +1
end
self (your actor with AI) would now chase the player.. that's some - very basic - AI. There is nothing special about AI code really. Basic principle of a simple AI is that your AI code looks at the world state (here the current position of the player) and reacts to it e.g. by moving the actor the AI controls or making the actor do something else e.g. attack:

Code: Select all

if distance(self, player) == 1 then

 self:attack(player)

end
.. or something like that.
Also, would it be illegal to make a snake clone and put it on the LÖVE forums?
No, game mechanics aren't subject to copyright and there is no patent covering "snake" and there will never be one either (it would be easy to find "prior art").
Thank you :)

Re: Adding AI?

Posted: Wed May 29, 2013 10:18 pm
by Sheepolution
Eamonn wrote:In case AI means something else in LÖVE
Nope, it's called the same everywhere.
Eamonn wrote: Also, would it be illegal to make a snake clone and put it on the LÖVE forums? I was thinking of making one but I'm not too sure... obviously not using a copyrighted soundtrack and just the concept itself!
As long as you're not making money off of it, don't worry about copyright. Nintendo is not going to sue you when you're remaking the original Zelda and put it on the forums, unless you're actually selling it.

Re: Adding AI?

Posted: Thu May 30, 2013 11:45 am
by Robin
Sheepolution wrote:Nintendo is not going to sue you when you're remaking the original Zelda and put it on the forums, unless you're actually selling it.
As long as you're not using Nintendo's image and sound assets, original reverse engineered code or things like that.

Re: Adding AI?

Posted: Thu May 30, 2013 11:47 am
by Sheepolution
Robin wrote:
Sheepolution wrote:Nintendo is not going to sue you when you're remaking the original Zelda and put it on the forums, unless you're actually selling it.
As long as you're not using Nintendo's image and sound assets, original reverse engineered code or things like that.
You can still get sued, even though you're not selling it? Oh because you're using and sharing something that's not yours right?

Still wondering how Mari0 got away with it..

Re: Adding AI?

Posted: Thu May 30, 2013 12:11 pm
by Robin
Sheepolution wrote:You can still get sued, even though you're not selling it?
Copyright law as shaped by the Berne Convention is not about profit, but about the right of the author to control distribution of their work.
Sheepolution wrote:Still wondering how Mari0 got away with it..
Luck, relative obscurity and more luck.

Re: Adding AI?

Posted: Thu May 30, 2013 8:54 pm
by Jasoco
As long as they aren't selling it, it's a fan game. Super Mario Crossover does the same thing with Mario and a bunch of other Nintendo, Capcom, Konami and other properties. But they do it for fun and not for profit.

Just don't try to charge anyone money or take donations to make the game and you most likely won't have a problem. There were projects in the early 2000s that tried to charge or otherwise take money and got shut down for good reason. If you're just making a silly fan game for people who love these games you should be fine.

I say should because this stuff could change at any time. Usually they're left alone because it's good publicity. But then again there is Nintendo taking advertising money from Nintendo LP's and Sega shutting down accounts that refused to remove LP's of an older game they had just released a sequel to.