The online racing simulator
Searching in All forums
(262 results)
Stuff
S2 licensed
Hey all! Sorry I've been "away" for a while but don't worry I'm not dead or anything just busy. (linux, job, moved, friends, etc) Or really, I've stopped LYTe VB6 version and I'm now working on a much nicer C/C++ OpenGL version that will support all tracks with 100% accuracy. Now, I have about oh.. 60%-ish complete so I'm guessing at my current rate, an alpha release will be ready in hopefully a month or two. Of course, developers suck at release date guessing, and I should probably say it will be done when it's done, but a "progress report" every once and a while is OK.

With that said, development will go bit faster (both in content generation and motivation) if I could get some help from someone that knows 3D modeling. What I need are all the layout objects as models, and any other models I might need like simplified car models. Nothing spiffy. Just simple shapes with colors and normals defined. Material properties (ambient, diffuse, specular, emmisive) would be nice too. 16 == 1 meter. .obj format? Also, not every single object has to be created. For example I can use the same cone model for cones of different colors, mirror certain objects, etc. I don't have a list of all the objects needed so will have to get back on what exactly there is, and its dimensions. Once anyone accepts my offer, I will get you that list or you can poke through LFS yourself. Of course, if there is anyway to get the actual models out of LFS (with permission) and use those, please let me know! I have no experience making 3D models so to do this myself using Blender would take another few weeks at least. Any help will greatly be appreciated. I can't pay anyone but will happily put anyone who helps in the credits. You'll also get to use LYTe before released!

K, thanks all for the continued interest, motivation and help! LFS rocks! And happy 2009!
Stuff
S2 licensed
Small problem there too. It goes: if 0, congrats, set to 1. if 1, try again. That means if its 0, both will be executed. Slap in an else and you're good to go.
Stuff
S2 licensed
Ahh.. HAHA! I have no idea about official autox definitions.. Maybe I should though with LYTe and all.. Thanks for clearing that up!
Stuff
S2 licensed
You need a xmas tree for autox? I know they're nice and all but really? If just for decoration then that's OK but for some real object on the course I don't get it. Just imagine that a green cone is a tree A while ago, Kegetys hacked LFS's memory and replaced an existing object with another object (a plain tree) but that's not really practical as only the one person's game is affected and my guess is the object has no collision detection or it behaves like the old object.

You can do 2+ start positions but you have to use the default location. If you put in the autox start point, it's one at a time with about a 5-10 second gap between people.

For the 2 second penalty, unfortunately that's built in and non-configurable. However my upcoming version of LYTe will include InSim tracking where you'll be able to setup something like that, but it will probably not be released for a few months at least.
Stuff
S2 licensed
Very interesting trying to interface scripting languages with InSim. I have no experience with that so I may have to look at how you did things or even use your .dll myself with my upcoming C++ LYTe. A scripting language for some type of autox interface is a possibilty for it so, your work could help a LOT! Of course all of this won't be for a while as I'm still working on the basic editor. (C/C++ SDL+OpenGL)

For callbacks I used this tutorial: CodeGuru: C++ Callback Demo
Stuff
S2 licensed
Merry Christmas too! :snowman: Woot for presents and days off!
Stuff
S2 licensed
Instead of making a fixed array why not use a STL container like a list, map or something else? Info here. And instead of storing UCIDs and PLIDs separate, I'd make a "player" map and store both in there. One central place to keep all people organized for lookups when a packet arrives.

But, if you have to use an array for some reason look into dynamic memory. (i.e. use a pointer to point to a resized array). Some info here.

Stuff
S2 licensed
I found this VB6 source after a bit. Doesn't seem too complicated so you might be able to convert it to C#. But, I don't know much about C# or .NET so good luck with that..

http://vbnet.mvps.org/index.html?code/disk/smartide.htm
Stuff
S2 licensed
Looks good! Except for the ribbon style of toolbar that I don't like. I mean, what's up with that home tab or the button group names. I'm sure there are ways to tweak that so just an opinion

Also, be wary of the name. There's already a WinMD5 out there, although not Pro. It is open source .NET however so maybe get some ideas, code or even collaborate?

And one last feature that might be useful is to bring those exports back in to be compared some how. It would be nice to do some side-by-side MD5 folder comparisons or something like that. Especially for backups to see what's changed.

Overall, nice program for a alpha/beta! I may have to download and use it once released. Keep it up! :up:
Stuff
S2 licensed
java.io.File does have the listFiles() method (along with lastModified, length/size, hidden, etc) that returns an array of java.io.File objects in the directory. I have not tested it but it's where I would start. Some examples here: http://exampledepot.com/egs/java.io/pkg.html
Stuff
S2 licensed
I'm on the side of XML and OOP. Of course, there is a time and place for every practice so you can't use it for everything. A good programmer imo, will always decide which to use based on their job and/or task and not because s/he likes one over the other. For example I really don't think it should be stuck into a DB. There may be a good reason for it I'm sure, but it violates MVC practices and scalability. On the other hand when you want exchange data between DBs, programs or whatever then XML is great. Very flexible! Don't forget XML is not a language, its a markup/syntax for making your own language/format. XML vs XHTML for example. It's not the language that matters most, it all depends on how you use it. OOP is similar in a way. Some basic programs can avoid it and that's all good but I'd like to see someone program a modern, multi-threaded program/game without it. And of course with OOP, kind of like here at work sometimes, it can be easily over-used. Arrg! soo many classes! no comments!? BAH! So again, all depends on how ya wiggle it..

