Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 [2]

Author Topic: Anyone a game dev here?  (Read 7696 times)

gruberscomplete

  • Captain
  • ****
  • Posts: 253
    • View Profile
Re: Anyone a game dev here?
« Reply #15 on: November 07, 2015, 08:02:45 PM »

Yeah. About my own problems. I'm trying to implement a super simple AI for a 2d game, but have no idea how I would start.

Such as for an rpg goblin. When a player is nearby, and detected, the goblins will run at the player, but avoid obstacles. And then different types of AI, like ones that gang up and surround you, or an archer that kind of runs around.

I also wanted to think of friendly AI's that follow you or neutral ones that live their lives without thinking you will attack them.

Does anyone have a good tutorial on the web? Thanks.
Logged
Click here for FREE ships!               Plentysector               Robots With Souls

Clockwork Owl

  • Admiral
  • *****
  • Posts: 790
    • View Profile
    • Starsector South Korean Community
Re: Anyone a game dev here?
« Reply #16 on: November 08, 2015, 01:15:06 AM »

AI is a complicated(and very interesting)part of a game.

I recommend you to learn the script, and not to just find things from Assets. Unity website has a set of scripting tutorial relevant to its product.

When starting from scratch, it is a good idea to bring a pen and paper, and write down(and draw) what you want. Then you can decide what function should be in a script, and how would you do it.
*For example, about the AI you described.
-You neatly wrote down what it should do. Good.
-Now you need to decide what the AI should be capable of:
1. "If a player is nearby" : Determining range with another object.
2. "and detected" : Determining whether an object is 'detected' to it.
3. "Run at the player" : Controlling an object(its body).
4. "Avoid obstacles" : Pathfinding.
-Then, think how you would create each functions. This requires knowledge in script you're using.
1. Should be a basic math. All hail to Pytagoras.
2. Depends on what kind of game it is, but we have a decent technic called raycasting.
3. Again, should be basic in Unity.
4. This is the tricky part: depends heavily on what kind of game it is, brute-force solution tends to eat up a lot of processing power, and end result isn't pretty if you get it wrong. There are several algorithms you can find, though. A famous one is A*[A-star] - it works in (2D or 3D) grid.
(Usual(and practical) game AI is dependent on the environment it is operating on: Is it on 2D or 3D space? Is the space grid-based or semi-continual? Is it turn-based or realtime? What are the things the entity controlled by AI is capable of? What are the goals and desirable behavior of the AI? etc.)

Again, learn the basics first. RPG can be a dangerous trap for the beginning of your game development career since some people almost irresistably plan on something epic - huge scale, complated mechanics, and sometimes evenmultiplayer. It is most likely to tire you out. Keep your first project simple.
« Last Edit: November 08, 2015, 01:47:23 AM by Aron0621 »
Logged

gruberscomplete

  • Captain
  • ****
  • Posts: 253
    • View Profile
Re: Anyone a game dev here?
« Reply #17 on: November 08, 2015, 05:15:15 AM »

AI is a complicated(and very interesting)part of a game.

I recommend you to learn the script, and not to just find things from Assets. Unity website has a set of scripting tutorial relevant to its product.

When starting from scratch, it is a good idea to bring a pen and paper, and write down(and draw) what you want. Then you can decide what function should be in a script, and how would you do it.
*For example, about the AI you described.
-You neatly wrote down what it should do. Good.
-Now you need to decide what the AI should be capable of:
1. "If a player is nearby" : Determining range with another object.
2. "and detected" : Determining whether an object is 'detected' to it.
3. "Run at the player" : Controlling an object(its body).
4. "Avoid obstacles" : Pathfinding.
-Then, think how you would create each functions. This requires knowledge in script you're using.
1. Should be a basic math. All hail to Pytagoras.
2. Depends on what kind of game it is, but we have a decent technic called raycasting.
3. Again, should be basic in Unity.
4. This is the tricky part: depends heavily on what kind of game it is, brute-force solution tends to eat up a lot of processing power, and end result isn't pretty if you get it wrong. There are several algorithms you can find, though. A famous one is A*[A-star] - it works in (2D or 3D) grid.
(Usual(and practical) game AI is dependent on the environment it is operating on: Is it on 2D or 3D space? Is the space grid-based or semi-continual? Is it turn-based or realtime? What are the things the entity controlled by AI is capable of? What are the goals and desirable behavior of the AI? etc.)

Again, learn the basics first. RPG can be a dangerous trap for the beginning of your game development career since some people almost irresistably plan on something epic - huge scale, complated mechanics, and sometimes evenmultiplayer. It is most likely to tire you out. Keep your first project simple.
Thanks!
When you say simple, its just going to be EXTREMELY simple. And maybe some more complicated stuff later on. It's gonna be a 2d game with only singleplayer, and a pre-placed world (no procedural stuff). I'm collecting sprites atm, and will use them for tilesets.

I was thinking of animating the sprites in a program that creates bones and transforms/pulls the image to look like its moving, that way you wouldn't need 50 sprites per enemy.
Logged
Click here for FREE ships!               Plentysector               Robots With Souls

Clockwork Owl

  • Admiral
  • *****
  • Posts: 790
    • View Profile
    • Starsector South Korean Community
Re: Anyone a game dev here?
« Reply #18 on: November 08, 2015, 05:51:01 AM »

2D space is generally simpler with absence of z-axis(and personally I don't like this mesh thing - too much effort to create). It's good to start from there.

Depends on what level those procedural stuff are. If map is preset and you stitch tile procedurally, that makes your life more easier. Procedurally generated map is where things starts to get ugly :P
But don't panic :P Just come up with a decent solution and it's all good. I'm not trying to scare you away from it ;D

Ah yes, I forgot - about pathfinding, it seems Unity has something called Navigation Mesh. While I haven't, you might want to check it out later when you want to make 3D game again.
« Last Edit: November 08, 2015, 05:56:09 AM by Aron0621 »
Logged
Pages: 1 [2]