TinyChan

Topic: game AI

+Anonymous A5.1 years ago #57,945

images-65.jpgusing ready made engine like unity
how do write out my own AI?
something good and world class, like minecraft or FEAR, relative to player's interactivity?


how do i connect all of its custom properties or plan out its capacity based on game difficulty and the unit's situation like morale or positioning?

cheers

+Anonymous B5.1 years ago, 14 minutes later[T] [B] #602,463

https://youtu.be/uq-gYOrU8bA

+Anonymous C5.1 years ago, 1 hour later, 1 hour after the original post[T] [B] #602,465

great questions thanks for asking

·Anonymous A (OP) — 5.1 years ago, 10 hours later, 12 hours after the original post[T] [B] #602,506

@602,463 (B)
good song thanks for sharing

@previous (C)
it s not. whats the answer tho

·Anonymous A (OP) — 5.1 years ago, 7 hours later, 19 hours after the original post[T] [B] #602,529

bump?

+Anonymous D5.1 years ago, 4 hours later, 23 hours after the original post[T] [B] #602,538

Go away and spend at least 5 years studying computer programming and game engine / A.I. development.

·Anonymous A (OP) — 5.1 years ago, 3 hours later, 1 day after the original post[T] [B] #602,555

@previous (D)
how do you balance your video game design

how do you tweak them

i think i have read 10 years worth of video game design book and i have never encounter the answer to my question, but i could be wrong so you can point me out the exact line for this

+Anonymous E5.1 years ago, 44 minutes later, 1 day after the original post[T] [B] #602,560

You need a partner with a seance of art. (you may find the humor in the sperling)

·Anonymous D5.1 years ago, 4 hours later, 1 day after the original post[T] [B] #602,591

@602,555 (A)
> how do you balance your video game design
Very carefully.

My experience is OpenGL & Vulkan in C/C++, so low level stuff, not so much working with game engines.

As for A.I., well it all depends what game you are making. There are hundreds of types. Do you want to write an A.I. for a FPS, where the enemy attacks you according to some clever deep learning algorithm which learns from your tactics? Or are you making an RTS where the A.I. has to do base building, unit production etc. I would start off by learning some basic algorithms like sorting, path finding, traveling salesman and so on, as well as basic data structures - arrays, linked lists, hashmaps, binary trees. Once you have a solid grounding in those techniques, maybe research neural networks - basic: perceptron, multi-layer feed-forward networks, gradient descent, back propagation; advanced: convolutional NNs, recurrent NNs, LSTMs.

> i think i have read 10 years worth of video game design book and i have never encounter the answer to my question
I find that very hard to believe.

·Anonymous A (OP) — 5.1 years ago, 4 hours later, 1 day after the original post[T] [B] #602,658

@previous (D)
hmmm. i know those algorythm names and data structures. especially data structure

as for neural networks, i believe that is more for robotic. The 10 years i read of also consists of those... but their application, actual application, doesnt seem to be as general... as applying neural deep AI to a mario gake can inflate it to outrageous data size... wont it? I guess what i am looking more is the actual basic in video game design?

or perhaps how exactly the concept is applied to a game... say, a tetris versus AI?

·Anonymous A (OP) — 5.1 years ago, 57 minutes later, 1 day after the original post[T] [B] #602,691

@602,591 (D) maybe the easier question would be how would you structure the game AI relative to player's experience?

·Anonymous D5.1 years ago, 8 hours later, 1 day after the original post[T] [B] #602,708

@602,658 (A)
> as for neural networks, i believe that is more for robotic.
Not at all. They are used in many game-related applications.

> applying neural deep AI to a mario gake can inflate it to outrageous data size... wont it?
That's where convolutional neural networks come in handy. But yes, in a game like Mario you wouldn't need such a sophisticated A.I.

@previous (A)
> maybe the easier question would be how would you structure the game AI relative to player's experience?
In that case, the answer is it depends.

To elaborate: you first have to decide what you want the player's experience to be, and in precise detail.

Are you make a role playing game, e.g. Witcher 3, which has an open world with NPCs? In which case you want to make sure the NPC behaviour is believable. Do they have a fixed daily program which follows a script? Or does their routine change according to what happens to them in the world. At the least you have to keep a record of their health (and at the very least, are they alive or dead). If you want to get really sophisticated, you could create a neural network which drives their actions, and have them learn when to fight or flee, based on their experience.

Or are you making a real-time strategy game, e.g. Age of Empires? You want to make sure your A.I. knows how to build a base - what a good build order is, when and where to build, how many units to produce etc. Then you'd need a rock/paper/scissors type algorithm which determines the best strategy to use in order to beat the player when attacking / defending.

