CakeNeq Games
  • Games
  • Dev Blog
  • Shirts 'n Junk

Path-Finding Codes

17/9/2015

0 Comments

 
The last two days have been, ahh, frustrating. I've been working on enemy path-finding AI. I've never really done much path-finding AI before, and when I do have an enemy with something more complex than walk till you hit a wall, then turn around it's as simple as, walk till you're close to the player, then charge at player. With Doomer, however, I think something a little more substantial is needed. I'm kinda getting into a slump, so I figured I'd write a thing about it. One of these things. A blog-ey thing.

Right now, normal units will wander to and fro, with a little randomized timer running(counted in frames, not time), if the unit hits a wall, it changes direction, if the timer hits zero, the unit changes direction and the timer is reset to a random integer between 10 and 300 (I think, don't quote me). When the unit is within range of the player and has a clear line of sight, the unit is triggered to change state(2), while in state 2, the unit remains stationary and fires repeatedly. (More advanced units will move between shots, or move while shooting, though I'm sticking with the basic components for now.) When the player too close, the unit will walk away from the player, when the player gets too far, the unit follows the player. That's where we hit the issue. When the unit is running, it just goes till it hits a wall, then stays stationary, but when it's pursuing, the unit ignore walls altogether.


I've tinkered with the units returning to a wandering state when the player breaks line of sight, but it makes the units feel more like turrets than actual moving people/creatures/demons which isn't the feel I want going forward. . . unless the unit actually is a turret. I've thought of having the unit slide against the wall or solid object, though I'm still a little lost on exactly how I'd implement it, another thing I've been tinkering with, is having destructible walls. I'd still need to figure out pathing for the more clever units, but for the tough dumb ones, it could be kinda cool if the enemies could just kick the shit out of a wall until it broke. 


Anyway! This is where my head is at the moment. Good luck on your projects and ambitions.

Give a man/lady a Twerk,
Teach a man/lady to twerk


Thanks,

Wyatt White
The Grand Moff Tarkin of Nothing.
0 Comments



Leave a Reply.

    Dev Blog

    This is the other place I ramble about what I'm working on.
    ​

    Old Stuff

    August 2022
    January 2022
    December 2021
    November 2021
    October 2021
    September 2021
    May 2021
    April 2021
    February 2021
    December 2020
    November 2020
    October 2020
    September 2020
    July 2020
    April 2020
    March 2020
    February 2020
    January 2019
    December 2017
    September 2017
    June 2017
    March 2017
    February 2017
    January 2017
    December 2016
    November 2016
    September 2016
    August 2016
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    January 2016
    December 2015
    November 2015
    October 2015
    September 2015