Skip to main content
GameDev.net gamedev.net

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro — $3/month.

Weakness detector

Weakness detector

Calin
Calin
DreamLand editor · · 12 min read
997 12

Blog entry 1: Weakness detector

[No introductions I will get straight to the problem]

In the "quick implementation" I did I had line of sigh in the shape of quads instead of circles. I added these quads to the pathfinding obstacle map doing this alowed me to make units avoid the enemy unit fire range/line of sight. This is useful if you want to attack the weak spots of your enemy while avoiding his combat units. You can actually go further with this and make from attacking weak spots a rule of a thumb. When you're attacking a base you can investigate the base from all sides and attack the base from the less defended side1 . This is 100% posible and any programer nows it. Just map the area where the enemy bunkers or turets are and avoid that area of the base when you begin the attack.

But there is another side to it. If you can exploit the weak parts you can also build AI that is aware of his weak parts. When you are aware of a weak part of your base (or attack force) you can think of ways to protect your base. It's very much like an ethical hacker job. The problem is when you play a good RTS game when you chose a tactic there will be weak spots to that tactic. It's called specialization. You become good at something at the price of becoming exposed or sesitive somewhere else. You know the good sides and the bad sides of the tactic right from the start (a tactic and the counters to that tactic is something you learn in time by playing a ton of multiplayer games). There are fixes to your weak spots but if you chose a tactic and then try to patch the weakenes right away you get broke and find yourself in a position of not being able to bring your attack force at the required strengh. So the way if works in multiplayer RTS is that you chose a tactic and hope that the fog of war will prevent your enemy from discovering the decision you made and exploit the weakess of that decision.
If I was AI and started pathching all my weak spots I would end up with an inefficient attack force2. But if me, AI am reacting only to those weakneses of mine that are known to the enemy I am placed in a position were I have more money to spend on my attack force.



1 In Starcraft bunkers and turets make a good defence but you can't place bunkers all around your base, there's not enough money. Because of this some parts of your base remain exposed and in games like Starcraft or Warcraft loose one or two buildings and you're critically handicaped.
2 I could reach eventually the number of units required for an attack but by that time the enemy would have expanded on the entire map, that's what non-newbies players do when they see an enemy that has good defence and weak attack force.


JoeJ in case you're reading this, some thoughts related to your journey of building a real-life-like video games characters. I think you have to decide what "room" your characters belong to. There is direct or explicit information. A question expressed in human language can be understood by computers (take Chat GPT for example). Two cars sitting next to each other, with serious bends in their bodies while the bend of each car's body matches the bend in the other car's body doesn't mean anything. It's just a layout on two objects in 3d space. A computer (robot) doesn't understand it. You need to build a software to interpret the layout. If this scene was on a circulated road it's a car accident that took place seconds ago and urgent action is required people might be hurt, the cars might burst into flames etc. If the cars are in a car cemetery it's just a boring typical scene with two cars dumped there by their owners probably ages ago, nothing worth exploring or wasting time on. The matching bends is just a coincidence. Diferent rooms diferent interpretations.
If you see two people displaying carate moves in a sports yard or a building where martial arts are taught, that's a typical boring scene nothing to spark particular interest. It's just young adults or some soldiers learning carate. If you see the same scene on the street it's a crime unfolding and urgent action is required. A computer is dead matter it doesn't have interpretations of things. Two car wreks is just arangement of things.
You have to look at the goal of the room to understand the meaning of how things are aranged. When you're on the street the goal of the room (everyone's goal in that room, I mean the goal of every person) is universal hapiness and harmony, if you see two smoking wreks at that point you act acordingly to this goal. When you walk past a car cemetery the goal of the room is that's someones working place none of my business what's taking place there, I'm a passer by, a guest. If I work at the car cemetery the goal of the room is do everything that's required in the job description. Two car wreks is my working material. If I walk into a university the goal of the room is advancing in knowledge. The common theme in a building like this is people with a certain dress code, discussions about grades, exams, people use specialized terms in acordance with the profile of the university, people carry books, notebooks, they oftern read from them or take notes (not just in the class rooms, in the hallways too). The univesity room is a small world with it's own rules. The street has it's rules. A car accident is likely to hapen on the street. You don't have car accidents or pedestrians being hurt by cars in an university. A remote area with car wreks far from the bussy streets of a city has it's rules. A supermarket has it's own rules people engage in a particual type of discussions and behaviour.


