ningx added HTTP 1.1 support for proxy_* directives in 1.1, so as long as you're on that or newer it should just work out of the box. If it's older than 1.1 I believe you need to look at just using a raw tcp proxy, which can be done with one of the nginx modules - I've not tried socket.io reverse proxying with older versions tbh.
Meh, I supposed the cheats way would be to use css to rotate the SVG element
I've added issues to github for your 2 things, that way I don't forget like I did at the weekend I got distracted by shiny things :o
When you say it's using too much memory/cpu/disk, how much and specifically what? If you're running it on windows a perfmon log (with % Processor time, Working and Private Set of the nodejs instance), + xi4n log as a pair would be awesome If you're running Linux then can you run top in batch mode (top -b) and also output xi4n to a log file and send those over please? If I can figure out what part of it is eating memory or CPU time, that can hopefully be fixed. I suspect it's probably to do with how packets are thrown about, at a guess.
Only reason I'm asking is because I'm seeing xi4n top out at about 20MB before the GC kicks in...
As for using it with nginx, or any other web server, the easiest way is to reverse proxy from your frontend server to nodejs. As it is out of the box, it may need a little content re-writing by the HTTP server. For nginx you want to be looking at the proxy_* directives, and subs_filter_* for the rewriting.
Unfortunately this is all my fault Doh - sorry about that
All those packages are depended on by plugins, rather than the xi4n core - but at the moment they don't load from their own directories - it's something I'm going to be putting in a fix for soon
I see your point, and something I'd totally over looked. Hmmm...
Still appreciated though dude, thank you
Also thanks for your thoughts as well Kiyoshi It's appreciated - you're spot on with your scoring idea - Infact I've been working on something like that in the tv.js-priority branch on github - https://github.com/theangryang ... s-priority/plugins/tv2.js if you wanna check it out. It's far from complete
I will be honest the whole custom camera thing is something I want to work on next, which will fall into the whole track node weighting, but I've not got as much time to work on xi4n for the next few weeks Fecking work and family
A lot of stuff isn't in there yet, like distances.
You using this.insim.VIEW_CAM? Because of how the whole nodejs require stuff works, it's all namespaced and not really like a header definition like you'd get in C/PHP/whatever.
Interesting, what version of node are you on? You can it by running node --version.
More likely me missing some dependencies in the package.json Don't suppose you remember what you needed to install?
Patches, etc. welcome There are a couple of places where it really needs a tidy - but they all focus around https://github.com/theangryangel/XI4N/issues/9 and https://github.com/theangryangel/XI4N/issues/8 so I've not done the tidying yet Specifically the bits that are really nasty is the config handling and plugin loading Patches welcome if you wanna come and play though
As an FYI to anyone following, I've just rejigged how the plugins can sit in the plugins directory, so if you pull a new revision and it's all busted, that'll be why I've tried to make it so that the new style doesn't break the old style though
ArmaII was released in 2009. Earlier this week it jumped to the top of the Steam top sold list because of a mod. There was no sale, there was no special offer. People were paying full wack, for an "old" game, because of a mod. Like it or not, no one here should argue against LFS being in the same category of "old", and no one should make any bones about potential customers considering not wanting to invest time and money in LFS when they look at it's apparent age.
In a multi-player scenario, as long as the server determines what mods can be used, just like every other sane mod-able game in history, there's no reason to be worried about mods. If a mod becomes popular, awesome. If it doesnt those servers will die, and there will always be people who want to play LFS 'vanilla'.
ArmaII isn't by any stretch the only example here, but it is the most recent and most prevalent that I can think of in the last few months which directly puts money into the developers pocket - for near zero effort post release - obviously LFS needs work to permit mods right now, so thats not an applicable argument at the moment.
The argument for not allowing mods because the LFS developers want to be able to alter and rev the API at will? Who cares. Label it as perpetually unstable, make no guarantees to stability, and make it really really clear - if the modders don't understand that, then it's their own fault. The linux kernel internal APIs aren't necessarily guaranteed stable between minor releases - and it copes absolutely fine because there are no guarantees made of internal API stability.
Apparently I forgot to add password capabilities completely I'm about to head away for for work, working very long hours for the next 2 days (behind a restrictive firewall that I don't control - yet), but I'll do my best to get it added into the github repo shortly If you need to hack it in for now you can pop it into https://github.com/theangryang ... master/lib/client.js#L165
You could serve packets to any connecting browser, if a plugin setup a HTTP server - like the livemap plugin does Or you could send back packets to LFS, like you would with any other InSim application.
Basically xi4n itself just translates and event-ifies packets from LFS, and a plugin just receives those events from the xi4n core. A plugin doesn't have to talk to a browser, it can talk to anything it needs or wants to There's no restriction on what a plugin can do at the moment, so if nodejs itself can do it, so can a plugin - be it talking to a browser, storing chat in a database or talking to another insim program - you name it and it can do it
Hope thats a bit clearer? I will be honest the code is a little hacky still and needs a bit of a tidy when I've got stuff working in a reasonable way, so it may not be the easiest to follow right now.
Hadn't even noticed that existed. I shall experiment after work this evening :up:
Not sure if LFS puts out InSim packets whilst watching a replay, but I'll have a play one evening this week and figure it out
Totally makes sense, and again something I'd not considered. It'd need to go in after I've started messing about with custom cameras, but I don't see why not..
Oh wow, this has gotten more views than I expected Thank you for your time one and all, I do appreciate it
I intend on having a little GUI that allows you to stop the automatic hunting, etc. picking a vehicle and a view manually, but it's not written yet.
Definitely something it needs
I'm considering a counter that determines how many times a vehicle goes off track, if they hit a certain threshold per minute then start ignoring them. Thoughts on that?
Totally in the works
Ah sorry dude, I wasn't really looking at player names or chat Had I noticed I would've totally said hi
Hadn't considered something like that either - I'll see what works out on that front
Well I thought it was funny
Yeah that sort of thing it where it really falls down. At the moment it treats all events equally. I'm going to start looking at some sort of prioritisation and starting and ending event detection to help mitigate that.
It did look like you had room, but tbh the driver could've gone either way
Not sure if I'll be able to do transitions, but it'll be interesting to try
I did have that in an earlier version, however I often found that I was missing good overtakes back in the field. I'll reintroduce it with the newer event detection system and see how it goes :up:
Ooooh, now thats a cool idea Would be interesting to try that out
Totally, what sort of time is the single class on Saturdays?
Thanks for your input hp999. Thats one thing that annoyed me whilst filming it. You've correctly spotted that there is a "cooldown" to prevent rapid changes of camera angle - at the moment thats very very dumb. I've added a vehicle speed sensitivity factor to my todo list
Something I'll be playing with in more detail is trying to catch the start of a potential crash or interesting overtake much, much more quickly.
Again, thank you for your time hp999 - it is appreciated :up:
Those of you who frequent the programmers subforum may know I've been working every now and then on a project called xi4n. If you're not aware of it, in general terms its a client and server InSim program that does everything through plugins.
One of the main plugins I've been working on is the "TV Director". It's aim is to automatically pick the most interesting thing on track and present it to you. At the moment it is very dumb, but giving me good prototyping information.
What I'd like you to do, if you have a spare 10 minutes, is to watch the following video and give me feedback on the quality of the TV directing - rather than the actual race or the quality of the video.
I am aware of several issues with it, and as I say this is very much a first shot at something thats usable, but needs work - but before I go any further I want other spectator feedback so I can focus on not only what I find interesting, but other spectators find interesting.
Critique it just as you would a human being. I want to know when the program made a good decision, when it made a bad decision and any other general thoughts. During the whole filming I was completely hands off, it was all controlled through the program.
I do have plans for this to go a lot further, so custom camera positions, rather than the default ones, making it a lot more intelligent. This is very much a massive prototype right now Hope thats uber clear
I apologise for the quality of the video and audio, I'm very much learning what are the best settings to use when uploading to YouTube, in combination with LFS, recording and compression, etc..
Assuming you want it to work on layouts as well as "proper" tracks you could do it a couple of different ways. The two that immediately spring to my mind are as follows. There are probably more.
The simplest would be to probably consider the track as 2 2D overlapping polygons. One that has the bounding edge of the "outside" of the track. The second is the "inner" edge. You then just use a point-in-polygon algorithm to determine if its outside of the first polygon then it's off the track on the "outside". If it's inside the second polygon then it's off track, on the "inside". Edit: The problem with this is that it sucks at tracks with overlapping sections
An alternative would be to consider the track as a single path (Edit: Path not polygon), using the center or racing line as the path, and knowing the distance from each point to the 2 (Edit: or 4 if you wanted up, down, left and right of the path) edges of the track. At the start of the race/at load/whatever build and balance a tree structure using the path coordinates to minimize the number of points you need to search each time. Everytime you want to check you use the tree to get the closest point on the path, then calculate the direction and distance to the path point from the players current position. You then know if its on or off track from the direction and distance. A little harder, probably more work to maintain, but may be potentially quicker to do every second. Edit: The benefit is that you get 3 dimensions and it should work properly for overlapping tracks.
Correct The livemap plugin works pretty well underload - I've had a couple of thousand concurrent connections before there are CPU issues on a small VM.
The web client itself is a little hacky and could really benefit from being ported to use angular.js or backbone, or something similar, but it's totally usable as it is right now.
As an fyi I've not worked on anything that's in the github repo at the moment (the repo on my home network has a few additions that I've not pushed up), as I've been using my evenings for a work project for a few weeks, however I do have plans to continue with xi4n as I've got a couple of competition plans that totally rely on it
Edit: The video above is out of date, in terms of the look and number of bugs in the livemap plugin - aside from some codepage issues, it should be bug-free.
Edit: Updated video on the youtubes - regarding what I've done, some experimental in-browser 3D track stuff, web control panels and bonus rambling: http://www.youtube.com/watch?v=vuZly5agOkM
I'm sure PRISM's main loop could be fixed up so it's faster. Edit: See DarkTimes' post above.
However, on the threads subject:
There are no threads in PHP, but you could come up with a hack using pcntl_fork - if you're on a POSIX compliant platform with pcntl enabled - or if you're on windows you could emulate it if you have the com stuff compiled into PHP (probably). It would be tricky to come up with something that works on both POSIX and Windows without needing to be programmed differently.
The main issue you'd have is that you'd need to communicate between your main process and your child process. If it's POSIX only you could use shared memory. If you want it cross platform PRISM would need another socket for communicating with the child processes and your child process would need to pass stuff to the PRISM process to send to LFS (unless you were using UDP, instead of TCP to talk to LFS).
Based on the fact that this is allowed to happen, I'll assume the server doesn't run any physics at all. So an "easy" fix is that the server could be less dumb and actually run physics steps to make sure that the data from the client is completely trustworthy. It would make the server heavier, but worth it if cheating is a big issue.
The alternative is an insim client that performs the calculation steps based on the coordinate and time delta between 2 MCI compcar packets for a particular racer. Combine that with knowing what vehicle they're racing with (and knowing the maximum m/s for a particular vehicle) you've effectively got a very dumb, server side only, anti-cheat system.
You can go further, but you effective start implementing the LFS physics system.
Wouldn't have had you as a cruiser there MadCatX However, nice work, and interesting to see you running Arch(?) I guess you're intercepting the throttle axis information and modifying what LFS sees and using InSim to monitor? I'm afraid I'm not up on PIDs
So something I wished that I had realised much, much earlier on is the rather obvious fact that some of these ideas are only as good as the quality of your pth files - which for my purposes are sometimes appalling it turns out.
I'm aware of the solution, but this 'ere head to head is taking longer than I planned
Pretty much, but tbh I can't see a solution, so I'm with you on just shipping the PTH files with it tbh Sorry, I kinda dumped my brain out on that bit of the post and never went back to edit it before posting
Pretty much what I'm trying to solve with a pre-calculated KD tree of track points at the moment - on paper it should be quicker than finding and grouping for each player But, you never know - I'll mock something up and see if it really is faster - I'm notorious for cocking up math sometimes
From what I had tested it seemed to be worth while fiddling with some sort of tree, but it's really without actually having written a full tree implementation yet. Bear in mind I'm not planning on making a tree of racers, just points on the track and then finding their nearest known point on the track in order to group vehicles and then doing the logic from the groupings. I'm reasonably confident that can be fast enough to run every few seconds - after all you don't want the camera hopping about too much
I'm more interested in grouping vehicles and then focusing on the largest group, as stage 1 - then trying more complex things from there, plus it gives me a good option for chopping down the number of calcs for the *interesting* stuff pretty quickly I hope.
I'd dismissed something like this early on because I'm also interested in lapping vehicles (which I could get from IS_FLG I suppose) and much faster vehicles coming through the field after an accident/pit stop/whatever - I couldn't see a reasonable way of supporting this with little extra work at the time, which is why I'd landed on grouping using pseudo-"wide" nodes. However I've realised I've kinda missed the obvious..
However, I will be honest your idea has me interested.
I'll see if I can find the time for some rough prototyping and see what comes out in a head to head battle between the 4 ideas
Cheers for taking the time to respond guys, I really do appreciate it <3