AzzyAI Showcase - Improvements to the Castle Route Function - Homunculus Headquarters - WarpPortal Community Forums

Jump to content


Photo
- - - - -

AzzyAI Showcase - Improvements to the Castle Route Function


  • Please log in to reply
8 replies to this topic

#1 Orthogon

Orthogon

    Amateur Blogger

  • Members
  • 490 posts
  • Playing:Ragnarok Online
  • Server:Chaos

Posted 04 May 2019 - 10:13 AM

I saw a couple of interesting old threads about this function, which never appears to have been finished. I've been working on my copy of AzzyAI and I have this function in a working state where the homunculus can traverse an entire map using the Castling skill to teleport the owner around.

 

Sample:

 

 

Edit 6/20/19: Swapped out original video for a better one.

 

Setup

I reviewed Dr. Azzy's pinned post, and he explicitly states that unmodified copies of his AI can be freely distributed. So I am not going to repackage a full modified version of his AI. But I will provide instructions for how to modify your copy in the same way I've modified mine.

1. I have modified three files that live in the USER_AI folder inside the AI folder inside the Ragnarok Online folder. So start by finding that folder on your machine: [something]\Ragnarok Online\AI\USER_AI.

2. Copy the USER_AI folder and save it somewhere else. I want you to have a backup in case something doesn't work. If you decide to revert to your previous configuration, just overwrite the files with the ones in this copy.

3. The files that I've modified are:

AI_main.lua
const_.lua
H_Extra.lua

Get the files at this link: https://drive.google...z7yHFeTYk6vTmnW

 

Update 6/20/19 - Uploaded new versions of the files - If the Homunculus strays from its route, it will clumsily work its way back using semi-random steps (an attempt to avoid getting stuck on a dead square). Two more routes included too: Stapos and Kobolds maps.

 

4. Copy those files into the Ragnarok Online\AI\USER_AI folder on your computer. Overwrite the ones that are already there. (You did make that copy of your USER_AI folder, right?)

5. Open H_Extra.lua with a text editor. There are routes for several maps included in this file. All are commented out except one.

Commented lines start with '--', example:

--MyRoute={{1,1},{2,2},{3,3}}

Always leave all the route descriptions commented out (the lines with map name and monster names).

To select the map you'll be playing on, comment out every route EXCEPT your route. Uncomment your route by deleting '--'. Continuing the example, here's the same line after uncommenting it:

MyRoute={{1,1},{2,2},{3,3}}

That's it for setup.

Configuration

Here are the required settings within the AzzyAI Configuration Tool to enable CastleRoute.

Homunculus tab, Basic Options:

