Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Improved actor's movements  (Read 7283 times)

0 Members and 1 Guest are viewing this topic.

vadbag

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 65
    • View Profile
Improved actor's movements
« on: February 05, 2007, 03:37:23 PM »

When actor is made to go left or right and the position of the mouse click is slightly above or below actor's hot spot, he goes to the new point in a straight line. This looks unrealistic, since the actor's legs walk strickly right or left (as animated), but the actor also "floats" upwards/downwards.

My suggestion is to make the actor follow a so-called "L" shaped line in this case, so that if the position of Mouse click was slightly above/below the hotspot, actor firstly goes upwards/downwards (or in diagonal) until he's at the same horizontal level with the mouseclick point, and then goes right/left.

I've seen this approach in a game, made with "Point&Click Development Kit" Engine. This game, as an example, can be downloaded here:

http://www.how2make.ru/h2mgame.rar (8mb)

This approach, in my opinion, produces much more realistic results.  :)
Logged
WME rocks!!!

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Improved actor's movements
« Reply #1 on: February 05, 2007, 04:54:08 PM »

The problem is (due to the way pathfinding works in WME) that while straight line guarantees the path is clear, the L-shaped path doesn't. So it could easily happen that the L-path goes through a blocked area.
On my ToDo list there's other task: to allow the developer to define exactly which animation to use for each walking angle. That should, to some extent, solve this problem too.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

vadbag

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 65
    • View Profile
Re: Improved actor's movements
« Reply #2 on: February 05, 2007, 06:42:00 PM »

to allow the developer to define exactly which animation to use for each walking angle.
I don't quite understand what you meant...  :-\ Do you mean, there will be 360 directions instead of current 8? ??? If so, then there'll be huge number of sprites needed... Or is it something else?
Logged
WME rocks!!!

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: Improved actor's movements
« Reply #3 on: February 05, 2007, 07:13:00 PM »

He means that you will be able to define how many directions you want depending on the angle.  ;) But I bet no one would be crazy enough to choose more than 8-16 directions. We have real time 3D characters for that.

In other words you could instruct the engine to use sprite A for angles 0-10, sprite B for angles 11-16 etc.
« Last Edit: February 05, 2007, 07:17:30 PM by odnorf »
Logged
fl*p

vadbag

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 65
    • View Profile
Re: Improved actor's movements
« Reply #4 on: February 05, 2007, 07:30:22 PM »

To: Odnorf
Thanks! I see what you mean.

IMHO, this approach will make 2d artists' job more complicated, and the result won't be ideal...

To:Mnemonic

Can't the waypoints be used to make sure the actor avoids blocked areas (with L-path)?
Logged
WME rocks!!!

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Improved actor's movements
« Reply #5 on: February 08, 2007, 10:49:30 AM »

Can't the waypoints be used to make sure the actor avoids blocked areas (with L-path)?
Well that's the problem. The waypoint system is designed to allow the actors to walk in *any* direction..
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

vadbag

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 65
    • View Profile
Re: Improved actor's movements
« Reply #6 on: February 09, 2007, 06:54:21 PM »

Sorry, but a last try...  :)

What if the L-path is created via two straight paths? In other words, when the player Left clicks, the game checks, whether Scene.MouseY equals to Actor's Y position. If it does, then actor.GoTo(Scene.MouseX, Scene.MouseY); if it doesn't than actor first goes to Scene.MouseY and from there goes to Scene.MouseX  ;D I think, this might be done within scene.script

What do you think?
Logged
WME rocks!!!

TheDerman

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 225
    • View Profile
Re: Improved actor's movements
« Reply #7 on: February 09, 2007, 07:42:49 PM »

I think this problem will improve greatly if we could simply have more directions of movement like 12 or 16. Is that hard to implement in the engine?

Being able to chose the sprites we use for certain angles will help, but I also think that with 16 directions, that might not even be necessary.

The problem as I see is that there are only those 8 angles, and so the engine has to choose the best one to fit where the character is walking to, and sometimes it just looks out of place if the engine chooses the LL angle and yet still goes off on a diagonal. If there was a direction between LL and UL, it could pick that instead which would look more natural.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Improved actor's movements
« Reply #8 on: February 11, 2007, 12:46:11 PM »

vadbag: It will work fine and should be easy to script, but only in case you'd use rectangular blocked areas only. I remember actually posting some simple script implementing the l-shaped movement, but I can't seem to find the thread right now...

TheDerman: Yup, it's on my todo list.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.017 seconds with 20 queries.