The online racing simulator
Searching in All forums
(744 results)
Scawen
Developer
There is now a manual temporary signup closure.

You can see how it looks on one of my test seasons: https://www.lfs.net/leagues/22/season/1218

(it says "Signup temporarily closed" and you can still click to see the signed up racers)

The option is activated on "Edit season" page as seen in the screenshot.

I've realised duplicate number detection is a bit complicated as it needs to retrieve quite a bit of info and search through it and present error messages to the user, preventing them submitting their updates. It's more complicated than you might expect because of the fully customisable entry fields. I might try something simpler like highlighting duplicate numbers in red, just when the page is displayed. Something to make it easier for admins without doing the full job. It might even be better that way, in case a new user selected a number that is really reserved for someone else like last year's winner, etc.
Scawen
Developer
OK CSV improved as requested.

If you click Get CSV on my test page you will see:

1) First row is column titles (as specified by admin)
2) The column after user name is Country

Admin should not add "Country" when setting up the signup required fields. It automatically appears in the CSV after the user name.
Scawen
Developer
These quick weekend updates are all I can really do at this time. Improvements that are harder to implement will have to wait for the future.

I'll be doing another push on the Retro tyre model at the start of the working week, moving towards the big release.

Of course, this test patch can be easily updated at any time if simple updates / bug fixes / documentation corrections are needed.
Scawen
Developer
Quote from iamproplayer7 :First of all, yes - there is problem in my own script/framework and i'm very sorry that i made you waste so much valuable time...

No problem at all, I only wrote a few sentences and briefly looked at the output in my InSim test program.

Good to hear you identified the issue.

Quote from iamproplayer7 :
- add direction to IS_AII like CompCar struct has.

At least this one should be easy if you have an atan2 function. Smile

Direction = atan2f(-Vel.x, Vel.y); // in radians
Scawen
Developer
Checked again and steering does work in F3.

In my test program I have:

case 'J':
SendCarPack(car_plid, CS_MSX, 32768 - 2000);
break;
case 'K':
SendCarPack(car_plid, CS_MSX, 32768);
break;
case 'L':
SendCarPack(car_plid, CS_MSX, 32768 + 2000);
break;

Full left lock would be the result of sending zero in the Value field.
Scawen
Developer
This is the LFS Programmer Forum.

In most cases it is probably best to not comment if you aren't a programmer. Otherwise I would have posted in General LFS Discussion or Test Patch forum.

I don't go and post my opinions in the quantum physics forums because I probably don't know what the **** I am talking about. Face -> palm
Scawen
Developer
Thanks for the feedback and bug reports. I've done most of them and will release an update today.

Quote from Bokujishin :Input 254 does not seem to do anything right now, all controls stay in their...

My test seems fine.
- set steering : ok
- set throttle : ok
- send a 254 : steering returns to centre / throttle returns to zero

I might change it to allow multiple values to be set at once in a variable sized IS_AIC (probably would change the zero byte to PLID and then allow multiple 4-byte blocks of "byte Spare/byte Input/word Value"

Quote from MizzMaster :Is there a way to engage starter motor in case gas engine stops? If not, Input...

Yes, I do this all the time when testing at layout square. Smile You set CS_IGNITION to 1
Scawen
Developer
EDIT: A new update is available below: https://www.lfs.net/forum/post/2114731#post2114731


OK, here is the test patch. The only new thing is AI control and data reporting through InSim.

docs/InSim.txt is included with this new section:


// AI CONTROL
// ==========

struct IS_AIC // AI Control
{
byte Size; // 8
byte Type; // ISP_AIC
byte ReqI; // 0
byte Zero;

byte PLID; // Unique ID of AI player to control
byte Input; // Select input value to set
word Value; // Value to set
};

// Values for Input

// CS_MSX 0 - steering : 32768 is centre
// CS_THROTTLE 1 - 0 to 65535
// CS_BRAKE 2 - 0 to 65535
// CS_CHUP 3 - shift up (set to 1 for a short time then set back to 0)
// CS_CHDN 4 - shift down
// CS_IGNITION 5 - set to 1 (auto switch off)
// CS_EXTRALIGHT 6
// CS_HEADLIGHTS 7 - 1: off / 2: side / 3: low / 4: high
// CS_SIREN 8
// CS_HORN 9
// CS_FLASH 10
// CS_CLUTCH 11 - 0 to 65535
// CS_HANDBRAKE 12 - 0 to 65535
// CS_INDICATORS 13 - 1: cancel / 2: left / 3: right / 4: hazard
// CS_GEAR 14 - for shifter (leave at 255 for sequential control)
// CS_LOOK 15 - 0: none / 4: left / 5: left+ / 6: right / 7: right+
// CS_PITSPEED 16
// CS_TCDISABLE 17
// CS_FOGREAR 18
// CS_FOGFRONT 19
// CS_NUM 20 - number of values above

// Special values for Input

// 254 - reset all
// 255 - stop control

// AI car info
// -----------

// Send a SMALL_AII with UVal set to PLID to receive current information about a local car

struct OSMain // included in IS_AII - identical to OutSimMain (main data in OutSim packet)
{
Vector AngVel; // 3 floats, angular velocity vector
float Heading; // anticlockwise from above (Z)
float Pitch; // anticlockwise from right (X)
float Roll; // anticlockwise from front (Y)
Vector Accel; // 3 floats X, Y, Z
Vector Vel; // 3 floats X, Y, Z
Vec Pos; // 3 ints X, Y, Z (1m = 65536)
};

struct IS_AII // AI Info
{
byte Size; // 96
byte Type; // ISP_AII
byte ReqI; // ReqI from the SMALL_AII request packet
byte PLID;

OSMain OSData;

byte Flags; // AIFLAGS_x below
byte Gear; // Reverse:0, Neutral:1, First:2...
byte Sp2;
byte Sp3;

float RPM; // RPM
float SpF0;
float SpF1;

unsigned ShowLights; // Dash lights currently switched on (see DL_x in OutGauge section below)
unsigned SPU1;
unsigned SPU2;
unsigned SPU3;
};

#define AIFLAGS_IGNITION 1 // detect if engine running
//
#define AIFLAGS_CHUP 4 // upshift lever currently held
#define AIFLAGS_CHDN 8 // downshift lever currently held

Download: [ download removed - F3 is now available ]
Last edited by Scawen, .
Simple control of AI car
Scawen
Developer
EDIT: A first test is now available below: https://www.lfs.net/forum/post/2114646#post2114646


Hello programmers.

There is a mod waiting for publishing, for the purpose of being "driven" by AI, but all it would actually do is drive along uncontrolled. But I don't really want to support such a bodge mod that bypasses all realism purely so it pulls away all by itself.

But I don't want to prevent something that could be fun so I've come up with a simple idea for just a few hours of work, to allow InSim to control a local car, in a very crude way. I've done a proof of concept and can now drive an AI car from an external program. Actually it disables the AI completely and you just set values, like Steer, throttle, brake, shift, etc.

EDIT: This is only for local AI. It would be far more complicated to do it from the server - that would require new multiplayer packets and I'm not getting into that.

EDIT2: To be clear, it can work for AI that are online, but the InSim must be connected to a local computer that has its own AI on it, and those are the only AI that can be controlled by this new simple packet.

I want to confirm if this could be useful.

It's just like this:

struct IS_AIC // AI Control
{
byte Size; // 8
byte Type; // ISP_AIC
byte ReqI; // 0
byte Zero;

byte PLID; // Unique ID of AI player to control
byte Input; // Select input value to set
word Value; // Value to set
};

// Input values from from CS_NUM in Inputs.h
// Special values

// 254 - reset all
// 255 - stop control

enum
{
CS_MSX,
CS_THROTTLE,
CS_BRAKE,
CS_CHUP,
CS_CHDN,
CS_IGNITION,
CS_EXTRALIGHT,
CS_HEADLIGHTS,
CS_SIREN,
CS_HORN,
CS_FLASH,
CS_CLUTCH,
CS_HANDBRAKE,
CS_INDICATORS,
CS_GEAR,
CS_LOOK,
CS_PITSPEED,
CS_TCDISABLE,
CS_FOGREAR,
CS_FOGFRONT,
CS_NUM
};

I think you might need some minimal feedback from the car, via a request info packet, and it could tell you some things like the lights and ignition status. I suppose you can get speed / position, etc from other packets like MCI? Or maybe you need something like an MCI for one car, which you can receive on request for a local AI, and maybe it has a little more date in it?

I want to keep it simple as I don't want this to go on more than this afternoon as I have other things that I am working on.
Last edited by Scawen, .
Scawen
Developer
Quote from versiu :I just can't get why almost everydev koded this the same way. It's unlogical way to simulate engine...

That's because...
1) The flawed model is simple to code
2) It is actually 'logical' (although not physical)

