python to control player rotation?

Discussions about UT99

python to control player rotation?

Postby museeeii » Tue Feb 07, 2017 12:51 am

Is it possible to use python to send data to change in-game player orientation (pitch, yaw and roll)? If so, is there an example of such thing?
museeeii
Novice
 
Posts: 13
Joined: Tue Feb 07, 2017 12:42 am

Re: python to control player rotation?

Postby Barbie » Tue Feb 07, 2017 4:24 am

Python is just another scripting language; if such would work with Python, it would also work with Perl, VBS or any other scripting language - Python has no special relationship to Unreal.

And manipulating Unreal's objects while it is running is possible by hooking system calls for example, but you need access to the computer where Unreal is running. But better ask a hacker for this. ^^
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
Barbie
Godlike
 
Posts: 1650
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: python to control player rotation?

Postby schwap » Tue Feb 07, 2017 5:14 am

It is possible to do this if you spawn a UDP / TCP receiver class to interpret the rotation calls.
schwap
Novice
 
Posts: 17
Joined: Thu Aug 25, 2016 1:06 am

Re: python to control player rotation?

Postby SilverSound » Tue Feb 07, 2017 7:40 am

Why would you need such a thing in the first place? I'm just curious.
"Woah what?! I wish I was recording that...."
User avatar
SilverSound
Adept
 
Posts: 282
Joined: Fri Nov 06, 2015 10:12 am
Location: St. Cloud, Florida
Personal rank: Curious

Re: python to control player rotation?

Postby papercoffee » Tue Feb 07, 2017 2:40 pm

SilverSound wrote:Why would you need such a thing in the first place? I'm just curious.

This

It sounds highly suspicious.
User avatar
papercoffee
Site Staff
 
Posts: 9128
Joined: Wed Jul 15, 2009 11:36 am
Location: Cologne, the city with the big cathedral.
Personal rank: coffee addicted !!!

Re: python to control player rotation?

Postby JackGriffin » Tue Feb 07, 2017 2:44 pm

I wouldn't jump too hard on OP for asking. There's a ton of things to be done with UEngine and a virtual reality headset (for example). UT's simplicity would allow a pretty easy connection to a VR rig.

I'm curious too Silver but probably for different reasons.
"You damn kids, back in my time we made the items, maps and games ourselves with an unwieldy engine using counter-intuitive crash-prone tools and we liked it so much we built communities around this which nowadays look like cults because they're quasi-parallel societies based on the same old games." -Hellkeeper
User avatar
JackGriffin
Godlike
 
Posts: 3751
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: Hack coder

Re: python to control player rotation?

Postby museeeii » Tue Feb 07, 2017 6:27 pm

I am just trying to send rotation data from my android to control player orientation.

@schwap do you know where do I found more info about UDP / TCP integration?
@Barbie I thought in making python save a file containing the info I need in game, then, in game, I read the file contents every tick. But problems may occur when concurrent operations of write/read take place. Yes, I have control over client machine =D
museeeii
Novice
 
Posts: 13
Joined: Tue Feb 07, 2017 12:42 am

Re: python to control player rotation?

Postby museeeii » Tue Feb 07, 2017 6:33 pm

BTW, I am already passing data through web sockets over local address: 192.168.1.14:8000
Is there a way to Unreal capture the data direct from that address?
museeeii
Novice
 
Posts: 13
Joined: Tue Feb 07, 2017 12:42 am

Re: python to control player rotation?

Postby sektor2111 » Tue Feb 07, 2017 6:37 pm

You can stop multiple posting withing 24 hours and do use EDIT button instead.
User avatar
sektor2111
Godlike
 
Posts: 3927
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: python to control player rotation?

Postby schwap » Tue Feb 07, 2017 9:31 pm

museeeii wrote:@schwap do you know where do I found more info about UDP / TCP integration?





The thing you're trying to do has been done already
(external program to modify rotation) - and theres a neat example on BeyondUnreal by Matthieu29.
It is actually made for UT2003.. but I guess it'll work on UT99 just fine. (might need a few changes, didn't check)

-> https://wiki.beyondunreal.com/Legacy:UDP_Server_Sample <-

For more informations have a look at these classes:




If you get it done, a video where you control the pawns rotation with your smartphone would be neat. :agree1:
schwap
Novice
 
Posts: 17
Joined: Thu Aug 25, 2016 1:06 am

Re: python to control player rotation?

Postby Barbie » Tue Feb 07, 2017 9:53 pm

If the intention is using another device than keyboard and mouse for player control: why not using the existing interface? The VR controller could simply simulate mouse and keyboard events...

museeeii wrote:I thought in making python save a file containing the info I need in game, then, in game, I read the file contents every tick.
Transferring data though a file as interface is limited by mass storage speed and UScript's inability reading data from a file (except a corresponding INI file).
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
Barbie
Godlike
 
Posts: 1650
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: python to control player rotation?

Postby museeeii » Tue Feb 07, 2017 10:17 pm

Thank you very much for your reply guys!
I am very excited because I just have done the script that rotates the player to a specified orientation, and its working! uhuu

If you get it done, a video where you control the pawns rotation with your smartphone would be neat.


Sure I will post a video here to share with you guys. And the source code will be in my GitHub as well the Mutator for download.

@schwap thanks for the links. I will start read it after now. I will try to understand those uc files and try to implement it

If the intention is using another device than keyboard and mouse for player control: why not using the existing interface? The VR controller could simply simulate mouse and keyboard events...

My real intention is to make a VR Cyberith treadmill-like platform for UT99, one you can walk, run, jump, turn, shot and so on.
museeeii
Novice
 
Posts: 13
Joined: Tue Feb 07, 2017 12:42 am

Re: python to control player rotation?

Postby JackGriffin » Tue Feb 07, 2017 11:07 pm

And now I'm REALLY interested....
"You damn kids, back in my time we made the items, maps and games ourselves with an unwieldy engine using counter-intuitive crash-prone tools and we liked it so much we built communities around this which nowadays look like cults because they're quasi-parallel societies based on the same old games." -Hellkeeper
User avatar
JackGriffin
Godlike
 
Posts: 3751
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: Hack coder

Re: python to control player rotation?

Postby SilverSound » Wed Feb 08, 2017 2:34 am

JackGriffin wrote:And now I'm REALLY interested....


That's amazing to think about isn't it? Just think about what it would look like to do BT with that sort of set up.
"Woah what?! I wish I was recording that...."
User avatar
SilverSound
Adept
 
Posts: 282
Joined: Fri Nov 06, 2015 10:12 am
Location: St. Cloud, Florida
Personal rank: Curious

Re: python to control player rotation?

Postby museeeii » Wed Feb 08, 2017 4:37 am

I finally did it folks!
Much thanks for @schwap to point me to a great UDP resource

Yes, the player is now controlled by my Android phone (only orientation so far) and the result was a great ... CRAP...
oh man, it is so frustrating :cry:

Just to get you know, I got two problems now:
The player rotation gets really laggy since the data is transfered through UDP socket. But I dont really know if it's because UDP. But the result of rotation in game happens only after a second or two;

The second problem is the camera being shaking, even if the phone is completely in rest over the table. Looks like the player got Parkinson's :loool:
I am using the magnetometer (Compass) to capture Android orientation and it is always oscilating from a range up to 10 degrees. I know I can try to smooth these oscilations but...
museeeii
Novice
 
Posts: 13
Joined: Tue Feb 07, 2017 12:42 am

Next

Return to General Discussions

Who is online

Users browsing this forum: No registered users and 4 guests