Announcement: Remember: you are giving away your fantastic ideas for free, and somebody else might even make money from them (or appear to). That's just how the world works! If you're worried about it, maybe you shouldn't post your ideas here.


Caravel Forum : DROD Boards : Feature Requests : Scripting options for better custom monster integration
New Topic New Poll Post Reply
Poster Message
RuAdam
Level: Master Delver
Rank Points: 157
Registered: 08-24-2004
IP: Logged
icon Scripting options for better custom monster integration (+1)  
So now we have all sorts of neat stuff to script custom monsters with. Yet they still can't be seamlessly integrated. The issue I'm talking about is targeting. Custom monsters will ignore stealth/invisibility decoys and stalwalrts. Also stalwarts will ignore custom monsters. I'd like to give a few suggestions that could solve these issues.

Target of monsters/heroes imperatives.
I think these are pretty self explanatory.
I imagine that when monsters/stalwarts search for the closest target, they check the distance to every valid target. These imperatives would simply set the NPC to be a valid target.

Target monsters/heroes imperative.
Wait for valid target test
Target_X, Target_Y, Target_O script variables.

This is the other part that would solve all the problems with stealth and the like. Just like the game determines the closest valid target for monsters, it could do the same for NPCs based on their targeting imperatives. Obviously if the player is in stealth and outside their range, they wouldn't be a valid target.
Previously we'd use My_X/My_Y and Player_X/Player_Y to calculate the next move. But if we'd have these features, we could have much more seamlessly integrated custom monsters.

Finally an option to calculate distance between two points using one of the following three formulas:
1, abs(X1-X2) + abs(Y1-Y2)
2, max(abs(X1-X2) + abs(Y1-Y2)) (number of steps in an open area)
3, (X1-X2)^2 + (Y1-Y2)^2
4, Pathfinding distance (based on the pathability of the type of the invoking NPC)
This would help out greatly in scripting custom movement types.
07-11-2014 at 11:50 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
skell
Level: Legendary Smitemaster
Avatar
Rank Points: 3734
Registered: 12-28-2004
IP: Logged
icon Re: Scripting options for better custom monster integration (+1)  
I think that we could have instead two special variables $currentTargetX and $currentTargetY, which will always be set to what this character would target if it was a roach.

____________________________
My website | Facebook | Twitter
07-11-2014 at 02:32 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts High Scores This architect's holds Quote Reply
Someone Else
Level: Smitemaster
Avatar
Rank Points: 1300
Registered: 06-14-2005
IP: Logged
icon Re: Scripting options for better custom monster integration (0)  
I like skell's suggestion - it would allow actually integrating goblin-like creatures. Also two target stuff.

Actually, if we had $currentTargetX and $currentTargetY, but also a script command GetNearestTarget and GetNextNearestTarget, we could theoretically have a monster capable of fighting three or more targets at once. :devil
07-12-2014 at 12:22 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
RuAdam
Level: Master Delver
Rank Points: 157
Registered: 08-24-2004
IP: Logged
icon Re: Scripting options for better custom monster integration (+1)  
My issue with skell's idea is that stalwarts would still ignore custom monsters.
Also it wouldn't allow for creating helpful custom NPCs that fight the monsters.

There was once a discussion about some allegiance system, but no simple solution was found.

Edit:
Something was bothering me about my suggestion and I finally figured out what. Custom friendly and custom enemy NPCs would ignore each other. So I thought of an alternative to the original imperatives I suggested.

Simple allegiance system
Have imperatives Allegiance monsters/heroes (mutually exclusive)
Allegiance monster targets heroes and is targeted by heroes, and allegiance heroes works vice versa.

This would allow for basic stuff, although it wouldn't be that flexible, so...

Complex allegiance system
Honestly even I think this might be overkill. But it would allow for complete flexibility in this regard, and I'm sure we'd see clever uses for it. So here it goes.
There would be special group labels that could be applied to NPCs. There would be three by default: Monsters, Heroes, Fluff. You could also add your own group labels.
Then you could use the Target <Group>/Target of <Group>/Is of <Group> markers to define how your NPC should treat others, and how should others treat the NPC.


[Last edited by RuAdam at 07-12-2014 01:04 PM]
07-12-2014 at 10:35 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
skell
Level: Legendary Smitemaster
Avatar
Rank Points: 3734
Registered: 12-28-2004
IP: Logged
icon Re: Scripting options for better custom monster integration (0)  
@hyperme - doesn't the new behaviors in 5.2 allow basically doing the targetting?

____________________________
My website | Facebook | Twitter
11-04-2020 at 04:55 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts High Scores This architect's holds Quote Reply
hyperme
Level: Smitemaster
Avatar
Rank Points: 1057
Registered: 06-23-2006
IP: Logged
icon Re: Scripting options for better custom monster integration (+1)  
skell wrote:
@hyperme - doesn't the new behaviors in 5.2 allow basically doing the targetting?

There are currently no implemented behaviours that affect targeting other than the Puff Target behaviour. I never got round to finishing the Monster Target and Ally Target ones because it would require quite a bit of poking around with monster and stalwart code to make it work. Since development has started up again, however, I can look into getting it done for 5.2

____________________________
[Insert witty comment here]
Qzvlkx?
11-04-2020 at 08:24 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Feature Requests : Scripting options for better custom monster integration
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.