The online racing simulator
Searching in All forums
(976 results)
MadCatX
S3 licensed
If there is a chance that your Internet traffic was being monitored, you should reinstall Windows as a security measure. You never know what kind of information might the malware be distributing...
MadCatX
S3 licensed
The malware most likely has to sniff the HTTP traffic and replace any request for an .EXE file with the request for the "setup.exe" you're getting. This is not a particularly easy thing to do so one of my guesses would be that it's just your browser that's infected through a bad plugin or something.
MadCatX
S3 licensed
Quote from svergie2 :This does not work for me at all, its just blank; nothing. Help?
Win 7 Home prem. 64 bit

OutGauge is probably not set properly.
MadCatX
S3 licensed
Quote from dawesdust_12 :More seriously, you want to loop through either your connection list (if you only care about users that are in the server) or your entire user list and create 2 arrays, one containing only usernames and another containing the desired sortable items (points,cash, crashes).

A map would be the structure to use in this case. In C# terminology it would be a Dictionary<string, List<int>>


<?php 
void SortAndPrint
()
  {
    
Dictionary<string, List<int>> scores = new Dictionary<string, List<int>>();

    
string[] files Directory.GetFiles(@"./""*.txt");
    if (
files.Length == 0) {
      
Console.WriteLine("No files.");
      return;
    }

    foreach (
string f in files)
    {
      
string name f.Substring(2f.Length 6); /* No trailing ".txt" and leading "./" */

      
string[] lines;
      try
      {
        
lines System.IO.File.ReadAllLines(f);
      }
      catch (
Exception e)
      {
        
Console.WriteLine(e.ToString());
        continue;
      }

      
scores.Add(name, new List<int>());
      foreach (
string s in lines)
      {
        
int val;
        try
        {
          
val Convert.ToInt32(s);
        }
        catch (
Exception)
        {
          continue;
        }
          
scores[name].Add(val);
      }
      
scores[name].Sort();
    }

    foreach (
KeyValuePair<string, List<int>> pair in scores)
    {
      
Console.WriteLine("--- " pair.Key);
      foreach (
int i in pair.Value)
      {
       
Console.WriteLine(i);
      }
    }
  }
?>

MadCatX
S3 licensed
Quote from DANIEL-CRO :About invisible window: maybe using ShowWindow((HWND)LFS, SW_HIDE); (as I already told Victor)

For this to work you'd have to get the handle of the console window which would require some heuristics and even then it would be error prone (like if you had two consoles with the same title running).
EDIT: You could generate some random string, call SetConsoleTitle() and look for that with FindWindow(), but that sounds like a nasty hack...

For a full GUI-less experience on Windows it would be better to have DCon run as a service.
MadCatX
S3 licensed
I really don't think this is in any way funny. If these allegations are true, then right now you have an indeterminate amount of people with unknown motives with access to a LOT of your data and almost no accountability. It also means that the software companies were outright lying to us about the security and privacy of their services.
It's not that I'm worried that NSA might find anything interesting on my Google accounts, it's the blatant betrayal of all their users who thought their data were safe that makes me sick. More to the point, how can we be sure that the NSA's wiretap is safe and cannot be abused by somebody else? How can we be sure that the companies in question don't have similar deals with other institutions?
MadCatX
S3 licensed
The mod can be configured to launch LFS with another InSim port if the default 29999 is in use by a BitTorrent client for instance...
MadCatX
S3 licensed
You got it backwards, this formula is for conversion FROM degrees to radians.
MadCatX
S3 licensed
  1. Something tells me that you don't have the right coordinates. Coordinates used by various InSim apps do not correspond to coordinates reported by LFS (can't remember the conversion off the top of my head).
  2. Atan2() returns angle in radians, but LFS reports heading in degrees. You have to use the same units.
  3. You are missing the second part of Step 4. Without it the algorithm doesn't produce correct results if the target is behind the car.
Other than that it looks fine to me...
MadCatX
S3 licensed
- You cannot convert Atan2 result to <0; 360) range by adding 180 the result. Google what Atan2 actually does and you'll see why...
- You're not converting LFS heading to "mathematical" angle correctly.

Seriously, if you have no idea about trigonometry, you'll probably have to suffer through some maths textbooks first... it's all in there.
MadCatX
S3 licensed
I use PSU Calculator to estimate the needed PSU power. The lite version gives only overall wattage (=sum of wattages on all rails) which is unfortunately quite useless. It won't help even if you had a 2000W PSU if all the power was on the 3.3 V and 5 V rails. Graphic cards, CPUs and mechanical drives motors feed off 12 V rails. PSU Calculator recommends at least 17.3 A on the 12 V, but it doesn't have G2020 in the database so I had to use i3-3210 instead. G2020 will probably use a bit less power, but I'm afraid you'll probably push your PSU to the limits anyway. If I use the same specs but with HD7790 instead, 12 V demands jump to 18.6 A. You also have to consider that the PSU's capacitors will degrade over time which will lower the PSU's power even more.