Anyway, on topic.. I read Coding Horror every once and a while along with the Daily WTF. Coding Horror is much better though! More updates, simple, straight-forward and now Jeff is here! Welcome!
Stuff
S2 licensed
Hmm.. I'm no cruise programmer by far but I do have a few questions.. Why no more than 8? Is there something about MCI packets where 8 is the limit? Why do you reference the MCI packets to cycle through all your connections? Besides, if a person is banned wouldn't they be kicked off and no longer in the connections list? Maybe you can get some kind of "banned" event and do it to just the one person?

Or maybe all the cruise servers can cooperate with a global player database? One that has an economy, credit ratings, intrest rates, and its own home mortgage crises! Or even repo your cars if you don't pay up.. maybe even give you some concrete shoes for the East river if you don't pay! Umm, no, nevermind..
Stuff
S2 licensed
Thanks! Gracias too! I will add it to the next release.
Stuff
S2 licensed
For that I think you'll need to research the listbox control, and reading/writing files. Actually, heres some linkage that may help http://www.freevbcode.com/ShowCode.asp?ID=3541
Stuff
S2 licensed
The current version only works with layouts < Y. The changes to Blackwood upped the version number in the layout header and since LYTe checks that you get: - ERROR! If it didn't the placement of Blackwood objects would be screwed up. Autocross is still OK though.

Give me a week or so and I will release one more VB6 version with Blackwood removed or.. fixed? (and a few other tweaks).
After that it will be all 3D, smx and maybe InSim management. That will be a while so..


Stuff
S2 licensed
This is a long shot, but maybe its being more like C and not so # (sharp) in that your Rcv_Buffer already has random data in it. In C this would be solved by memset, which sets all bytes to 0. I dunno much about C# but my guess is this is done implicitly but ya never know, I certainly don't
Stuff
S2 licensed
Hrm, only thing I can think of is some default autocross layout? I remember watching a hotlap of a person hitting autox objects that were there by accident, being my default autox layout.. I don't know how replays would behave or if its even possible anymore, because of a fix.

Also, maybe the MCI/nodelap packet tells when they brake? If so just extract the x, y at the same time, determine how far they were then show either a button, DX8 injection prompt or log?

Just guessin'
Stuff
S2 licensed
Hmm, if I read your list right, are your connection IDs the same as your player IDs? Thats usually not the case afaik. Connection IDs go from 0 (host) to number_connected (not including AI) sequentially. Your player IDs look right as I think they are semi random. I dunno maybe I'm missing something. And you say its the same user? Maybe check something in the user name that could be throwing off your code? That ^2 and ^3 look unique to me
Stuff
S2 licensed
You can use IS_PEN. It has a reason enum, one of which is PENR_WRONG_WAY. Or you might be able to use the route checkers and other marshal objects. Maybe some other packet is sent when those are driven over, or the IS_PLL like dougie said.
Stuff
S2 licensed
I think he wants some PHP code to get hotlaps from LFSW but only from/to a certain upload date. In my limited experience with LFSW info via this link, I could get hotlaps (&action=hl) but the entries don't include a timestamp.. Other than that, I dunno
Stuff
S2 licensed
Here ya go!

Database
inSim errors.
where would i put the !sell commands?
Running a lfs server with money on it
Make the inSim insim program m ... files with the user data
earning cash
3 Errors opening file (txt)
Links

But srsly.. just stop programming for a while and draw out a model. It doesn't have to be in any standard or whatever. Just visualize the relationships that programs need. Think of cruise server type events (whatever those are, don't ask) that you could handle, think of the InSim events that you would need to make the cruise events work, think of the commands you would need, think of where you're going to store all this, think of the children, us and your poor computer! Once you show us a decent model, maybe one of us will write some psuedo code to help.. maybe..
Stuff
S2 licensed
Ahh yes. the lfsSMX_ things are structs I defined based on the SMX.txt. They are:


struct lfsSMX_HEADER {
char LFSSMX[6];
unsigned char game_version, game_revision, SMX_version;
unsigned char dimensions, resolution, vertex_colours;
char spare1[4];
char track[32];
unsigned char ground_col[3];
char spare2[9];
int num_objects;
};

struct lfsSMX_OBJECT {
int X, Y, Z, radius;
int num_points, num_tris;
};

