News: Go to the wiki and do the Flying Ship tutorial May 22, 2012, 02:21:53 pm
Welcome, Guest. Please login or register. *

Player Movement demo
Pages: 1
  Send this topic  |  Print  

  Player Movement demo
Author Message
0 Members and 1 Guest are viewing this topic.
2playgames
OpenWar Project Founder
Administrator
Sr. Member
***
Offline Offline

Posts: 857


Busy busy busy busy busy


View Profile WWW
« on: May 03, 2008, 09:22:05 pm »

http://openwarrts.svn.sourceforge.net/viewvc/openwarrts/experiments/movement/src/
(check out and build with victory engine in build path)

This is a demo of the movement proposed by Darvin. Players point the mouse and the character looks that way. Moving is done with the arrow keys. These correspond to the natural direction from the player (not character) point of view.

Example: when looking right, the up key will strafe the character left (from the character pov) which is up from the player pov
Example: when looking down, the up key will move the character away from the cursor which is up from the player pov

Also, the character takes time to rotate, it isn't instantaneous. There is also acceleration and braking in the walking.

Bug: when going from a direction around +180 degrees to -180 degrees, the player rotates the wrong (long) way.
Logged




2playgames
OpenWar Project Founder
Administrator
Sr. Member
***
Offline Offline

Posts: 857


Busy busy busy busy busy


View Profile WWW
« Reply #1 on: May 03, 2008, 10:38:15 pm »

I've added some different modes, which you can choose by pressing a number:
1: The advanced mode detailed above
2: The "FPS" input (up = move to cursor), but without the adjustments
3: The simplest, where up is up, left is left, etc.

All are possible, we can make this an option in the game.
Logged




Darvin
OpenWar Staff
Staff
Sr. Member
**
Offline Offline

Posts: 506


The Concept and Design King


View Profile
« Reply #2 on: May 04, 2008, 02:26:20 am »

I just tried it out.  Aside from the bug as mentioned, it's look good.  Out of all the movement modes, only movement mode 1 (I found out after a while that pressing 2 on the keyboard gave me movement type 1) really strikes me as being intuitive, so I have to stick with it as the best option. 

One question I do have is what control we have over turn speed.  I tried tinkering around a little bit with the code, but I couldn't modify the turn rate.  Secondly, occasionally my character would develop a "wobble" while moving.  While this didn't interfere with my intended direction of motion, it did look a bit weird.
Logged
2playgames
OpenWar Project Founder
Administrator
Sr. Member
***
Offline Offline

Posts: 857


Busy busy busy busy busy


View Profile WWW
« Reply #3 on: May 04, 2008, 01:25:59 pm »

The wobble is on purpose. It's just a little sin() added to the rotation and it's supposed to make the character look like it's walking. Of course something that stupid won't be in the game.

The turning is done by
Code:
setRotation((getRotation() * 4 + targetDir) / 5);
i think you can lower the turn rate by increasing both numbers. however, this was only the quickest, simplest smooth turning i could think of, something more advanced can of course replace it

By mode 1, i assume you mean the mode where the actual integer value is 1, so it's
Quote
2: The "FPS" input (up = move to cursor), but without the adjustments
anyway, i personally feel most at ease with 3 or 1, so i guess here we have a good reason to make it a setting in the game Smiley
Logged




Darvin
OpenWar Staff
Staff
Sr. Member
**
Offline Offline

Posts: 506


The Concept and Design King


View Profile
« Reply #4 on: May 04, 2008, 07:21:54 pm »

So long as it's intentional, the wobble isn't a big deal.  We're hardly at a stage at which we're looking at polishing the game, so trying new things tops our priority.  We can always modify or remove this if we come up with a better way to give an impression of walking (we'll probably do something with the sprite itself).

Quote
anyway, i personally feel most at ease with 3 or 1, so i guess here we have a good reason to make it a setting in the game
Goes without saying that it should be a setting.  However, we might get into a bit of a disagreement over what the default should be :-P
Logged

Pages: 1
  Send this topic  |  Print  
 

Jump to: