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

Duplode

  • Moderator
  • Breaths Stunts
  • *****
  • Posts: 3600
  • Through the astral door - to soar
    • View Profile
    • The Southern Cross Stunts Trophy
Re: Cas-Stunts track editor (ex "Introducing my....")
« Reply #45 on: August 10, 2016, 12:09:13 AM »
Excellent work! I believe we are quickly approaching the point at which we should recommend Cas-Stunts over TrackBlaster to newbies  :)

Also... were you able to verify the anti-hogging system works well?

I forgot to mention that in the last post. Here it works exactly as you described, both with the Linux build and the Windows one under Wine.

There have been many changes so I expect a bug or two might be hiding underneath some key or mouse button. Let me know if that is the case.

Here are a few things I noticed -- truly minor stuff next to the strides made over the last few updates:
  • The flip, rotate and mirror commands probably should also act on selected tiles without having to cut and paste them beforehand. I suspect implementing that is in your plans, given the four new buttons on the left panel (which currently do nothing).
  • Similarly, pressing DEL with selected tiles probably should delete their elements.
  • If you have a multi-tile picked the keyboard editing cursor will occupy more than one tile; however, pressing DEL will only delete the upper left tile. The behaviour is, in fact, correct; only the visual display is mildly confusing in this edge case. I'm not sure if there is a good solution to that -- the only thing I can think of is shading the other cursor tile(s) in light grey to indicate there is something different going on, but that might be too messy for too little gain.
  • While checking the readme it took me several seconds to realise the "LMB" in the mouse selection shortcut stood for left mouse button. That might be just me though  :)

And two further feature suggestions:
  • A copy-cut-paste mode for terrain. After mulling about it as I type this post, I think that is the only important TrackBlaster feature still missing. (There is also comparison mode, but it is not that important IMO, specially given that it takes far fewer keystrokes to load another track in Cas-Stunts and that copy-paste works seamlessly across tracks.)
  • A keyboard brush mode, either as an editing mode (analogous to what TAB does in TrackBlaster) or activated by holding a key. (Not really critical, given the mouse-centric nature of Cas-Stunts, but it would be a nice addition for keyboard loyalists. Similarly, and even less critically, there is also a case for adding selection with the keyboard.)
« Last Edit: August 10, 2016, 12:13:25 AM by Duplode »

Cas

  • Otto's Student
  • **
  • Posts: 343
  • Think different. That's OK... as long as you think
    • View Profile
    • Dimioca Labs
Re: Cas-Stunts track editor (ex "Introducing my....")
« Reply #46 on: August 10, 2016, 01:08:09 AM »
Thank you, Duplode!  And yes... some things are already in my work queue.

Quote
The flip, rotate and mirror commands probably should also act on selected tiles without having to cut and paste them beforehand.
I've thought of this. It's easy to implement. I'll do it.

Quote
[...]given the four new buttons on the left panel (which currently do nothing).
They do have a function!  When you're pasting, you can flip and rotate using those buttons, not just the shortcut keys. Yet, it'd be good for them to have a function when you're not pasting.

Quote
Similarly, pressing DEL with selected tiles probably should delete their elements.
Could be... Anyway, you have CTRL+X (cut). DEL would delete the region without copying it to the clipboard, which would be unrecoverable as of now. I think this is a good thing to implement once I have added undo/redo capabilities.

Quote
If you have a multi-tile picked the keyboard editing cursor will occupy more than one tile; however, pressing DEL will only delete the upper left tile.
I had not thought of that. Yes, I think it'd be better to expand the keyboard cursor so that it marks not only the current track element, but also the element on the current tile. This may take a little more work, but I can do it.

Quote
[...]it took me several seconds to realise the "LMB" in the mouse selection shortcut stood for left mouse button.
As I was writing that, I realised it wasn't completely obvious, but "left-mouse-button" didn't fit there. I figure I should make some nice touches to the documentation. Do you think a PDF with images would be better?  Or is it good to use a standard TXT format?  Now I'm thinking it's not so standard after all. Since I wrote it in Linux, it must be using 0Ah for line end, which would be ignored in DOS/Windows.