If you had a decent PSU and an i5, I'd say go for 7790 but with the hardware setup it just might not be worth it. I found a bunch of tests which show the difference between 7770 ad 7790, but notice that the tests were run on a highly overclocked i7-960. (http://www.purepc.pl/karty_gra ... d_7770_i_hd_7850?page=0,2)
MadCatX
S3 licensed
HD7770 will probably do since you're going to be CPU-limited anyway. You'll need a PSU with at least 18 A on the +12 V rail for that card...
MadCatX
S3 licensed
Quote from Scawen :Hmm, I have no idea what that means.

This is what a crash dump from WINE looks like. It's much more useful to debug WINE itself rather than the application that is run through it.

Any idea how to reproduce it Dave? If it's a bug in WINE, I might be able to track it down...
MadCatX
S3 licensed
This sort of thing cannot really happen in a racing car. Loss of vision and consciousness is caused by the blood not flowing into the brain and only a force that is "pushing on one's head" can make the blood flow from the head to feet. Cornering and braking forces in a car push driver's body left/right or forward/backwards, not up/down so they cannot cause any severe flow of blood away from the brain.
Last edited by MadCatX, . Reason : Accidentally typed &quot;from&quot; instead of &quot;flow&quot; :shurg:
MadCatX
S3 licensed
Quote from Stang70Fastback :Dot products! School IS useful in real life!!!

QFT
However, dot product is not the best solution in this case because you also want to know whether vector V is to the left or right of vector U. Atan2 does provide such information, dot product is always positive.
MadCatX
S3 licensed
Quote from DANIEL-CRO :
This code seems to frezze it imediately, and DEDI stop responding if I endlessly send "/reinit", but no crash.

I can't reproduce this on Windows nor WINE no matter how fast I send the keys. Once the server processes the message queue, it resumes normal operation as far as I can tell...
MadCatX
S3 licensed
The problem you're trying to solve is not really a programming problem but a mathematical one. It's usually much better to solve these problems with a pencil and a piece of paper before you start writing any code. Do you know what Cartesian coordinates system is? Do you know how some basic trigonometry works there? If you don't, you've got to do some reading on that first. If you know this, your problem is actually quite simple.

You're trying to find an angle between two vectors. Vector V is a vector between the car and the destination, vector U is the motion vector of the car (=a vector which shows which way is the car moving (and how fast, but that is not necessary to know in this case)).
Getting V is easy: V = B - A = (B.x - A.x; B.y - A.y)
Since you only need the heading of the car, not the motion vector itself, you can use car's heading from MCI packet.
Now you have to:
  1. Use atan2(V.y, V.x) to get Alpha (in radians and in <-PI; PI) range)
  2. Convert Alpha to degrees and to <0; 360) range
  3. Use (Heading + 90) to get Beta which is car's heading in degrees. Heading is 0 if the car is moving North (along the Y-axis) which is why you need to add 90 (and subtract 360 if the result is greater or equals to 360)
  4. R = Alpha - Beta. R > 0 means the destination is to the left of the car and vice versa. Also, if R > 180, R = R - 360 and if R < -180, R = R + 360
A modified Atan2 which returns angle in <0; 2*PI) range can look like this

<?php 
static double Atan2Positive(double ydouble x)
   { 
     
double angle Math.Atan2(yx);
     if (
0)
     {
       return 
Math.PI angle;
     }
     else
     {
       return 
angle;
     }
   }
?>

Last edited by MadCatX, . Reason : Atan2 range was incorrectly listed as &lt;-PI/2; PI/2), correct range is obviously &lt;-PI; PI)
MadCatX
S3 licensed
LFS communicates with external applications via InSim, OutSim and OutGauge. These are network interfaces so you can use them with more or less any language you like...
MadCatX
S3 licensed
Another solution would be a InSim.NET->LFS_External wrapper. It might help resurrect LFS_External based projects which would require a complete rewrite. Something of this sort is in the works...
LFS_External has a few inherent problems (besides the lack of support for LFS 0.6B and above) which is why I really don't recommend it for any new projects.
MadCatX
S3 licensed
At this price and performance range I suggest you go with the card you can get cheaper, there's hardly any other meaningful way of comparing these two cards...
MadCatX
S3 licensed
Quote from ADr3nAl1n :The open source of LFS_External is public ...

Unfortunately it's not. What's public is just a reverse-engineered source which is very difficult to read and modify...
MadCatX
S3 licensed
Quote from jobans :And how to add that packet to lfs_external?

You cannot do that because there is no source code available for LFS_External. You have to use another more up-to-date library.
MadCatX
S3 licensed
Quote from ADr3nAl1n :If I remember correctly lfs_external does not have that packet , But I am not sure

You are correct, LFS_External is unaware if the ISF_CON flag so it cannot even tell LFS to send IS_CON packets.
MadCatX
S3 licensed
Quote from maaland :how much you want then for programming an insim?

You see, this is not a hiring office but a but an Internet forum. People go here not to look for a job, but to discuss stuff related to a video game they like. Your chances of finding a programmer who'd join you because he might get paid are therefore rather slim.
You can get people for your project by making your project somehow interesting and innovative. I'm sorry, but yours isn't. The functionality you want could be easily written over a weekend, but I doubt that many people would like to work on something that has been done gazillion times before...
FGED GREDG RDFGDR GSFDG