YesNoOk
avatar

VarRandom berzerk [Solved] (Read 333 times)

Started by LaQuak, June 03, 2011, 07:51:18 am
Share this topic:
VarRandom berzerk [Solved]
#1  June 03, 2011, 07:51:18 am
  • ****
    • www.justnopoint.com/Masters/
Whats up guys hows it going. First let me say that I've actualy fixed the problem but I backed the funny copy of the code before the fix and wanted to know what you guys thought. Secondly VarRandom did a flawless job for me in old WinMugen which is why I am angry with it and its behavior in 1.0 I am using VarRandom for AI purposes for this test. So this is the copy of the funny copy. It's rather long but should be easy to read since simple works :D

Spoiler, click to toggle visibilty

So what do you guys think?
Last Edit: June 04, 2011, 05:32:06 am by LaQuak
Re: VarRandom in 1.0 when AILevel is on.
#2  June 03, 2011, 08:41:58 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
I still want to know what displaytoclipboard says as you run through the attack. I am still of the opinion that the variables value is being changed somewhere up the line.

[state -2]
type = displaytoclipboard
trigger1 = 1
text = "%d"
params = var(12)


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: VarRandom in 1.0 when AILevel is on.
#3  June 04, 2011, 05:30:20 am
  • ****
    • www.justnopoint.com/Masters/