Quote
A copy-cut-paste mode for terrain.
This already can be done. Use T to switch terrain-pasting on. You can do it while pasting too. What cannot be done now is to past only the terrain. Internally, it is already implemented, but there is no key or button for that. I'm going to add some clickable indicators on the panel soon for these things, though.

Quote
A keyboard brush mode, either as an editing mode (analogous to what TAB does in TrackBlaster) or activated by holding a key.
I have something better than that in mind, but it's kind of challenging. I'll see what I can do.

Also... what do you think about licensing?  The project is currently freeware. I was considering making it free software.
Earth is my country. Science is my religion.

Duplode

  • Moderator
  • Breaths Stunts
  • *****
  • Posts: 3600
  • Through the astral door - to soar
    • View Profile
    • The Southern Cross Stunts Trophy
Re: Cas-Stunts track editor (ex "Introducing my....")
« Reply #47 on: August 10, 2016, 01:46:16 AM »
Quote
[...]given the four new buttons on the left panel (which currently do nothing).
They do have a function!  When you're pasting, you can flip and rotate using those buttons, not just the shortcut keys. Yet, it'd be good for them to have a function when you're not pasting.

Oops! Somehow I hadn't thought of this meaning and the corresponding motion while testing.

Quote
Similarly, pressing DEL with selected tiles probably should delete their elements.
Could be... Anyway, you have CTRL+X (cut). DEL would delete the region without copying it to the clipboard, which would be unrecoverable as of now. I think this is a good thing to implement once I have added undo/redo capabilities.

I see -- just like X in vi  :) The relatively minor advantage of using DEL will be not overwriting the clipboard then. In any case, I agree undo/redo should probably come first. 

I figure I should make some nice touches to the documentation. Do you think a PDF with images would be better?

All things equal, I tend to favour simple text files, though images might be useful indeed. There is also the option of going for both by writing the readme in markdown and adding a rendered PDF version alongside it. As for the current readme, I'd only suggest wrapping it to 72 characters and changing the line endings to DOS format (which would ensure it is easily readable under both target OSs).

Quote
A copy-cut-paste mode for terrain.
This already can be done. Use T to switch terrain-pasting on. You can do it while pasting too. What cannot be done now is to past only the terrain. Internally, it is already implemented, but there is no key or button for that. I'm going to add some clickable indicators on the panel soon for these things, though.

Awesome -- I had skipped that line of the release notes.

Also... what do you think about licensing?  The project is currently freeware. I was considering making it free software.

It's up to you of course, but I would wholeheartedly endorse such a change.

Cas

  • Otto's Student
  • **
  • Posts: 343
  • Think different. That's OK... as long as you think
    • View Profile
    • Dimioca Labs
Re: Cas-Stunts track editor (ex "Introducing my....")
« Reply #48 on: August 12, 2016, 06:06:44 AM »
New update!

Cas-Stunts 2.3.2 beta
Download this version

New features:
  • Undo/Redo - still no panel buttons, but respond to CTRL+Z and CTRL+Y respectively
  • Flipping/rotating selections in-situ and full-track if no selection
  • DEL to delete current selection without pushing it to the clipboard
  • Status indicators in the panel. A little small, I think. They still cannot be used as buttons
  • Keyboard cursor has been enhanced for clarity
  • K switches track-affected-by-pasting just like T switches terrain-affected-by-pasting

By far, the most complex changes are in the Undo/Redo and Flipping/Rotating options. They seem to work well, but maybe there's a bug I haven't seen. Notice that rotating the selection in situ is not possible unless it's a square. Also, being able to disable track affected by pasting operation now allows, for example, for copying the terrain from a track. Current Undo/Redo system can hold 29 levels. This is because they're supposed to be 30, but there's a known bug that seems to be innocuous. Undo level can be easily modified. Any thoughts? :)
« Last Edit: August 12, 2016, 06:08:18 AM by Cas »
Earth is my country. Science is my religion.

