Author Topic: Bliss / Cas-Stunts track editor  (Read 5682 times)

Cas

  • Stunts Master
  • *
  • Posts: 160
    • View Profile
    • Dimioca Labs
Re: Cas-Stunts track editor
« Reply #75 on: September 29, 2016, 01:11:35 AM »
Quote
by "toolkit" I just meant "whatever it is in the FreeBasic infrastructure that allows you to draw things on screen"

Yeah, it's difficult not to use these terms today :P  Both "toolkit" and "SDK" sound like a different paradigm. It's like saying "folder" instead of "directory"... makes no harm, but we Linux users see a warning sign come up when we hear that word and wonder if maybe the guy assuming we're talking about Windows. I used to do all the blitting in assembly, but FreeBasic really does have very powerful primitives and for 2D, most of the time, it's not necessary to get that deep... and I like the fact that anybody can compile my source with just FreeBasic and no more requirements.

*  I've added shortcuts for everything. You'll see that in the next update. There's even one for transitions, but although you can use that, I have the feeling that it'll be more comfortable getting used to using the link shortcut, because the transition one requires that you press it again and again until you find the transition you're looking for. And about ramps, no, they have a shortcut of their own. What I mean is that ramps can easily be produced with the link shortcut most of the time.

I'm thinking it is still worth trying to implement the keyboard editing style I told you about before.

Quote
[...] so that simply adding the relevant web address would be enough for the program to do the proper thing, right?

Yes, that's my idea. If the tournament is ZakStunts, Cas-Stunts will parse the HTML. If it's any other, it will look for specific text-based configuration files from where it will get the info to do the same thing, so any tournament can implement that "protocol" easily without having to display a particular appearance. Downloading the current track from ZakStunts using Cas-Stunts can be more convenient than doing it from the website, because Cas-Stunts won't automatically save it to disk, but will just load it into memory and allow you to save it wherever you want, which by default, will be the directory you set in the configuration (probably Stunts' directory). Besides, Cas-Stunts gets the track title and author's name from the site and you can store that in your format of preference. On the other hand, the scoreboard is just a gadget and it will always be more comfortable to check it on the website, which also allows communication and navigation.
Earth is my country. Science is my religion.

Duplode

  • Moderator
  • Considering trying out spam
  • *****
  • Posts: 3410
  • Through the astral door - to soar
    • View Profile
    • The Southern Cross Stunts Trophy
Re: Cas-Stunts track editor
« Reply #76 on: September 29, 2016, 02:34:43 AM »
I'm thinking it is still worth trying to implement the keyboard editing style I told you about before.

Oh yes, that plan about a smart TAB brush! Am I right in suspecting that, at this point, it would be essentially an extension of the "link tiles" feature, powered up by the individual shortcuts? Suspending practical concerns for a moment, I'm imagining the following sort of behaviour, with examples in increasing order of trickiness:
  • Let's say you have the brush activated. You press "RIGHT" two times, so that it lays down a west-to-east straight.
  • As in the normal editing mode, you can switch materials at any point with "M".
  • Then, you press "L", and given the track continuity it automatically picks a loop with west-to-east orientation.
  • Next, you press "H" to place a chicane, and it cycles between the two east-to-west chicanes.
  • Following that, you press "A", and it automatically picks one of the two appropriate banked road transitions, and then it switches to the straight banked road which fits for the next tile.
  • Finally, you press "DOWN", which should change the direction of the track by inserting a right banked corner... but what if you had picked the wrong banked road orientation for placing a right turn? The alternatives would be doing nothing (forcing you to go back and redo the banked road segment), mirroring the previous banked road segment (which might not work if there is another banked corner in it) or simply inserting two banked roads transitions so that the banking is mirrored going forward (which is arguably a little too magical, and is less likely to be what you actually want to do).
  • As an alternative for banked road introduction and other similar cases, using "Z" for cycling between valid 1x1 continuations, in the spirit of the regular "link tiles" feature, might work nicely too.
(Do note that this whole vision is clearly biased towards the suggestions I made in the previous post. Reinterpret it as you see fit  :))
« Last Edit: September 29, 2016, 02:55:24 AM by Duplode »

