The online racing simulator
Searching in All forums
(40 results)
1
pizza_delivery
Demo licensed
Quote from wheel4hummer :I was just thinking, if you run PWM through a capacitor, wouldn't it smooth it out and basically act like a DAC?

great to see more and more people interested in this field.

PWM and DAC are two different things.

PWM is a square wave signal where the "on" and "off" time is varied to achieve an overall average voltage.

a DAC is a Digital to Analog Voltage. The output is a constant and steady voltage.

I haven't messed around with DACs a lot, but from the ones that I've heard of, they use multiple op amps and switches to accumulate a voltage with respect to the binary input.

Apart from Atmel, check out Microchip USB devices. I've used the 18f4550 and it's got a lot of tools you can use, especially various sample codes to get you up and running. Some microcontrollers even support internal DAC so that you don't even need to buy a seperate one.

good luck.
pizza_delivery
Demo licensed
bluetooth would be even cooler.!!
pizza_delivery
Demo licensed
public struct IS_SMALL
{
public const byte Size = 8; // always 8
public byte Type; // always ISP_SMALL
public byte ReqI; // 0 unless it is an info request or a reply to an info request
public byte SubT; // subtype, from SMALL_ enumeration (e.g. SMALL_SSP)
public uint interval; // value (e.g. for SMALL_SSP this would be the OutSim packet rate)

public byte [] getPacket()
{
byte [] data = new byte[8];
data[0] = Size;
data[1] = Type;
data[2] = ReqI;
data[3] = SubT;
data[4] = BitConverter.GetBytes(interval)[0];
data[5] = BitConverter.GetBytes(interval)[1];
data[6] = BitConverter.GetBytes(interval)[2];
data[7] = BitConverter.GetBytes(interval)[3];

return data;
}
}

//create a constructor for outgauge init packet
IS_SMALL ogInit = new IS_SMALL();
ogInit.Type = (byte)PacketType.ISP_SMALL;
ogInit.ReqI = 0;
ogInit.SubT = (byte)smallType.SMALL_SSG;
ogInit.interval = 1000; //set time interval to 1000 msec.
pizza_delivery
Demo licensed
err, more problems:

after sending the outgauge init packet right after the ISI packet, i'm getting a repetitive error message:

Insim : first bye in packet does not match size.

I did a search on teh forums, and someone mentioend outdated insim version.

I'm looking in the insim.txt and I can already see that the IS_VER.Product only has two available parameters - Demo or S1
pizza_delivery
Demo licensed
Thanks to all who replied.

I finally got outgauge to enable. Hopefully the rest will be easy. The reason why I want to write my own app is for learning purposes only, not only that, but the motivation!

My plan is to make a dash using led's and a lcd display. I was able to send data out through the usb port to my usb device the other day, so in theory, it shouldn't be too bad.

again, thanks for the help, I realized I made some stupid programming mistakes, but then again, it was 4am in the morning
pizza_delivery
Demo licensed
brrr, can't attach files in an edited post

anyways, the 1st button "initialise insim" has all the code for sending packets.

as I said, this is a really raw version, and I'm only writing quick code to test if insim initialized properly.

the 2nd packet I am sending is supposed to initialise outgauge, which isn't working either.

please give me user feedback as to how I can improve my coding or hints on methods of debugging etc.
pizza_delivery
Demo licensed
Quote from DarkTimes :Hmm, that's strange, I wonder why setting the ReqI to zero fixed the problem, as a non-zero ReqI should only cause InSim to sent an IS_VER packet after connecting. Out of interest, what value were you assigning to the ReqI before?

yea I don't think it's working whether I set ReqI to either 0 or 1

I'm still geting that random red error text

maybe my laptop is really that slow

as I said, I'm fairly new to c#, so I was just forcing values to variables to ensure they are the storing the values that I want. which was why i set reqi to 0x01

I've attached a .zip of my project. the Initialize Insim button is where all the packet sending takes place. The 2nd packet is suppose to initialise outgauge, which, doesn't work

