Stunts Forum

Stunts - the Game => Stunts Related Programs => Topic started by: Cas on September 24, 2021, 12:00:47 AM

Title: Simple Garage
Post by: Cas on September 24, 2021, 12:00:47 AM
I have had an idea very similar to Dreadnaut's CarPark in the relatively recent past. That is, besides the idea of a more complex and elaborate car manager more like what Daniƫl and KyLiE would like, which I also like, at a point, I thought that I could make something command-line-oriented to have it working soon and to make it flexible for the keyboard-centric user like me.

My idea was not exactly the same, but similar. Instead of using command line arguments for the main program, I envisioned the program like you'd call it and you'd get a command line interface inside it. Then you'd type command to list the cars, delete, backup, restore, etc. You'd also have commands to tag cars, so that groups of cars could exist that you could backup or move together quickly.

In my experience, nothing takes more time in developing a program than working on the interface visuals, so making this a command-line program would make it possible to complete the project very quickly, although it wouldn't be the nicest car manager for most users, which leaves space for somebody else making another with a different style as well.

Metadata?  Well, that's another topic. I don't think it should be dynamically added or removed from cars while handled by a car swapping program. Whether metadata should be added by the author when creating the car, that's another thing and I think it's up to the author.

EDIT: OK, I got tempted by the idea and I made this simple command-line-based garage manage. I didn't want to steal the name, so I called it Simple Garage. It's made quickly and my own way, but if you like it, just tell me, or I could just add things to it to make it more like the CarPark idea. Anyway, I'm willing to collaborate. The zip I've uploaded contains the Linux and DOS versions. I can also compile it for Windows if you guys want. If you call it with a command line, it'll execute the command. If you just call it alone, it'll open a console and you can call commands there. Type "HELP" for... well, help. "EXIT" to exit, of course.

Dreadnaut: if you like it and if you want to guide me a little, I can make this one work more and more as you want and then, if you prefer it, we could use the CarPark name. What it currently does is pretty simple. You can create groups of cars and move either individual cars or whole groups between Stunts and the garage. If a car has a number of files other than four, they're still all copied together, but you get a warning when you list them.

Most recent version:
Simple Garage 2.1 - 2023-02-02

Older sgar 1.1 and 2.0 kept just in case for now
Title: Re: Simple Garage
Post by: dreadnaut on September 24, 2021, 05:39:48 PM
Quote from: Cas on September 24, 2021, 12:00:47 AM
EDIT: OK, I got tempted by the idea and I made this simple command-line-based garage manage.

Hahaha, discussing a project sometimes is enough to make it start, isn't it? ;D

I have also started writing some code, with the UI in mind first instead. Let's proceed on our own ideas separately, we'll see where we end up!
Title: Re: Simple Garage
Post by: Cas on September 24, 2021, 06:33:11 PM
Ha, ha!  Yes, it's because I had this in mind for long, so your thread made me think "Then I'm not the only one wanting something like this. I better get it done".

I made some bug fixes and updated a few things. It's really quick to work on something like this because there isn't much interface to write. I'll upload an update later.
Title: Re: Simple Garage
Post by: Daniel3D on September 25, 2021, 10:51:29 AM
When I started to use Sgar i just edited the CFG with the right directories (running separate instances of dosbox makes E:\ the game dir in my case)
but when I moved cars to the garage it seemed to work well. Within Sgar i could list and see them in the garage and move cars back and fort.
but when I exited the program, the garage dir did not exist and the cars were gone.

This issue was solved by manually creating the garage dir.

Don't know if this is a known and already fixed bug though. But since there is no update yet. I thought I mention it.
Title: Re: Simple Garage
Post by: Cas on September 26, 2021, 01:10:45 AM
The program is not very rich in terms of reporting when things go wrong. The directories you put in the configuration file are supposed to exist prior to using, but granted, this isn't stated anywhere. Also, when you try to move cars to a non-existing directory, Simple Garage happily tells you that this has been done, which is also wrong.

I have already fixed some bugs, but I'm going to take special care about this issue. It's not a bug in the sense that I expected people would set up existing directories and knew it wouldn't work otherwise, but it definitely it's not good for it to not report this or help the user solve the problem. I'll post the update soon.

EDIT: Here it is. Fixed that bug and a few others and added some commands. Take a look at the powerful group features... for example, the "only" command.
Title: Re: Simple Garage
Post by: Cas on May 31, 2022, 03:19:11 AM
I have made an important update to Simple Garage. The new zip file sgar11.zip is in the first post. The Windows binary is still not ready, but you have the source and the GNU/Linux and DOS binaries. Simple Garage 1.1 is an improvement in many ways:

