Hours of pain

mataruamatarua Auckland, New ZealandMember Posts: 854
Here's something I have learned in the last 24 hours.

Trying to debug something - and the culprit was rules within a rule.

I had a rule that met condition A

Then inside that rule three more rules, lets call them conditions 1, 2 and 3.

So if A fires and 1 fires it should do A1.

So if A fires and 2 fires it should do A2.

So if A fires and 3 fires it should do A3.

Well it would only do A3 even if the conditions were A1.

I just now extracted the nested rules out and put the A1, A2, A3 rule as conditions and it solved it.

I had protection in there and everything and it was just mental - drove me mental.

Logic not following the logic. Scoured it and tested it so much it came down to it firing the last rule in the list.

So I think it skips things so quick inside the nesting rule it can do things out of sync.

Best not to nest rules by the looks.

Any thoughts?

Comments

  • VolontaArtsVolontaArts Member Posts: 510
    nice work solving that.. i would have never lol
  • mataruamatarua Auckland, New ZealandMember Posts: 854
    When I am stuck - at night - and it's late - the morning session usually solves it - not today! But got it sorted :)
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited September 2013

    @matarua Also glad you sorted it. :-) But I wouldn't throw nesting Rules out of the window, that's an integral part of programming when required, in lots of other situations....

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • mataruamatarua Auckland, New ZealandMember Posts: 854
    @gyroscope yep - I will just be very aware of it in the future - to be honest I used a bug my tester (partner;) found to make my game perform a certain way - which meant spawning an actor on top of itself and I was using an attribute to control the spawning but that was getting grief with jumping up multiple attribute values based on 2 of 3 rule sets but not the first. The game is also mental - it's a new one I am doing as a bit of a sidetrack from my monster game. So all going well I will have this one out soon :) While my current game sits at two years development this will be two weeks. Here's hoping!
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Just use a .03 timer this will give you a code cycle scan.
  • mataruamatarua Auckland, New ZealandMember Posts: 854
    @FryingBaconStudios tried that - I think there was just too much going on to be honest.
Sign In or Register to comment.