Shoegazing Leo

  • Two-stroker
  • *****
  • Posts: 2131
    • View Profile
    • Stunts LOL Classics
Re: Cas-Stunts track editor
« Reply #49 on: August 12, 2016, 07:19:58 PM »
My last two tracks were made almost 100% on Cas editor.

Duplode

  • Moderator
  • Breaths Stunts
  • *****
  • Posts: 3600
  • Through the astral door - to soar
    • View Profile
    • The Southern Cross Stunts Trophy
Re: Cas-Stunts track editor (ex "Introducing my....")
« Reply #50 on: August 12, 2016, 11:06:53 PM »
New update!

Already uploaded!  :) Generally speaking, the new features work beautifully. It is a minor detail, but I particularly liked the look of the mode indicators.

New update!

Cas-Stunts 2.3.2 beta
Notice that rotating the selection in situ is not possible unless it's a square.

Makes perfect sense. It would be nice to have a modifier (SHIFT?) to drag square selections without having to count pixels, though that lies in gold-plating territory already.

The only issues I noticed this time were:

  • SHIFT+R doesn't rotate not-on-clipboard selections in situ, affecting the picked element instead. The counter-clockwise panel button works correctly.
  • Full-track flipping/rotation if there is no selection doesn't work -- the picked element is affected instead. I actually think the current behaviour is preferable to having one-key whole-track flipping/rotation, as adjusting picked elements as you draw is a more frequent action than adjusting the whole track. I suggest adding a select-all command to make full-track operations possible in two keystrokes.
  • If you cut a piece of track/terrain, do a single extra action and then undo this action, the cut is also undone.
  • It is not possible to undo a copy, and undoing a cut does not restore the previous state of the clipboard (I see how that would require a clipboard buffer, which might or might not be in your plans.)

Cas

  • Otto's Student
  • **
  • Posts: 343
  • Think different. That's OK... as long as you think
    • View Profile
    • Dimioca Labs
Re: Cas-Stunts track editor
« Reply #51 on: August 13, 2016, 02:10:20 AM »
@Leo - Thank you!  And what did you use for the other almost 0%? :P  The built-in editor or Track Blaster?  I'd like to know which things are still felt more comfortable in editors other than Cas-Stunts. Track Blaster is actually a great work and if I understand correctly, it was made for the Stunts community, just like Cas-Stunts, so I have great appreciation for it.

@Duplode:

Thanks for the review!  I hadn't seen the problem with SHIFT+R. Just fixed it. It was almost a "typo". My idea with full track transformation was that it'd be done with the mouse. When you're using the keyboard, just like you see it, it's more comfortable to have a current element transformation instead. Yet, I could implement a full-track selection with they keyboard easily.

I was unable to reproduce the errors with Cut + Undo that you mentioned. Probably I misunderstood the error. Could you please give me sequential details on how it gets to happen?  Maybe I haven't tested it thoroughly enough.

As regards undoing copy operations, my idea with the Undo/Redo system is that only grid modifications are affected by it, so the clipboard is not part of that system. I considered making it part, but then you would sometimes press CTRL+Z and see nothing happen and think something is wrong and you've actually dropped what you had in the clipboard, which is not immediately seen. Also, say I add the controversial meta-data, I don't think meta-data modifications should be undoable with CTRL+Z either. But if you think it'd be useful, I could think of "uncopying" and "uncutting". Paste is indeed undoable because it does affect the grid.

The forced-square selection system is not difficult to produce. I will consider it

EDIT:  I think I found what you meant. I've fixed something that was wrong. It affected both cutting with CTRL+X and deleting blocks with DEL. After these operations, the changes were not being pushed to the Undo queue. On the other hand, cutting by pressing the corresponding panel button was pushing the changes. You can verify that this error would not occur if you use the panel instead. In that case, I've fixed it now for the keyboard too.
« Last Edit: August 13, 2016, 02:32:40 AM by Cas »
Earth is my country. Science is my religion.