Cas

  • Stunts Master
  • *
  • Posts: 160
    • View Profile
    • Dimioca Labs
Re: Cas-Stunts track editor
« Reply #77 on: September 29, 2016, 04:33:11 AM »
It's more or less like that, what I had been thinking. Although there are some differences, the spirit is the same and it still have some difficulties. I'll describe me vision, more or less:

  • You activate this mode while sitting at a spot with the keyboard cursor, which is understood like you're going to create a path starting from that tile. If the tile is empty, a straighway will be created on next move in the direction you move
  • Arrows will not turn, but instead, they will try to continue the road in the absolute direction of the arrow. When you press the arrow in the direction you came from, the last tile will be deleted and the cursor will move to the previous position. If it were not possible to move in the direction you request, nothing will happen. Say you're standing at North-to-South straighway and activate the mode, then hit the right arrow key; a split will be created
  • Upon pressing an arrow or a shortcut (such as L), Cas-Stunts will pick one of the tiles such that it properly connects with the previous tile. If there is more than one possibility, the first available one will be inserted immediately and you'll be left at the next position. A key will allow you to switch to alternatives for the previously inserted tile, which will sometimes modify the resulting position, like in the case of the chicane
  • The grid will not really be modified as you generate the path. This path will actually be stored in a separate sequential buffer and on each move, it will be rendered on top of the current grid, meaning that going back will restore the previous contents of the grid and advancing on top of other elements can cause combination or jumping over. You can just hit ESC and the whole path will be cancelled
  • When you attempt to insert a tile which is not compatible with the last tile, Cas-Stunts will try to find a suitable transition. As you underlined, some transitions cannot be made on one step (banked road from one side to other or bank road to elevated road), but in those cases, I can see there is one very simple solution, which I will explain below, because it requires some Cas-Stunts-internal specifics

Alright. Here are the specifics. When following a path to check a track or when finding transitions, what Cas-Stunts does currently is keeping a database of the characteristics of each tile. One of these characteristics is the connector type in each of the four directions. Connector type 1 is that of paved, dirt and icy roads. Connector type 0 stands for no connector. Connector type 2, for example, means elevated road. A ramp is a tile element that has a type-1 connector on one end and a type-2 connector on the opposite one, the other two connectors being type-0. Banked roads have two connector types: on for right-handed banked road and another for left-handed banked road. The catch is that there always exists a transition (i.e.: a tile with two opposed connectors of different types and the other two being type-0) that has a type-1 connector on one end and any other connector type you want at the opposite end. This means you can create a combined connector very easily. First check if a simple connector exists. If it does, insert it. If it does not, create a simple transition to type-1 followed by a simple transition from type-1 to the new type. This way, it no longer sounds that magical :)
Earth is my country. Science is my religion.

Duplode

  • Moderator
  • Considering trying out spam
  • *****
  • Posts: 3410
  • Through the astral door - to soar
    • View Profile
    • The Southern Cross Stunts Trophy
Re: Cas-Stunts track editor
« Reply #78 on: September 29, 2016, 06:54:14 AM »
Arrows will not turn, but instead, they will try to continue the road in the absolute direction of the arrow. When you press the arrow in the direction you came from, the last tile will be deleted and the cursor will move to the previous position. If it were not possible to move in the direction you request, nothing will happen. Say you're standing at North-to-South straighway and activate the mode, then hit the right arrow key; a split will be created

...so that the arrow keys always create straights, regardless of context. It does makes sense.

Upon pressing an arrow or a shortcut (such as L), Cas-Stunts will pick one of the tiles such that it properly connects with the previous tile. If there is more than one possibility, the first available one will be inserted immediately and you'll be left at the next position. A key will allow you to switch to alternatives for the previously inserted tile, which will sometimes modify the resulting position, like in the case of the chicane

I like this way of doing it too -- it makes the command set more orthogonal. For corners, would that mean pressing the corner button would insert, say, a right turn, and then the switch button would flip it into a left turn?

You can just hit ESC and the whole path will be cancelled

