Jump to content

josk's Blog

  • entries
    3
  • comments
    6
  • views
    7,122

Which way? Thata way, no thata away! Waypoints.


josk

2,514 views

 Share

As a side project I have been working on a Top Down Game Template so you can make games similiar to Shadowgrounds, Diablo etc.

 

 

I have been working with waypoint navigation as the video shows.

In the video example I have put two crawlers in to the scene and gave them the same script.

I give them a different waypoint controller target. This waypoint controller then takes care of its selected target.

The waypoint controller has 4 pivots as targets placed around the map for the target to move to. The amount of pivots can be more, any sensible amount.

There is also a false waypoint target. If you drag this into the waypoint controller, say in its 4th spot. The target will then after the 3rd waypoint go to the first one.

in the video the top crawler has two active waypoints and two waypoints that are false causing it to go back and forth. While the other crawler has all four active.

 

The great thing is its a standard template, drop them in game place your pivots and just drag which ever pivots/waypoints in to the slots from first to last, any extra slots take the false waypoint.

More options will follow for waypoints like a random waypoint.

I have already done something with animation so you only have to type Walk or Run into the slot and it works.

 

Hope thats all clear.

 

blogentry-54-0-02843400-1428954977_thumb.jpg

  • Upvote 3
 Share

3 Comments


Recommended Comments

Looks good and use friendly! Good job. :)

For waypoints I use this method and it works quite well.

I create a script for my waypoint pivots and give them a target entity. The target entity will be another waypoint pivot placed on the map.

Then the patrolling entity has one waypoint target and once it is reached the patrolling entites waypoint target is replaced with the waypoints target entity.

I hope that makes some sense. I just thought I would share. It's really cool/helpful that you're making these templates, keep it up!

  • Upvote 1
Link to comment

Yeah I am ttrying to make them user friendly, plenty of comments.

It's actually making me think more about my coding and making it clearer.

 

The waypoints work similier to how you do it but more drag and drop. The scripts are really generic so can be dropped into any game.

 

Also the camera is further away to show the npc's navigating the waypoints.

Link to comment

The enemys now chase after the player when within a certain distance and if close enough attack. If the player manages to run off more than a set distance the enemy will resume its waypoint patrol.

The range at which the enemys attack can be changed in the script panel.

 

I think I might do a worklog in the showcase forum soon.

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...