The online racing simulator
Searching in All forums
(263 results)
Stuff
S2 licensed
Awesome idea!

In fact we had ideas to do something very similar. ie, setup a layout database, insim program to track position etc, have a dedicated autox server with live stats. Of course there were problems with making things run smoothly so it didn't get too far.

Fortunately, you did it first and so far its turning out great. If there is anyway I can help I will be happy to. One thing I have planned is finishing that Layout Thingy program

Good job again Vic!
Stuff
S2 licensed
Yep its only on the client side and as of yet there no way to know A small pit packet has been suggested before but who knows if that will ever happen. The only way I can think of is to get MCI packets and see if the player is within the pit rectangle. Just like the InSim fuel mod did before we had in-game fuel. Of course this requires the position and dimension of that rectangle beforehand. If I ever make such a system I will make the rectangle info available to everyone and hope that anyone else will do the same.
Stuff
S2 licensed
Uploading live results to a php script? Hmmm.. sounds like what the program I'm making for the North American League does. For now the only relevant thing it does is upload qualify (best lap) info to our site, which is entirely a LAMP server.

It also does a little more with the server, including: reporting host*.txt info every N seconds, downloading a xml list of our members, downloading detailed member info for when they join the race, and downloading a welcome message. Future ideas are easy to implement.

Oh, its also a HTTP server so people could see live results, or even control the program after logging in, from any browser.
Stuff
S2 licensed
Mobile phones I'm not too aware of. Let's say not at all Programming for them I assume would be tricky because I doubt the different phone manufacturers talk to each other on programming standards. Besides, if anyone were to make a program for themselves it would be for limited use.

So yeah, it all depends on context. But for the most part, in the context of computers, Java is still nice imo.
Stuff
S2 licensed
There we go. If you post it, they will come (with better graphics). I knew someone would have a better idea so I kind of rushed the icon and wound up with crappy edges/border. I remade the icon anyway and reuploaded the attachments.
Replay icon!
Stuff
S2 licensed
Well, now that we have associations for the replays, I made a slightly different icon for them! Didn't want to take away from the original that much so I only made the black part a triangle to represent the play in replay. What do you think?

Edit: remade the icon.. better edges. same name so just redownload and replace

preview and icon
Last edited by Stuff, .
Stuff
S2 licensed
We too, LFSNAL, have something like this. It consists of quite a few php scripts (including a mpr parser), mysql db and a lfs-server-insim-management program.

It works by the manager program posting/getting info with the server scripts. Web based, post and gets stuff. We try to keep as much as possible server side with the manager program being a connection to best laps or whatever.

With all that said, the system is always under development, slowly. There is still some work to be done and would be a while if we were to release anything. RiCiN wrote the php and handles the server. I wrote the manager.
Stuff
S2 licensed
Aww.. what about the rest of us? Post the code here too? p-p-p-p-pleeease
Stuff
S2 licensed
The VB6 project I'm slowly making does this sort of thing. It uses the method the_angry_angel mentioned with the SPX and LAP packets. It works pretty well but it could use some reworking/thinking. To do this it takes advantage of sorting a hidden column of each person's total time. I use this very cool API List View control by Charles PV to take care of the table and sorting. Check it out and I can show you the code I use if you're interested.
Stuff
S2 licensed
Hrm.. Call me crazy but I like Java.

Its no more "strict" than any other comparable language, like C++, python, PHP or whatnot. Most of these languages use very similar syntax anyway..

Java is very powerful, protects the user, takes your mind off memory, 100% object oriented, multi-threaded, extremely portable (write it once, works everywhere there is a JRE; Winblows, Linux, Mac, as an applet in a browser!, etc).

On top of all that, the included standard library is huge and enables you to a lot more things that would take forever in some other languages. Stuff like.. databases, networking, GUIs, XML, cryptography, etc.

No wonder its used for mobile phones, OpenOffice.org, Oracle!, Azureus and legos.
Stuff
S2 licensed
Interesting program!

I also made a layout program a while ago in VB6, at my long outdated site: Layout Thingy. It can only open AU1 layouts saved from S1. But! since I will have some free time in a week or so, I will slowly continue the program to open up more/different layouts with all the objects from S2. Eventually, I want to make the program an editor but like you know and everyone says, it's quite a bit of work.

