Using two subtrees element affects priority.

pier4r
Skynet
Skynet
Posts: 3390

Using two subtrees element affects priority.

Post#1 » 14 Nov 2016, 21:52

After my question here: https://itch.io/t/47436/questiondoes-a- ... s-priority I started happily to use subtrees.

Well, I discover that if I have the first branch: subtree - subtree - condition - action .
While another branch is subtree - condition action, and the first subtree is more left than the second subtree in the first branch, the first branch is not selected.

I thought what mattered was the first element in a branch, to select the branch.
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

User avatar
GFX47
Dev
Dev
Posts: 2914

Re: [bug] using two subtrees element affects priority.

Post#2 » 14 Nov 2016, 21:57

This needs a screenshot!

pier4r
Skynet
Skynet
Posts: 3390

Re: Using two subtrees element affects priority.

Post#3 » 14 Nov 2016, 22:27

Attached to this post. The bot is without shield, the leftmost branch is meant to retreat if the bot has no shield, but the two subtrees (one is fine) somehow affects the priority.

That branch is never activated. If I remove the first subtree, then it works again.

It is strage because, as you can see in the screenshot, another branch use heavily the subtrees and there I saw no errors so far.

Wait! Now I see it, it is the first subtree in the inactive branch that is too right, while the other branch (the active one) has the only subtree more on the right. So my fault. Alright.
Attachments
photo_2016-11-14_22-24-40.jpg
photo_2016-11-14_22-24-40.jpg (137.45 KiB) Viewed 1722 times
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

User avatar
GFX47
Dev
Dev
Posts: 2914

Re: Using two subtrees element affects priority.

Post#4 » 14 Nov 2016, 22:46

That's because child nodes are checked from left to right, not based on relative angles.
That's the oldest bug of the game ^^' I really have to fix it but you guys will hate me because you will have to fix all your trees...

pier4r
Skynet
Skynet
Posts: 3390

Re: Using two subtrees element affects priority.

Post#5 » 14 Nov 2016, 22:53

No I completely understand. It is based on the x.value of the children of a node. If node1.x.value < node2.x.value and both siblings, node1 activated. So actually visually the first subtree (the inactive one) come first, but in terms of x-axis the active subtree come first.

It is completely ok, it has just to be documented (and I have to remember it).

If you want to change it, instead of using angles you can use distance from the parent (if you have x,y coordinates for every node) plus the x location. So with equal distance, the rightmost node, otherwise first the one with shortest distance from the parent. But it is less user friendly.
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

User avatar
Avaren
Script
Script
Posts: 38

Re: Using two subtrees element affects priority.

Post#6 » 15 Nov 2016, 04:17

I think it's fine how it is atm, the tutorial does say it checks the leftmost node first and that node is the leftmost node.

pier4r
Skynet
Skynet
Posts: 3390

Re: Using two subtrees element affects priority.

Post#7 » 15 Nov 2016, 07:57

Indeed, agreeing with avaren. It was my fault.
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

User avatar
GFX47
Dev
Dev
Posts: 2914

Re: Using two subtrees element affects priority.

Post#8 » 15 Nov 2016, 09:05

Avaren wrote:I think it's fine how it is atm, the tutorial does say it checks the leftmost node first and that node is the leftmost node.


Yeah but let's face it, the angle approach makes more sense.

User avatar
Aimer RC
Script
Script
Posts: 16

Re: Using two subtrees element affects priority.

Post#9 » 15 Nov 2016, 09:19

Please don't change this system. It's working fine, and no-one complained about it. Well except of you. xD

User avatar
GFX47
Dev
Dev
Posts: 2914

Re: Using two subtrees element affects priority.

Post#10 » 15 Nov 2016, 09:26

Aimer RC wrote:Please don't change this system. It's working fine, and no-one complained about it. Well except of you. xD


It's not the first time is causes some misunderstanding :/

User avatar
Avaren
Script
Script
Posts: 38

Re: Using two subtrees element affects priority.

Post#11 » 17 Nov 2016, 02:27

GFX47 wrote:
Aimer RC wrote:Please don't change this system. It's working fine, and no-one complained about it. Well except of you. xD


It's not the first time is causes some misunderstanding :/

Well if you did make it angle based at least I could make groups of Actions symmetrical...

ConsciouS-0nE
Autonomous Entity
Autonomous Entity
Posts: 740

Re: Using two subtrees element affects priority.

Post#12 » 17 Nov 2016, 16:01

Well......
Attachments
Screenshot_2016-11-17-23-00-30.png
Screenshot_2016-11-17-23-00-30.png (149 KiB) Viewed 1666 times

pier4r
Skynet
Skynet
Posts: 3390

Re: Using two subtrees element affects priority.

Post#13 » 17 Nov 2016, 17:53

Do manage that with the PC? I cannot make stright lines with the shield controller very well.
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

ConsciouS-0nE
Autonomous Entity
Autonomous Entity
Posts: 740

Re: Using two subtrees element affects priority.

Post#14 » 17 Nov 2016, 18:09

pier4r wrote:Do manage that with the PC? I cannot make stright lines with the shield controller very well.

I use my thumbs on a 4.5" screen display phone ;)
Im not the best player, but atleast im something.I'm 8
Science is madness! 3:)

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 1 guest