Search Unity

★ Game Creator ★

Discussion in 'Assets and Asset Store' started by Catsoft-Studios, Jul 12, 2017.

  1. BV123

    BV123

    Joined:
    Dec 7, 2016
    Posts:
    33
    Hi, I don't know if this'll help but I just tried this and it seems to work okay as a temporary fix:

    1) Create a Trigger (On Start)

    2) Add an Enable Component action for the player object that disables the CharacterAnimator component

    3) Add a Wait action for .0001 seconds

    4) Add an Enable Component action for the player object that re-enables the CharacterAnimator component

    Hopefully that helps. :)

     
    Catsoft-Studios likes this.
  2. Catsoft-Studios

    Catsoft-Studios

    Joined:
    Jan 15, 2011
    Posts:
    534
    Interesting. Thanks for sharing this. We weren't aware of this work-around and might help us narrow down the search :)
     
  3. yurilin1

    yurilin1

    Joined:
    May 22, 2013
    Posts:
    87
    Hi, can I use the save/load system directly or should do some extra job.
    I have tested on a 3d map and make a trigger to open a door then I used the function of saving the game.
    After I reload the game and start,(use load previous) I found the door still keeping closed and the camera also not the last saved camera.
    This did not surprise me because I know to make the whole scene to be a serialized data is not a good idea.
    But after doing this, I found the editor window became very lag in runtime and all things get stuck.
    I don't know what happened would cause this(not loading the game won't cause the game stuck).
    I guess, maybe I should record player state, which camera are using, last scene name, any change on the previous play as variables and reload on start then init them myself to finish the save/load.
    But I'd like to know what save/load function really saves.
    Thanks.
     
    Last edited: Oct 19, 2018
    Catsoft-Studios likes this.
  4. Catsoft-Studios

    Catsoft-Studios

    Joined:
    Jan 15, 2011
    Posts:
    534
    We're still working on the Save/Load system, introducing small changes. Camera and object states don't get saved, as you correctly said, since that would require serializing the whole scene.

    For now we automatically save the character's positions, items in the Inventory, Variables content, Equipment, Stats and Status Effects (maybe I'm missing something, but you get the point). It doesn't save animations, or object world positions, though this is coming soon.

    Currently there's an issue when loading a game that loads the same scene. We're working around the clock to solve this problem in the next update. As a temporal work-around you can load an empty scene with a "Load Game" action set to be triggered on Start. That will prevent this error.

    Cheers!
     
  5. BV123

    BV123

    Joined:
    Dec 7, 2016
    Posts:
    33
    Hey, I think I figured it out! :eek: It seems to be just enabling the Has Exit Time check box for the upward transition between Locomotion and (Up) Base in the animator fixes it. I can't believe that's all it was. o_O

     
    Last edited: Oct 19, 2018
  6. yurilin1

    yurilin1

    Joined:
    May 22, 2013
    Posts:
    87
    Good tips and that exactly what's the problem.
     
  7. yurilin1

    yurilin1

    Joined:
    May 22, 2013
    Posts:
    87
    Hi, thanks! Will this cause some side effects? I found this problem when walking on a not very flat ground(tiled blocks paint by some kind of level editor). It plays drop animation even for a very minor height difference but not an ik footstep now.
     
  8. BV123

    BV123

    Joined:
    Dec 7, 2016
    Posts:
    33
    Hey, I noticed that too but I don't think it's related because that was happening before I enabled that check box. I just double checked in a new project without ever enabling the check box first and the "floatiness" problem when going downhill is still there. I don't think that was happening with the previous version of GC. I'll double check in a saved older project. :)
     
  9. yurilin1

    yurilin1

    Joined:
    May 22, 2013
    Posts:
    87
    I am sorry I came back again.
    I tried the saving system for a variable but seems not work for me. What's wrong with me then?
    1. First I created a global bool variable and set it to be saved.
    1.png
    2.then when I open the door on the scene. I save the variable in this way.
    2.png
    3. The runtime shows the command has been executed.
    3.png
    4. I loaded a game from an empty scene on start like this.
    4.png
    Seems the data is still the same. (the scene position seems was loaded successfully but the data seems not right)
    5.png

    So am I misunderstand the usage of saving or there were some problems here.

    Thanks again.
     
  10. BV123

    BV123

    Joined:
    Dec 7, 2016
    Posts:
    33


    Yep, this seems to be a new bug because it wasn't happening with the previous version. I'm sure there will be fix sometime soon though. We'll just have to wait a bit. :)
     
  11. yurilin1

    yurilin1

    Joined:
    May 22, 2013
    Posts:
    87
    Here I found some problem requires an idea.
    Players won't aware what's next will be a camera switch, so they would keep holding the same direction.
    As the player did not change its rotation to face the new camera. They soon walk out of the new trigger of change camera. Because of the on player trigger exit trigger, the camera keeps switch between 2 zones repeatedly.
    This would cause like this.
    1.gif
    :eek:hope anyone could give some advice.
     
  12. BV123

    BV123

    Joined:
    Dec 7, 2016
    Posts:
    33

    I think as a temporary fix you can open the CharacterLocomotion.cs script and replace lines 233-242 with:

    Code (CSharp):
    1. this.verticalSpeed += (Physics.gravity.y * Time.deltaTime);
    2.             if (isGrounded)
    3.             {
    4.                 this.jumpChain = 0;
    5.                 this.lastGroundTime = Time.time;
    6.                 if (this.verticalSpeed < Physics.gravity.y)
    7.                 {
    8.                     this.verticalSpeed = Physics.gravity.y;
    9.             }
    10.             }
    11.             this.verticalSpeed = Mathf.Max(this.verticalSpeed, this.maxFallSpeed);
    12.         }
    The character controller should no longer bounce when going downhill and can still jump multiple times. It doesn't seem to mess anything up but if I'm missing something you can always just re-import the script.

    Hope that's helpful. :)
     
    Catsoft-Studios likes this.
  13. yurilin1

    yurilin1

    Joined:
    May 22, 2013
    Posts:
    87
    It is cool.
    But I am now messing around another 2 problems upon.:confused:
     
  14. BV123

    BV123

    Joined:
    Dec 7, 2016
    Posts:
    33
    Understood, but try the above code when you get a chance. You should definitely see a difference when going downhill. :)
     
  15. BV123

    BV123

    Joined:
    Dec 7, 2016
    Posts:
    33
    Hey, if I understand you correctly, the way I would handle this is sorta how I would handle a player going through a door. By temporarily disabling player control and then moving the player to the other side.

    You're gonna want to use Trigger (on enter), Move Character action, and Enable/Disable Component action for the trigger collider components. It's funny because it's kinda difficult to explain but really easy to do in practice. I will say that you'll need 4 triggers (on enter) in a row with the 2 outer ones being the targets for the Move Character actions on the inner ones. The outer triggers' actions should switch disabling the collider components for the inner triggers.

    Anyway, I hope that helps steer you in the right direction.
     
    Catsoft-Studios likes this.
  16. yurilin1

    yurilin1

    Joined:
    May 22, 2013
    Posts:
    87
    This is interesting and I would have a try.
     
    Last edited: Oct 22, 2018
    Catsoft-Studios likes this.
  17. Catsoft-Studios

    Catsoft-Studios

    Joined:
    Jan 15, 2011
    Posts:
    534
    Agree. This is a very interesting approach. This problem occurs because we weren't very smart when positioning these Cameras and their respective Triggers.
     
  18. bathyscaphe

    bathyscaphe

    Joined:
    Apr 14, 2018
    Posts:
    16
    Hi) Is this asset is compatible with ps4/XB1/Switch ?
     
    Catsoft-Studios likes this.
  19. Catsoft-Studios

    Catsoft-Studios

    Joined:
    Jan 15, 2011
    Posts:
    534
    You shouldn't have any problems with these systems. We haven't tested it with Switch nor X-Box, but this package provides access to the source code, without any pre-compiled libraries, so as long as Unity compiles it to a platform, we also do.

    Moreover, we do provide support for per-platform Triggers, so you can develop your game taking into account different target devices (see image below).

    trigger.png
     
  20. yurilin1

    yurilin1

    Joined:
    May 22, 2013
    Posts:
    87
    Hi, would you have a look at what's wrong with my save/load in this thread?
     
    Catsoft-Studios likes this.
  21. Catsoft-Studios

    Catsoft-Studios

    Joined:
    Jan 15, 2011
    Posts:
    534
    Sorry I missed that post. Seems fine. We have received some inquiries regarding the save/load system and looks like we pressed the wrong button during the previous update.

    This happens due to the scene loaded is the same where you are. We'll patch this bug in the next update 0.7.3. Shouldn't take long till it's available (hopefully mid-next week).
     
  22. yurilin1

    yurilin1

    Joined:
    May 22, 2013
    Posts:
    87
    ok. After I read the example script. I think the engine itself not save variable automatically but requires create a model class for sealization first.
    I like the slot-based save system so I'd like to use the save system by engine itself but not somthing like playprefs script instead. I don't know whether I am right.
     
  23. yurilin1

    yurilin1

    Joined:
    May 22, 2013
    Posts:
    87
    I had created an inited scene for loading.
    I've tested serialized class for load and seems works. But the load function only fires on the init scene.
    As you are going to create a new update. Well, these things won't be problems. Thanks.
     
  24. Catsoft-Studios

    Catsoft-Studios

    Joined:
    Jan 15, 2011
    Posts:
    534
    Yes, with the latest update you can customize where and how the data is serialized and saved. We'll be soon updating the documentation, but it's fairly straightforward to do.

    We just reproduced the error and you're right. Global Variables don't get reset and updated when loading a game save. I'll open a ticket right away and have this fixed the next iteration. Thanks for the heads up!
     
  25. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    207
    Can game creator support splitscreen? Like dual heros and inventories
     
  26. Catsoft-Studios

    Catsoft-Studios

    Joined:
    Jan 15, 2011
    Posts:
    534
    Game Creator doesn't support split screen at the moment though it does support LAN multiplayer using a third-party module called Multiplayer for Game Creator.

    Regarding the Inventory, you only have access to one inventory. Despite this, due to popular demand, we're researching about having "Inventory Containers" where you can dump or retrieve all your inventory items from a given container. This would be very useful in case you're making a game with multiple playable characters or to have a stash of items outside of the player's inventory.
     
    StevenPicard likes this.
  27. yurilin1

    yurilin1

    Joined:
    May 22, 2013
    Posts:
    87
    First, I must say, I am not urging you. I just want reflect some problems I found. Just some advice.
    First, I create a new empty black scene only for the load. I add an init action on this scene for loading current profile.
    But I found the system gives me an error that not found a character while loading from a scene which got a character.
    So I copied a character into this empty scene.

    This time the loading finished, but while load up twice times, The character's position and rotation both being inited correctly, but there gives me an error like init the character rotation error.

    transform.localRotation assign attempt for 'player' is not valid. Input rotation is { NaN, NaN, NaN, NaN }.
    UnityEngine.Transform:set_localRotation(Quaternion)
    GameCreator.Characters.CharacterFootIK:WeightCompensationRotation() (at Assets/Plugins/GameCreator/Characters/Mono/Characters/InverseKinematics/CharacterFootIK.cs:214)
    GameCreator.Characters.CharacterFootIK:LateUpdate() (at Assets/Plugins/GameCreator/Characters/Mono/Characters/InverseKinematics/CharacterFootIK.cs:86)


    This error can not catch by try or an float.isnan condition. It seems happened in another session. I guess whether this maybe causes by the initial sequence between loading interface and scene initialization or some memory leak.

    I don't know whether you could recreate the problem because I really add a lot of myself. (for example: add some loading class for record camera and items). But you may take a look into this.
    As the onload() start depends on its gameobject,it maybe be earilier than other required gameobject. I don't know whether this would cause character initial error.

    Another way to reproduce this problem seems can set the timescale to 0 then reset to 1.(I used a resume menu set timescale by script).

    Currently, this error not cause some harm but just report an error.
    I don't know whether all I say is reasonable, just have a look when you are free. Thanks.


    ps. I think you could create a forum on 000website or some free webhost, otherwise, people won't find the existed thread of there problem.
     
    Last edited: Oct 29, 2018
  28. yurilin1

    yurilin1

    Joined:
    May 22, 2013
    Posts:
    87
    Hi, another advice. And here I think we'd like to add a function to compare not equal, both for string and number.
    for example, when you have the key, you open the door, but when you get a wrong item you get the tip(simple message) . This situation can not simply triggered by an else because there may be other conditions together with in the clause.(like near the door first). May be repeat the other condition in else branch or nested case can do but I think things can be easier by add the not equal selection:)
    Thanks.
     
    Last edited: Oct 29, 2018
    Catsoft-Studios likes this.
  29. Catsoft-Studios

    Catsoft-Studios

    Joined:
    Jan 15, 2011
    Posts:
    534
    Hi @yurilin1

    We'll open a ticket and try to reproduce the error. We haven't encountered it until now, though we're going to change quite a lot on how the save/load system reloads a new game, so it may be fixed after that. Hope to circle back to you when we release GC 0.7.3 and you can test it out.

    We currently have an internal issue tracker but we're also looking at integrating a community one using GitLab. We do have everything set up, but we'd like it to be able to access it from our domain. We've taken notice of the need of that.

    Regarding the compare function, I'm not sure what you mean. Inside the Trigger On Drop Item?
     
  30. yurilin1

    yurilin1

    Joined:
    May 22, 2013
    Posts:
    87


    V5[TL4X{PDKIQ{0_D6O}J98.png
    Here I use a condition to compare a global variable to check current equipment(I made my own Item system)
    I'd like here the "value" could be equal/not equal for many different situations.
    This is just an example because I think once we may face these problems.
    Currently, I did not require this function because I can simplify the condition inside an else branch.
    But you may think about it.
    Sorry for my English XD
     
    Catsoft-Studios likes this.
  31. Catsoft-Studios

    Catsoft-Studios

    Joined:
    Jan 15, 2011
    Posts:
    534
    The idea is that Game Creator and the rest of the modules have simple and generic functionality. For advanced or more specific Actions/Conditions/Triggers we're putting together a new platform called Game Creator Hub. This will be a place where you'll be able to download free Actions/Conditions/Triggers from community members. This would be a great place to add the things you mentioned :)

    Your English is perfect ;)
     
  32. RoyS

    RoyS

    Joined:
    Jan 12, 2009
    Posts:
    651
    "Regarding the Inventory, you only have access to one inventory. Despite this, due to popular demand, we're researching about having "Inventory Containers" where you can dump or retrieve all your inventory items from a given container. This would be very useful in case you're making a game with multiple playable characters or to have a stash of items outside of the player's inventory."

    Much needed. Also, how about NPC/Creature (moveable vs stationary crate or desk) where you can get meat from a deer for survival or health potions/weapons from a bandit?
     
    Catsoft-Studios likes this.
  33. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    300
    Do you plan to create something like an AI kit?
     
    Catsoft-Studios likes this.
  34. Catsoft-Studios

    Catsoft-Studios

    Joined:
    Jan 15, 2011
    Posts:
    534
    You can do that using the Item action, which allows you to execute instructions like: "Give 100 meat to the Player". At the Discord channel we've been discussing about having some kind of system for loot tables. We'll be introducing a new concept in the future called "Collections". These will work very much like Local Variables, but will also allow you to pick one randomly, access an element by index, etc...

    Yup, but it's a secret ;)
     
    RoyS likes this.
  35. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    300
    Can you tell me about your roadmap or plan?
     
    Catsoft-Studios likes this.
  36. Catsoft-Studios

    Catsoft-Studios

    Joined:
    Jan 15, 2011
    Posts:
    534
    Sure. Take a look at our roadmap: https://docs.gamecreator.io/annex/roadmap. Beware though that we update it quite a lot and priorities change based on the feedback we receive.
     
  37. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    300
    Is the AI module for battle? Or do you include a variety of things like villager AI? Please tell us by the first quarter of next year.
     
  38. Catsoft-Studios

    Catsoft-Studios

    Joined:
    Jan 15, 2011
    Posts:
    534
    It will handle both cases. The AI module won't be tied to a specific game genre or mechanic. Can't say much because we're still discussing how we're going to approach it (state machine or behavior tree) as well as which high-level actions and conditions to include.
     
  39. RoyS

    RoyS

    Joined:
    Jan 12, 2009
    Posts:
    651
    AI....companion follow and fight?

    Randomized loot from containers...that way player gets unexpected loot from bandit cave containers, etc.
     
  40. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    300
    It seems like a good approach. I look forward to the first quarter of next year. I hope it will not be late. And please pay attention to mobile performance.
     
  41. Catsoft-Studios

    Catsoft-Studios

    Joined:
    Jan 15, 2011
    Posts:
    534
    Companion follow will definitely be possible, since you can already make one follow you around using the "Character Follow" action. As for fighting, this is a very broad description, but yes, you'll be able to make characters fight the player and even each other ;)

    Thanks! Looking forward to it too :p Did you experience any performance issues on mobile? We haven't received any complains until now.
     
    RoyS likes this.
  42. RoyS

    RoyS

    Joined:
    Jan 12, 2009
    Posts:
    651
    I have an animated door. I don't want the player to be able to "activate" the door unless they are close to it.

    The 3 conditions I'd like to have met in order to have the door work...
    1 - Is LMB being pressed (done)
    2 - I want the player to be in the door's collision area.(see below)
    3 - I need to check the state of the door. That way if it's open the player can close it and if closed he can open it.(see below)

    I've looked thru the options...
    2...Neither "Character" conditions will work to have the player colliding with the door collision.
    3...I'm trying to add the condition Variable-->Variable Book to check the door state, but it's not accepting my "is-door-open" variable (I did have the "actions" set the door state via bool).
     
  43. yurilin1

    yurilin1

    Joined:
    May 22, 2013
    Posts:
    87
    If you don't have too much detail requirement(such as whether face the door).There is an easy way to do a quick job. The advanced setting on a trigger has an option of checking whether the player within a certain range of itself. You can check the cog icon on the right corner while using on trigger enter event.
    EQ}~T1G111G1Y2ZRAA8GSYL.png
     
    Last edited: Oct 31, 2018
    RoyS and Catsoft-Studios like this.
  44. Catsoft-Studios

    Catsoft-Studios

    Joined:
    Jan 15, 2011
    Posts:
    534
    @yurilin1 is 100% right. Advanced options is your friend here.

    Could you post the images of the variables you've set up? Our approach would be:
    • Create a Local Variable next to the Trigger
    • Add a new variable of type bool and call it "is-door-open"
    • Instead of calling an Actions, call a Conditions object and check of the "is-door-open" is set to true
      • if it is, play the animation that closes the door and set the "is-door-open" to false
      • if it isn't, play the animation that opens the door and set the "is-door-open" to true
    That should cover all cases.
     
    RoyS likes this.
  45. RoyS

    RoyS

    Joined:
    Jan 12, 2009
    Posts:
    651
    These are "attached" to the vending machine. Just trying to get a simple message to come up first. And I have attached a capsule collider to the fps player and the vending machine and they should be enough to set the trigger off.
    ~~~~
    Trigger
    On Start
    Min Distance - Checked
    Min Distance to Player 1 (I positioned the trigger to the front of the vending machine)
    (under this trigger I added the below action)

    Action-->Message-->Simple Message
    Message "Spend 30 gold for Soda (LMB)"
    Time 5
    (Other settings for this is default)
    ~~~~
    I should have that simple message coming up, but don't for some reason.
     
  46. yurilin1

    yurilin1

    Joined:
    May 22, 2013
    Posts:
    87
    On start only execute on the scene init period once.
    So however you walk close to the trigger later, nothing would happen.
    Seems you are asking how to walk into an area and play a message now(?)
    So why not using on trigger enter instead.

    I said the advanced setting is always using from some "global triggerable" situation. Such as press key, mouse click on something. These triggers always listening so you can add a min distance as a limit condition.

    For more complexed condition, I'd suggest using "nested condition".But the engine does not have such function directly. You can use the action "call condition" in a condition to simulate a nested condition.
     
    Catsoft-Studios and RoyS like this.
  47. RoyS

    RoyS

    Joined:
    Jan 12, 2009
    Posts:
    651
    I set up a box with a trigger to issue a message to see if I could nail down my problem...simply a trigger and message to keep it simple. Still nothing. So I sent a unitypackage to Catsoft.

    I could see my trigger collision and thought I was hitting it, but Catsoft said my trigger area was too small. They said that once they set it to 5, it worked. I was doing two vending machines and didn't want one to trigger the other, so set the trigger area too low...so I'll just keep things more apart.

    Thank you, Catsoft for taking a look at my issue.
     
    Catsoft-Studios likes this.
  48. Catsoft-Studios

    Catsoft-Studios

    Joined:
    Jan 15, 2011
    Posts:
    534
    You're welcome ;)
     
  49. paddywwoof

    paddywwoof

    Joined:
    Apr 19, 2016
    Posts:
    11
    My solution to the glitchy example was to change the trigger to 'On Player Stay Timeout' with Duration 2. That way if you teleport into the other scene and stand still you will teleport back - which is maybe what you want but if you run off then you stay in the Scene where you landed. IMHO the examples should be changed to do this.

    Another thing; I tried yurilin1's suggestion to stop the crouch cycling while idle and, although it's much better, I still get a kind of shivering while the Player stands on the ground (but not when running or walking) This doesn't happen in the unity editor, only when I build the game (on linux64)
     
    Catsoft-Studios likes this.
  50. Catsoft-Studios

    Catsoft-Studios

    Joined:
    Jan 15, 2011
    Posts:
    534
    Yeah, we'll update the examples so they don't have this. Nonetheless, another quick solution (may not work for everyone) is that, instead of instantly swapping between cameras, add some timeout between them. That way, the player will see how the camera flies from a perspective to another and will intuitively change their perception of where forward is.

    Not sure if this is the issue you're talking about, but we'll be adding a small time-offset because the player can shiver a bit when it detects no ground below it (due to floating point precision). This will be addressed in the upcoming update ;)