- Non documented "version" command (forgot to add it to "help", he, he)
- Listing commands list, ls and l, which used to be one and the same and had a parameter to specify either Stunts or garage are now split in commands list and l, to list among all cars, ls, to list among cars in Stunts and lp (for parked) and lg (for garage), to list among those in the garage and the old parameter is gone
- Groups can be referenced by placing a # at the beginning of the group name. The * is no longer used for that because it's now used for what we all know: as a wildcard for filters
- Most commands, including the listing commands, but also park, retrieve, addto, rf can accept complex filtering

A word on complex filtering:

You can specify a single filter or a collection of filters separated by commas. Each filter can be a proper filter, like in directory listing, that can start and/or end with an asterisk, but can also be a reference to a group or a car ID. This means that the following commands are now valid:

- addto mygroup March - Adds the Porsche March Indy (or any car containing "March") to mygroup
- addto all * - Add all cars to the "all" group
- park pmin,Ferrari - Park the Porsch March Indy and all Ferraris
- ls lambo*,*962,fgto - List all Lamborghinis, the Porsche 962 and the Ferrari GTO if present in Stunts directory
Title: Re: Simple Garage
Post by: Daniel3D on May 31, 2022, 08:24:09 AM
I very good. Now I can make a preparation script to prepare the game for the next race.
Just unpack the carpack in the game directory and select the prep for race option in the pre-game menu.
8)
Title: Re: Simple Garage
Post by: Cas on June 22, 2022, 07:18:02 PM
Updated Simple Garage 1.1 to contain all details to make it GPLv3. It's now officially free software
Title: Re: Simple Garage
Post by: Cas on January 08, 2023, 11:54:58 PM
Updated Simple Gararage to version 2.0. Some improvements include:

Title: Re: Simple Garage
Post by: Overdrijf on January 14, 2023, 10:13:15 AM
Feature request for next years version 3 or 2.1: the screen is too short to display my full car list, a way to enlarge the screen and get more text lines or a way to scroll up would be a nice addition.

Although I've been playing with the software for all of 5 minutes, so maybe I'm missing something that's obviously already there...
Title: Re: Simple Garage
Post by: Cas on January 14, 2023, 09:29:41 PM
Yeah, I've been thinking of a scrolling function and the source already has some features that are not being used that are there for a future scrolling function, but I have to sort out some things that are in the way!  I'll try to get that done for the next version
Title: Re: Simple Garage
Post by: Cas on January 29, 2023, 11:29:59 PM
Update!  Simple Garage 2.1 includes the following:


Things to bear in mind:

Title: Re: Simple Garage
Post by: Duplode on January 30, 2023, 03:33:12 AM
A very useful update! The new version is already available from Southern Cross.

Quote from: Cas on January 29, 2023, 11:29:59 PM
  • Scrolling is sometimes buggy when the output is long. If you guys test it and pinpoint the problems and how to reproduce them, I'll be able to solve them
Here is one test case (checked with the Linux binary): with 32 cars in the game directory, use lp five times, scroll up (a single PgUp is enough), and do another lp. The final lines of the output won't show up. (A further lp after that works fine.)
Title: Re: Simple Garage
Post by: Cas on January 30, 2023, 07:49:26 PM
Uhm... that make sense. I know more or less what's happening. I'm using a circular buffer. By default, I'm compiling with a buffer of 200 lines. When you do an lp with 32 cars, the default output is 34 lines long (the cars, the number of cars and one blank line), plus the command line, for a total of 35. If you do this five times in a row, you're pushing 175 lines into the buffer, which is less than 200, so no problem, the buffer is being used without its circular nature. Now, when you do one more lp, you get to 210 lines, so if this fails, I imagine the last 7 cars won't be shown.

The problem is that reading the code, it looks good. When the buffer is full, the start pointer should move down on every push I have to examine it closely. I'll be testing the logic with this example. Thanks!
Title: Re: Simple Garage
Post by: Cas on February 03, 2023, 01:42:13 AM
Bug fix uploaded

Title: Re: Simple Garage
Post by: Duplode on February 03, 2023, 02:35:55 AM
Updated, thanks!

Quote from: Cas on February 03, 2023, 01:42:13 AMNote: It doesn't seem to be possible to remove older attachments in the main post. How is it supposed to be done?

That command is a little out of the way, indeed. Edit the post (with the "full edit" option, More >> Modify), and expand the attachments pane. There should be a delete button next to each attachment.
Title: Re: Simple Garage
Post by: Cas on February 04, 2023, 04:47:15 AM
Ah!  Thanks!  I found it. The button was practically invisible with the dark background skin, but hovering over the region, it appears