OldHomunType = Amistr (In case you read this far and don't have an Amistr - Sorry...)

Homunculus tab, Walk/Follow Options:

RelativeRoute = False
UseCastleRoute = True
UseIdleWalk = Route_Circle (technically Route_Linear should work too, but ALL the routes I've included in H_Extra.lua are designed for Route_Circle, and I haven't tested any of my code changes to see if they work with Route_Linear).

Tips

CastleRoute is still not perfect. It's harder than I imagined to keep the Homunculus from getting stuck, but here are some tips:

1. Leveling on aggressive monsters works best because they will come to you. This keeps your Homunculus from wandering too far off its route. CastleRoute will work for non-aggressive mobs too but you may want to be close enough to monitor what's going on as you may have to intervene from time to time (usually you just have to manually move back closer to the route path so Homunculus can get back on track). The Homunculus seems to be better at pathfinding its way TO a target than it is at coming back. They are not good at situations requiring a U-turn to get back to the owner.

2. Setting the Homunculus to React instead of Attack in the Homunculus Tactics tab works well in combination with the first tip. Let aggressive mobs come to you.

3. One more tip that helps if you do decide to level on non-aggressive mobs: On Homunculus tab under Basic Options, set DoNotAttackMoving to True. This will keep your Homunculus from chasing off after a passive mob that finally stops in a spot that is hard to get back from or too far away.

All these tips have the same goal, keeping the Homunculus from wandering off its route and getting stuck.

Optional Settings

Here are the values I'm currently using for some of the stuff in AzzyAI Configuration Tool to help CastleRoute work better. It is not required to use these settings, they are just provided as a starting point:

Homunculus tab, Basic Options

StationaryAggroDist = 10 (This only matters if you are NOT following the tips above. But if the Homunculus has to go attack targets, having a fairly long leash will give it a better chance of encountering enemies.)

Homunculus tab, Walk/Follow Options:

FollowStayBack = 5 (One of the conditions to cast Castling is that Homunculus and owner are not too close together, this keeps Homunculus hanging back a bit.)

I set FollowStayBack = 0 now due to an issue where the Homunculus gets stuck if it's on one side of the screen and there's a target in range on the other side of the screen. This problem is pre-existing to my changes, but wouldn't tend to come up that often when hanging out in Orc Dungeon since targets tend to come to you, and frequently get killed by your neighbors when at the edge of your range.

IdleWalkDistance = 11 (My routes tend to keep steps 5 squares apart so I'm allowing lots of room to move around.)

It doesn't matter what IdleWalkDistance is set to when using route_circle or route_linear, that parameter only affects the other route choices.

IdleWalkSP = 20 (When Homunculus gets below this percentage of max SP, it will pause for SP tick. You can even set this to 0 if you have no other skills to save SP for.)
StationaryMoveBounds = 10 (Again just allowing for a nice amount of freedom of movement.)

Closing

I have only tested these modifications with one Homunculus, an Amistr/Sera. It is still just level 109 so I don't know the best way to utilize this with AoE skills and I don't know if it works well with the other Homunculus-S types.

I don't want to have to hold your hand to make these modifications work for you. I've already spent quite a few hours making them work for myself.

It is of course fine to post problems and questions. If I see them and I can answer them, I will, and I'm sure there are more knowledgeable people than me who might answer too.

If there is demand, I would consider generating more routes to include in H_Extra.lua. Perhaps by commission?


Edited by Orthogon, 20 June 2019 - 07:35 PM.

  • 3

#2 4853121207141913140

4853121207141913140

    Awarded #1 Troll

  • Members
  • 895 posts
  • Playing:Ragnarok Online
  • Server:Renewal

Posted 05 May 2019 - 11:43 AM

how does this fare on portals?


  • 0

#3 Orthogon

Orthogon

    Amateur Blogger

  • Members
  • 490 posts
  • Playing:Ragnarok Online
  • Server:Chaos

Posted 05 May 2019 - 02:20 PM

how does this fare on portals?

 

Are you wondering if you could traverse multiple maps with it? I think you could potentially, but I haven't tried it.

 

What kind of scenario would have to be tested?


  • 0

#4 Ashuckel

Ashuckel

    '-' intensifies

  • Members
  • 18996 posts
  • LocationJohto, Hoenn, Unova, Kalos, Alola
  • Playing:Ragnarok Online
  • Server:Chaos

Posted 05 May 2019 - 02:45 PM

From town back to OD2? lol
  • 0

#5 Orthogon

Orthogon

    Amateur Blogger

  • Members
  • 490 posts
  • Playing:Ragnarok Online
  • Server:Chaos

Posted 06 May 2019 - 03:08 AM

From town back to OD2? lol

 

That's funny, but having alternatives to sitting in OD2 is exactly why I started working on this.


  • 0

#6 4853121207141913140

4853121207141913140

    Awarded #1 Troll

  • Members
  • 895 posts
  • Playing:Ragnarok Online
  • Server:Renewal

Posted 06 May 2019 - 10:40 PM

would be nice if there's a way to avoid portals, else will travel around rune midgard afk.


  • 0

#7 Orthogon

Orthogon

    Amateur Blogger

  • Members
  • 490 posts
  • Playing:Ragnarok Online
  • Server:Chaos

Posted 07 May 2019 - 04:27 AM

would be nice if there's a way to avoid portals, else will travel around rune midgard afk.

 

It works by referencing a route you define, a series of ordered pairs. So as long as your route doesn't go too close to a portal I think you could ensure your homunculus doesn't accidentally Castle you onto another map.

 

I've been trying to get the Castling behavior down to where the homunculus only casts Castling if it's standing exactly on one of the points on the route, but when I added a condition like that it seemed to start skipping movement behavior altogether when it wasn't on one of those points - I'm still gaining understanding of how all the pieces work together.


  • 1

#8 Orthogon

Orthogon

    Amateur Blogger

  • Members
  • 490 posts
  • Playing:Ragnarok Online
  • Server:Chaos

Posted 04 June 2019 - 05:20 PM

Added instructions for how to set this up in first post if anyone wants to experiment with it.


  • 0

#9 Orthogon

Orthogon

    Amateur Blogger

  • Members
  • 490 posts
  • Playing:Ragnarok Online
  • Server:Chaos

Posted 20 June 2019 - 07:24 PM

Replaced the video in original post with a nicer one.

 

New versions of files in the link in original post. If the Homunculus strays from its route, it will clumsily work its way back using semi-random steps (an attempt to avoid getting stuck on a dead square). It works quite well!

 

There are also two new routes in h_extra.lua: Stapos map and Kobolds map (the one without archers).


Edited by Orthogon, 20 June 2019 - 07:28 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users