Content

Post new topic Reply to topic
<<  1, 2, 3  >>

ZEQ2-Lite Unity conversion (unnoficial) - Warm up

Author Message
Eagle The Purpose View user's profile Send private message

Reply with quote Sunday, March 15, 2015

I think I'll use axis for basic movements, and use keys for things like boost/fast fly.

Using axises will permit to manage walk and run on the same action but depending on the axis intensity. Testing the thing.

Calling for the community to suggest controls types. Please post your ideas. ^^

Zeth The Admin View user's profile Send private message

Reply with quote Sunday, March 15, 2015

Are the "var controller" and "float speed" 2 new introduced variables ?


Yes. controller and speed are local variables to that method.

And this "this".. I have searched on many sites what it meant but didn't understand anything.. What does it refer to ? Neutral


this is used to specify the instance scope. While not technically needed, it helps avoid ambiguous code. Otherwise, it's not clear where (what scope) your variable came from : local, file, class, namespace, or instance.

Eagle The Purpose View user's profile Send private message

Reply with quote Sunday, March 15, 2015

So there, "this" is "public class TestControls1 : MonoBehaviour{" ?

Edit: Uploading a video of the controls test. I'll detail everything in my next post.

Eagle The Purpose View user's profile Send private message

Reply with quote Sunday, March 15, 2015

PRRRA!

Quick test of the controls. Far from being finished but it's already that done.


New computer, new things. - Mod Dragon Ball

Quickly made map, with a spawn script attached to it. It makes the player spawn when the game start:

using UnityEngine;
using System.Collections;
public class Spawn : MonoBehaviour {
public GameObject Player;
void Start(){Instantiate (Player, Vector3.zero, Quaternion.identity);}
void Update() {}}



And that's the controls script:

using UnityEngine;
public class TestControls1 : MonoBehaviour{
   public float walkSpeed;
   public float runSpeed;
   public float dashSpeed;
   public float flySpeed;

   public void Update(){
      this.CheckMove();
   }
   public void CheckMove(){
      var controller = this.GetComponent<CharacterController>();
      float v = Input.GetAxis("Vertical");
      float h = Input.GetAxis("Horizontal");
      float you = Input.GetAxis("Jump");

      if(v > 0.1){controller.Move(this.transform.forward * walkSpeed);
         if(v > 0.4){controller.Move(this.transform.forward * runSpeed);}}
      if(h < -0.1){controller.Move(-this.transform.right * walkSpeed);
         if(h < -0.4){controller.Move(-this.transform.right * runSpeed);}}
      if(v < -0.1){controller.Move(-this.transform.forward * walkSpeed);
         if(v < -0.4){controller.Move(-this.transform.forward * runSpeed);}}
      if(h > 0.1){controller.Move(this.transform.right * walkSpeed);
         if(h > 0.4){controller.Move(this.transform.right * runSpeed);}}
      if(you > 0.1){controller.Move(this.transform.up * flySpeed);}
      if(you < -0.1){controller.Move(-this.transform.up * flySpeed);}
   }
}



Controls work that way.

Forward: Z or W
Backward: S
Strafe Left: Q or A
Strafe Right: D
Jump/Fly Up: Space
Jump/Fly Down: Left Control or Right Control

Assigned them by setting axis inputs in Unity's menu.

Depending on the joystick intensity when being pushed, the character walks or runs (doesn't work with keyboards, it's only 0% or 100%).

Still Being worked on.

Eagle The Purpose View user's profile Send private message

Reply with quote Sunday, March 15, 2015

News:

- Added Gravity (alpha 0.0.0.0.0.0.0.0.0.1)


Next Tasks (not in order of importance):

- Finishing Movement Controls.

- Fixing speed issues.

- Finishing physics

- Mouse Look (mouse controls/camera controls)

qwerty In Advance View user's profile Send private message

Reply with quote Monday, March 16, 2015

ZEQ2-Lite Unity? it's better to start from here.

ZEQ2 Web Build

Eagle The Purpose View user's profile Send private message

Reply with quote Monday, March 16, 2015

What will it bring to me ? I have to start from 0, it's the best and funniest way to learn.

I try to make everything by myself, with less aids as possible.

Eagle The Purpose View user's profile Send private message

Reply with quote Friday, March 20, 2015

Another question, about the actual ZEQ2-lite this time.

Is ZEQ2-Lite gravity system decrementing vector up speed value and once reaching 0, increment negative value to a certain point (falling speed limit) and all of that progressively in the jump action ?

If it is true, that require a boucle and few ifs, am I right ?

Zeth The Admin View user's profile Send private message

Reply with quote Friday, March 20, 2015

Is ZEQ2-Lite gravity system decrementing vector up speed value and once reaching 0, increment negative value to a certain point (falling speed limit) and all of that progressively in the jump action ?