Duplode

  • Moderator
  • Breaths Stunts
  • *****
  • Posts: 3600
  • Through the astral door - to soar
    • View Profile
    • The Southern Cross Stunts Trophy
Re: Cas-Stunts track editor
« Reply #52 on: August 13, 2016, 02:47:44 AM »
My idea with full track transformation was that it'd be done with the mouse. When you're using the keyboard, just like you see it, it's more comfortable to have a current element transformation instead.

Oh, sure -- once more I skipped one obvious action to test  :)

As regards undoing copy operations, my idea with the Undo/Redo system is that only grid modifications are affected by it, so the clipboard is not part of that system. I considered making it part, but then you would sometimes press CTRL+Z and see nothing happen and think something is wrong and you've actually dropped what you had in the clipboard, which is not immediately seen. Also, say I add the controversial meta-data, I don't think meta-data modifications should be undoable with CTRL+Z either.

I'd agree on those being good reasons for not implementing it. The benefit would be marginal, and as you say it could get confusing.

Cas

  • Otto's Student
  • **
  • Posts: 343
  • Think different. That's OK... as long as you think
    • View Profile
    • Dimioca Labs
Re: Cas-Stunts track editor
« Reply #53 on: August 27, 2016, 05:56:38 AM »
New update:

Cas-Stunts 2.3.3 beta
Download this version

New features:
  • Panel indicators are now pushable buttons
  • In debugging mode, the parent element is shown as a small icon, for clarity
  • Cas-Stunts keeps track of editing time on new tracks
  • Track title, author's name and other information can be viewed and edited
  • Tracks with info can be saved as a single file or split, which can be changed at run-time while saving, but also in the configuration file for start-up default
  • A default author name can be specified in the configuration file, for new tracks
  • Whole-track selection with CTRL+W
  • Help option, showing keyboard shortcuts

Some bugs fixed, some bugs still linger. Next update, I shall kill all bugs and remove the beta.
Don't know if I should publish the meta-data format spec here or in the other thread... probably in the other thread.
Earth is my country. Science is my religion.

Duplode

  • Moderator
  • Breaths Stunts
  • *****
  • Posts: 3600
  • Through the astral door - to soar
    • View Profile
    • The Southern Cross Stunts Trophy
Re: Cas-Stunts track editor
« Reply #54 on: August 28, 2016, 03:24:43 AM »
Nice!

In debugging mode, the parent element is shown as a small icon, for clarity

At first glance, I found that a little uncomfortable --- the icons get quite small for 2x2 elements, and the track direction becomes a little harder to follow with the eyes. Then, however, I remembered that (as the name says!) you are not supposed to do most of your editing in debug mode, but only activate it if you get confused about the fillers. Additionally, the small icons sidestep the issue when displaying main tiles of 2nd or 4th quadrant large corners (in which only a tiny sliver of the corner near the centre is displayed), which is a far more annoying issue. On the whole, therefore, I now feel this change is an improvement.

Tracks with info can be saved as a single file or split, which can be changed at run-time while saving, but also in the configuration file for start-up default

I will ask a few more things about the metadata in the other thread, but here is something specific to Cas-Stunts: One thought that crossed my mind was whether it would be better to delete the .smd file on changing the format from split to combined, as otherwise a superfluous and possibly outdated .smd file would be left behind. However, doing so might not be worth the trouble, as if later on you add an "Export Metadata" command the same "issue" will reappear, with no sensible way of "solving" it (not to mention that, with the current behaviour, changing the format from combined to split and then back to combined works as an export command of sorts).

Cas

  • Otto's Student
  • **
  • Posts: 343
  • Think different. That's OK... as long as you think
    • View Profile
    • Dimioca Labs
