Mixed scaling in a single way-system?

  • #1, z tom-barnetTuesday, 01. February 2022, 21:41 hodinky 2 years ago
    Hi all,

    I have a little problem with setting up the size of the main character on the waypoints in one of the levels. As sketched on the enclosed image, there are three main areas in the stage. The front area, with character size 100, then the back area with the door, with character size 65, (for the perspective). The problem however happens in the area on the right side of the level. There are stairs leading up and the character is thus moving up on the Y-axis while retaining the same size (100). However, Visionaire reads it as the character moving to the back, and the scaling clashes between the size set at the waypoint close to the door and the size set at the waypoint on the top of the stairs, making the character do crazy things.

    Is there any way to solve this problem? 
    So far I "patched" it by creating two separate way systems for each area of the level, but there is a little problem with the hero transiting between these two way systems (hero stops or you have to click several times to make him go where you want).

    Any ideas please, on how to either make the way system obey my wishes :-) or how to create two way-systems in the same area (with no obstructions) where the main character can seemlessly cross from one to the other?

    Bažant

    37 Posts


  • #2, z afrlmeWednesday, 02. February 2022, 14:06 hodinky 2 years ago
    I would maybe consider using 2 way systems & using action areas (also found under way systems) to change between the 2 way systems as needed. You will likely have to experiment a bit to get it working exactly - or at least more or less - working how you want it to work.

    Duplicate your main way system & edit the second as needed. The reason for duplicating is so that you keep the way borders & paths & scale values as consistent as possible so that there shouldn't be any jarring jumps between scale when changing between the way systems.

    Anyway, in your example image I would use the action area & new way system on the center path going up to the door/exit. You can create actions for both on character enters & on character leaves.

    Imperátor

    7285 Posts

  • #3, z tom-barnetWednesday, 02. February 2022, 17:28 hodinky 2 years ago
    Thank you for the reply. I did manage to set up something along with the terms you describe, using the action area. However, it is not ideal. 

    I am using a single click interface and to avoid the Hero walking to the nearest point when you click unwalkable areas (like sky, trees etc.) and only walk to a destination clicked within the walkable area, I set up interactions with only objects upon left-click and disabled moving of the character. The walkable area is then covered with "tiles" of walkable objects and that's how the hero moves across the screen. This however creates a problem when I use two way-systems because when Hero is in WS1 and you click on the far end of WS2, the Hero will not go where you clicked because the object position is not within the currently active WS. 

    It can be solved by creating large conditioned objects fully covering the whole area of each of the way systems. The objects are active only when the WS underneath is inactive. That makes the character walk towards the border of the two WS, where there is an active area that switches between the WS. BUT even with this solution, the hero will stop after entering the action area and you will have to click again to finish walking to the original destination.

    Idk, this is the best I could come up with. If anyone has a better solution, especially where the character does not stop at the border and the destination does not need to be clicked again, ill be happy to hear it!

    Bažant

    37 Posts

  • #4, z afrlmeWednesday, 02. February 2022, 19:06 hodinky 2 years ago
    Have the same way system borders for both. Just switch between the two with the action areas.

    Imperátor

    7285 Posts

  • #5, z tom-barnetWednesday, 02. February 2022, 19:53 hodinky 2 years ago
    Unfortunately, the Hero always stops in the middle of walking once the way system changes.

    I followed your suggestions and even made two identical way systems but with different scaling values. They always switch between each other based on action area so the character never stands on the "tarnished" scaling points.

    I suppose there is nothing more to do?

    Bažant

    37 Posts

  • #6, z afrlmeThursday, 03. February 2022, 03:09 hodinky 2 years ago
    Ah you mean they don't continue to the destination?

    Ok you will likely need to use a bit of scripting to store the destination into a variable before changing the way system so you can update the engine & tell the character where to go after. It should look like something along the lines of this...

    execute a script:
    cws_destCommand = game.DestinationCommand
    
    cws_destItm = game.DestinationItem
    
    cws_destItmPicked = game.DestinationItemPicked
    
    cws_destEvent = game.DestinationEvent
    
    -- + --
    
    cws_dest = game.CurrentCharacter.Destination
    
    cws_destObj = game.CurrentCharacter.DestinationObject


    change way system to example

    execute a script:
    game.DestinationCommand = cws_destCommand
    
    game.DestinationItem = cws_destItm
    
    game.DestinationItemPicked = cws_destItmPicked
    
    game.DestinationEvent = cws_destEvent
    
    -- + --
    
    game.CurrentCharacter.Destination = cws_dest
    
    game.CurrentCharacter.DestinationObject = cws_destObj

    I don't know if you need all of those to resume walking to the destination, but all of those are to do with destination events. Ideally it would be best if you used functions instead & added some if queries in, but it should do the trick.

    Imperátor

    7285 Posts

  • #7, z tom-barnetThursday, 03. February 2022, 09:44 hodinky 2 years ago
    Thank you so much! It works perfectly!!! smile

    I have just one more problem, which will probably be something I missed, but I just cannot find anything. I have an object within the WS2, that the hero just refuses to go to from the WS1. There are other objects in WS2 as well and they work perfectly: the Hero smoothly comes to them when starting from WS1. But for this one troublesome object, the hero just walks to the border of the two way-systems and stops. I checked if the object Position is within the WS2, it should be normally reachable without any issues. If I move this position by +21px on the Y axis, it works, but when I change the coordinates to the original, the problem is back. I even tried to extend the Walking area around it in all directions, with no effect. Even tried to move the Waypoints, no effect. I just do not understand what is the issue with this one. It is also within my "walking tiles" objects, that are all set as walkable and work everywhere else. What am I missing?

    Bažant

    37 Posts

  • #8, z afrlmeThursday, 03. February 2022, 13:10 hodinky 2 years ago
    You could try deleting the object & recreate it. It could have corrupted somehow. As for any other reasons, I couldn't say without seeing some screenshots or a video of everything related to the setup for that object & the way system, etc.

    By the way, if you open up the developer console (TAB) while running your game via the visionaire studio editor, you can see the way system & paths the engine is calculating when you click on an empty space, object, or character in the scene.

    Here's a screenshot of the way system overlay enabled. I'm not really sure what the red lines represent, but the blue line is the calculated path when I click on something & the character can't walk in a straight line between point A & point B.

    https://i.gyazo.com/6864bc29f45c659f5c5e106e4e7bebfc.jpg

    Maybe enabling that will see what's happening when you click on the object.

    Imperátor

    7285 Posts

  • #9, z tom-barnetFriday, 04. February 2022, 08:44 hodinky 2 years ago
    Thanks for the tips.

    I tried to delete and recreate the object, but with no success.

    I checked the way system in debug console and when I click the misbehaving object, I get a blinking X in the place where the object position for the character should be. But I don't know what does it mean? I found the Console documentation page but I am none the wiser. I also noticed I have the same issue on a few "walking tiles" as well, which would explain why I have to sometimes click several times at the beginning of the scene to get the character moving at all. However these disappear for asome reason after a while.

    Any idea what could be the problem? 

    Bažant

    37 Posts

  • #10, z afrlmeFriday, 04. February 2022, 12:46 hodinky 2 years ago
    Maybe to do with how you have drawn the way borders & or way paths. Could you post a screenshot of them?

    Imperátor

    7285 Posts

  • #11, z afrlmeSaturday, 05. February 2022, 19:10 hodinky 2 years ago
    Sorry, just saw your message. I wouldn't have known if I didn't get an email notification as the message system never shows me that I have a new message - might be the ad blocker I'm running that's preventing it from working.

    Anyway, I don't see anything wrong in the images you sent me, though I don't believe you sent me any screenshots of the way paths themselves. Does anything get printed to the log when you load that scene/change to that way system?

    By the way if you haven't already, you should set the log level in options > player, to info so that it prints more things to the log.

    By the way (again), if you aren't already on our discord server, then it might be a good idea to join as you will get a much faster answer on there than on here. Me, Simon, & Sebastian are active on there most of the time almost every day & there's plenty of regulars on there that are willing to answer questions & help out too.

    https://discord.gg/g5zFejW

    Imperátor

    7285 Posts