SRL Archive - Senior Discussions and Debates

Scripts dependant on DTMs?


Daniel

2012-01-23 05:05:04

Should we try and discourage people using DemiseScythe's tutorial for object finding via DTMs? Especially since it discourages the use of arrays, and discourages the use of TPAs, etc, and bloats up their scripts and introduces bad coding habits and structure for both beginners and advanced scripters alike.

I don't know, but I feel that overusing them is bad, as they could (probably) be easily broken by Jagex if they wanted to, unlike our more modern (well, traditional, kinda) TPAs, etc.

More and more beginners are using this tutorial (usually after reading Coh3ns beginner one), and directly copying the code from that tutorial with little to no modifications, and wonder why the hell their script doesn't work nor understand/know what each method does. A lot of beginner scripts I look at, and give help to, all have the aFound boolean assigned to each FindDTMRotated method, as-well as the common parametre -Pi among others.

This is just my train of thought at the moment and what I feel. Feel free to add, and/or criticise. I just want to know other people's opinions on said topic. :)

Cheers,
Dan. :)

Flight

2012-01-23 05:36:08

Well look at it this way… Should users have problems compiling/running/maintaining their DTM scripts we could all just point them twords DemiseScythe. I say whatever works, if it works for them then grand, if not then I'm guessing they'll use TPAs, ect…

Daniel

2012-01-23 05:48:26

From: Flight
Well look at it this way… Should users have problems compiling/running/maintaining their DTM scripts we could all just point them twords DemiseScythe. I say whatever works, if it works for them then grand, if not then I'm guessing they'll use TPAs, ect…


I understand that, and that isn't what I was getting at. I was getting at the fact that the use of them for significant object detection employs really bad coding practice, especially how Demise writes her code. And the fact that it's (now) the most looked at tutorial for beginners on the topic of object finding.

Kyle Undefined

2012-01-23 09:17:41

I think DTMs can be useful, and that her code can be improved. Once she learns (if she does/wants to) how to use them in arrays then I guess it be a bad thing. TPAs are really the way to go, but each person has their own type of scripting that appeals to them.

Coh3n

2012-01-28 01:42:08

I think most of you can agree I have A LOT of scripting experience, and honestly, I've seen both TPAs and DTMs used for everything. There are certain situations where one may be better over the other, but if done properly, they both usually work.

I don't think her tutorial discourages the use of arrays/TPAs (I haven't read it, maybe she does say DTMs are better), I think she's offering an alternative (plus, she doesn't know that much about arrays I don't think), and from my experience there's no reason why she shouldn't. She understands DTMs and they work well for her. I'd probably do the same thing.

You said, "I feel like overusing them is bad…". Well, is overusing TPAs bad as well? I don't know. Maybe.

Also, aFound is an extended type, not boolean, and it returns the angle the DTM was found at. ;) Just wanted to clear that up.

Bottom line, we shouldn't discourage an alternative to TPAs. Let users explore their options. If one method isn't working, offer an alternative.

weequ

2012-01-29 17:05:47

I personally think we need more advanced DTM stuff. Like ability to add points that result true when they are not found and false when they are found. Also is it possible to determine that two (or more) subpoint colors must be same but still using tolerance to search them with tolerance? Tell me if you cannot understand and I'll try to explain better.

Flight

2012-01-29 21:26:31

From: weequ
I personally think we need more advanced DTM stuff. Like ability to add points that result true when they are not found and false when they are found. Also is it possible to determine that two (or more) subpoint colors must be same but still using tolerance to search them with tolerance? Tell me if you cannot understand and I'll try to explain better.


Kinda neat. I'd personally like to see a DDTM editor very similar to the DTM editor; something that allows us to chose the main and sub points, each with an extra option of 'drift amount', should the subpoint be found a few pixels in either direction. I'd like to see them be easily created just like DTMs and also printed to a simple string like DTMs.

Coh3n

2012-01-29 23:33:24

From: Flight
Kinda neat. I'd personally like to see a DDTM editor very similar to the DTM editor; something that allows us to chose the main and sub points, each with an extra option of 'drift amount', should the subpoint be found a few pixels in either direction. I'd like to see them be easily created just like DTMs and also printed to a simple string like DTMs.
The "Area Size" part in the DTM editor increases the area it looks for that point. If area size is 1 it's one pixel, if it's 2 it's 4 pixels, 3, 9 pixels, know what I mean?

Flight

2012-01-30 00:10:59

From: Coh3n
The "Area Size" part in the DTM editor increases the area it looks for that point. If area size is 1 it's one pixel, if it's 2 it's 4 pixels, 3, 9 pixels, know what I mean?


Wow… I never knew what that meant. :o

Coh3n

2012-01-30 00:28:35

From: Flight
Wow… I never knew what that meant. :o
I didn't until Demise told me. :p

mixster

2012-01-30 06:22:45

If you want to add new features to DTMs, I'll just point out that the sauce code is all there :) There did also used to be shapes which would change what area is searched by the area size, but I don't know if that was a SCAR only feature or if Simba has it as well (since no one ever used it.)

As far as its use goes, the problem is that DTMs are just a glorified string of FindColor's and, as such, they are limited by that. Rotation is probably the only reason why it should ever be used in favour of other methods, but even then you could recreate the functionality by producing a series of TPAs, filtering by distance and then checking the angle between them. The code may be longer / uglier / whatever you want to call it, but it would offer maximum flexibility and, if you're clever, better accuracy. As far as time requirements go, I guess it would depend on how well you designed it - having the searches in an optimised order (for least matches) and the like.

Whether or not they should be discouraged needs some factual, empirical and/or logical basis. Are DTMs more likely to break? Do they make fixing scripts harder? Are they less accurate/precise/fast than equivalent methods? Do they lead to worse structuring of scripts? Do they lead to worse memory usage? Are they going to assassinate Wizzup?? It's those sorts of questions rather than just saying we should or shouldn't.

marpis

2012-02-02 17:01:04

I once wrote a DTM system of my own for SCAR. The function returned all the subpoint indexes that were actually found, which I think was pretty handy. It was very easy too, less than 300 lines IIRC.
Of course it was very slow since it wasn't in a plugin.