Author Topic: Unit Intelligence  (Read 4735 times)

hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Unit Intelligence
« on: 21 January 2009, 21:56:34 »
This could be an AI attribute that affects many different behaviours of a unit. Like if they automatically guard or take the shortest path or avoid traps or come to the aid of nearby units or retreat. I think this would make some units more independent than others; I'm not sure if this would be a good thing.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

dannylee

  • Guest
Re: Unit Intelligence
« Reply #1 on: 22 January 2009, 23:12:04 »
That would be great, sometimes the al is so stupid that they can't even find a way around a lake or river or forest, than they just walk in a circles for a few seconds and than stop.
Danny

modman

  • Guest
Re: Unit Intelligence
« Reply #2 on: 23 January 2009, 22:41:33 »
I would have to say, Glest has the worst pathfinding I've seen in a modern RPG or RTS game.

Could you explain this in a little more detail, Hailstone?  What would the units do if I sent in a Wyvern, for example?  What if they saw strong defence?

hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Unit Intelligence
« Reply #3 on: 23 January 2009, 23:38:14 »
I'm not sure of the details, it was just an idea to get people thinking. If a unit faced strong defence it might try go a different way or maybe request reinforcements. Which makes me think why units don't communicate back besides the usual "ok sir"?
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

modman

  • Guest
Re: Unit Intelligence
« Reply #4 on: 27 January 2009, 02:52:04 »
Cause it's simple that way!

Units should realize when to retreat, but that's covered in the "Improved AI" topic.  What this is useful for is when only one or two units encounter a large opposing force they should retreat until a nearly equal force is amassed on their side.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Unit Intelligence
« Reply #5 on: 28 January 2009, 07:58:55 »
This entire topic could actually be combined with Ideas to Improve AI. I agree with modman, and such a thing wouldn't be too hard.

Check the size of the opponent's group in a small area
Calculate how many can attack
    If outnumbered, fall back and request back up
    Else attack.
If loses are too high, call for back up.

My c++ skills are improving, but I don't really know the glest engine's classes and elements, which makes it difficult to mod it. Say, maybe someone should mae a simple file with syntax and a short description. Sure would make it easier for people to be able to modify the source. For now, I'll do it the slow way, examining everything... Maybe I'll take note, but there's still the things I got no idea what they're for...
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Unit Intelligence
« Reply #6 on: 28 January 2009, 23:42:21 »
OT:
Quote from: Omega
and such a thing wouldn't be too hard.
Unless you've actually done it. Don't say it wouldn't be hard.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

daniel.santos

  • Guest
Re: Unit Intelligence
« Reply #7 on: 29 January 2009, 03:52:59 »
OT:
Quote from: Omega
and such a thing wouldn't be too hard.
Unless you've actually done it. Don't say it wouldn't be hard.
true dat! :)

So just to follow up, I think it's a good idea and definately should be part of the Improved AI thread.  Also, I wouldn't too lightly say how it should be implemented.  My 1st idea is that each unit.xml designates the AI intelligence, but then I think that perhaps units with more kills should get a boost to their intel?  Perhaps the default level can have +15% intelligence or something.  Anyway, my other thought was about agility (somebody added this as a feature request to the bug database recently).  Finally, we'll have to work out how it will effect the AI, but I'm very much in support of having "stupid" and "smart" units.  Moreover, I'm in support of having leadership units who increase the AI intelligence of the units they command (or are near).  Perhaps it can be expressed in terms of a baseline of zero and units that are more intelligent than average would have a positive value and less intelligent, negative.

But there is a lot to consider with this topic and I don't have the full brain for it at the moment (got my head mostly on networking code).  But briefly, consider how ants function.  They communicate with each other in order to function as a whole unit.  Unit communication and awareness can be a part of this discussion as well.  I can think of some pretty interesting non-RTS games (simulation style) that could do neat stuff with that.  Also, part of this Improved AI includes a new path finder that collects important data about each path it returns and can accept requirements for a path (i.e., one that doesn't have enemy units, or enemy units that can attack, etc.).

gameboy

  • Guest