That is a welcome feature. (I'm now thinking of the times I accidentally wrecked a track with the TAB brush in TrackBlaster :D)

Cas

  • Stunts Master
  • *
  • Posts: 160
    • View Profile
    • Dimioca Labs
Re: Cas-Stunts track editor
« Reply #79 on: September 29, 2016, 07:11:20 AM »
Pressing an arrow would create a straightway or turn depending on where you press it. Say you start and go up, so you get a vertical straightway. You continue to press up several times and the straightway gets longer. The keyboard cursor stays not where you just placed a tile, but where you're going to place the next tile. So now you press the right arrow. What happens is a corner from South to East appears where you were standing and now you're standing to the right of the corner. If you continue to press right, you'll get straightways. So the alternating shortcut key would not change the direction of turns, but rather, for example, whether the turn is large or sharp.

Now, saying all this is already complicated, you see. Imagine what it is like to code it! :D
Earth is my country. Science is my religion.

Cas

  • Stunts Master
  • *
  • Posts: 160
    • View Profile
    • Dimioca Labs
Re: Cas-Stunts track editor
« Reply #80 on: October 05, 2016, 09:11:18 AM »
New update... almost finishing...

Officially, the name of the editor is changed from Cas-Stunts to Bliss and this version can almost be considered complete!

Bliss 2.4.4 beta
Download this latest version

Lots of new features and bug fixes!

Most important features and bug fixes:
  • Shortcuts for all track elements!  Also, press the space bar and start typing the name of an item to find it quickly
  • An internal registry recognises original tracks
  • Raw format, plus fixes in the way the other two formats are handled. Bliss will always first try to find an overlay, then fall back to a companion file
  • ENTER on selection has been enhanced to support more types of closed-circuit and can be used to fill a region with scenery
  • Selecting a region with the keyboard is now possible!
  • Coordinates for the keyboard cursor
  • New documentation
  • Deleting a selected region with DEL can be configured to modify only track, only terrain or both, like cutting and pasting
  • Some conflicts regarding undoing and redoing in some situations were corrected
  • Companion flies for split format were being searched for at the home directory instead of at the directory where the track file is

I would say the most worked-on area in this update has been keyboard-based editing, but there are many "invisible things" that have been enhanced or fixed. Hope you guys like it. This is likely the last update before the final, stable version. I consider this one already very stable. If you guys find anything that's really important to change or add, this is the best moment to come up with it :)
Earth is my country. Science is my religion.

dreadnaut

  • Helen`s Lover
  • **
  • Posts: 613
    • View Profile
    • chezDreadnaut
Re: Cas-Stunts track editor
« Reply #81 on: October 06, 2016, 10:26:23 PM »
If the tournament is ZakStunts, Cas-Stunts will parse the HTML. If it's any other, it will look for specific text-based configuration files from where it will get the info to do the same thing, so any tournament can implement that "protocol" easily without having to display a particular appearance.

You can also use the current track data from here: http://zak.stunts.hu/track.json

Cas

  • Stunts Master
  • *
  • Posts: 160
    • View Profile
    • Dimioca Labs
Re: Bliss / Cas-Stunts track editor
« Reply #82 on: October 06, 2016, 11:10:01 PM »
Thanks, Dreadnaut!  I didn't know that one. It certainly is a lot simpler than the HTML. Only parsing the paths would be more complicated, but since that is a constant, I wouldn't need to do that part.

Is this file always present and does it always point to the current track?  If you ever make changes to the website (which could break Bliss parsing the HTML), will this file still have the same structure, so I can rely on it instead of the HTML?

If I would ever not be present to update Bliss and you would need to make changes to the site that would break the communication between Bliss and ZakStunts, you can still use "Bliss Tournament Protocol", like it's described in the manual.txt file. Instead of entering zak.stunts.hu for the link (which would result in Bliss trying to parse the HTML, or json, if I update it), enter btp:zak.stunts.hu and it will use BTP like it were any other tournament site.
Earth is my country. Science is my religion.

dreadnaut

  • Helen`s Lover
  • **
  • Posts: 613
    • View Profile
    • chezDreadnaut
Re: Bliss / Cas-Stunts track editor
« Reply #83 on: October 07, 2016, 10:54:12 AM »
Is this file always present and does it always point to the current track?  If you ever make changes to the website (which could break Bliss parsing the HTML), will this file still have the same structure, so I can rely on it instead of the HTML?

You can consider the json schema fixed. Any changes will be backward compatible. The file is always up to date, a similar one was there for USC as well, and is used to show races on http://stunts.hu

Cas

  • Stunts Master
  • *
  • Posts: 160
    • View Profile
    • Dimioca Labs
Re: Bliss / Cas-Stunts track editor
« Reply #84 on: October 09, 2016, 09:23:40 PM »
I'll switch to reading that file instead, then, so that any future HTML updates on the site won't break communication with Bliss :)
Earth is my country. Science is my religion.

