The online racing simulator
Downloading Skins
(20 posts, started )
Downloading Skins
I've not seen anywhere in insim a way of extracting skin name info, and i'm unsure if the details of how to download a skin from LFS World are public anywhere.

I'm writing a server application and obviously the dedi-host does not download skins, and for my project it would be extremely beneficial if it could (and discard after a fortnight - but that bit I can do) - actually, I wouldn't mind if they where only 64x64 or 128x128, but in any case, i'd like to get the skins so I can render off a little car image of who's online.

Can anyone give me some pointers on this please?
No
Quote from Becky Rose :I've not seen anywhere in insim a way of extracting skin name info, and i'm unsure if the details of how to download a skin from LFS World are public anywhere.

I'm writing a server application and obviously the dedi-host does not download skins, and for my project it would be extremely beneficial if it could (and discard after a fortnight - but that bit I can do) - actually, I wouldn't mind if they where only 64x64 or 128x128, but in any case, i'd like to get the skins so I can render off a little car image of who's online.

Can anyone give me some pointers on this please?

I have a feeling LFS most likely just uses HTTP to get the files (http://www.lfsworld.net/showskin.php?name=___), use wireshark (formerly known as ethereal) to validate this assumption. However, since as you said there's no way of knowing the name of the file to get externally to LFS you wouldn't know what to request...

Also, there doesn't appear to get a resizing option in the querystring parameters that showskin.php accepts.
A kludgy solution would be to delete/move your skins_x directory contents, disable skin download and then watch for the "could not find skin" message. Now I'm assuming thats still a normal "message", rather than the downloading notification we now get (I've not seen it for a while).

Kludgy, but it would kinda work.
Unfortunately showkin only lets you view skins if you are logged in as the person who uploaded it :/
Quote : Kludgy, but it would kinda work.

Unfortunately this is for use with the dedi-server (hense the need for it) so I dont think it would work at all.
#7 - CSU1
Does that mean that on LFSW there is a duplication probably thousands of times of the exact same skin wasting space because they are "named" different!
Quote from Becky Rose :Unfortunately this is for use with the dedi-server (hense the need for it) so I dont think it would work at all.

Surely you can just load the MPR into a normal client to do the "magic"? Or am I missing the whole point?
Quote from Becky Rose :Unfortunately showkin only lets you view skins if you are logged in as the person who uploaded it :/

Ah, well then it's time for you to sniff the traffic between LFS and LFSW.
Fun times ahead.
Yup 'fraid so Angel, although in fairness that's because i've not divulged what i'm trying to do. It sounds more grandious than it is, but basically I want to write a live timing system that shows a web cam of the race.

The application sits on the server and outputs data to be used by the timing pages, including an image generated by rendering a cmx files. I would very much LIKE to use players own skins, and basically show something not too dissimilar to what you get in LFS (although much smaller and jpg'd). I wont go as far as the small touches like skid marks and particle systems, although I MAY do basic reflection mapping, but anyway the point is it runs entirely on the server and is live, so replays aren't even generated.
Since that machine would be rendering stuff and such, wouldn't it be easier to have a non-dedi lfs server and then an application that places the camera somewhere and takes a screenshot? This would only work if it is a windows server, since I dont think you can run LFS under any other operating system?
It's not easier, running 3 installs of LFS on 1 machine isn't possible. Running a program that renders 3D scenes every few seconds in the background is, however, and that part I am working on now. However cars will have to have pre-defined skins probably based on starting position or perhaps by using the drivers name colours.

EDIT: Oh, no i'm not taking a screenshot. I'm loading the 3D files of the track & cars and positioning them. I'm just working on the CMX format now.

EDIT2: CMX format 1 Becky Rose 0 ... Lightschemes.int in the header doesn't make sense to me...
Quote from Becky Rose :EDIT2: CMX format 1 Becky Rose 0 ... Lightschemes.int in the header doesn't make sense to me...

The lightschemes in the header defines the number of LIGHTSCHEME blocks that come after the main header.

Or am I missing the question again?
Hmmm the car rendering stuff from online... I remember people trying that... and especially for applying a skin... very hard.

I know Victor was trying to do this once, but it didn't turn out so well. I'd imagine you'd have to get some kind of 3D rendering plugin that would grab the skin and apply it on a simplified model, and present it in either flash or output it as an image that can be handled with PHP. I used to know of one such plugin that did just this, but it never applied any kind of texture/skin to the model

Is this what you're trying to do? Would be interesting to see how it turns out.

EDIT: What you COULD do Becky is grab only the side shot of a skin file at the given coordinates, and then have it outputted onto a flat 2D side image of the corresponding car. It may very well be 2D, but it is a whole lot easier this way (especially for presenting on a webpage). Maybe 2D wouldn't help if you are trying to show a grid? Thinking it like how Batracer does it (if you've ever used it). You have a hard-edged template and it exports the skin in only the designated area... and cuts off the rest (see attachments). The yellow is the paint area.