as I said, I'm just sort of debugging the programming at the moment. Please give me user feedback! I don't have formal training in c# programming, so any tips/hints would be great in debugging methods, better algorithms etc.
Last edited by pizza_delivery, .
pizza_delivery
Demo licensed
I've done Java, so all the concepts of object oriented programming is exactly the same. The only difference is marshalling, which I should have sufficient resource from example codes.

I would really like to take this opportunity as a learning process, and I believe I'm pretty close!

edit. hrm, i think I got it.

i'm not getting the red text anymore after changing the ReqI value to 0
Last edited by pizza_delivery, .
Help with insim initialiasation (C#)
pizza_delivery
Demo licensed
Hello,

I wrote a small c# app to initialize insim through the udp port.

I'm getting an error saying:

insim: port 30000
insim - udp : unnamed (port 30000)
[RED text] InSim: Packet received before ISI packet

obviously, it did not initialise insim properly.

I've followed the C# tutorial as reference on how to marshal all the data types into a byte packet of size 44

here is my code. Note that I was too lazy to figure out how to marshal the admin and server name, but i suspect that these data values do not matter. so I just set all the bytes to 0

note: please don't laugh at my code, this is more or less my first c# app.


public byte [] initPacket()
{
//create an array for the Insim Initialisation packet
byte[] data = new byte[size];

//size of packet
data[0] = size;

//packet type
data[1] = 0x01;

//ReqI
data[2] = ReqI;

//zero value packet
data[3] = 0;

//UDP Port
data[4] = BitConverter.GetBytes(UDPPort)[0];
data[5] = BitConverter.GetBytes(UDPPort)[1];

//flags
data[6] = BitConverter.GetBytes(Flags)[0];
data[7] = BitConverter.GetBytes(Flags)[1];

//Sp0 - Set value to 0
data[8] = 0;

//prefix
data[9] = (byte)Prefix;

//interval
data[10] = BitConverter.GetBytes(Interval)[0];
data[11] = BitConverter.GetBytes(Interval)[1];

for(int i = 12; i<43; i++){
data[i] = 0;
}
data[43] = 0;
return data;
}

}

here is the code that creates the instance of my struct.

IS_ISI isInit = new IS_ISI();
isInit.type = (byte)PacketType.ISP_ISI;
isInit.ReqI = 1;
isInit.Zero = 0;
isInit.UDPPort = 30000; //use port 0
isInit.Flags = 0;
isInit.Sp0 = 0;
isInit.Prefix = '!';
isInit.Interval = 100; //100msec interval -> send data through UDP port instead of TCP


and this is the command to send the packet

sendSocket.SendTo(isInit.initPacket(),sendEndpoint);
pizza_delivery
Demo licensed
The quote DrftMstr posted was a pm from me. Normally, I don't rip out on people like this, especially on the internet, but I just hate it when people try to insult others when things don't go their way. I apologize to everyone for the inconvenience this has caused.

I agree that I should buy S2 to help out the community. I've been following the progress since the beginning stages of LFS, and as an engineering student, I know how much devotion it takes to develop what LFS has come out to be.

As I mentioned, I am an engineering student. Money for me is scrace, and time is definitely of no luxury! I only get to play LFS a handful of times on friday nights. Heck, my laptop can't even run LFS above 30 fps with a few cars on the track. Buying S2 will only be a distraction for me at this point.

Sim racing is what encouraged me to go into engineering. On my spare time, I like to devote my time and experience into things like this: http://youtube.com/watch?v=8ZKv0dJCjiA in which I hope to make this project open source to expand the possibilities of this project.

I hope that people understand this post more clearly. Encouraging people to help LFS grow is a great thing, but I don't think insulting others is the way to go.
pizza_delivery
Demo licensed
by blipping the throttle, do you mean like heel toe?

I tried doing this to avoid lockup on the wheels upon braking, but i can't blip the throttle at all.