Re: Unit Intelligence
« Reply #8 on: 29 January 2009, 11:15:34 »
Quote
So just to follow up, I think it's a good idea and definately should be part of the Improved AI thread.  Also, I wouldn't too lightly say how it should be implemented.  My 1st idea is that each unit.xml designates the AI intelligence, but then I think that perhaps units with more kills should get a boost to their intel?  Perhaps the default level can have +15% intelligence or something.  Anyway, my other thought was about agility (somebody added this as a feature request to the bug database recently).
Thats a great idea i love it.
BTW I added those requests.

ZaggyDad

  • Guest
Re: Unit Intelligence
« Reply #9 on: 29 January 2009, 16:51:56 »
Is this idea just for the computer players, or the real players too? If it were for players too, it might be a bit annoying, since the units might retreat when you want them to attack, or call reinforcement units that you're keeping for defense at your base. Could be quite annoying.

And also, if an air unit is going somewhere, it should only check units that can attack air.

hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Unit Intelligence
« Reply #10 on: 30 January 2009, 02:44:55 »
Quote
If it were for players too, it might be a bit annoying, since the units might retreat when you want them to attack
True. I think this is what stances help with though. Set to aggressive stance and it will attack instead of retreating. Perhaps intelligence is the effectiveness of stances (at least partially)? Does reaction time and skill come into it somewhere?

The ORTS project has done different studies into RTS AI which might be worth looking at.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

modman

  • Guest
Re: Unit Intelligence
« Reply #11 on: 31 January 2009, 03:34:41 »
Alright!  AI's interest me, especially RTS AIs.
That's what I plan to do as a profession BTW, but of course I can flux a little to where I am needed. :D
Not sure what I have to study in school to get qualified for this ???, so I'll have to look into it.

hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Unit Intelligence
« Reply #12 on: 31 January 2009, 06:18:46 »
My Uni has a unit on AI and also http://aigamedev.com/ is interesting. I think AI is mostly done with scripting these days.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Unit Intelligence
« Reply #13 on: 31 January 2009, 10:45:47 »
OT:
Quote from: Omega
and such a thing wouldn't be too hard.
Unless you've actually done it. Don't say it wouldn't be hard.
Well, I admit, I haven't done it. But a possible strategy would be to use vectors and iterators. Do the same for your force. Now subtract the two integers (defenders - attackers) and if the result is >0, then attack, other wise, return to the starting base.

I admit, AI is my weak spot, and I'm sure RTS AI are some of the hardest. Scripting would be very nice for AI, but how to do it in Glest?
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

modman

  • Guest
Re: Unit Intelligence
« Reply #14 on: 31 January 2009, 16:27:22 »
I truely think that a good AI could put Glest over the top of Wesnoth, especially when combined with more, origanal compositions (the compositions for Wesnoth are exquisite!).  It would be nice to find a composer that would compose a few pieces that would go with Tech or Magic (The idea that more than one soundtrack can play per faction, and would play them in random order.

This article is very interesting.

hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Unit Intelligence
« Reply #15 on: 1 February 2009, 01:38:58 »
The url for the link appears to be missing Modman.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

modman

  • Guest
Re: Unit Intelligence
« Reply #16 on: 1 February 2009, 20:47:41 »

hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Unit Intelligence
« Reply #17 on: 3 February 2009, 10:51:52 »
It's interesting thanks. I only had a brief look at it though.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

daniel.santos

  • Guest
Re: Unit Intelligence
« Reply #18 on: 17 February 2009, 09:09:30 »
OT:
Quote from: Omega
and such a thing wouldn't be too hard.
Unless you've actually done it. Don't say it wouldn't be hard.
Well, I admit, I haven't done it. But a possible strategy would be to use vectors and iterators. Do the same for your force. Now subtract the two integers (defenders - attackers) and if the result is >0, then attack, other wise, return to the starting base.

I admit, AI is my weak spot, and I'm sure RTS AI are some of the hardest. Scripting would be very nice for AI, but how to do it in Glest?
vectors and iterators do nothing for you alone.  There are merely mechanisms to hold and iterate through data objects.  You've obviously never done this type of stuff before and, to be blunt, you have no idea how to actually do it.  You are just making wild assumptions.  You do know what happens when you "assume" don't you?  You make an "ass" out of "u" and "me" ;D