Topic: Switch Statements in UFE?

What's up everyone is it possible to use switch statements to utilize other scripts and combine them with UFE? I ask because the creator of an AI package from the Unity Asset Store called Orbit said that Orbit can be used with any game toolkit such as UFE. I told him about UFE and he said that after I train the AI in Orbit to adapt to the player's style of fighting in-game I would have to make a script involving a switch statement to tie the results of the AI made in Orbit to UFE. The problem I have is that not sure how switch statements can be used in UFE if they can be used at all. I did notice that UFE's code structure is different or at least from what I've seen. And also the reason I would like to use Orbit along with having access to the upcoming UFE v1.1 AI is because in case none of you know is that Orbit is used to make and train the AI to adapt to the player's style of playing in any game you can make regardless of how good the player becomes. Interesting isn't it. So anyhow I'm learning switch statements through tutorials from youtube and the scripting documents from Unity's website. Ahead of time it will be helpful if one of you know if and how switch statements work in UFE if it's any different from Unity's that is.

Share

Thumbs up Thumbs down

Re: Switch Statements in UFE?

By switch statements, you mean this?

switch (someInt) {
    case 0:
    // Do something
    break;
    case 1:
    // Do something else
    break;
}

It's just another way of doing If statements, so UFE should be compatible with that.

But more specifically, we'd need to see the API for Orbit to tell you how easy/hard it is to incorporate.

Share

Thumbs up +1 Thumbs down

Re: Switch Statements in UFE?

Yep that's basically the overall process behind Orbit. It switches from one case to another based on the player's actions.

Share

Thumbs up Thumbs down

Re: Switch Statements in UFE?

Okay as for the API on the official website of Orbit here's what I found.

Constructors
For this section a runtime Orbit network will be called ‘NetworkName’.
public NetworkName(): constructs an instance of NetworkName with all skill levels set to 1.
MyNewNetwork myNewNetwork = new MyNewNetwork();

Enumerators
Public enum Skills: enumerator containing the names of all the skills in your network with zero offset.
// Levels up the Fire skill in an instance of MyNewNetwork 
MyNewNetwork myNewNetwork = new MyNewNetwork(20.0);
myNewNetwork.LevelUp(MyNewNetwork.Skills.Fire,5.0);

Methods
public int Classify(double[] levels): classifies the levels array as one of the classifications provided to Orbit in the Orbit Trainer. Returns the classification as an integer if the length of levels is equal to the number of skills in the network.
//Instantiate a MyNewNetwork, classify a level array then print out the results to the console
MyNewNetwork myNewNetwork = new MyNewNetwork();
Debug.Log(myNewNetwork.Classify(new double[4]{40.0, 30.0, 23.5, 2.5}); //Prints out an integer

That's all I found on their API document page unfortunately. So yeah Yumcha if this still isn't enough info on Orbit's API structure I'll send a request for more detail of Orbit's API to Tom (the developer in charge of Orbit) who I have been communicating with on the Unity forums where I'm also subscribed to by the way.

Share

Thumbs up Thumbs down

Re: Switch Statements in UFE?

Having a quick look at the Orbit website, it should be possible.  I'm just not sure how exactly we'd integrate it into UFE.

Also worth mentioning is that 1.1 has a pretty good AI (which you can see working here) and you might be better off waiting for this instead of reinventing the wheel so to speak...

Share

Thumbs up +1 Thumbs down

Re: Switch Statements in UFE?

Yeah I'm pretty sure UFE's AI is good that was just me trying to experiment for possible integration from Orbit to UFE. Quick question about UFE's AI features, is it setup where we can all develop different types of AI that can be selected from the game intro screen like in the beta demo? What I mean is that say I would want an AI type that has a specific style of playing against another AI or a player. A style like repeatedly faking and playing mind games on it's opponent, a deceptive AI type for example. Is this a way UFE's upcoming AI released can be used for? I saw the pictures of the AI editor that MisterMind posted on the UFE v1.1 new thread and it looks awesome but hard to tell if what I ask can be accomplished with it. Well either way I will most definitely wait for the new UFE to be released instead of like you stated reinventing the wheel which would be jumping the gun. So yep thanks Yumcha you've truly brought me back into reality!

Share

Thumbs up Thumbs down