Maybe we can combine skills to release something better?
I dunno, just playing around with ideas.

edit: If you don't have a layout for S1, here is one made by Boosterfire thats pretty fun. (the one in the screeny too)
Last edited by Stuff, .
Stuff
S2 licensed
Yeah, everything seems correct, but I'm definitely no expert when it comes to the exact bitwise difference between C and Java. But, on the other hand I do have that pesky verifyID working in my Java InSim app.. Here is what I have:

To get the two word bytes from a packet, this is what I use. It's not the code I posted earlier, that returns the true value. This one returns a value that will work in my InSimPack, not the correct value unfortunately.. Its very similar. I think the only thing needed to get the correct value is change the 3 to (length - 1), like the 2nd one. Code from: code snippets

public static int bytesToInt(byte[] bytes, int offset, int length) {
int temp = 0;

for (int i = 0; i < length; i++) {
int shift = (3 - i) * 8;
temp += (bytes[i + offset] & 0xFF) << shift;
}

return temp;
}

And here is my convert function used in my InSimPack to send that int back. Code from: experts exchange googley match

public static byte[] intToBytes(int value) {
byte[] bytes = new byte[4];

for(int i = 0; i < bytes.length; i++) {
int offset = (bytes.length - 1 - i) * 8;
bytes[i] = (byte)(value & (0xFF << offset) >>> offset);
}

return bytes;
}

While not perfect, it works for me for now until I have the time to poke around with the bits for a better solution. Oh, and I will also post my working Java package later (week I guess, after finals) to show the rest

edit: Well, here is the whole thing as a jar. Feel free to extract it, browse the incomplete docs and stuff and use the package. This one is working but not every event from InSim is handled properly yet. Most of them are. Like I said, give me a week or so and I will post a better version
(take out the .zip to run it, or the .jar to open it easily.. 1.5 required because of the enums and few "for each" loops)

Last edited by Stuff, .
Stuff
S2 licensed
Yep, definitely a card problem. I had a similar problem with my last card, an ATI 9800 Pro. The bottom half of the screen was checkered with those black blocks and the textures on the models were corrupted, having black pixels "sprayed" on them.

In my case it was nothing software related nor overclocking. I reinstalled my whole system, tried multiple drivers, happened in every 3D app including video and I do not overclock.

The only solution, for me at least (probably you too ) is to replace it. Woot for RMA
Stuff
S2 licensed
Ahh yes very cool.
Any list of little secrets like that?
Stuff
S2 licensed
Actually a Java short is 2 bytes signed, -32,768 to 32,767. Whereas a word is 2 bytes unsigned 0 to 65,536. A Java character is also 2 bytes unsigned, so that would be a better choice


public static int wordBytesToInt(byte[] bytes, int offset) {
return (char)(bytes[offset] << 8 | bytes[offset + 1]);
}

And yeah, 512 is correct for the InSimVer part of the version packet (no verify ID )
Stuff
S2 licensed
I can post what I have maybe tonight or tomorrow. We (RiCiN and I) still have to package it, create a few more classes, tweak it and a few more javadocs/comments.

A plugin system I could see because only thing a program has to do is use the main InSim class and setup a listener, just like ActionListeners for buttons or whatnot. The InSim class handles the connection, keep alive, verification ACKs, and raises events then passes the packet/class to each of its listeners. Simple right?

And speaking of school projects, I too am using this for my Java class.
Stuff
S2 licensed
Yeah, whenever I hear about someone having problems with the .zip it makes me think of an installer of some kind. But like XCNuse said, some people can't install without admin rights. Hrm..

One idea is to create some app that could download the latest .zip if needed, or you can select it. Choose the folder to extract, it extracts it. Create all the start menu/desktop/quick launch shortcut stuff? It could do that too. The programmer could include any option we can think of.

Does any app do this already? Ideas?
Stuff
S2 licensed
Can I see too how you setup all your classes? I am also in the process of making a Java InSim manager thingy and would like to see what anyone else has created.

In my project, I have setup a class, InSim, and two interfaces. One interface for getting base events (version, messages, state packet, etc) and one for race tracking events. All I need so far. Each packet is a class and the other parts of the program just implement one of the two interfaces to receive InSim events. I also have a JTable setup to show some of the connected player info.

