Characters walk over eachother or behind

Started by AndreasBlack, Tue 23/08/2022 12:39:14

Previous topic - Next topic

AndreasBlack

I've tried playing around with Character.baseline, but it's like i've explained in the topic. What am i missing? Ofc when the characters walks behind another character he should be behind. When walking in front he should be in front of the NPC. This must be such a common thing. I did search for it, but couldn't find the solution, unfortunaly.

Crimson Wizard

#1
Quote from: AndreasBlack on Tue 23/08/2022 12:39:14
I've tried playing around with Character.baseline, but it's like i've explained in the topic. What am i missing? Ofc when the characters walks behind another character he should be behind. When walking in front he should be in front of the NPC. This must be such a common thing. I did search for it, but couldn't find the solution, unfortunaly.

By default character's baseline equals to its Y coordinate, and it is updated automatically by AGS. You only have to set baseline when you need to override this behavior. Please describe your situation in more detail? What happens in your game and what problem are you trying to resolve?

AndreasBlack

The characters are walking behind certain things not just characters, but objects, or certain parts of the rooms. Before i've set the baseline in game start, had no trouble until i realised this issue. I'm most likely doing things wrong. I'm confused as to when i should use the character.baseline and when not and just "Walkbehind Area's"?

I think the solution probably could be really simple. I just need to do a Character.baseline=1 when walking the path temporarely and reseting it to 0 afterwards for the playable character. I've prepared a screenshot in case this doesn't work out! It's complicated. More characters could stand at similar places but those should not be affected by the walkbehind area, if that makes sense.  (roll)


Crimson Wizard

#3
Quote from: AndreasBlack on Tue 23/08/2022 15:54:02
The characters are walking behind certain things not just characters, but objects, or certain parts of the rooms. Before i've set the baseline in game start, had no trouble until i realised this issue. I'm most likely doing things wrong.

Why do you set character's baseline yourself at all? How are your objects and characters arranged on screen?

Could you post a screenshot of your game? That would at least make it more clear what the situation is.

Quote from: AndreasBlack on Tue 23/08/2022 15:54:02
I'm confused as to when i should use the character.baseline and when not and just "Walkbehind Area's"?

Normally, for traditional looking p'n'c games with sideview you don't need to set character's baselines, and only arrange objects and walkbehinds correspondingly. The character's and object's automatic baseline is at their "feet". For walk-behinds you need to set baseline yourself (you may do that by dragging a baseline control in the editor).

You mostly need manual baselines for some special scenes, and games with alternate perspectives (like top-down view, for example).

AndreasBlack

#4
Good that you've clarified that. It did solve my issues now tho, but i've for sure taken water over my head. Hopefullly i'll sort stuff out. Nothing is gamebreaking at least.
I have a 12th floor hotel business to run/script, and you can take the stairs. (roll) However now that i've sorta solved the baseline issue with the forground parallax. I'm not sure my "smart" idea actually works so good in theory. The player can get stuck and walk back in forth on the stairs to the second floor. If the player changes his mind, if not then it works tho. Again not gamebreaking, but not sure if it's the way to go atm.

I have to "turn off" the hotspot/walkable area temporary when the player is on the floor above or else the player can mispress and the characters runs down again to the previous floor, and it's how i should "think" about how to make that work, that is tricky. Since there are more playable characters. Atm i use regions or inside the hotspots turning of the walkable area on the floor below, so that if switching to another character, that character can just walk near the stairs and the hotspot/walkable area should be activated again. (laugh).

Probably waaaay overcomplicating things. :-[ Screenshot will come tommorrow if i can't get it to work tommorrow. Thanks for the help always!

Edit: To clarify i use a hotspot as sort of a "automatic walk up the stairs" click, so the camera follows it perfectly. Also it was easier to use the tween module to darken the player when getting further from the screen onto the stairway.

Crimson Wizard

#5
Quote from: AndreasBlack on Tue 23/08/2022 21:20:51
Probably waaaay overcomplicating things. :-[ Screenshot will come tommorrow if i can't get it to work tommorrow. Thanks for the help always!

A single screenshot, or at least a schematic, can save several posts of explanations. Your last post left me as puzzled as the previous ones, I still cannot guess what the problem is based on your description. You mention parallax, was that causing issues? I cannot tell how multiple floors or use of hotspots are relevant to the baseline problem, if they are.

AndreasBlack

tbh, i don't think a screenshot will help much either if i get stuck i'll probably have to upload a video to show what the issue is, but i'm quite sure the baseline is solved as for now. It's a complete different issue now, probably why the confusion. Since it's so specific things it's easier shown in a video, everything seems to be working OK now for the baseline. And i'll start another thread if i get stuck on the other stuff hotspots/regions, etc. Sorry for confusing, i guess in my fasting mind i could travel from one issue to another! (laugh)


Pax Animo

One thing I'd like to mention is check your sprites, as from my understanding they will effect your character/object baselines, as Crimson mentioned, baselines are set at the character's/object's feet, which is the bottom line of the sprite of said character/object.
Misunderstood

newwaveburritos

Quote from: Pax Animo on Wed 24/08/2022 01:50:00
One thing I'd like to mention is check your sprites, as from my understanding they will effect your character/object baselines, as Crimson mentioned, baselines are set at the character's/object's feet, which is the bottom line of the sprite of said character/object.

I think it's worth noting that the baseline is the bottom of the sprite which is not necessarily the feet.  I know I've problems because I assumed that AGS would somehow know about feet.  It knows about sprite bottoms so if you have a few extra pixels things can get confusing.

Pax Animo

#9
Quote from: newwaveburritos on Wed 24/08/2022 01:57:05
Quote from: Pax Animo on Wed 24/08/2022 01:50:00
One thing I'd like to mention is check your sprites, as from my understanding they will effect your character/object baselines, as Crimson mentioned, baselines are set at the character's/object's feet, which is the bottom line of the sprite of said character/object.

I think it's worth noting that the baseline is the bottom of the sprite which is not necessarily the feet.  I know I've problems because I assumed that AGS would somehow know about feet.  It knows about sprite bottoms so if you have a few extra pixels things can get confusing.

That's why i already said it's the bottom line of the sprite.
Misunderstood

Khris

A common issue with staircases is that they'll have overlapping walkable areas, something not supported by AGS due to the 2d color map. And since we don't have much control over the walking itself, workarounds need to be used.
Once simpler way is to keep a flag for each character to keep track of whether the character is walking on the "top" or "bottom" part, then manually set baselines.

The best solution depends on the specific situation.

SMF spam blocked by CleanTalk