I don't understand your question. Are you asking about the world vector up or local vector up of the player? You don't really decrement these as much as use them with a negative offset (to produce a downward direction).

There are many design paths to implementing a jump in a game.

Eagle The Purpose View user's profile Send private message

Reply with quote Friday, March 20, 2015

I used this vocabulary to simplify a bit what I meant.

I based all the physics on the character (local), not the world (if you meant map by that).

I made the jump control (even if it looks like a fly up for now) and the gravity drag the character down (it even make the player go through the ground, however it has collider or not..), but it doesn't look natural.

I think the gravity should be, adding a force (this.transform.up) when jumping, and just when the action is started, apply the gravity to slow down the movement and bring back the object to the ground (transform.Translate(-Vector3.up * Gravity * Time.deltaTime);}). Add few ifs to it to limit the falling speed or something else, but it's only details.

Is that how ZEQ2-lite gravity system works ?

Postscript: Sorry if I have badly explained, I don't really have time right now to write on the forum.

Shenku RiO Incarnate View user's profile Send private message

Reply with quote Saturday, March 21, 2015

Just a thought, but a big key to making decent looking gravity is understanding the physics involved with it.

(WARNING: Long Example! Apologies in advance!)

For example, as an object is sitting at rest on the ground, technically there is still a constant force of G(G = Gravity) pressing down on them to keep them from floating off. Jumping gives you a positive vector making the character go up, but the initial vector is influenced by both Drag(air resistance) and Gravity, which first decelerates to 0(which is when you the character reaches the peak height), and then begins accelerating towards the ground at roughly a rate of 32 feet per second per second(no, not a typo, the 32 feet per second fall rate increases by 32 feet every second), until after factoring in drag which is what makes objects on Earth reach what's called Terminal Velocity. Basically, the force of the earth pulling you down is limited because of the force of the air pushing back up against you as you fall, which is why objects eventually stop accelerating when falling and stay at a constant vector downwards.

in game terms for jumping and falling, you would need to apply the upward velocity from the jump immediately, then as soon as the character leaves the ground you start applying the Gravity and Drag accelerations down(not as a solid number, because again, it's only 32 feet per second per second), which means that each time another 32 is added(since they're technically negative numbers and are thus subtracting from the initial vector once every second), the velocity upwards is decreasing a little more until eventually the number goes negative and the character begins to fall.

Then, to keep the velocity from getting too high downwards(assuming you want realistic gravity) you would have two if statements checking to see if the character's in a "walking" state(basically, the character is standing/walking/running on the ground) and if true resets the falling velocity back down to 0(since the force of gravity down and the force of the ground resisting cancel each other out). The second if statement checks to make sure that your acceleration never exceeds Terminal Velocity, and if for whatever reason it does, it reverses the acceleration(simulating drag) and decelerates you slowly back to terminal velocity over time.

And to keep things smooth, you would need the Gravity function to be processed every tick(with the acceleration values updating every second unless one of the if statements results changes) to ensure a smooth transition of velocity when jumping and/or falling(otherwise if it's not processed every tick, you may have momentary instances in which gravity doesn't apply itself to the character, and you could end up with Wile E. Coyote syndrome).



At least, if I was building up a gravity/physics system from scratch, that's how I'd do it. I'm not the best at programming though, so there's probably better (although likely more technical) methods out there.

Though honestly, it might just be easier to use a template that already has gravity in place and modify it to suit your needs rather than trying to reinvent the wheel completely from scratch.

Eagle The Purpose View user's profile Send private message

Reply with quote Saturday, March 21, 2015

Well, that's pretty much what I said earlier and that's what I already planned to do.

I'll need a boucle (I'm searching how it works) to apply the gravity constantly after the jump, few ifs for the conditions of application and include the gravity system in the void update (or as another void that will be called in the void update). The void update is executing the scripts at each frame.

For now, I'm struggling with including collisions (getting infos about collisions then the code can do the rest) in the physics code to make work the IsGrounded state and complete the jump control/gravity.

It's a little blurred like that, but I'm working on organizing all of that and finish these tasks.

Thanks for you for the reply anyway. Don't worry about the walls of text, I think I can handle them in this kind of case. Smile

I think I'm in the good way if I though as same as you. That's a good thing. ^^

On this, going back to work. See you later. Wink

Eagle The Purpose View user's profile Send private message

Reply with quote Sunday, March 22, 2015

Okay, I think I have found a way to do all of that.

But another problem again, I'll have to figure out how to separate walls and floors from the whole group they are in that is the map. (seems like there's no face groups system like in 3D modelling programs..)

If I don't separate them, the player will be able to become "IsGrounded" just by touching a wall. It'll result in:

- Disabling gravity.

- Making the player be able to jump (can be performed an unlimited number of times if a wall is near..).

Am I right ?

Edit: It's not really important but I find it better to say it, I created a group for ZEQ2-Lite(Unity) Pre-Development on moddb. All medias will now be uploaded there instead of my profile that I keep for other things.

Eagle The Purpose View user's profile Send private message

Reply with quote Wednesday, April 15, 2015

  public gameobject Terrain;
  bool IsGrounded = false;

   public void Update(){
      this.OnCollisionEnter ();
   }

   public void OnCollisionEnter(Collision col){
      if(col.gameObject.name == "Terrain"){IsGrounded = true; System.Console.Write("Grounded");}
   }



"error CS1501: No overload for method `OnCollisionEnter' takes `0' arguments"


?? Searched on other forums but didn't find a solution nor understood what is the problem there..

Shenku RiO Incarnate View user's profile Send private message

Reply with quote Friday, April 17, 2015

Wh1t34Gl3(SAS) wrote :

  public gameobject Terrain;
  bool IsGrounded = false;

   public void Update(){
      this.OnCollisionEnter ();
   }

   public void OnCollisionEnter(Collision col){
      if(col.gameObject.name == "Terrain"){IsGrounded = true; System.Console.Write("Grounded");}
   }



"error CS1501: No overload for method `OnCollisionEnter' takes `0' arguments"


?? Searched on other forums but didn't find a solution nor understood what is the problem there..



Not 100% sure, but usually errors about a function's arguments means that the variables it's checking are wrong. I.e. "OnCollisionEnter(Collision col)", the lines inside the parentesis are the arguments.

The "takes '0' arguments" seems to imply that you have OnCollisionEnter being called with a variable that it doesn't understand what it's suppose to do with it. The "0" in your error suggests, to me at least, that there maybe shouldn't be any arguments inside those parentesis...?

That's just my best educated guess though, I don't know the syntax of the code type you're working in...

Zeth The Admin View user's profile Send private message

Reply with quote Friday, April 17, 2015

You shouldn't be manually calling OnCollisionEnter. It's a Unity triggered event that calls automatically when a collision occurs. Additionally, it passes a Collision object as a parameter. There's no overloaded (variation) that accepted no parameters.

Eagle The Purpose View user's profile Send private message

Reply with quote Friday, April 24, 2015

Mmmmh.. I have to think about some things..

