Smart AI
Dec 28 2009, 10:51 pm
By: Sacrieur  

Dec 28 2009, 10:51 pm Sacrieur Post #1

Still Napping

How many times has it happened that the computer sends its units helplessly towards the enemy in TS, CHW, or HS only to die a horrible death at the hands of a player or other units like itself? Not only is it unfair for the poor creatures, but also detrimental to the players. The soldiers only tend to steal kills or block your path when trying to escape. But no more!

I was thinking about this in light of a map I'm making named Battlefront (currently in preproduction, I'll be looking for terrainers soon). I wanted to change the formula of the genre for the better. One of the things I wanted to do was smart AI divided into regiments and squads. How I was going to do this with computer AI confounded me for a time.

Then it came to me that if I was going to control them precisely I would need to be able to command each unit individually. So 1-pixel locations enter the picture. By following each soldier with a 1 pixel location I can track each and every one of them. By combining several different locations on top of this I can ultimately control entirely what the squad does. With a lot of triggers I can make the group work as team completing objectives, covering fire for other teams, and helping out the players by both getting out of their way as they run back to base and getting in the way of whatever is trying to kill the player.

Suddenly the options are limitless. The only drawback is that due to the limited number locations being placed on the map these squads will probably be smaller in numbers. This matches up with my original goal for my map though \:D

I will work hard to produce a proof-of-concept map ASAP.



None.

Dec 28 2009, 11:31 pm Kenoli Post #2



Giving units individual locations doesn't help much. The best you can do is still to just clumsily order them around with 'move' or 'attack'.
Imagine trying to get a group of units to not block the player. How do you determine if they're blocking? How do you order them in such a way that they create a path for the player? You'd need all sorts of information about the surrounding environment that can't be detected at all. Such a maneuver doesn't seem even remotely feasible.



None.

Dec 28 2009, 11:48 pm Sacrieur Post #3

Still Napping

Quote from Kenoli
Giving units individual locations doesn't help much. The best you can do is still to just clumsily order them around with 'move' or 'attack'.
Imagine trying to get a group of units to not block the player. How do you determine if they're blocking? How do you order them in such a way that they create a path for the player? You'd need all sorts of information about the surrounding environment that can't be detected at all. Such a maneuver doesn't seem even remotely feasible.

You can tell whether you're blocking the player by detecting if an enemy player is in the player's vicinity (the players will have several locations on them, the largest one will be used for this). To tell if the player is running is done by detecting the direction of the player (never said it was going to be easy \:P) and the enemy player. If the vectors are the same or similar then the squad will be ordered to move away when the player gets close and then move/attack the enemy target.

Again, I never said it would be easy, but it can be done.

The surrounding environment will be more wide and open and with less narrow winding paths to improve AI/player function. The AI will mostly be given a list of objectives with priorities. Self-preservation will be a top priority as well as helping players. If you call for help after diving head first into an enemy base full of twenty enemies they're not going to come and rescue you, rather realizing it is a lost cause and you shouldn't of dove in, in the first place.



None.

Dec 28 2009, 11:50 pm Marine Post #4



Obviously this is going to take a while, and I agree with kenoli, it won't help to make individual locations very much, although you might find a way that it will. Also, if you have the same unit, one location can't be centered on all of them, and multiple locations will take up strings + it will be a mess, since it won't identitfy which unit is where and what you want done with that specific unit. By the time you figured that out and ordered something, the location would move since a unit may die/be created.

Also, you'd need locations to tell where the player is on the map, to register if they're in a tight area that is easily blocked or an open area where you can't be blocked. Another thing, you can't register what unit order units of the same kind are in unless you use EUDs.

Overall, you need EUDs to do this.



None.

Dec 29 2009, 12:41 am Sacrieur Post #5

Still Napping

Quote from Marine
Obviously this is going to take a while, and I agree with kenoli, it won't help to make individual locations very much, although you might find a way that it will. Also, if you have the same unit, one location can't be centered on all of them, and multiple locations will take up strings + it will be a mess, since it won't identitfy which unit is where and what you want done with that specific unit. By the time you figured that out and ordered something, the location would move since a unit may die/be created.

Also, you'd need locations to tell where the player is on the map, to register if they're in a tight area that is easily blocked or an open area where you can't be blocked. Another thing, you can't register what unit order units of the same kind are in unless you use EUDs.

Overall, you need EUDs to do this.

There will be a location for every squad unit. It doesn't make so much as a mess as one might think. Sets of locations labeled A1, A2, A3; B1, B2, B3; C1, C2, C3... will hardly add too much clutter. As soon as the unit dies the location will be moved back to a resting area where a new unit is spawned and awaits for the team to head back to base and replenish its forces with fresh reinforcements.

And you can't detect precisely where a unit is on a map in the traditional sense, but you can detect where a unit is relative to other units. Some simple conditions will suffice:

Player 7 brings exactly 1 terran marine to location A1. - Tagging the unit.
Player 1 brings at least 1 [men] to location A1-1. - A1-1 will be the units next largest location (probably a 3x3). Also saying that there is an allied player right next to the marine.

So with that information we can add a death count to a calculator that will factor the units next decision.

Where exactly the marine is in P1's area can be deciphered using three locations that follow P1: a 3x3 location, 3x1 location, and 1x3 location.


P1-1 is the player's 3x3 location.
P1-H is the player's 3x1 (horizontal) location.
P1-V is the player's 1x3 (vertical) location.

If the marine is in P1-1, but not anything else then he he is in a diagonal. If he is in P1-H he is to the side, and if he is in P1-V then he is above or below the player. It isn't a perfect system with absolute detection, but it is better than nothing.



None.

Dec 29 2009, 12:50 am lil-Inferno Post #6

Just here for the pie

I made a topic that weaves its way in and out of what you're saying. But what I was talking about is just general artificial intelligence.

http://www.staredit.net/topic/8936/




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[02:26 pm]
UndeadStar -- Vrael, since the ad messages get removed, you look like a total madman for someone that come late
[2024-5-02. : 1:19 pm]
Vrael -- IM GONNA MANUFACTURE SOME SPORTBALL EQUIPMENT WHERE THE SUN DONT SHINE BOY
[2024-5-02. : 1:35 am]
Ultraviolet -- Vrael
Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
Gonna put deez sportballs in your mouth
[2024-5-01. : 1:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
[2024-4-30. : 7:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
[2024-4-29. : 6:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[2024-4-29. : 4:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[2024-4-29. : 12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[2024-4-29. : 11:17 am]
Zycorax -- :wob:
Please log in to shout.


Members Online: X405