[phpBB Debug] PHP Notice: in file /viewtopic.php on line 969: Use of undefined constant gu - assumed 'gu' (this will throw an Error in a future version of PHP)
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 969: Use of undefined constant personal_album_id - assumed 'personal_album_id' (this will throw an Error in a future version of PHP)
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 969: Use of undefined constant gu - assumed 'gu' (this will throw an Error in a future version of PHP)
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 969: Use of undefined constant user_images - assumed 'user_images' (this will throw an Error in a future version of PHP)
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4519: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3716)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4521: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3716)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4522: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3716)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4523: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3716)
Speed Dreams Community • View topic - Creating a track renderer/editor in HTML/JS

Creating a track renderer/editor in HTML/JS

Use this forum to report bugs or ask for help

Moderator: kilo

Creating a track renderer/editor in HTML/JS

Postby josepedrodias » Mon May 22, 2017 1:05 am

I got really frustrated with the existing editor (bundled with torcs, in Java).

Ended up wanting to create a better one.
So far I managed to render tracks to canvas. They're mostly correct but due to what I presume are rounding or interpolation errors, they don't quite close right.
Starting to sketch the editor itself but that's 10% at most.

Wanted to say hello and let you know about my little effort and gather any feedback - do you find this relevant? Am I missing a much better editor? Is this the better way to reach the developers? Cheers!

current demo (focus on the viewer for now, ignore the editor for the time being, just started the GUI forms):
https://josepedrodias.github.io/torcs-t ... index.html

source code:
https://github.com/JosePedroDias/torcs-track-editor

P.S. - testing in Chrome with some ES5/6 features wo/ babel. May break on some browsers.
josepedrodias
 
Posts: 3
Joined: Mon May 22, 2017 12:53 am

Re: Creating a track renderer/editor in HTML/JS

Postby madbad » Wed May 24, 2017 7:25 pm

Hi Josep,
really interesting project.
We really need a better editor, and I think web technologies are perfect for this kind of work.

I've tried, in a similar way, to to render track maps on canvas with javascript and I found similar issues: with some track the start and end did not align preperly (honestly I didn't put much effort in my attempt)

Test1
Image

Test2
Image
User avatar
madbad
 
Posts: 119
Joined: Sat Jan 22, 2011 3:45 pm

Re: Creating a track renderer/editor in HTML/JS

Postby josepedrodias » Thu May 25, 2017 1:55 am

The editor is taking shape:

https://josepedrodias.github.io/torcs-t ... almela.xml


It would be great if anyone with knowledge on the implementation internals to take a look at my interpretation on the curve segments, both in abstract:

https://github.com/JosePedroDias/torcs- ... ndering.md

and on code:

https://github.com/JosePedroDias/torcs- ... le.js#L101


I'll eventually take a look at the tooling source code myself but it will take me much longer to figure it out without guidance.
josepedrodias
 
Posts: 3
Joined: Mon May 22, 2017 12:53 am

Re: Creating a track renderer/editor in HTML/JS

Postby simon-2 » Sun Jun 11, 2017 11:19 am

hi,

i guess you are struggling with the clothoid segments (rStart ≠ rEnd)?
i also had this problem when implementing a "split segment" function to the old (java) editor; but solved it *. You need to "copy" the original algorithm for creating curves from the SD sources (or from the java editor). There is one (or two?) loops run before creation of the final segment to sum up lengths and/or angles of the profile steps (within a segment) and determine a compensation factor. When figuring this out, i made a spreadsheet to check if i got it right; i will have a look if i can still find this.

Else, is the folder to search for it.

regards

*sorry for not sharing this up to now...
simon-2
 
Posts: 90
Joined: Thu Jan 29, 2015 3:01 pm

Re: Creating a track renderer/editor in HTML/JS

Postby simon-2 » Sun Jun 11, 2017 1:39 pm

argh... i found the spreadsheet, but this forum does not allow spreadsheet attachments and dropbox has no public folders any longer..?? But you could send me a pm with your mail adress. For the extended java-editor with split-segment functionality, i will try to upload it somewhere else...

btw: i really like the attempt of creating a new editor, as the old one is... in need of heavy improvement :lol: but i have seen/heard of at least three such attempts within the last 2-3 years, none of them bringin up a result with better/more functionality than the "old" one, yet. i don't want to discourage you, but i think creating a really good editor is much more than chaining segments. Imho, the old editor offers a good base structure (maybe outdated, but still doing its job) with the most important functionality, and it might be less work to fix the issues and add missing functionality to this one than to code a completely new one from scratch (unless you want to do a "next generation" full 3d-editor with integrated terrain and scenery modeling, directly exporting an acc-file without the intermediate step via trackgen).

any way- good luck; and i'd love to see a better editor :)
simon-2
 
Posts: 90
Joined: Thu Jan 29, 2015 3:01 pm

Re: Creating a track renderer/editor in HTML/JS

Postby josepedrodias » Fri Jun 16, 2017 12:43 am

Thank you for your feedback. I'm quite new to Torcs/SD too in general, not only track editing. I found it fun to hack the format and most things are kind-of self explanatory in the format. Anyhow there should be a comprehensive reference on it all. The biggest problem for me have been curves with two radii - my results don't match trackgen's. The feedback from trackgen 1st and the game 2nd when a track has design problems aren't much help either.

My Palmela track, for instance - I ended up not using 2 radii curves to bypass that problem. My debugging process was by running it through trackgen and opening the resulting mesh on blender. It's mostly ok there but SD hangs running it...

I haven't really commit to creating a full editor. Wasn't intending to replace any endeavor, just try to author a track or two. Anyway it's good to have alternatives, particularly if they're compatible. Besides, if my tooling work ends up being relevant I'm sure it can be picked up by other people.

I'm sending you my email address so you can upload any helpful info regarding track parsing and whatnot. Cheers.
josepedrodias
 
Posts: 3
Joined: Mon May 22, 2017 12:53 am


Return to Problems, Fixes & Help

Who is online

Users browsing this forum: Google [Bot] and 17 guests