Alright, you got it. VarRandom values were going berzerk while in motion i.e. moving, jumping ect and, to our troubleshooting, in motion of the combo only persisting to a solid value when MoveHit but only for the duration of the p1/p2 stun which in this case was long enough for a new value to randomize and jump right in and take over causing in the situation. Tweaking around the -3 VarRandom for randomizing made the value persist, thus fixing the funny copy problem so thats done. However, it still heavily favors lower values and hardly ever played 6 and 7 so I am going to implement a few VarRandom randomizers with different Var(#) for ground only,ground to crouch only, ground to crouch to air and super ect. for better organization and optimization.

Going back and looking over my VarRandom in old Mugen I was a little bit off in the whole "it worked for me in old mugen" statement. What I did in old Mugen is use states 10000+ so instead of having a bunch of the same states in -1 like I did in this trial (bunch of 235 doing the same thing basicaly) I had randomizers for 10000/10010/10020/10030 ect so in essence, VarRandom had to randomize the state other then randomizing a value. So yeah...thats that.

*thankful nod*
Re: VarRandom berzerk [Solved]
#4  June 04, 2011, 05:43:27 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
You want ignorehitpause = 1 on that first varrandom. And because of the way it works

var(12) = random%8

would get you a proper range if it's still favouring the low values.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: VarRandom berzerk [Solved]
#5  June 04, 2011, 05:58:20 am
  • ****
    • www.justnopoint.com/Masters/
Actualy this one is giving me weird stuff as well.

Quote
[State -3, VarRandom]
type = VarRandom
triggerall = AILevel && numenemy
triggerall = statetype != A && roundstate = 2
trigger1 = ctrl
v = 12
range = 0,5

[State -3, VarRandom]
type = VarRandom
triggerall = AILevel && numenemy
triggerall = statetype != A && roundstate = 2
trigger1 = ctrl
v = 13
range = 0,1

Quote
[State -1, Randomizer]
type = ChangeState
triggerall = AILevel && numenemy
triggerall = statetype != A && roundstate = 2
triggerall = p2bodydist x < 20
triggerall = p2bodydist y = [-25,25]
triggerall = enemynear,stateno != 5100
triggerall = enemynear,stateno != 5101
triggerall = enemynear,stateno != 5110
triggerall = enemynear,stateno != 5120
triggerall = ctrl
trigger1 = Var(12) = 0
trigger2 = Var(12) = 1
trigger3 = Var(12) = 2
trigger4 = Var(12) = 3
trigger5 = Var(12) = 4
trigger6 = Var(12) = 5
value = 235

[State -1, Randomizer]
type = ChangeState
triggerall = AILevel && numenemy
triggerall = statetype != A && roundstate = 2
triggerall = p2bodydist x < 20
triggerall = p2bodydist y = [-25,25]
triggerall = enemynear,stateno != 5100
triggerall = enemynear,stateno != 5101
triggerall = enemynear,stateno != 5110
triggerall = enemynear,stateno != 5120
triggerall = ctrl
trigger1 = Var(13) = 0
trigger2 = Var(13) = 1
value = 235

Basicaly whats happening is that clipboard is showing that I am using Var13 0 and 1 but it always plays Var12 changestates. If I change var12 range from 0,5 to say 0,7 then it plays Var13 changestates as well when I specificaly tell them not too *shrugs* Doesn't make sense to me why it's not picking Var13 unless it's ordering.
Last Edit: June 04, 2011, 07:40:42 am by LaQuak
Re: VarRandom berzerk [Solved]
#6  June 04, 2011, 07:58:45 am
  • ******
  • I hang out tough. I'm a real boss.
    • USA
    • litotichues.com/
Changestates above always activate before changestates below if they get the chance.

The only way var13 changestates will work is if var12 changestates are able to. Do the random% thing like Cyanide suggested.



P.S.: Instead of "enemynear, stateno != 5???" use "p2stateno != 5???."

This is because enemynear keeps working when the opponent is dead; AI will keep considering them for its moves. P2stateno only reads the opponents that are alive, close and facing your character (yes, it'll read player3's or player4's statenos at the given opportunities).
Re: VarRandom berzerk [Solved]
#7  June 04, 2011, 08:26:07 am
  • ****
    • www.justnopoint.com/Masters/
Even so I dont see why say changestate with Var(12) = 3 should play before Var(13) = 0 when clipboard clearly displays it's doing Var(13) = 0. I also dont see how AI could be playing Var(12) = 6 and 7 when they are specificaly changed to Var(13) = 0 and 1 and clipboard shows that var13 is active but its fooling me I guess. Ah good ol' random. I feel like de ja vu because I remember me asking something like this before. I mean I know why it's doing it because once AI is active it's active since I have it in -3 and I have it in all over my .cns, even if I delete changestates in -1 I just find it odd thats all. Thanks for the tips guys :) I'll get it to work thats no biggie.
Last Edit: June 04, 2011, 08:30:54 am by LaQuak
Re: VarRandom berzerk [Solved]
#8  June 04, 2011, 08:30:01 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Triggers for the first are the same as triggers for the second with the exception of the variable used. Unless var(12) becomes none of those values at some point, that one will trigger, and var(13)'s changestate never will because 12 is above it and takes precedence.

Just like QCF+a attacks being above A attacks.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: VarRandom berzerk [Solved]
#9  June 04, 2011, 08:51:17 am
  • ****
    • www.justnopoint.com/Masters/
That's correct but let you ask you a dead serious question and please be honest with me. With Mugen being coded as is and taking precedence, in this situation, does what I said make any sence? Like to me, when I write my test to use var(13) states and Mugen shows me that Var(13)  is playing yet it plays Var(12) states but the right combination when I specificaly told Mugen not to use Var(12). Because that doesnt make sence to me because I wrote it that way because docs said so also...in it's wording.

I know for a fact I hate random, but I like Cyanide and Rajaa :woeh:
Re: VarRandom berzerk [Solved]
#10  June 04, 2011, 09:03:24 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Mugen looks at the below
type = changestate
var(12) = value between 0 and 5
value = do something
Is it true? Yes therefore activate this one.
It's not true? Ok move to
type = changestate
var(13) = value between 0 and 1
value = do something else

Depending how you have the changestates from 235 listed will alter where it goes from there. Aside from anything else, you're still just activating the same state regardless of the value of the variable. It doesn't matter what value it has at all.

trigger1 = Var(12) = 0
trigger2 = Var(12) = 1
trigger3 = Var(12) = 2
trigger4 = Var(12) = 3
trigger5 = Var(12) = 4
trigger6 = Var(12) = 5

Is essentially the same as alive unless var(12) lacks a value on that list at some point. Therefore what you have is simply a piece of code that sends you into state 235. Which is an ACTUAL randomiser in this situation and probably more useful that what you have listed there.

And believe me, what you have listed there is not doing at all whatever you think it is.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: VarRandom berzerk [Solved]
#11  June 04, 2011, 09:17:59 am
  • ****
    • www.justnopoint.com/Masters/
I know this is basics and I should not even be asking this and even though it's fixed with all of your guys suggestions I'll just show you how I had my 235 changestates. Lol it looks funny how it just all goes to the same place >:D

Quote
[State 235, ChangeState]
type = ChangeState
triggerall = AILevel
triggerall = Var(12) = 0
trigger1 = MoveHit
value = 230
ctrl = 1

[State 235, ChangeState]
type = ChangeState
triggerall = AILevel
triggerall = Var(12) = 1
trigger1 = MoveHit
value = 230
ctrl = 1

[State 235, ChangeState]
type = ChangeState
triggerall = AILevel
triggerall = Var(12) = 2
trigger1 = MoveHit
value = 230
ctrl = 1

[State 235, ChangeState]
type = ChangeState
triggerall = AILevel
triggerall = Var(12) = 3
trigger1 = MoveHit
value = 230
ctrl = 1

[State 235, ChangeState]
type = ChangeState
triggerall = AILevel
triggerall = Var(12) = 4
trigger1 = MoveHit
value = 230
ctrl = 1

[State 235, ChangeState]
type = ChangeState
triggerall = AILevel
triggerall = Var(12) = 5
trigger1 = MoveHit
value = 230
ctrl = 1

[State 235, ChangeState]
type = ChangeState
triggerall = AILevel
triggerall = Var(13) = 0
trigger1 = MoveHit
value = 230
ctrl = 1

[State 235, ChangeState]
type = ChangeState
triggerall = AILevel
triggerall = Var(13) = 1
trigger1 = MoveHit
value = 230
ctrl = 1

Precedence or not. I told it to

Quote
[State -3, VarRandom]
type = VarRandom
triggerall = AILevel && numenemy
triggerall = statetype != A && roundstate = 2
trigger1 = ctrl
v = 12
range = 0,5

[State -3, VarRandom]
type = VarRandom
triggerall = AILevel && numenemy
triggerall = statetype != A && roundstate = 2
trigger1 = ctrl
v = 13
range = 0,1

And it didnt do it but I am telling it to do it and Mugen showed me what it was using. Unless those VarRandom triggers are off some how. In no way I am arguing because you guys are right I am just ? at why it played the proper actions in a wrong var and range. And what do you mean what I had listed is not doing it?
Re: VarRandom berzerk [Solved]
#12  June 04, 2011, 10:09:30 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Once more, they're all going to the same place. That's the same (again) as having them all in one trigger, and having something like Alive there,

You may have your variable randomising. But all it's doing is changing state. Turn the variable off if you want proof. He'll still go 235>230. You may differ later on, but if you want that to work it will use the ones you list FIRST over the ones you list LAST because mugen runs through states from top to bottom. So if you put a changestate with var(12) = anything above a changestate with var(13) = anything the var(13) one will never trigger because the var(12) one has. And vice versa. You need to use ONE variable, you cannot use 2 unless you want to make your triggers stricter.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: VarRandom berzerk [Solved]
#13  June 05, 2011, 03:37:56 am
  • ****
    • www.justnopoint.com/Masters/
I got you, like I said this should be kindergarden stuff but I guess I am thick and tend to forget that it's just hard coded like that. Well I have 2 and a 1/2 methods for this so thats always chill. Thanks guys.