The online racing simulator
Searching in All forums
(241 results)
w126
S3 licensed
Thanks a lot. Much better now. Smile
w126
S3 licensed
I am requesting them once at the beginning and it seems to work except in SPRs (I haven't checked MPRs yet).
Should I request them at other times/events?

Here is my current code (using JInSim):

public class MyInSimTest implements InSimListener {

static String hostname;
static int port;
static String adminPassword;

SimpleClient client;

private String track;
private String layout;
private String camera;
private short flags;
private float replaySpeed;
private int viewedPlayerId;
private int raceInProgress;
private Map<Integer, Car> playerCars = new HashMap<>();
private Map<Integer, Byte> playerPassengers = new HashMap<>();

public static void main(String[] args) {
new MyInSimTest(args);
}

public MyInSimTest(String[] args) {
hostname = args[0];
port = Integer.parseInt(args[1]);
if (args.length > 2) {
adminPassword = args[2];
}

client = new SimpleClient();
try {
client.connect(new TCPChannel(hostname, port), adminPassword, "MyInSimTest",
(short)(InitRequest.LOCAL | InitRequest.RECEIVE_MULTI_CAR_INFO | 512),
1000, 0);
// #define ISF_AXM_LOAD 512 // bit 9 : receive AXM when loading a layout
client.send(new TinyRequest(Tiny.SEND_STATE_INFO));
client.send(new TinyRequest(Tiny.AUTOCROSS_LAYOUT));
client.send(new TinyRequest(Tiny.ALL_PLAYERS));
} catch (IOException e) {
e.printStackTrace();
}
client.addListener(this);
}

@Override
public void packetReceived(InSimResponse response) {
if (response instanceof StateResponse) {
StateResponse stateResponse = (StateResponse) response;
String curTrack = stateResponse.getTrack().getShortname();
if (! curTrack.equals(track)) {
System.out.println("Track changed: " + track + " --> " + curTrack);
track = curTrack;
try {
client.send(new TinyRequest(Tiny.AUTOCROSS_LAYOUT));
} catch (IOException e) {
e.printStackTrace();
}
}
String curCamera = stateResponse.getCameraString();
if (! curCamera.equals(camera)) {
System.out.println("Camera changed: " + camera + " --> " + curCamera);
camera = curCamera;
}
short curFlags = stateResponse.getFlags();
if (curFlags != flags) {
Integer.toBinaryString(flags);
System.out.println(
"Flags changed: " + toFlagsString(flags) + " -->\n" +
" " + toFlagsString(curFlags));
flags = curFlags;
}
float curReplaySpeed = stateResponse.getReplaySpeed();
if (curReplaySpeed != replaySpeed) {
System.out.println("Replay speed changed: " + replaySpeed + " --> " + curReplaySpeed);
replaySpeed = curReplaySpeed;
}
int curViewedPlayerId = stateResponse.getPlayer();
if (curViewedPlayerId != viewedPlayerId) {
System.out.println("Viewed player id changed: " + viewedPlayerId + " --> " + curViewedPlayerId);
viewedPlayerId = curViewedPlayerId;
System.out.println("Current car: " + playerCars.get(viewedPlayerId));
System.out.println("Current passengers byte: " + playerPassengers.get(viewedPlayerId));
}
int curRaceInProgress = stateResponse.getRaceInProgress();
if (curRaceInProgress != raceInProgress) {
System.out.println("Race in progress changed: " + raceInProgress + " --> " + curRaceInProgress);
raceInProgress = curRaceInProgress;
}
}
if (response instanceof AutocrossLayoutResponse) {
AutocrossLayoutResponse layoutResponse = (AutocrossLayoutResponse) response;
String curLayout = layoutResponse.getName();
if (! curLayout.equals(layout)) {
System.out.println("Layout changed: " + layout + " --> " + curLayout);
layout = curLayout;
}
}
if (response instanceof NewPlayerResponse) {
NewPlayerResponse newPlayerResponse = (NewPlayerResponse) response;
int playerId = newPlayerResponse.getPlayerId();
playerCars.put(playerId, newPlayerResponse.getCar());
playerPassengers.put(playerId, (byte) newPlayerResponse.getPassengers());
System.out.println("New player: " + playerId);
}
if (response instanceof PlayerLeavingResponse) {
PlayerLeavingResponse playerLeavingResponse = (PlayerLeavingResponse) response;
int playerId = playerLeavingResponse.getPlayerId();
playerCars.remove(playerId);
playerPassengers.remove(playerId);
System.out.println("Player leaving: " + playerId);
}
}

private static String[] flagsMeaning = { "gam", "spr", "pau", "shu", "suh", "suf", "sun",
"s2d", "fre", "mul", "msu", "win", "mut", "vor", "ibv"};

public static String toFlagsString(short flags) {
StringBuilder result = new StringBuilder();
int powerOf2 = 1;
for (String meaning : flagsMeaning) {
if ((flags & powerOf2) != 0)
result.append(meaning);
else
result.append("---");
result.append(" ");
powerOf2 *= 2;
}
return result.toString();
}

}

Receiving IS_NPL/IS_PLL when playing SPR possible?
w126
S3 licensed
I'm trying to detect a car model of the currently viewed car in a single player replay. I am able to get the state changes with id of the viewed player. However, the only way of mapping this id to a car model (that I know of) is through the data received earlier in IS_NPL packets (new player joining). These packets don't seem to reflect what is happening in a SPR being played, I only get them during an actual race.
w126
S3 licensed
From LFS/docs/Commands.txt :
Quote :Local commands:
---------------
Most of these text commands replicate functions usually controlled by
pressing on-screen buttons but can be useful in other situations, for
example when controlling LFS from an external program using InSim.
...

Maybe it could be used as a workaround and also potentially lead to more efficient way of managing multiple LFS programs.
w126
S3 licensed
I have tested on Linux with Wine and an old mobile Radeon GPU using open source drivers which have poor performance. In the worst places on Westhill from the cockpit view the framerate went up by around 40 % in 0.6H5 when compared to 0.6H (in 0.6H4 it was maybe 15 % better then 0.6H). Very impressive! Thumbs up Smile
w126
S3 licensed
Here is a 0.3 s time difference from that last log:
Quote :22:21:15.675668 sched_yield() = 0
22:21:15.675693 gettimeofday({1432498875, 675702}, NULL) = 0
22:21:15.675719 select(0, NULL, NULL, NULL, {0, 4949}) = 0 (Timeout)
22:21:15.680780 clock_gettime(CLOCK_MONOTONIC_RAW, {417569, 108602728}) = 0
22:21:15.998481 futex(0x110070, FUTEX_WAIT_PRIVATE, 0, {5, 0}) = -1 EAGAIN (Resource temporarily unavailable)
22:21:15.998991 rt_sigprocmask(SIG_BLOCK, [HUP INT USR1 USR2 ALRM CHLD IO], [], 8) = 0

But this does not necessarily mean that clock_gettime system call takes that long. Could you add -T option to strace?
Quote : -T Show the time spent in system calls. This records
the time difference between the beginning and the
end of each system call.

Last edited by w126, .
w126
S3 licensed
The DLLs in ~/.wine/drive_c/windows/ are not the proper DLLs, they are just Wine placeholder DLLs. You need to download the real ones, for example, the files from http://www.dll-files.com look ok - just choose zip version.
Here are the checksums of the files that work with LFS on my Linux:
~/.wine/drive_c/LFS$ md5sum D3D*
1c9b45e87528b8bb8cfa884ea0099a85 D3DCompiler_43.dll
86e39e9161c3d930d93822f1563c280d D3DX9_43.dll

w126
S3 licensed
Maybe you copied 64-bit versions of D3D*43.dll files into LFS directory? Did you copy them from Windows? What version of Windows and which directory under Windows?
w126
S3 licensed
Quote from Gutholz :But one can use coordinates from MCI packets. First drive the route slowly and press buttons to place 'notes', then save the notes, then the notes get played back if you come near their location.

I think the difficult part is that the notes should be played before the place where they were set (for example, during recce you know the turn severity only after driving through it). In addition, how much in advance they should be played depends on how fast the car is and on specific driver preferences (RBR has earlier-later slider in the settings, AFAIR, some version of Dirt, too).
w126
S3 licensed
Seeing that the autocross system had just got new features (not just bug fixes), could we also get the slab object equivalent that has gravel texture and behaves like gravel when driven on?

Some like LFS-Trackmania, some LFS-Minecraft. Why not LFS-RBR? Big grin
w126
S3 licensed
This is great!
But... on such a large drivable terrain I could not find any gravel road section or gravel area. I'm not sure if it's a bug. Wink
w126
S3 licensed
Quote from blackbird04217 :In my first implementation of a GA each gene has a value from -1 to 1. I may later change this to be from 0 to 1, but it seems like a reasonable approach. If the application of a particular gene needs a larger range it can always be multiplied later. If there are 100 reference points along the track, then there would be 200 genes in each chromosome which the driver gets. One for steering input, one for brake/throttle input where negative is braking.

Taking this approach I will then compute the current and next reference points and interpolate their genes for the input of the car.

[...]

Any driver that falls off the track will stop moving, and fitness will remain the distance where they went off the track.

Just a few thoughts... A combination of GAs and racing seems interesting^2.

The approach you described could maybe slightly improve a prescription for already good lap around a track, but I don't think it has a chance to work from a random population. The desired steering inputs at any situation are strongly dependent on the lateral position on the track, car heading (relative to the road axis) and its current speed, not only on the reference points which you use. The "genes" should somehow express this dependence on many parameters. In this way virtual drivers evolved by the GA could be able to recover from errors. This is needed because at the beginning they will almost always be far from the perfect line and speed.

Regarding the fitness function, there should be a penalty for driving off the track, but the simulation of a single driver should not be stopped then. By stopping you are not allowing off-track virtual drivers recover and potentially shine in other places on the track.
Last edited by w126, .
w126
S3 licensed
Quote from CodieMorgan :Were is africa? 0.o

Wasn't it sunk in revenge for Black Hawk Down?
w126
S3 licensed
Quote from JeffR :Note that lateral peak force is related to the component of force perpendicular to the direction of travel.

Someone might choose to describe and model tyre forces this way, but it is not the standard method of doing it used by almost everyone.
See the figure on page 2 of http://zzyzxmotorsports.com/li ... uencing-tire-modeling.pdf . I think most of published tyre data is compatible with the coordinate system described in this document.
Lateral force is perpendicular to the direction of wheel heading, not the direction of wheel travel.
w126
S3 licensed
Quote from Bob Smith :you end up with your car sliding side to side with a magnitude of the relaxation length.

That must have looked funny, as the typical value of relaxation length for lateral behaviour is around 1 m, FWIR. I must say all these things are pure theory for me, I haven't really experimented with them in code.
Here is another damping method (which you may have seen already): http://groups.google.pl/group/ ... tors/msg/509e0cfe0516548a
w126
S3 licensed
Some solution for low/0 speed and oscillation problem is described in Development of an Intermediate ... or Optimal Design Studies, formulas (7.3.8) to (7.3.12).
w126
S3 licensed
Quote from The Very End :I hope they manage to sort this crisis out, having most of the people in the current ruling government out, it got to be hard getting everything back on track.

The current government having the leading role in ruling the country is almost not affected by this. The prime minister and 'full' ministers were not on the plane. In Polish political system the president mainly represents the country and is able to veto the parliament legislation (which again may be rejected by parliament with more votes).
w126
S3 licensed
Quote from obsolum :I understand they were all very important people but still... ~3000 vs. 132?

You are definitely right. In this tragic situation it is really sad that in the lists of victims published by many Polish sites they only mention VIPs and neglect pilots, flight attendants, bodyguards etc.
Last edited by w126, .
w126
S3 licensed
Quote from Shotglass :wouldnt you only need a relatively straight forward set of 4d data to reproduce a tyre in all its behvioural characteristics?
doesnt sound too complicated to me... maybe 5d if you add aligning torque too

And normal load, camber, temperatures...

I think there is always too much talk about force combining in such discussions, as if we were Flatland citizens.
w126
S3 licensed
Quote from MadCat360 :There are, TC 22 America and scroll down.

If they were competing in WRC, their final time would've put them 24th out of 26 WRC cars (25 WRC cars competed).

You mean these 25 cars? http://www.wrc.com/jsp/index.j ... son=2010&rally_id=MEX
These are not all WRC cars. The last 2 are Peugeot 206 XS in A6 class (FWD with probably not much more than 150 hp).
Entry list: http://www.wrc.com/jsp/index.j ... son=2010&rally_id=MEX
Did they even run on the same stages exactly? Does comparing the total times make any sense?
Last edited by w126, .
w126
S3 licensed
It seems the device is produced by this Czech company: http://www.motion-sim.com/

The copy of the video you linked to and the donation links look very fishy indeed.
w126
S3 licensed
The data available from real-time official LFS interfaces are very limited, so this problem looks difficult. However, RAF contains slip fraction.
Quote :Slip fraction
-------------
This is the dynamic value of the current combined slip ratio relative
to the combined slip ratio that would provide the greatest force.

0 to 254 - slip ratio increasing up to maximum force available
255 - slip ratio exceeds the maximum force slip ratio

Obviously, it's not real-time data, but maybe it could be used to construct a model of very high-level "distilled" grip characteristics of a given car and setup.

Such a model could be a function which takes:
  • linear acceleration vector,
  • angular acceleration vector,
  • linear speed (needed for cars with downforce),
  • car orientation (e.g. up-vector, needed to take driving on banked surfaces into account, and forward-vector to distinguish between cases of moving on the same trajectory with varying amounts of drift)
and returns the slip fraction values for all four wheels.

The above data (function inputs and outputs) can be logged quite easily with simple calculations from RAF of test runs of a given car and setup with near to optimal tyre temperatures. Then the hard part would be to find a mathematical expression that approximates the function with sufficient accuracy. The inputs of the function can be retrieved in real-time from OutSim (with some simple calculations) and the AI could use the approximating function to get "predictions" of slip fraction values when driving.

This ignores real-time tyre temperature and wear, but AI could deal with cold tyres by not using 100 % of the optimal grip at the beginning and gradually going closer to the limit as tyres warm up. Also, adding steering inputs to the parameters of the function may seem useful, however, they already influence existing function parameters.
w126
S3 licensed
Quote from brt900 :cmon 2002 turbo beat mk2 escort wtf is wrong with these people i need that escort

Just one example from this forum:
http://www.lfsforum.net/showthread.php?p=1352885#post1352885
w126
S3 licensed
Quote from brandons48 :I wonder what would happen if Block completely dominated the WRC?

Hell would freeze over?
w126
S3 licensed
Using the data from CAR info binary format is for sure better than 1/4 of unsprung mass. FWIR exporting of it was added in LFS later than the discussion in this thread took place.
FGED GREDG RDFGDR GSFDG