keeping in mind that I am using mouse.
pizza_delivery
Demo licensed
I looked at some of the top times on the demo maps, and apparantly, some got got 1:09x

is this even possible???
I Got 1:13:88!!!
pizza_delivery
Demo licensed
Sorry, I just had to!

I've been practicing for so long until I switched to a setup. I became so frustrated because I knew that setup had potential but I my laptimes were even worse.

Finally, I decided to lower the braking force, and I was able to corner so much smoother, until I finally got

24:05
53:70
1:13:88!!
pizza_delivery
Demo licensed
well I guess what I really meant was to "point" the car into the corner and then brake compared to just braking in a strait line parallel to the road.

I don't know if this is faster or not.
pizza_delivery
Demo licensed
well, what I really meant was trying to aim the car into the apex while braking instead of just "Straight in and turn".

dont know if this is a faster technique or not, but I see a lot of WR record lines do it.
pizza_delivery
Demo licensed
hrm, some guy online who can get 1:13's consistently suggested that I turn into the apex while braking into the corner.

Problem is that I'm using mouse and once I try to turn, my wheels sort of lock up and straighten out and it starts to get really difficult to control the car where as just braking ina strait line, letting go fo the brakes and turning.

how do you guys do it?
pizza_delivery
Demo licensed
man, I just tried some guys setup who got 1:13:10 on it and I just find it so difficult to drive with that setup! I spin out so easily and I have no clue how to accelerate when exiting a corner.

is this normal?
pizza_delivery
Demo licensed
Just go online and race. Even if you crash, just apologize. This happens all the time.

There are many things you learn online which you can't while playing against the AI.
pizza_delivery
Demo licensed
bah, I did some hotlapping and the closest I got was 1:14:08! here is my replay

first few laps are kinda shitty
to rumble strip or not to rumble strip
pizza_delivery
Demo licensed
I can only get 1:14:22 and I find it really difficult to get into the 1:!3 zone.

I see some people not even having to go onto the rumble strips on turns, and they seem so slow and they can easily get 1: 13: 50ish
Fanatec 911 wheel
pizza_delivery
Demo licensed
Anyone have this device? I was wondering how well it feels with the belt drive system inside and a dual belt drive system.

http://youtube.com/watch?v=0FfjEu9O7MU&feature=related
pizza_delivery
Demo licensed
Netkar is supposedly pretty good. Anyone try it out yet?
pizza_delivery
Demo licensed
1:11! omg!

so far, my PB is only 14:38 and that's still pretty slow

Keyboard is kinda cheap since it uses autosteer lol
pizza_delivery
Demo licensed
Quote from Cr!t!calDrift :Meh, if LFS Demo was only 1 week, me and many others would be gone.


Then again that's probably a good thing o_O.

Hm, if you want to find friends, I suppose just driving around on servers and starting some small talk in between races has always helped. Although it IS true that S2 has a good community, s2 doesn't exactly have the biggest amount of servers. And by the looks of it, I haven't seen demo in months, but I am pretty sure that it's dead by now.

Yea, this is exactly what I did. Got a few contacts doing so. It's really nice how we're all a small community and we all know each other like back in the days of the BETA versions.
pizza_delivery
Demo licensed
Quote from Matt0snap :LOL...ok then. If you would of acutally quoted my whole post you will see that I said I hate demoers who whine for more stuff thinking they have the right to it. I don't care about demoers who play the game as is... If they want more stuff then they buy the game. But where do people get off thinking they can argue with us thinking that they deserve better tracks and cars.

I wasn't talking about people like you who just play the game, I was talking about people who whine in these forums.

EDIT: Just re-read my first post.... Guess my rant about people whining was in a different thread..

Why do you even care?
Are you part of the development team for LFS? The success of LFS has nothing to do with you.

I was simply trying to find a few guys to race with. If you can't even accept that, then... you need help.
1
FGED GREDG RDFGDR GSFDG