EDIT, the last picture I attached is the final outputted version with shading and highlights applied automatically:
Attached images
BTCCTourMG.gif
Castrol_MG2.GIF
-bV.gif
Quote :The lightschemes in the header defines the number of LIGHTSCHEME blocks that come after the main header.

Or am I missing the question again?

Well it wasn't really a question, more a matter that at the moment i'm reading an int and it doesn't make sense, i'm expecting no more than about half a dozen lightschemes and I get quarter of a million. Reading each byte gives me (and I forget now because I am coding the cmx part at work and the insim part at home, and i'm currently at home) 53,78,83,80 or something along those lines - which no matter what I do with it doesn't give me a sensible number and I dont yet understand why. I've checked, checked and double checked the offset, I must have done a silly somewhere that i'm just not seeing.

Quote :I know Victor was trying to do this once, but it didn't turn out so well. I'd imagine you'd have to get some kind of 3D rendering plugin that would grab the skin and apply it on a simplified model, and present it in either flash or output it as an image that can be handled with PHP. I used to know of one such plugin that did just this, but it never applied any kind of texture/skin to the model

Errr, i'll leave the web stuff to web people, I eat 3D for breakfast and I have a 3D engine, i'll export a rendered image to jpg and let the webcam type web page thingamy do the rest. I just can't apply the right skin to each car on the server once I get the models in.

I either need to be able to read off the drivers skin from insim and request it from LFS World, or to download a skin from the drivers account for the chosen car class (which will at least be right most of the time), or i'll have to use "green" for pole, "orange" for 2nd and so on :/.
Well, it seems like to get a skin off of LFSW all you'd have to do is make a GET request to skins.liveforspeed.net and make sure you set the user agent to "LFS" - the path has to go be "/CAR_CODE/512/FILENAME". Since it's Apache the request paths are case sensitive.

The tricky part is getting the name of the skin to d/l. It's sent by the host in the TCP connection it maintains with clients. Atleast initially when the "new user" bit gets in you immediately get packets that say what car the user is in and the skin name.

Other than sniffing this off of the wire I can't think of any other way currently to get the skin name (unless I'm missing something), and ofcourse if you're not the machine's administrator then good luck on getting the interface to go promiscuous.
Administrator access to the box could be arranged but it is outside of my area of expertise and I wouldn't really know how to make use of it. I'm also not keen on packet sniffing because I know what it involves!

Thank you very much for the tips on how to get the skin off of LFS World though, that is extremely useful. I think the solution here is for me to carry on (assuming I ever get the CMX import working! lol) and ask for Scawen to introduce a new insim command to get the skin name and hope he says yes .
Quote :...i'm expecting no more than about half a dozen lightschemes and I get quarter of a million

A new day and a fresh head and the silly error spotted!

I had loaded the entire header into a bank from the file stream in order to pick out the bits I wanted, but instead of peeking the int from the bank, I was reading off the next int from the stream...

I'm daft
It also doesn't help that i've just realised the SMX format is different for cars and tracks ! lol... I'll work on cars first
What are you going to achieve here Becky is some kind of tiny live LFS 3D spectator? Sounds insane.

Downloading Skins
(20 posts, started )
FGED GREDG RDFGDR GSFDG