Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Angle changes by executing certain commands #182

Closed
XinkeAE opened this issue Mar 29, 2017 · 9 comments
Closed

Angle changes by executing certain commands #182

XinkeAE opened this issue Mar 29, 2017 · 9 comments
Assignees
Labels
Milestone

Comments

@XinkeAE
Copy link

XinkeAE commented Mar 29, 2017

Hi,

I'm wondering how many degrees does the agent rotate by executing commands:
"TURN_LEFT", "TURN_RIGHT", "LOOP_UP", and "LOOP_DOWN"?

Thanks!

@mwydmuch
Copy link
Member

mwydmuch commented Mar 29, 2017

It's interesting question. We haven't checked this before. When it comes to up and down axis, speed is ~2.5 degrees per tic. Turning speed is ~1.75 degrees in first few tics and accelerates to ~3.5.

In addition, values change when SPEED button is active, look up and down accelerates to ~2.8 degrees and turning speed to ~7 degrees.

This is the original Doom mechanics, we haven't changed anything in it.

TURN_LEFT_RIGHT_DELTA and LOOK_UP_DOWN_DELTA buttons allows to use custom values, however, our api limits them to integer values - we should probably change that.

@XinkeAE
Copy link
Author

XinkeAE commented Mar 29, 2017

Thanks @mwydmuch for the explanation. It was helpful!

@XinkeAE XinkeAE closed this as completed Apr 2, 2017
@XinkeAE
Copy link
Author

XinkeAE commented Apr 5, 2017

Hi @mwydmuch ,

I have another question related to this. Obviously there is an upper bound and lower bound the the pitch angle (LOOK_UP and LOOK_DOWN). Could you please also let me know the exact value of it?

Thank you so much!

@mwydmuch
Copy link
Member

mwydmuch commented Apr 6, 2017

Lower bound is exactly -56, upper is 32 degrees. Don't ask why :)

@XinkeAE
Copy link
Author

XinkeAE commented Apr 6, 2017

Hi @mwydmuch ,

Thanks for the reply. I was doing some experiments based on the parameters you suggested and compute the heading of the agent accordingly, but i couldn't get the right heading. Here are some issues I'm still confused about:

  1. Every time we execute the command like "look up", how many tics does it corresponds to?

  2. In the customize key-binding, is there a way to bind "TURN_LEFT_RIGHT_DELTA" and "TURN_LEFT_RIGHT_DELTA" to a certain key?

I really appreciated your tips!

@mwydmuch
Copy link
Member

mwydmuch commented Apr 6, 2017

  1. You have a full control over the number of tics that agent performs in one action (second parameter of game.make_action -> https://github.com/mwydmuch/ViZDoom/blob/master/doc/DoomGame.md#makeAction). Active buttons are "pressed" during the entire duration of action. So if the action will last 4 ticks, "LOOK_UP" will change pitch by 4 * 2.5 degrees. Same in case of "DELTA" buttons, however, doing a quick test now I've discovered that they may be bugged.
    Please give me 2 days, I will investigate and add support for floating points variables.

  2. "DELTA" buttons corresponds to mouse movement, there is no way to bind it to a certain key right now.

EDIT: No one used "DELTA" buttons in the last year competition.

@mwydmuch mwydmuch reopened this Apr 6, 2017
@mwydmuch mwydmuch self-assigned this Apr 6, 2017
@mwydmuch mwydmuch added this to the 1.1.2 milestone Apr 6, 2017
@mwydmuch
Copy link
Member

I forgot to close this one, I've added support for floating point values and now everything works as described above.

@XinkeAE
Copy link
Author

XinkeAE commented Jun 11, 2017

Hi @mwydmuch , sorry for bothering you again,

Regarding the MOVE_FORWARD AND MOVE_RIGHT buttons, I'm wondering how many units are these buttons corresponding to. Say if I use the MOVE_FORWARD for n tics, how much does the agent move forward?

Thanks.

@mwydmuch
Copy link
Member

mwydmuch commented Jun 11, 2017

I don't know the exact mechanic of movement in the engine, but it implements some simple acceleration and momentum, so it's a little bit complicated.

It looks like that default max walking speed is ~8 in-game unit. With SPEED button pressed max speed and acceleration is doubled.

From ZDoom wiki:
"Side movement running speed is actually 4/5ths forward running speed, and the side walk speed is 24/25ths forward walk."

I think it's possible to combine forward and side movement to achieve greater speed, like in Quake.

You can measure speed with help of POSITION_X, POSITION_Y, POSITION_Z game variables.

In-game unit to real life unit translation: https://doomwiki.org/wiki/Map_unit

akolishchak pushed a commit to akolishchak/ViZDoom that referenced this issue May 27, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants