Walking behind hills

Started by stuh505, Thu 27/05/2004 23:31:24

Previous topic - Next topic

stuh505

As it stands I see no way to have a walkable area that accurately represents walking over a hill parallel to the viewing direction.

You can have an abrupt change in scaling, as they go from being on the front side to the far side, but still when they walk to the top of the hill then its a continuous walkable area and all of a sudden they are way far away.

So I have 2 ideas for simple ways to change this.

1) Allow walkable areas to overlap each other, and give them a layering order.  By default it is assumed they are on the top layer.  Make a new tool, the "seam" tool which allows you to join walkable areas.  When the character walks over a seam, the area they are on will switch to the area it was seemed to.  This would allow for characters (in 2d) to appear to be realistically traversing mountanous or other odd terrain.

Here is a screenshot to demonstrate what I mean:



does this make sense?  I think it does...

the second Idea I don't have time to explain because i have to go on a date but ill explain later

TerranRich

This is complicated, BUT the only way I've seen so far to actually implement behind-hill walkable areas. This might just work. I can already picture the hundreds of newbie questions regarding this feature, even though it will be well documented. :P
Status: Trying to come up with some ideas...

strazer

#2
Could a workaround like described in this thread be used for this?

Edit: Hm, I misunderstood obviously. I thought the problem was the walkbehinds.

Gilbert

The problem was that if the areas can overlap themselves large change would be made to the engine, which is not a trivial job, and it doesn't seem to be that useful.

I suggest you may try script over the problem, using functions like the one strazer mentioned.

Sometimes it's good (and maybe essential) to add some new features to the engine but what I recommend is that, as there's actually no end to adding new stuffs, people should learn more about the engine first - what it can and cannot do, and they try to work with the limits. Having limits in an engine doesn't mean it would restrict or prohibit creativity or its usefulness, sometimes you just need to change your ideas a bit and the engine can handle it perfectly already, and try to ask for new features only if it's REALLY needed and there's no easy way to do it at the moment.

Rui 'Trovatore' Pires

I'm probably misunderstanding something, but what about using continuos scaling? Won't that solve it?
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Mr Jake

yes, but he wants his character to disappear behind the hills as he walks over them, but he cant place a walkable area there because its in 2d.

stuh505

hey, its just an idea.

but, there are 2 hurtles redrum:

1 - making the character appear before the hill, and then behind the hill, without crossing a baseline...

2 - making the character be forced to walk backwards or stand still in order to go forwards

continuous scaling would also need to be in effect...but it is not a hurtle because it already exists.

I neglected to mention in my previous example that you would also need to define and link a walk-behind area to the orange/purple walkable areas.

Strazer: I read the thread and downloaded your file but I don't know how to open this type of file (AGT?) and the original posters files are no logner available

strazer

#7
Just put the .agt file in your AGS program directory. Then, a new template is available when you start a new game.

I still don't know if it is what you're looking for, but here's a demo of the first hill I've made.
Took me some time to get the walkable areas just right and place the regions correctly so the pathfinder works as expected.

Quoteoriginal posters files are no logner available

I can still access Scorpiorus's files in that thread. Strange.

Edit: Updated URL

LostTrav

I like the idea, but when the walk behind the hill only parts of the body can show

Walkaround

Objects and regions. The objects are crops of the hill. When a player steps on a region next to a sliver of hill the sliver is turned on so that the chars head etc... is hiden. Then a last sliver when he is completely behind to scale. You can use global ints to determine which way he is going as to activate certain slivers

stuh505

Here is an attempt I made to script the going-down half of the problem (not going to do the going-back up part until I like the going down part).  It really looks bad, because when going down the hill, the character has to be sliding irregularly...I can't use the walk command because it would make the character face forward (since he is walking down on the screen) the only way I can think of to get around this would be to make a new VIEW showing with a copy of the characters "walk down" loop, and switch to that view when walking down, and then switch back...but that is pretty funky....how did you do it Strazer?

Quotefunction WalkDownHill(int hill_object, int hill_top_x, int hill_top_y, int hill_bottom_x, int hill_bottom_y, int hill_end_x, int hill_end_y){
  //PRE: hill_object is OFF, function called when walk over region at top of hill, hill_object is duplicate image of top of hill
  if (ObjectOff(hill_object)){ //to eliminate infinite loop when walk over region again
    //go to top of hill first
    MoveCharacterBlocking(GetPlayerCharacter(),hill_top_x,hill_top_y,1);
    ObjectOn(hill_object);
   
    //show back
    FaceLocation(GetPlayerCharacter(),character[GetPlayerCharacter()].x,character[GetPlayerCharacter()].y-50);
   
    //"walk" behind hill
    while(character[GetPlayerCharacter()].y != hill_bottom_y){
        character[GetPlayerCharacter()].y++;
        Wait(1);
    }
 
    //walk out of hill range
    MoveCharacterBlocking(GetPlayerCharacter(),hill_end_x,hill_end_y,1);
    ObjectOff(hill_object);
  }
}

strazer

#10
Quoteit would make the character face forward (since he is walking down on the screen)

Heh, good point. I didn't even notice that.
Your view idea sounds good to me.

EDIT:

I've updated the demo with this idea. Requires AGS v2.62.

Ali

#11
I've come up with a simple means of making a character walk over hills which I haven't read about in threads like this.

It doesn't requre objects or anything like that. You just enable and disable walk-behinds and change the ego's main view to one where up and down are inverted. Here's a zipped template:

http://www.2dadventure.com/ags/Walk_Behind_Hil.zip

It's a bit awkward at the moment because of the shape of my walkable areas but with tweaking it could work well. It also has the advantage that you don't need to have a cutsequence to go over the crest of the hill.

I'm sorry if this has been brought up before, let me know what you think.

-Al.

EDIT: I didn't realise Strazer's solution used the view-inverting idea. Never mind!

TheMagician

Hi Ali,

just tested your template. Works fine for me!
I just don't get the part
Quotechange the ego's main view to one where up and down are inverted
Why would you need that?

Btw: that's a really lovely character you got there.  :D

Ali

If you get rid of the 'set character view' numbers for all the walkable areas you'll see that Nelly would walk down the hill backwards.

The inverted-view-swapping makes it possible for a character to walk down the screen playing their up loop so it looks like they're walking away from the camera down the slope.

Btw: Thanks!

SMF spam blocked by CleanTalk