Jump to content


Photo

Will it blend?


  • Please log in to reply
3 replies to this topic

#1 Ruub

Ruub

    GMC Member

  • GMC Member
  • 413 posts
  • Version:GM:Studio

Posted 03 November 2011 - 04:40 PM

Hello!

I was overthinking the AI for my game (AI not as in learning but just computer meanies which I try to disguise as people). Now in my game YOU can
create your own lvl. That's swell and all but it does create a problem for me. I'm not sure if the average computer out there will hold my idea for the
coding, I'm actually rather afraid it won't. So before I start dragging myself into my biggest coding challenge so far I was hoping you guys could share with me
if this is actually a rather smart idea:

*if you are lazy, you can only read the red text. It kind of tells you what I'm about to do.

Spoiler


Also, al the 'nodes' you see are drawn in paint so I could get a clear vision.

Last but not least, if this IS the wrong part to post this question.. please move it to novice questions/etc. Most people look there.

Edited by Ruub, 03 November 2011 - 04:42 PM.

  • 0

#2 Ember

Ember

    I made a bubble

  • GMC Member
  • 33 posts
  • Version:GM8

Posted 03 November 2011 - 05:01 PM

Smart, easy, and efficient.

But the pathfinding will be a problem (unless you know how to hack A* or make it work to your needs).

I actually have an AI engine that works using this same method, though a bit more "in-depth".


Tip: Allow the nodes to have "states".. i.e. Ground, Air, Blocked and also let them have priorities. THEN this will be like 2D Unreal Tournament. Posted Image

Edited by Ember, 03 November 2011 - 05:01 PM.

  • 0

#3 Ruub

Ruub

    GMC Member

  • GMC Member
  • 413 posts
  • Version:GM:Studio

Posted 04 November 2011 - 12:50 AM

Yeah I'm also thinking the path-finding will be hard :rolleyes:

Maybe not directly the connection of points but making sure it gets only the right points. Else it would walk around the whole lvl every time it wanted to move somewhere!

I actually have this wicked untested idea for this (just now) Every time the AI passes a node it will collision_line in the direction he needs to go and if there isn't a node on that spot (also within his restrictions (jumping height, has it been to that node already, etc))
it will go clockwise (or counterclockwise when going left???) until it does find a suited node. Gotte think it threw first but I think it might be a possibility.

[EDIT] nvm, it can't imagine that working yet xD still thinking

Edited by Ruub, 04 November 2011 - 12:52 AM.

  • 0

#4 paul23

paul23

    GMC Member

  • Global Moderators
  • 3355 posts
  • Version:GM8

Posted 04 November 2011 - 07:43 AM

Building A* specifically for this is "easy", it's just another place where you go with a node-based approach.


Much more difficult is automatically building the nodes, & test for node connections. (As a naive implementation will do n! checks).

May I actually suggest not using a navigation mesh. This sounds much better to your needs, as when within a polygon, you KNOW you can move anywhere from anywhere within that polygon - in a straight line. Creating a much more natural shape.


Now to create a navigation mesh, there are several algorithms to generate convex hulls which can be "easily" adapted to your needs.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users