The online racing simulator
Comments on Psyinsim Tutorial...
I didn't want to pollute an otherwise excellent threads with some comments, so I put them out separately.

That's the point of APIs. Just like Pyinsim, it is to gloss over the minute details and allow you to do things without need to know those things.

The beauty of folks like sdether is that they donated such APIs in open source format. So you can go and study their code, see how it works, learn not only InSim but in a lot of cases some new tricks and even how things differ between C#, Java, Python, etc. when attempting to do the same things.

Take for example (I use sdether's because I use it). I original built one of the first C# APIs when Scawen first rolled out InSim (see those discussions concerning new packets way back when). I did it one way (i.e. avoiding events) and sdether did it another way (using events), but he did have a nice trick of marshalling the structures for the InSim packets. I hadn't originally thought of that and was a nice trick to have learned by reviewing the codebase.

No sense doing the exact same thing over again and again for each app. And there is a fine line. Do you have the time to invest? Do you need to learn or want to learn? Or do you just want to write your app?

But on the flip side, if you want to truly learn, yes you need to do it yourself from scratch. With InSim that means learning something about programming network connections (dealing with sockets, ports, packets, etc.) and translating the InSim packets from/to the raw bytes of the structures.

Quote :
Of course, there are the big API's, such as LFS_External, and while these are great, they tend to gloss over a lot of the details, and try to shield you from the way that InSim actually works. Although you can make cool apps with those tools, you can't really learn InSim from them. For someone like me, who likes to get into the meat of something and really figure it all out, this isn't much use.

Thats always a valuable idea. I do this constantly... PHP apps, ASP.NET MVC based apps, Linq based apps, various Java based stuff. If new (or aspiring programmers) take one thing to heart in the well written tutorial, it is to strike out on your own and experiment. Even if you don't complete an full InSim API (or whatever else you research, i.e graphics engines, networking libraries, etc.) you at least learn something whether it be new techniques, APIs, etc.

Quote :
So a little while ago I created a small InSim module for Python. The idea behind this was, first of all, to explore Python as a language, for my own interest

Point blank, no. There are several misleading comments in this block that really set my teeth on edge.

The only thing closer to the underlying architecture of InSim would be a C or C++ library.

Python is NOT far better suited to writing InSim apps. It is only one of a multitude different ways of doing things. Is it better than C# or Java (which are based on the C paradigm)? Not in general no. Is it for someone who is proficient with Python? Sure. Can Python be easier to learn? Maybe, but in a lot of ways its no different than .NET or Java programming either (same imports, same try/catch/fetch, same define functionality [i.e. methods, functions, procedures]).

The fact that you sullied an otherwise good article with opinions/comments such as these is really quite unfortunate.

Quote :
But also to create an InSim API that was much closer to the underlying architecture. I wanted something that would be easy to use, but that wouldn't be an excuse for not understanding how it all really worked. Pyinsim was intended to be a vehicle to help you learn how InSim really operates. Now, whether I was successful or not, I have no idea, but I still think Pyinsim is a great little tool, and that Python is far better suited to writing InSim apps than C# or Java. You may disagree, but I stand firm.

Thanks for your comments. I've removed that bit from the tutorial now. I just wanted to explain why I was doing what I was doing, but I guess it didn't come across in the way I had intended. Sorry to have set your teeth on edge.

FGED GREDG RDFGDR GSFDG