struct lfsSMX_POINT {
int X, Y, Z;
unsigned char colour[4];
};

struct lfsSMX_TRIANGLE {
unsigned short vertex_A, vertex_B, vertex_C, spare;
};

About the only thing they do is make reading the file easier. Instead of reading individual chars, ints, etc, it reads into those structs making it easier to manage imo.

For your code, I see you define some big (3000) integer arrays for your points that are not necessary. 3000 * 4 = 12000 bytes of memory a piece.. In a quick test on Blackwood, the max number of points any single object has is 660, so 3000 is a waste that may be slowing you down a bit. On the other hand, redefining the array for every object may slow you down too. Hmm, a quick test will help solve which is faster. It all depends..

Overall, our programs are very similar. I do see your program is technically 3D however. Perspective changes accordingly. You should use an orthographic view if you want a true 2D render. And yeah, your depth/z buffer is a little screwy. Mine is too I think but it gets better once zoomed in. Check out the oval building near the Blackwood pits for a good example.

Also for comparison, I attached what I have so far too. To use, create a folder named 'smx' or 'smxU' along side the .exe, move/copy the smx files inside those, then run it. If the smx are found, you will see a list of buttons on the right to open one. Use w, a, s, d respectively to move around, right mouse button to rotate, mousewheel to zoom, left and right to roll, up and down to adjust fov, space to toggle the overlay, o to toggle a world origin thing. The movement is all keyboard event based so its not smooth. I still need to implement some threaded animation code for that.

Have fun with it! I am
Stuff
S2 licensed
Good luck with the wld folder. The smx is hard enough!
Yeah, I too get those white spots. They vary though depending on camera position of course as they are just rendering artifacts where some triangles dont exactly touch because of the crazy math. A small bit of anti-aliasing should fix it. I have not tried that though. I use C/C++ and OpenGL so my loading times are pretty quick. Blackwood takes no longer than a second to open for me. AMD 2600+, 1gb, Radeon 9800 Pro. Below is the code I use, might help.. (C++, OpenGL, include stdio.h, no fread checks yet)


FILE *file;
file = fopen(filename_, "rb");
if (file == NULL) {
open_ = false;
// TODO: raise error, could not open
} else {
lfsSMX_HEADER smxHeader;
fread(&smxHeader, sizeof(lfsSMX_HEADER), 1, file);

glBegin(GL_TRIANGLES);
for (int i = 1; i <= smxHeader.num_objects; i++) {
lfsSMX_OBJECT smxObject;
fread(&smxObject, sizeof(lfsSMX_OBJECT), 1, file);

// store object points for use below when we get the triangles
lfsSMX_POINT smxPoints[smxObject.num_points];
fread(smxPoints, sizeof(lfsSMX_POINT), smxObject.num_points, file);

// easy to adjust opacity
int alpha = 255;

// read all the triangles for this object
for (int j = 1; j <= smxObject.num_tris; j++) {
lfsSMX_TRIANGLE smxTriangle;
fread(&smxTriangle, sizeof(lfsSMX_TRIANGLE), 1, file);

glColor4ub(smxPoints[smxTriangle.vertex_A].colour[2], smxPoints[smxTriangle.vertex_A].colour[1], smxPoints[smxTriangle.vertex_A].colour[0], alpha);
glVertex3i(smxPoints[smxTriangle.vertex_A].X, smxPoints[smxTriangle.vertex_A].Y, smxPoints[smxTriangle.vertex_A].Z);
glColor4ub(smxPoints[smxTriangle.vertex_B].colour[2], smxPoints[smxTriangle.vertex_B].colour[1], smxPoints[smxTriangle.vertex_B].colour[0], alpha);
glVertex3i(smxPoints[smxTriangle.vertex_B].X, smxPoints[smxTriangle.vertex_B].Y, smxPoints[smxTriangle.vertex_B].Z);
glColor4ub(smxPoints[smxTriangle.vertex_C].colour[2], smxPoints[smxTriangle.vertex_C].colour[1], smxPoints[smxTriangle.vertex_C].colour[0], alpha);
glVertex3i(smxPoints[smxTriangle.vertex_C].X, smxPoints[smxTriangle.vertex_C].Y, smxPoints[smxTriangle.vertex_C].Z);
}
}
glEnd();

open_ = true;
}

Last edited by Stuff, .
Stuff
S2 licensed
That looks fine to me.. except for the colors I think. Here is a comparison to mine in the attachment. To fix the colors, swap your red and blue colors. Don't know why, but it works.
Oh! To get the results Scawen has in that thread, you would have to add all the objects that are not included in the smx and texture them all. Not really plausible imo.
Last edited by Stuff, . Reason : oh!
Stuff
S2 licensed
Very nice! Although they are a little lower in resolution than I use in LYTe, they're still more accurate and look a lot better. I will definitely try to use them in my new version. Thanks a ton(ne)!
FGED GREDG RDFGDR GSFDG