1. Deciding which one between the Character Controller and the Rigid Body I should choose. (the Rigid Body is better for collisions but not recommended for the rest, and it's the reverse for the Character Controller. The Rigid Body seems to fix the -why movement when moving on the xz/-x-z plans too..)

2. Fix the boucle of the gravity system that makes CRASH the whole thing..

3. Find a way to group the map so I can name parts "wall" and "ground" for the Grounded state. (or maybe basing the grounded state on the "ground"'s angle, like "if the angle of the ground is over 45°, IsGrounded becomes false", but it might have flaws, need to think more about it..)


When I was modifying the Player's prefab, I made a little mistake by running the game, and I had a clone of myself in it. It was moving as same as me (since it's linked to the main character's movement), but no cameras for it. It was moving twice or more my speed too. It was weird, but funny and good to know. Surprised

Eagle The Purpose View user's profile Send private message

Reply with quote Friday, May 22, 2015

No big update yet. The map is a bit changed, I kept the character controller, the gravity collision script is now based on the floor angle (need fixes), the gravity works, the incrementation boucle of gravity speed is accepted (no errors) but this last doesn't seem to work in game.

I'm currently modelling a Goku Super Saiyan 4 for further tests.

Edit:

I wouldn't even think I could go until this point.. I just need to fix the side view and model the ear and I will start the hairs:


I'll test the new pupils I have already shown as well:


Current details added on the current model:

Zielan KoRnified View user's profile Send private message

Reply with quote Friday, May 22, 2015

I'm not sure if it's wise to model the base mouth after an expression, with modeled in dimples.
Seems like it might make it cumbersome for you to work with morph targets and stuff later on.

Eagle The Purpose View user's profile Send private message

Reply with quote Friday, May 22, 2015

I have already thought about that. But there's nothing I can't undo, so I don't hesitate to test things. If something goes wrong with some parts I will remove or transform them.

The dimples could be separated as same as Nello did for the pupils. For the mouth, I can still reduce the vertex count once again. (in fact, the whole model need to be tweaked..)

But it's just the beginning. It will be improved in the future. And since this is the only thing I can do for now, I won't have any problems with morph targets. Laughing

Each thing at a time. Wink

Thank you for the advice though, taking in mind.

Eagle The Purpose View user's profile Send private message

Reply with quote Friday, May 22, 2015

Remodeled a bit but didn't change anything of the special details. Looks smoother and more accurate. Soon making the ear and then hairs.

Eagle The Purpose View user's profile Send private message

Reply with quote Tuesday, May 26, 2015

There's few questions that are running in my head since your last message in f3+ thread, Zeth...

What is ZEQ2, exactly ?
Why was Zios stopped ?
Why creating ZEQ2-Lite ?
Why returning on ZEQ2 ?
Why didn't you say anything if the unity version was meant to be for ZEQ2 ?
If I continue on this, what things should I provide to launch something ?
What will become ZEQ2-Lite ioQ3 after an hypothetical success of the new version ?
What should ZEQ2-Lite Unity's content be about ?!

>Global

I'm working on an adaptation of ZEQ2-Lite under the unity engine but, it isn't making things really better (in the case I reach my goal).

I need some ideas. Debating on each decisions. ZEQ2-Lite is build by the whole community, I can't do as I want to or copy the exact same thing that was done before, with the exact same flaws... It would go half against the project's nature and/or wouldn't present any changes..

Eagle The Purpose View user's profile Send private message

Reply with quote Wednesday, May 27, 2015

Updated to Unity 5. Scripts don't need changes apparently. Remaking the map to retest everything.

Zeth The Admin View user's profile Send private message

Reply with quote Thursday, May 28, 2015

What is ZEQ2, exactly ?


Depends on when you are asking. The definition and goals for it have changed over time. Currently, it's intended to be a Unity project rooted in Dragon Ball Z accuracy -- built as an extension to a more abstracted, customizable fighting game.

Why was Zios stopped ?


Zios is a group moniker for products we produce. The Zios engine? Developer interest/manpower largely. Inevitably, like most early projects, it was more about learning/personal growth and breaking expectations/standards to help with productivity.

Why creating ZEQ2-Lite ?


The last paragraph should cover that.

Why returning on ZEQ2 ?


The idea behind the 2013 push to rekindle the project was due to developers actually starting to have interest and time. It didn't pan out so the project did not resume.

Why didn't you say anything if the unity version was meant to be for ZEQ2 ?


I do not understand the question.

If I continue on this, what things should I provide to launch something ?


Identify yourself distinctly. A ZEQ2 Unity project already exists. ZEDU is its own project based on ZEQ2-lite content. If you intend to create another branch of ZEQ2-lite on Unity, make sure you give your project a unique presence as to not confuse or associate it with others that may exist of a similar basis.

What will become ZEQ2-Lite ioQ3 after an hypothetical success of the new version ?


It's already released and out there. It was never intended to be worked on after initial release and has already served its purpose fully. It will persist as its own thing regardless.

What should ZEQ2-Lite Unity's content be about ?!


ZEQ2 Unity will aim for its root goals. Your project can be about whatever you wish.
If it's called ZEQ2-lite Unity, it probably should just be a direct port of ZEQ2-lite to Unity (without [m]any drastic feature changes).

Eagle The Purpose View user's profile Send private message

Reply with quote Thursday, May 28, 2015

Depends on when you are asking. The definition and goals for it have changed over time. Currently, it's intended to be a Unity project rooted in Dragon Ball Z accuracy -- built as an extension to a more abstracted, customizable fighting game.



An engine in an engine ? I expected that a bit. I just hope it won't cost money, like Zios.. I don't think it is possible anyway.

Zios is a group moniker for products we produce. The Zios engine? Developer interest/manpower largely. Inevitably, like more early projects, it was more about learning/personal growth and breaking expectations/standards to help with productivity.



I guess it wasn't really advanced or that some things weren't adapted to the actuality (at the time) if you started other things instead of keeping it.

I do not understand the question.



I always heard that ZEQ2 and ZEQ2-Lite were different projects (public, not public, dev team, no dev team etc... Plus what you said), and you confirm it.

So, by your definition of ZEQ2-Lite, ZEQ2"-Lite"(Unity) is a nonsense. What I was aiming here in fact, was the current ZEQ2...

Identify yourself distinctly. A ZEQ2 Unity project already exists. ZEDU is its own project based on ZEQ2-lite content. If you intend to create another branch of ZEQ2-lite on Unity, make sure you give your project a unique presence as to not confuse or associate it with others that may exist of a similar basis.



What you see in this thread is not official nor the actual development of a new branch of ZEQ2. I wait to reach the actual level of the official ZEQ2(Unity) to think about what to do for the next.

...


So... I'm not changing the name for now, it's just a test, I will just continue, following ZEQ2 and ZEQ2-Lite's concepts and ideas, trying to find improvments etc.... Until I reach a certain point.

Thank you for answering.

<<  1, 2, 3  >>
Post new topic Reply to topic

Actions

Online [ 0 / 6125]