SDK?

Discussion in 'General Discussion' started by Bolk, Oct 5, 2010.

  1. Bolk

    Bolk Registered

    Joined:
    Oct 4, 2010
    Messages:
    11
    Likes Received:
    0
    Will there be an SDK available at the launch of rF2? Or even better; prior to launch?

    If so, is there any chance that we can compile a list with values we'd like to see? :rolleyes:
     
  2. Jeremy Miller

    Jeremy Miller Former ISI Senior Programmer

    Joined:
    Oct 5, 2010
    Messages:
    276
    Likes Received:
    3
    Just to clear things up: Are your referring to what we call the internals plugin sdk?
     
  3. Rantam

    Rantam Registered

    Joined:
    Oct 5, 2010
    Messages:
    93
    Likes Received:
    6
    I assume we're not going to get the tools provided to those who get a license to use rF as base for a new standalone game (despite that would do things more easy to modders). But what about the previously called "ISI tools"?

    Will the .gmt exporter be available for other programs like blender, Maya, etc or just for 3DS Max?

    What about the documentation?

    Thanks for the answers :)
     
  4. Bolk

    Bolk Registered

    Joined:
    Oct 4, 2010
    Messages:
    11
    Likes Received:
    0
    Yes, that's what I meant!
     
  5. Philip Oakley

    Philip Oakley Registered

    Joined:
    Oct 5, 2010
    Messages:
    6
    Likes Received:
    0
    An SDK (much like Source SDK) would be great. gMotor SDK :)

    I am also thinking of making a *.GMT plugin for Blender :) Watch this space!
     
  6. Jeremy Miller

    Jeremy Miller Former ISI Senior Programmer

    Joined:
    Oct 5, 2010
    Messages:
    276
    Likes Received:
    3
    @Bolk There are some additions to the internals plugin API however, the overall design is currently the same as for rF1 with the exception of compatibility with the new rF2 code base. I cannot, off the top of head think of anything that has been removed.

    I just recently (yesterday) converted a rF1 plugin to rF2. Granted I have certain added benefits being and ISI programmer. The process took less than 30 minutes and I think I walked to the soda shop half way though. A programmer should be able to do the same given he used polymorphism correctly

    You are welcome to compile a list. However, lets remember we have to careful were we hook into the code so I cannot promise they will be implemented. I also have to reconcile your list with others that I have.

    @Rantam
    At this time, just 3D Max. I have recently heard artist's around here mention documentation. I am not 100% but it may be ready for release.

    @Philip Oakley
    That would be awesome. I have been trying to find time for years to do a plugin for Blender. I have been dabbling in Python for quite awhile and I wanted to publish something but just cannot find the time.
     
  7. Bolk

    Bolk Registered

    Joined:
    Oct 4, 2010
    Messages:
    11
    Likes Received:
    0
    Thanks for your prompt reply Jeremy. I was working on a livetiming plugin and had to get some information which was not available in the internals plugin struct. So I took that info from the server by quering an UDP port. I'll compile a list and get back to you. Thanks!
     
  8. Luka K.

    Luka K. Registered

    Joined:
    Oct 5, 2010
    Messages:
    10
    Likes Received:
    0
    It would be awesome. It would help a lot of us that target rF2 :D
     
  9. Rantam

    Rantam Registered

    Joined:
    Oct 5, 2010
    Messages:
    93
    Likes Received:
    6
    That would be great, being Blender a free open source application!! :)

    @Jeremy Miller, thanks indeed for the answer!

    Best regards
     
  10. Warlock

    Warlock Registered

    Joined:
    Oct 5, 2010
    Messages:
    28
    Likes Received:
    2
    What about ability to draw onscreen without any 3rd party proxy DLL?
    I.e. some call of plugin API function before your call d3d->Present() to draw some additional/customer info like TVStyle do.
     
  11. Jeffrey Rietveld

    Jeffrey Rietveld Registered

    Joined:
    Oct 5, 2010
    Messages:
    34
    Likes Received:
    1
    This would be good indeed.
     
  12. fazerbox

    fazerbox Registered

    Joined:
    Oct 6, 2010
    Messages:
    187
    Likes Received:
    8
  13. Bolk

    Bolk Registered

    Joined:
    Oct 4, 2010
    Messages:
    11
    Likes Received:
    0
    My list:

    In the structs ScoringInfoBase or ScoringInfoV2 or an extention to that, I'd like to see the following variables:

    • Number of clients connected
    • Server name
    • Gameversion
    • Server MOTD
    • Series
    • Current players
    • Max players
    • Numaiplayers
    • Damage multiplayer
    • Datarate

    Basically all the stuff you get when quering the UDP data port.
     
  14. fazerbox

    fazerbox Registered

    Joined:
    Oct 6, 2010
    Messages:
    187
    Likes Received:
    8
    Is there a way to query rFactor Dedicated Server via UDP? Which Port?
    Where Can I find command format list?
    Or Every time I connect to rFactor Server automatically send me all infos?


    Regards,
    Max.
     
  15. Bolk

    Bolk Registered

    Joined:
    Oct 4, 2010
    Messages:
    11
    Likes Received:
    0
    Which language do you want? I can offer PHP and C# ;)
     
  16. Frank Geyer

    Frank Geyer Registered

    Joined:
    Oct 5, 2010
    Messages:
    222
    Likes Received:
    3
    PHP would be nice Bolk ... Thank You!

    EDIT: You are talking about querying the default UDP Query Port via PHP WITHOUT any additional plug-in - right !?!?
     
  17. fazerbox

    fazerbox Registered

    Joined:
    Oct 6, 2010
    Messages:
    187
    Likes Received:
    8
    C# is ok :D

    my email: fazerbox@gmail.com

    Thanks.
     
  18. Alex Sawczuk

    Alex Sawczuk Administrator Staff Member

    Joined:
    Oct 4, 2010
    Messages:
    851
    Likes Received:
    971
    imo there really should be a standard web interface or official plugin for the dedicated server that all these external apps use.

    There are plenty of live view plugins etc for rfactor 1 and each uses its own plugin, which isn't very practical. A standard one should be used and then people can write their own user interface on the other side.
     
  19. Bolk

    Bolk Registered

    Joined:
    Oct 4, 2010
    Messages:
    11
    Likes Received:
    0
    Yep, just by quering the UDP gamedata port. I'll get back to you later tonight..
     
  20. Bolk

    Bolk Registered

    Joined:
    Oct 4, 2010
    Messages:
    11
    Likes Received:
    0
    Wow I got a couple of requests for the UDP code.

    First of all, a big thank you to René from wiesental-racing.de. He helped me out a lot. I managed to port his PHP code to C#. So here it is in C#:

    Code:
            private void button2_Click(object sender, EventArgs e)
            {
                // This constructor arbitrarily assigns the local port number.
                UdpClient udpClient = new UdpClient(34297);
    
                udpClient.Connect("85.17.181.194", 34297);
    
                // Sends a message to the host to which you have connected.
                Byte[] sendBytes = Encoding.ASCII.GetBytes("rF_S\0");
    
                udpClient.Send(sendBytes, sendBytes.Length);
    
                //IPEndPoint object will allow us to read datagrams sent from any source.
                IPEndPoint RemoteIpEndPoint = new IPEndPoint(IPAddress.Any, 0);
    
                // Blocks until a message returns on this socket from a remote host.
                //Byte[] receiveBytes = new Byte[];
                Byte[] receiveBytes = udpClient.Receive(ref RemoteIpEndPoint);
                string returnData = Encoding.ASCII.GetString(receiveBytes);
    
                textBox2.AppendText("Gameversion: " + _ShortFromBuffer(receiveBytes, 0x11).ToString());
    	textBox2.AppendText(Environment.NewLine + "Servername: "+ _StringFromBuffer(receiveBytes, 0x2D).ToString());
                textBox2.AppendText(Environment.NewLine + "Servermodt: " + _StringFromBuffer(receiveBytes, 0x69).ToString());
                textBox2.AppendText(Environment.NewLine + "Series: " + _StringFromBuffer(receiveBytes, 0x19).ToString());
                textBox2.AppendText(Environment.NewLine + "Track: " + _StringFromBuffer(receiveBytes, 0x49).ToString());
                textBox2.AppendText(Environment.NewLine + "Session: " + (_ByteFromBuffer(receiveBytes, 0xD2) >> 5).ToString());
                textBox2.AppendText(Environment.NewLine + "Session_time: " + _ShortFromBuffer(receiveBytes, 0xD9).ToString());
                textBox2.AppendText(Environment.NewLine + "Session_laps: " + (_ShortFromBuffer(receiveBytes, 0xDB) / 16).ToString());
                textBox2.AppendText(Environment.NewLine + "Curplayers: " + _ByteFromBuffer(receiveBytes, 0xCF).ToString());
                textBox2.AppendText(Environment.NewLine + "Maxplayers: " + _ByteFromBuffer(receiveBytes, 0xD0).ToString());
                textBox2.AppendText(Environment.NewLine + "Numaiplayers: " + _ByteFromBuffer(receiveBytes, 0xD1).ToString());
                textBox2.AppendText(Environment.NewLine + "Damagemult: " + _ByteFromBuffer(receiveBytes, 0xD3).ToString());
                textBox2.AppendText(Environment.NewLine + "Datarate: " + _ByteFromBuffer(receiveBytes, 0xCE).ToString());
    
                udpClient.Close();
            }
    
            private int _ByteFromBuffer(byte[] buffer, byte idx)
            {
                int byteval;
                byteval = buffer[idx];
                return byteval;
            }
    
            private int _ShortFromBuffer(byte[] buffer, byte idx)
            {
                int shortval;
    
                shortval = buffer[idx] | (buffer[idx+1] << 8);
    
                return shortval;
            }
    
            private int _LongFromBuffer(byte[] buffer, byte idx)
            {
                int longval;
                
                longval =  buffer[idx] | (buffer[idx+1] << 8) | (buffer[idx+2] << 16) | (buffer[idx+3] << 24);
                
                return longval;
            }
    
            private string _StringFromBuffer(byte[] buffer, byte idx)
            {
                string Return = "";
    
                while(buffer[idx] != '\x00')
                {
                    Return = Return + char.ConvertFromUtf32(buffer[idx++]);
                    
                }
    
                return Return;
            }
    
    Be advised.. I suspect you guys know the language so I am not going to bother with textboxes etc. You can change those yourself ;) This is just a c/p from one of my test apps.

    I cannot tell you anything about performance. I just fetch the data every 5 seconds or so and distribute it via my own apps (instead of quering the UDP port on every view). I store some data in memcached to display it on our frontpage: http://beneluxracingonline.com/news (left)

    But, that requires PHP. My version is a copy based on this version: http://www.wiesental-racing.de/viewtopic.php?f=20&t=138&sid=e021aa344b1b4c9a90b373b9c0ef4271

    Download the file p166_rfquery_plugin_v2.1.rar. In the rfquery folder there are two self explaining files: rFQuery.php and rfpluginquery.php

    But guys, as much as I want to help you.. We are getting offtopic ;) I'd like to keep this thread tidy so the devs can pickup some SDK requests from us :) So if you have any further questions, please send me a PM.
     

Share This Page