Or are you making a simulation / city building game, like Cities Skylines? Path-finding algorithms are absolutely essential if you want to simulate traffic and people realistically.

Or are you making a turn-based game, e.g. Civilization... or chess? You would need to investigate algorithms like mini-max, alpha-beta pruning & Monte Carlo tree search.

Pick one and maybe I can answer the question in a little more detail.

> or perhaps how exactly the concept is applied to a game... say, a tetris versus AI?
This is a good one to start with to get some experience at the relevant problem solving, because a naive algorithm (I would probably go with brute force: test every rotation and position for best fit) would be quite easy, but to make an unbeatable A.I. could be quite challenging. Here is a short paper which examines different approaches and compares their performance:
https://chihsienyen.github.io/pdf/Tetris_AI.pdf

Check out this guy's YouTube channel - some really good explanations of a number of game A.I. related algorithms: https://www.youtube.com/user/Cercopithecan

·Anonymous A (OP) — 5.1 years ago, 45 minutes later, 1 day after the original post[T] [B] #602,713

@previous (D)
i see... the links are appreciated but your thoughtful handwritten answers are more welcome.
> sophisticated
is sophistication important then?
how would it enhance player experience then? is this a concern?
> unbeatable AI
just makes the stats unfairly advanced then
> brute force algorythm
what is this? is this cheap in processing? aka as like the original AI? would you considwr the original AI to be bruteforcing?

sorry to clarify, maybe im more looking for the original game's processing/creation of sorts...

·Anonymous D5.1 years ago, 40 minutes later, 1 day after the original post[T] [B] #602,714

@previous (A)
> is sophistication important then?
Again, it depends on what you're making. If it's the next epic AAA title, then yes, it's extremely important. However those games normally have huge teams behind them, each developer focused on just one small aspect of the game. If it's a small mobile game / puzzle / anything made by a single ιndy developer, then simplicity is key and you want to look for ways to minimize the scope of the project, while keeping the game interesting.

> > brute force algorythm
> what is this?
brute force is any algorithm which iterates though all possible combinations in order to find the best. E.g. password cracking - you test every possible combination of character in a string until you find the right one.

> is this cheap in processing?
Not always. For some simple games (like tic-tac-toe) which have a small number of game states, it's very cheap. However in other games like chess, there are more game states than atoms in the universe, so it's totally impractical to use a brute force algorithm, unless you can find a way of discarding moves which are extremely unlikely to succeed (see alpha-beta pruning).

> sorry to clarify, maybe im more looking for the original game's processing/creation of sorts...
Ah, OK. I thought you were wanting to make an A.I. which plays Tetris. The game itself is quite easy to implement. You would start by examining the main components and rules of the game:
- the game board is a 10x22 grid
- there are 7 pieces (called tetrominoes) which drop down randomly from the top and fall down to the bottom
- the speed at which they fall depends on the level the player has reached
- each piece may be rotated (4 positions) and moved left/right/down by the player
- when a piece can't fall any further it is locked in place
- if a whole row of the grid is covered by pieces, it is removed and the player's score increases
- once the score reaches a certain level, the level increases
- if the any piece gets stuck at the top of the grid, it's game over
and so on...

Then you would think about how to represent the components in data structures, and what variables you need to keep track of (like score, level, game state etc.)

Finally you would write a game loop which updates the game state and then renders it. How you render depends on whether you're using a game engine or coding it yourself (using OpenGL for example).

Also look at this guy's channel:
https://www.youtube.com/watch?v=KNljfKjQxyc

·Anonymous A (OP) — 5.1 years ago, 16 hours later, 2 days after the original post[T] [B] #602,803

tenor-3.gif@previous (D)
i see... thank you. then how do adjust sophistication to be relative against my scope? i dont want to overwork the schedule

> bruteforce
ok that d be bruteforce... whats the other alternative to it then?
if i recall, all kinds of algorythm would require the entire constructs of data to be tested against the algorythm
ex: finding out if all the polygons are pushing against the main unit for collission and so on

how do you "discard" the unwanted process then?

> tetris AI
well thats what i mean, an AI for a tetris game's versus CPU...not its component. how would you make a game's AI that plays the game naturally against you and not overpowered Warcraft 3 Insane AI?

Start a new topic to continue this conversation.
Or browse the latest topics.

:

You are required to fill in a captcha for your first 5 posts. Sorry, but this is required to stop people from posting while drunk. Please be responsible and don't drink and post!
If you receive this often, consider not clearing your cookies.



Please familiarise yourself with the rules and markup syntax before posting.