Your NPC I think should react to what they perceive. If it's a request made in spoken or written human language (say you tel them to bring something) their will behave based on what you've told them. But they should also be able to read indirect information: movement of objects, characters, what object is left where, who is doing what or speaking to whom. In a RTS or a third person RPG game you can't follow the eye movement of characters or the direction a character is looking at (there was a FPS demo I played which had an adult guy and a chick next to him and if you were looking at the woman he would say anoyed "why you looking at my woman?" that was a funny moment) so a NPC can't interpret what you're doing in a case like that. But generaly speaking you need factors that drive NPC's behaviour.
How to generate a dynamic environment something proceduraly driven? I was thinking you could have characters (NPC's) of diferent professions and backgrounds. Each 'profession' interacts in a specific way with each of the other professions (question is it posible to have a biased chat GPT? a robot that comes up with biased answers based on some predefined criterias? that would solve the people with different profession problem). Then you could have a city map and have all these people (NPC's) of different professions placed on that map at random locations and times. This would create random interactions of people on the street and each time you load the map the experience would be diferent, no need to script and predefine things in advance. Imagine a woman with a pet on the street (dog or cat or whatever) and another woman with a child walking by. The interaction is programatically driven it may or may not take place it's a random encounter. When the woman with the pet and the one with the child are close the child says "I'm afraid" the woman with the pet would answer "don't be afraid it's a friendly cat" and then the child would interact with the pet for a while, then they would separate and go their ways. Other times the woman with the pet might walk at the same time and location but without the woman with the child being around so the interaction would not take place, the woman with the pet would reach faster a crosswalk and that could trigger another change in the environment for example it could make a car slow down and stop which in turn would trigger other changes (the car would pass without slowing down under different circumstances for example if the woman with the child and the one with the pet were to met). This way you get a dynamic environment. Usually people don't interact with each other when they are walking on the street but sometimes they do, it's enough to have someone say "pardon me" and that could set the action on a diferent course. Also if you have people that know each other meet that's a guaranted interaction. If you could have chat GPT characters with different personalities interact that would drive fresh spontaneous discusions.


Blog entry 2: Player screen space

Before I get to player screen space idea I will say one or two things about something else.

Advanced AI vs classical AI

In my past blog entries I was saying I will be working on a scenario were Advanced AI is fighting classical AI. After sorting things out I reached the conclusion that if you want Advaced AI working at full capacity you have to place him in the same room with another advanced AI.

How we think

Our thinking is entirely purpose driven. We like to belive we're chosing our thoughts I mean like we're deciding what we're thinking at. IMO the enviroment around us dictates what we're thinking at. When we're walking down the street solving the problem of getting from point A to point B is keeping our mind bussy. One could emphasize that we chose the path we're going to follow when we're about to walk down the street which implicitly means that we're the ones deciding what we're going to think at. But when you decide to reach a destination you're decission are not driven by "just because" they are driven by eficiency motives (which path is shorter etc.). In my opinion there is no such thing as freedom of will. When the sidewalk, road, whatever is clear (no people or things requiring atention) we fall back from a problem solving state of mind to a meditative state of mind.

Meditative state of mind.

Meditation is like having a chat with someone in your mind. The person you're talking to doesn't answer back when you do that, but what happens is that you state one thought and then you derive another thought from it. And then you derive a third thought from your second thought or maybe from your initial thought. It's very much like writing a blog entry. When you're writing a blog entry "the medium" where your thoughts are saved is the screen of your computer. You can go back and read what you wrote a few seconds ago. It's there. Same thing happens when we think. Every thought is driven by another thought we've previously had or an external event. When the external event does not require attention anymore we're back talking to people in our minds. I for one talk with frob and JoeJ about AI and programming in my mind (it means that I'm preparing for a future encouter with them), I'm talking with my mother in my mind about house problems (I'm preparing what I will say next time I meet her) etc.
Meditation is also problem solving because we talk with people about life problems too. Hence we're preparing discussions in our free time.
Thinking is like speaking out loud ideas. The thought remains in a "medium", we can recall it the next second we had the thought. We articulate ideas in our mind but we can't remember exactly the form in which our thoughts were expressed (except the very last thought) like a computer screen. We can't remember the exact form of the thought even if the thought was just a minute ago. We can't meditate indefinitely. When you begin to repeat yourself I mean you stop saying new things to the person you're talking to in your mind the meditation if over. You move to something else. We learn new things each day so soon we're back at talking with the person in our mind because we have new things to say.
In my mind I talk to JoeJ in english, I'm thinking in English that is. With my mom I'm talking in Romanian or Russian (I'm thinking in Romanian or Russian).

Purpose driven player screen space.

It's not dificult to imagine an AI player that plays a RTS exacly like a human player I mean the AI plays using a screen centered on a certain part of the map. The AI would have a mouse cursor. The cursor moves in straight lines from one building to the other or to locations on the screen were units are located or need need to be moved. The order of mouse events could be very well driven by a state machine. If a building or a move unit location is outside beyound the edges of the player screen the AI would move the mouse cursor to the edge of the screen to scrool the screen in the desired direction. Moving the move cursor from one location to another takes time. The end result will look very much like a human playing the game. If you go down this road chances are sometimes you will miss enemy workers scouting your base if your screen is centered elsewhere. But I think that's the correct aproach to things. It's reasonable and realistic.


Discussion

Loading comments...