I'm interested to try this, even the 'fake' version (making throttle response more realistic without doing a full engine simulation).

My understanding of the physical reason for this is that the diameter of the fully open butterfly valve is chosen to allow sufficient airflow at the engine's maximum power rpm. At low rpm the engine draws in air at a much slower rate so there isn't much resistance and so at low rpm it makes barely any difference whether the butterfly valves are fully open or half open. At low rpm when air flow is low, what makes the difference is whether the valves are a tiny bit open or slightly more open.

These days I'm sure it is more complicated as there is throttle mapping. So there is not a linear mapping between pedal and rotation of the butterfly valves. I don't know yet how the throttle mapping might be varied at different rpm. I'd be interested in that (but it doesn't affect the ability to try a test).

Also to note, not exactly the subject of this thread but even in a traditional engine without throttle mapping, and even at max power rpm, our model is also wrong, because the throttle response is linear, but that doesn't match the characteristic of butterfly valves which produce an S-shaped flow-vs-resistance characteristic. I'm sure that S-shape would be straightened by the throttle mapping (but just to repeat, I know that is not really the topic of this thread).

I do have higher priorities at the moment though, like trying to get to a state where we can do that release. This post is more to acknowledge that I'm interested in this subject, for those who didn't know that already. Smile
Scawen
Developer
I'm working on other things now but please do tell me whenever you think of any more features that could help, or anything good about forum-based signups that still isn't covered by the updated system.

I've allowed public access to the "Get CSV" function as well so people can see how that works without needing to set up a test league.
Scawen
Developer
The signup system now has support for skins.

If the administrator includes a field named "Skin" and a racer enters the name of a skin that has been uploaded, the skin is displayed on the signup page. A skin pack zip of all the skins can also be downloaded.

Signups test page: https://www.lfs.net/leagues/22/season/1219/signup/view
Forum thread: https://www.lfs.net/forum/post/2114364#post2114364
Scawen
Developer
Skin packs are now available. I think maybe it should only be for administrators but I have enabled it on the public page for now so you can see and test it. https://www.lfs.net/leagues/22/season/1219/signup/view
Scawen
Developer
Thanks for the suggestion.

I think it may be possible to detect if the administrator has entered a field named 'Skin' which could then could be used as a special case to provide a download link for the skin and hopefully some info about which res is available.

I've added "Skin" field to my test season and maybe tomorrow I can try to make use of it.
Scawen
Developer
Screenshots in first post updated to show page updates including avatars, flags and info links.

For now, you can visit the signups page of my test league: https://www.lfs.net/leagues/22/season/1219/signup/view
Last edited by Scawen, .
Scawen
Developer
Nice bug finding again. Big grin

About the important one:

First time I've seen this code, but what happened: it stored the servers in the correct order but extracted from the database in a basically random order. At the same time, passwords were extracted preserving their order, so in fact if you had more than one host with different passwords, the passwords could be assigned to the wrong host.

I've changed the code to reassemble the list of servers in the order they were stored, so this should fix the problem. I recreated your test in my Round signup season and the bug appears fixed. Also my fake passwords have remained with the correct hosts, if I look in Edit Season.
Scawen
Developer
As mentioned, the signups can be seen by anyone, so could be linked from a forum discussion thread.

Examples: (the required fields per entry are all editable)

1) Here is a list of signups for a test season in which you can enter as a single racer (1 per team).
https://www.lfs.net/leagues/22/season/1219/signup/view

2) Here is a list of signups for a test season in which you can sign up in teams of up to 4 racers per team:
https://www.lfs.net/leagues/22/season/1218/signup/view

3) Here is a list of signups for a test season in which you can sign up for individual rounds:
https://www.lfs.net/leagues/22/season/1223/round/1/signup/view
Scawen
Developer
I hope all the time zone stuff works properly, it's always confusing to implement and made my day's task a lot harder. Especially when we are dealing with things displayed near day and month boundaries, and must be placed and displayed in the correct day slot, and the viewer can be in any time zone, at any time, and select any month or week to view.

I'd obviously like to know if there are any errors with time zones.

A simple test is if someone could compare the in-game event browser with the website calendar and make sure it looks correct. Hovering over the event time should show the UTC time, in case that is useful.

One test I should do is set my timezone to somewhere far from UTC and confirm that some events fall into a different day or month on the calendar because of the time zone of the observer. But I'm a bit tired now, probably will test tomorrow.

I don't plan to do any more on this stuff for now except for any fixes. Really it was some holiday work but has gone on 4 extra days and we all know what I really have to work on now.

I hope the calendar and league section improvements are helpful.
Scawen
Developer
I can't see any glitches on our performance graph, and a network test now shows very little packet loss, so I wonder if the problem has been resolved?

The graph looks clean from around 18:00 UTC on Saturday (7 December).
Scawen
Developer
Thanks for the info.

I've now corrected it, in a new installer you can download with this link. It has a different file name ending _install.exe instead of _setup.exe to avoid the CDN caching the old version.

Download: https://www.lfs.net/file_lfs.php?name=LFS_EDITOR_7F_install.exe

For interest only:

The problem seems to be that NSIS stores the empty folders in some other location, not in the standard directory structure visible when you open the archive. So that's why you couldn't see them in the 7E installer, although they do appear in the fresh installation. That 7E, with editor patch applied, was also the source I used to create the 7F installer. I didn't know that before and annoyingly I forgot to test that installer, although I did test all the game ones.
Scawen
Developer
Quote from redekizde :Any idea of what it could be or is there any way to fix this?

I've sent you a PM about a quick test to get some more information.

EDIT: problem solved.
Last edited by Scawen, .
Scawen
Developer
Quote from Flame CZE :I see, it's because the patch is from 0.7A to 0.7E13 and the new background was added in 0.7C. Ideally the patch should only include changed files from 0.7E to 0.7E13, but maybe there are some technical reasons why it's done this way Uhmm

I think this should be possible and I've made a note to look at it for the next test patch.
Scawen
Developer
With some changes in Test Patch E13, you should now be able to join hosts even if UDP packets cannot get from your computer to the host.
https://www.lfs.net/forum/post/2077190#post2077190
Scawen
Developer
With test patch E13, you should now be able to join hosts online even if UDP packets cannot get from you to the host.
https://www.lfs.net/forum/post/2077190#post2077190
Scawen
Developer
I had to restart the server again this afternoon for some tests.

To those who were online at the time, sorry for the disruption.

I hope the provider will make some sense out of the test results.
FGED GREDG RDFGDR GSFDG