Cas

  • Stunts Master
  • *
  • Posts: 160
    • View Profile
    • Dimioca Labs
Bliss 2.5 - final version
« Reply #85 on: December 22, 2016, 03:57:45 AM »
Hi, guys. I'm here announcing that we can now consider Bliss to be complete, although some bugs might be detected in the future, that I would have no problem to fix and maybe some feature would become important one day and requested, but other than that, it already does all it has to do. You can download the latest, final version from here:

http://www.dimioca.com/bliss

I would suggest that you guys download it and keep the zip file and if you can also replicate it to your sites, to have an alternative download source, it would be even better, in case my server would ever fail. Following are some changes you're going to find in this final version:

  • Time estimates are now based on the results of the Race for Immortality event held in October and November of this year
  • It is now possible for a user to calibrate with any track, not just 4am.trk
  • Bliss.trk and napalm.trk are now also included. Replays from R4I are, too, built-in in a subdirectory
  • Bliss is now free software under the GPLv3. You can take a look at the source code if you wish
  • Shortcut keys now try to follow the path being drawn
  • You can still select a track element by pressing space and typing, but now what's being typed is highlighted in the panel
  • Background landscape images have been replaced with public-domain landscape graphics
  • There were a couple of bugs, one regarding cutting with the mouse and another having to do with scenery generation, both fixed

Thank you all guys for your support on this project and special thanks go to Duplode, for his amazing feedback!
Earth is my country. Science is my religion.

Duplode

  • Moderator
  • Considering trying out spam
  • *****
  • Posts: 3410
  • Through the astral door - to soar
    • View Profile
    • The Southern Cross Stunts Trophy
Re: Bliss / Cas-Stunts track editor
« Reply #86 on: December 23, 2016, 04:15:28 AM »
Downloaded! I will upload it to Southern Cross in the next few days, possibly tomorrow. Congratulations for the final release  :)

Cas

  • Stunts Master
  • *
  • Posts: 160
    • View Profile
    • Dimioca Labs
Re: Bliss / Cas-Stunts track editor
« Reply #87 on: May 17, 2017, 03:08:48 AM »
My goodness!  Duplode's was the last message in the Stunts Related Programs subforum till now!  And it was in December... Anyway...
Just wanted to tell you guys I've made a few touches to Bliss in the last months and I thought I should by now update the program as it's published. You can download the latest version (Bliss 2.5.2) from here: http://www.dimioca.com/bliss

It's just a couple of bug fixes and two simple features:
- You can now set a "Stunts directory" and a "Tracks directory" for more comfortable access. If you feel comfortable editing the configuration file, you can also add your own extra directory links there by following the instructions in the manual, but the two I mentioned can also be modified from the Settings menu.
- Although Bliss is a portable project, you can, if you prefer, move the executable to a protected location so that it cannot be written to by other programs (protection from trojans). Bliss will try to find its data files at /home/user/bliss or /home/user/.bliss for GNU/Linux or %appdata%\bliss for Windows or follow the PATH for DOS. Only if not found there, it will try to locate them at the executable directory.
« Last Edit: May 20, 2017, 09:50:12 PM by Cas »
Earth is my country. Science is my religion.

arturbmallmann

  • Stunts Fan
  • *
  • Posts: 13
    • View Profile
Re: Bliss / Cas-Stunts track editor
« Reply #88 on: May 18, 2017, 11:21:20 PM »
Good improvements! :)

Cas

  • Stunts Master
  • *
  • Posts: 160
    • View Profile
    • Dimioca Labs
Re: Bliss / Cas-Stunts track editor
« Reply #89 on: May 20, 2017, 09:50:46 PM »
Thanks. If you see anything acting up, just let me know.
Earth is my country. Science is my religion.