📜 ⬆️ ⬇️

The history of the creation of a torrent render for 3ds max



Hello everyone, I want to tell Habra about one unusual network service and the process of its development. But first, a few words about me directly - I’m an application programmer for MAXScript (this is a scripting language embedded in 3ds max), and 3ds max is one of the most popular packages for creating various 3d graphics and in it, of course, there is such a thing as rendering, for which everything was actually written below.

Idea


The process began with one idea that came to my mind quite suddenly late at night on November 30, 2010 and spilled out the following day into such a post on the 3dcenter.ru forum:
12/01/2010 12:49 PM
This thought came to mind and not climbs. I want to discuss with the community the usefulness and feasibility. I’ll omit the main part of the technical details, but it’s quite realistic to do this either as a plug-in (SDK) or even a script (MAXScript).
So, the point is to use other people's computers for rendering your scenes for free (or not). There is a rating system, i.e. you can’t render your own for a long time (“download”), but not render someone else’s (“distribute”). For those who are afraid that his scenes or textures will be used by bad people, protection is provided - the coordinates of all objects of the scene are initially zeroed, the correct coordinates are encrypted and transferred to the render as a separate file, the textures are broken into small squares and are collected into the same one just before the render . The display of the visualization itself (VFB) can be disabled, i.e. the person does not even see that he is rendering. Similar actions occur after the render - the image is automatically broken into pieces (or the pixels are simply mixed up according to some law) and can be correctly assembled only on the side of the author of the scene. For altruists, it is possible to disable protection, i.e. the junk scene is freely available. The protection may be different, and in general everything that I am writing is not fully thought out - only options.
...
Well, in general, somehow, I ask you not to throw tomatoes, and if I didn’t invent a bicycle, then we will discuss how viable this idea is.

Our community of 3D Schnics took the idea with enthusiasm, it turned out that it was already five years old, i.e. many similar thoughts occurred to me, of course there were skeptics who also doubted technical issues, and generally the feasibility of such a project in comparison with existing render farms and various services for remote rendering, but on a global scale no one succeeded prove that the service torrent rendering is technically impossible or will become useless when implemented. In short, in the course of a two-month forum discussion, Internet searches and research of various technical details, I came to the conclusion that everything is possible and necessary to do, and posted on the forum:
08/02/2011 22:11
I finally decided on the concept and dug out all the theory that I need in the process, I will not say the details, because decided to keep the implementation myself. Thank you all for participating.

Concept


The main conclusion I made in the research process is to learn PHP. At that time, my experience in network development was limited to my own simple HTML website plus a bit of css and javascript. And since PHP was the easiest and shortest way from zero to the server part of the project and was supported by all potential hosting providers, I decided to stop there and chose the classic Apache + PHP + MySQL bundle. In addition, it turned out that many torrent trackers (if not most) are also written in PHP, this fact has put the final point in the choice of technology.
')
Learning the basics of PHP and self-indulgence with home lokalkhost alternately with freelancing and fooling around lasted about a year and a half, during which time the general concept of service matured in my head definitively, which was what the post read:
09/22/2012, 19:53
development in the code has begun!

Implementation, First Phase: Connect


At the beginning of the implementation, everything went pretty smoothly, I created the first version of the client base, adapted several PHP training lessons on the registration scripts for myself and created a connection directly from 3ds max to the MySQL base via a PHP script. Technically, all this works as follows - the client, written in MAXScript, works inside 3ds max and sends using dotnet (the max script with the dotnet is very good friends) various http-requests with POST queries to the server-side PHP script, which is already connected to the database, adds and modifies the data in it and issues echo or exit responses that are returned to the client for processing. For the user, it looked like this: after login from the client, the parameters of its node (version 3ds max, number of processor cores and gigabytes of memory) were automatically added to the database and posted on the Internet to the public on the page of registered nodes. All this was hung on offsite:
04/01/2013, 18:04
The project has an offsite: torrender.net

People began to register slowly, and I tightly engaged in the client part, namely the torrent files. It was decided to give scene files and render results in password-protected WinRAR archives, I already had experience managing winrar from a max script via the command line, but it turned out to be more difficult with torrents, since the max script to create a torrent file was unreal (and if real, it was very slow), but you can't say that I didn’t try, I just rather quickly gave up on this idea. Fortunately, we managed to download the mktorrent program, which, like Winrar, was controlled by a max script from the command line and made torrent files from the archives as an automatic machine. Finally I got it to the tracker.

Implementation, second phase: TBdev


In search of a suitable tracker, I had to google quite a lot, I stopped at TBdev again because of the simplicity, popularity and availability of information on the Internet on various issues:
04/17/2013 07:51
I fasten the tracker, registration is stopped, login does not work for anyone.

And here I was waiting for a global catch, because TBdev had its own database and it was easier to add my tables to it than to shovel the entire tracker engine together with the anounser, since distribution of torrents tracker is just what I myself would not do:
04/24/2013 14:03
There are two news, good and bad.
Good - the tracker is screwed, distributions and downloads - everything works. I finish the remnants of the lich, the base of the tracker and begin to make seeds.
Bad - you all have to re-register. Then I will say where and when.

Finally, a bunch of client-tracker earned as it should, i.e. the user loads the scene, and then the client works and automatically does the following things:
  1. Creates a winrar archive
  2. Creates a torrent file for the archive
  3. Uploads a torrent file to the tracker
  4. Unloads the same torrent file from the tracker, but with a user-defined passkey
  5. Puts a torrent file for distribution in uTorrent (also controlled by the command line)

Implementation, third phase: alpha release


After the second phase, my enthusiasm subsided a bit and I broke off with the project for more than six months, I had to earn money, all sorts of freelancing orders had fallen, in short, there was a pause in the torrenter, which I still regret. But nevertheless, after some time I again leaned on the torrender and released alpha, despite the fact that TBdev podgadil me a little base:
02/19/2014 01:18
WORKING ALPHA RELEASE!
The client is updated, download there.

Render-lich is available - you can create "Jobs", i.e. render tasks, upload them to the server and receive render results from other users
Render-cider is available - you can go to the Render Seed tab and click the Find Job button to download and render the job from other users, and then send the results to the person
All the details in the readme

And also, there is not very good news. It turns out there was an installation in the tracker - delete inactive users a month later offline, so the entire user base was dropped, except for the last two lucky ones, so most will have to overload.
I apologize for this moment, but it was impossible to learn in advance about this setting.

The final


After alpha, I didn’t release the project from myself, it was beta, then the client’s release with the already added rating system, and now the development is slowly continuing towards improving the service, users are slowly but surely registered, the nodes are added to the database and no one knows ...

Source: https://habr.com/ru/post/216609/


All Articles