Re: Cas-Stunts track editor
« Reply #55 on: August 28, 2016, 04:36:56 AM »
Yeah, the small icons, I decided to implement when I noticed how the arrows in debug mode make it very difficult to identify the track element. For two-tile elements, there's no problem, but four-tile ones normally keep at least two tiles when you're building an illusion track. Very rarely only the parent element will be used, so in non-debugging mode, it's almost always clear what element is there. In debugging mode, on the other hand, clarity focuses on showing where fillers are, so you are left with only one quarter, which, as you say, it's too tiny to distinguish in most cases.

About deleting the .smd file, I hadn't thought about that and now that you mention it, I see the issue with the export format too. One thing I can say that will make this less of the problem is that .smd files contain a hash that allows to link them to a certain track; therefore, forgotten .smd files would not get accidentally linked to the wrong track. Anyway, I agree this is not a comfortable behaviour. My original intention, as you know, was to only implement the overlay system, which would only need to be ignored by applications not using it, but I'm sure we can figure out a method we can all find optimal.
Earth is my country. Science is my religion.

Cas

  • Otto's Student
  • **
  • Posts: 343
  • Think different. That's OK... as long as you think
    • View Profile
    • Dimioca Labs
Re: Cas-Stunts track editor
« Reply #56 on: August 31, 2016, 08:08:30 AM »
Upgrade. Beta removed!

Cas-Stunts 2.4
Download this version

This is mostly a bug fix and beautifying upgrade. Now I can concentrate on new features for the next version. This is what we've got on this one:

New features:
  • Menu icons now display descriptive text when hovered by the mouse cursor. Also, there's a nice menu border now
  • A title bar has been added for DOS
  • The documentation file has been updated

Fixed bugs:
  • Editing time was being saved even when it was unknown
  • When pointing at an element on the grid, unless it was the main block that was being pointed, it appeared in the panel as a "filler". The parent element name is now displayed
  • SMD files were not being deleted when a track was converted to single-file format
  • Keyboard cursor was leaving a trail when moved on a selected area of the grid
  • Some items in the DOS build were not displaying properly
  • The DOS version was skipping frames for drawing the mouse cursor. This was fixed by removing screen-locking, which now causes a few much more acceptable artifacts
Earth is my country. Science is my religion.

Cas

  • Otto's Student
  • **
  • Posts: 343
  • Think different. That's OK... as long as you think
    • View Profile
    • Dimioca Labs
Re: Cas-Stunts track editor
« Reply #57 on: September 11, 2016, 06:42:52 AM »
One more update. Going back to beta, but with a few bells and whistles. There's a lot more "invisible work" that will help in the future than what's evident, but still, this time you'll enjoy a few new features. So...

Cas-Stunts 2.4.1 beta
Download this version

New features:
  • F1 for help if already at palette page #1
  • Select from a set of 28 built-in scenarios when creating a new track
  • A track file to be loaded can be specified in the command line. Good to set up the editor in your system so that you can drag the track file on top of it
  • Simple track error check by pressing 'C', like in Stunts
  • Complex track analysis capabilities have been implemented, although they can't be seen at the moment

Lots of bugs have been fixed, as can be seen in the distribution file. However, with the introduction of these complex features, I fear new bugs may have come up. If you give the track checking system a hard time, you may encounter some. Also, the built-in scenarios have not been made with exquisite patience. If some of them are too ugly or dull, they could be removed and replaced with better ones. Suggestions are welcome :)
Earth is my country. Science is my religion.

Duplode

  • Moderator
  • Breaths Stunts
  • *****
  • Posts: 3600
  • Through the astral door - to soar
    • View Profile
    • The Southern Cross Stunts Trophy
Re: Cas-Stunts track editor
« Reply #58 on: September 12, 2016, 03:19:17 AM »
First of all, I love the long list of built-in terrains. It feels like starting a new town in SimCity  :)

It is great to finally have an external track checker. You can be sure I will throw everything I've got at it!  :D Here are a few issues I have noticed so far:
  • Some of my pathological test tracks with lots of paths make the track checker crash in the Linux 64-bit version. Attached is one example, which is accepted by Stunts and can be raced normally, including against an opponent. Interestingly, no crash happens in the Windows version ran under Wine.
  • When the checker rejects a dual-way track the cursor goes to the top left corner rather than to the problem spot, as it does with a single way track.
  • The straightway-before-jump test is too strict. In particular, it should always accept a jump followed by a bridge corner, and should treat the straight part of a split as a straight (and not as a corner).