Do you have something similar? Learning by example is one of the better ways imo. Thanks a ton and if you want my code too, trade is OK.
Stuff
S2 licensed
Ahh the verify ID. You have two choices.

You could just not mess with it. Just dont send ISF_GUARANTEE in the ISI packet and then just ignore the verify ID. Not recommended imo because its best to check the data was sent and received.

Other way is to just send back the verify ID bytes in an ISP packet. Don't bother trying to print them out. The data is a 2-byte unsigned integer, which means you would have to convert it and so on. You'll notice in my ISP packet there are optional places for those verify bytes. Send it back like so:


Case "PLL"
Dim udtPLL As IS_PLL
CopyMemory udtPLL, bytRecvData(0), LenB(udtPLL)
Call SendISP("ACK", udtPLL.bytVerifyId(0), udtPLL.bytVerifyId(1))
Call removeid(udtPLL)

You could even make removeid() return a boolean and only send back the verify bytes if removeid() succeeded/udtPLL was processed.


Case "PLL"
Dim udtPLL As IS_PLL
CopyMemory udtPLL, bytRecvData(0), LenB(udtPLL)
If removeid(udtPLL) Then Call SendISP("ACK", udtPLL.bytVerifyId(0), udtPLL.bytVerifyId(1))

Lemme know
Stuff
S2 licensed
Ahh .Net.. Check out Messiah's project, LFS Live. Its on sourceforge but didn't come up. There is also sdether's a few posts down <-click
Stuff
S2 licensed
If its VB6 example you need, I posted one here. I have updated the okSocket control since that post so if you use it, there is an updated okSocket in the outgauge example I posted not too long ago, here. Hope it helps
Stuff
S2 licensed
For the VB6 programmers on the forum, here is a working test of OutGauge!
Only thing it does for now is output the speed and RPM to a label on the form, nothing special, just testing. Included is my little okSocket, which might be hard to understand if you go through the slightly hackish code so if you have any questions, I will be happy to help.

Have fun!
Stuff
S2 licensed
T3 going fine for me in some limited testing. For loading the bans on startup, yeah probably not needed but it would be a good place to check the bans.ban file for any errors before it actually goes to use the file
Stuff
S2 licensed
I dunno what a uint16 is but I'm guessing it stands for an unsigned integer thats 16 bits? That's what you need, just not sure how to copy it over to that InSim array. Since you're copying the individual bytes, you have to figure out how to separate that uint16 into 2 bytes. Not sure if I can help right away but have a look at other code, esp LFS.Live by Messiah. Maybe someone with .NET exp will step in. I'm not too familiar with .NET, mostly VB6 and Java

Remember with the ISI packet, that port is the one you are listening on for LFS data, not the one you are sending to. Keep them separate otherwise LFS will start to receive its own data and get really b0rky

Probably the best way is to create a user-defined type (in VB6 anyway), aka a struct in C. If you do that, everything is in place as it should be. Only thing you have to do is fill it in then copy the type into an array to send.

Keep playing
Stuff
S2 licensed
No! Don't give up yet.. Maybe I can help to get you back on track

I'm pretty sure that LFS checks the size of the packet you are sending it to tell if it has all the data, so you have to make sure when you do .send, that the array/packet is the right size and the right order. The size of the InSim packet (below) is 24 bytes. From your code (Dim InSim(13) As Byte), you are only sending 14 bytes. See? 14 != 24 so LFS rejects your data.

What you have to do is make InSim(23) As Byte and make sure the data goes into the right spot. Can't just stick the data anywhere and expect the program to determine where something starts/ends

For example..
ISI + chr(0) goes into 0-3 '<-- one byte for each character so make sure it's not unicode
2 port bytes goes into 4-5 '<-- 2 bytes for 0-65535 so make sure the number is not signed
flag byte goes into 6
nodesecs goes into 7
password goes into 8-23


struct InSimInit // UDP packet to initialise the InSim system
{
char Id [4]; // ISI + zero
word Port; // Port for UDP replies from LFS (0...65535)
byte Flags; // Bit flags for options - see below
byte NodeSecs; // Number of seconds between NLP or MCI packets (0=none)
char Admin [16]; // Admin password (required if set in LFS host options)
};

See how that goes and keep trying.
FGED GREDG RDFGDR GSFDG