There are other smaller issues with the checking rules, but given the infuriating amount of edge cases, exceptions and exceptions-of-exceptions of the in-game track checker I believe it will be more useful for everyone if I, rather than pointing them one by one, write down a complete description of the rules as applied by Stunts. Between the experiments I have accumulated over the years and what we have learned through restunts that won't be difficult to prepare, and so I should be able to to post it here in the near future.

Finally, a question about distribution. Now that there is a stable version, what do you prefer for me to make available at Southern Cross: the latest stable version, the latest version even if it is a beta, or both of them?
« Last Edit: September 12, 2016, 03:32:23 AM by Duplode »

Cas

  • Otto's Student
  • **
  • Posts: 343
  • Think different. That's OK... as long as you think
    • View Profile
    • Dimioca Labs
Re: Cas-Stunts track editor
« Reply #59 on: September 12, 2016, 05:11:27 AM »
Thank you so much for testing, Duplode. This track-checking system is extremely complex!  Even before reading your post, I had acknowledged a number of errors (or sometimes not errors, but differences from Stunts) and other limiting issues that I still don't know how I will solve. Just to analyse tracks, I had to build several arrays and user-defined types (structures), plus a number of testing routines, many of which are recursive. I am still working on adding more features and, although I have not finished what I was doing, you may be interested in what I've just added: Cas-Stunts can now estimate the time it will take you to race the track OWOOTly. This will be yet another feature to play with, ha, ha.

Now, going back to the issues:
  • I tested your pathological track, found the problem and solved it. Still, it wasn't really an "error", but a limitation. Cas-Stunts divides the track in "sections" and then creates "paths" combining these sections. The maximum number of sections was 100 and your track had more than 100. Now the maximum is 255. Still, a very pathological track may make it jump. Extending it past 255 will require me to change some functions because of obvious reasons. It's nice to see that even a track like the one you sent me works with just 255 maximum sections. I should make Cas-Stunts at least warn when this number is exceeded. If it worked in Windows, it means it did by overwriting other data in the program memory and probably was unstable after that.
  • I haven't been able to reproduce the second problem. By dual-way, do you mean a track with more than one path or a track that attempts to re-enter another path in the wrong-way?  In the first case, everything seems to work fine on my side. In the second case, it's not doing it right, but it's still not placing the cursor at (1, 1). Can you send me a track in which this happens?
  • I'm having a hard time with the straightway-before-jump error. Originally, I made Cas-Stunts very warm-hearted about it, but then, testing how Stunts works, I found that it refuses to run a track if it finds this error even if the error is located at a branch that's unfinished!  For this reason, I decided to always check for this error first, even if there is a valid path. Now I see that, if you can access a jump from a split, Stunts will report the error if only the curved entrance is used, but will not if the straight on is. Testing for this requires that I change a lot in the way I test the sections, because it means that, when testing one section, I must take into consideration what happened when I tested another section that ended in the same split. I'm really, really confused.
  • I've also noticed some curious behaviour in the way Stunts selects the path the opponent will follow. Apparently, paths are measured in tiles, ignoring the difficulty of the elements in them. This, I expected. But when two paths are the same amount of tiles long, it looks like Stunts prefer the one that heads North, even if it's the one turning. I am guessing it checks North, East, South, West in that order.
  • About distribution... this time I kept the previous one because I realised I may have introduced bugs, although the bugs would be only in the new sections (especially in track-testing). I think it'd be nice if you included the new version, but keeping the stable one is important. Also, I'll be posting a newer one in a matter of days, so if it's much work for you, it's OK if you just keep the stable one on the site. Anyway, the new one is here. But if you include both, even better.
Earth is my country. Science is my religion.