Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: SmashManiac on Sat 03/01/2004 08:55:24

Title: Can't delete useless junk from my game!
Post by: SmashManiac on Sat 03/01/2004 08:55:24
Ok, so this is my first post. I've played with AGS since last month and just encountered a really annoying problem.

Ok, well, this sounds stupid, but I was trying to develop a template and I'm not able to delete some things I manually added:

- Inventory items
- Dialogs
- Views
- Characters
- Cursors
- Fonts

If that was not enough, I'm not able to delete some global variables created with the interaction editor. There's also that "Global 1" variable that I absolutely don't know if AGS uses it for something and if its safe to remove it... once I find HOW to remove it.

I'm sure all those are really easy to erase... when you know it. I won't even be surprised if I say "This is so easy, why didn't I think of it?" or something like that, but I've tried many things, searched in the help file and on the forums, and found nothing except "How to CREATE dialogs, cursors, characters, etc."

I'm using ver. 2.60

BTW I suppose it's possible to use more than 10 cursors in AGS in the scripts even if in the interaction editor there's only Usermode1 and Usermode2?
Title: Re:Can't delete useless junk from my game!
Post by: Phemar on Sat 03/01/2004 10:10:07
Basically out of that list you gave there,  the only things I've discovered how to delete are fonts, guis, rooms, sprites and things off the parser.

Hope this helps!
Title: Re:Can't delete useless junk from my game!
Post by: Ishmael on Sat 03/01/2004 11:47:23
You cannot delete those things. You can get rid of fonts by resetting them. CJ has said (if I remember right)  that if he'd include the possibilty to delete character, views, dialog topics, someone would ofcource mess their game, and come here asking "what is the problem when I try to run my game but ít crashes all I did was deleted rogers view???"

So you just can't. Atleast not yet.
Title: Re:Can't delete useless junk from my game!
Post by: SmashManiac on Sat 03/01/2004 18:30:30
Quote from: TK on Sat 03/01/2004 11:47:23
You cannot delete those things. You can get rid of fonts by resetting them. CJ has said (if I remember right)  that if he'd include the possibilty to delete character, views, dialog topics, someone would ofcource mess their game, and come here asking "what is the problem when I try to run my game but ít crashes all I did was deleted rogers view???"

So you just can't. Atleast not yet.

Wh-wh-wh-WHAT? Geez... now that's not cool at all, but I understand. (Thanks for the font tip!)

Oh well, guess I'll do with it. Hey, it's free!!!
Title: Re:Can't delete useless junk from my game!
Post by: Archangel (aka SoupDragon) on Sat 03/01/2004 19:44:32
Quote from: SmashManiac on Sat 03/01/2004 18:30:30
Oh well, guess I'll do with it. Hey, it's free!!!

Hehe it's so refreshing to hear someone say that for a change! Anyway, I think the idea, Smash, is that unused sprites don't take up much space neither do they cause slowdown, so allowing you to delete them would probably cause more problems than it would solve.

Happy AGSing ^,^
Title: Re:Can't delete useless junk from my game!
Post by: Hollister Man on Sat 03/01/2004 23:10:26
The other option for sprites is to create an image that says "Replace me" or something, so that you KNOW that it can be overwritten.  Then just import over that sprite when the time comes.  Just keep track of what you are using, and it will work for everything you mentioned.  It doesn't really take up any additional time to do so, in my experience.

Perhaps someone with a copy of the older versions (back when CJ implemented delete options) could make a template with the maximum of blankness, but it isn't REALLY needed. Everything can be overwritten, AFAIK.

Title: Re:Can't delete useless junk from my game!
Post by: Dorcan on Tue 06/01/2004 00:27:23
The only way to delete all dialog Topics, is to clic on replace from file and select the blank dialog file previously created from a new blank game...
So, if you just want to add a topic, or an option, to test, just remember to export dialogs so you can undo your changes  ;D!
Title: Re:Can't delete useless junk from my game!
Post by: James Kay on Tue 06/01/2004 01:29:22
Maybe it'd be cool to have a "deletable" option in the main settings (or rather an "expert user" on/off setting)..
I can see why AGS was written the way it was - to make it pretty foolproof, but for more experienced coders and people with a general grasp on what they're doing, not being able to delete stuff is a real pain. And all these roundabout ways of circumventing that is, well, ridiculous.

On the other hand, with today's connection speeds, an extra few K on a download isn't going to kill anyone, really...but personally I'm just really anal and don't want stuff I don't use cluttering up the game (it's obsessive compulsive).
Title: Re:Can't delete useless junk from my game!
Post by: Scorpiorus on Tue 06/01/2004 15:59:49
QuoteMaybe it'd be cool to have a "deletable" option in the main settings (or rather an "expert user" on/off setting)..
I remember something like this was already suggested some time ago.

QuoteOn the other hand, with today's connection speeds, an extra few K on a download isn't going to kill anyone, really...
Well, sprites take up the most of the space but we can delete them already.

I noticed AGS became more spotting on deleting things, so for example, you can't delete a sprite if it's used in a view or for cursor graphics. Text script is another matter as it's impossible to check all the referenced resource data at design time.

~Cheers
Title: Re:Can't delete useless junk from my game!
Post by: James Kay on Wed 07/01/2004 12:23:03
The best feature would be and option like:
delete unused (sprites/fonts/scripts)
but I can't even begin to imagine the pain and headache this would be to program.
Title: Re:Can't delete useless junk from my game!
Post by: on Wed 07/01/2004 21:49:33
Quote from: James Kay on Wed 07/01/2004 12:23:03
The best feature would be and option like:
delete unused (sprites/fonts/scripts)
but I can't even begin to imagine the pain and headache this would be to program.

That would be cool. In my line of work, I use AutoCAD. It has a command named "purge" which delete from the drawing all (or filtered) unused items and data. At time you can take a 5megs drawing and bring it down to 800k, just because of all the things you inserted just to delete it 2 days later.

Many times I wished more programs had this feature.
Title: Re:Can't delete useless junk from my game!
Post by: Gilbert on Thu 08/01/2004 05:32:45
Well this can be a dangerous feature and I don't think it's worth taking the risk in inplementing it.
The reason is, for it to correctly determine whether a say, sprite, is unused or used, it must also scan in the scripts, which in some cases, may contains things like calling a function with a variable holding the sprite number, or even calculating a sprite sprite number to use via a formula, etc., which is impossible to be analysed correctly.
Title: Re:Can't delete useless junk from my game!
Post by: Ben on Thu 08/01/2004 21:42:44
Well, what if the editor left a blank space where the sprite is, but left the index? Wouldn't that solve the problem of scripts calling sprite numbers that don't exist?
Title: Re:Can't delete useless junk from my game!
Post by: Scorpiorus on Thu 08/01/2004 22:14:24
I suppose the function needs an actual bitmap image and the sprite number is just a reference to one. But even if it wouldn't crash what should it display instead?

EDIT: imo, the error message (saying the sprite that doesn't exist) is the most suitable mean to handle these kind of faults.

~Cheers
Title: Re:Can't delete useless junk from my game!
Post by: Gilbert on Fri 09/01/2004 02:20:49
Actually even that, it's just a solution past crashes, still it would become even more annoying if you really need to use a sprite in your script (since it would display something you didn't expect). Moreover, this kind of cleaning functions, if existed, will be mostly used near the final stage of creating a game, in which case you'll mostly likely to release a game with graphics glitch (if it's not well spotted in final tests, and even if you spotted it, it can also be quite annoying yto import the sprites back).

I think it's safer and better to let the game maker himself to determine which resource is redundent, and remove/replace it one by one himself, as there SHOULD NOT be that many such useless junks in your game if you planned your game nicely.
Title: Re:Can't delete useless junk from my game!
Post by: Scorpiorus on Fri 09/01/2004 15:15:10
Furthermore, again since that cleaning routine would be unable to check the sprites in script there is no sprite it the database that can be considered unused for sure.

I still like the idea to be able to delete everthing you want as long as that option is hidden under user/expert mode or something.

~Cheers
Title: Re:Can't delete useless junk from my game!
Post by: Pumaman on Sat 10/01/2004 20:08:06
The main problem is things that are referenced by number (eg. dialog topics, views, GUIs, cursors etc). I have been gradually changing these to have textual names (which GUIs and views now support) so that I will be able to add support for deleting them.

The other option that has been discussed is some sort of "reset" option for things like views and characters, which would leave the view there but simply blank out all its loops and frames, or for a character reset all its options to the default state.

However, I'm generally very cautious about adding Delete functionality - when it was added for sprites it has caused several problems since with people deleting things that they were still using.
Title: Re:Can't delete useless junk from my game!
Post by: SmashManiac on Sat 10/01/2004 21:15:11
Quote from: Pumaman on Sat 10/01/2004 20:08:06

However, I'm generally very cautious about adding Delete functionality - when it was added for sprites it has caused several problems since with people deleting things that they were still using.


That's the USER's problem! As long there's no accidental deleting possibility, the problem you mentionned should not be a problem for an attentive user.
Title: Re:Can't delete useless junk from my game!
Post by: Ishmael on Sun 11/01/2004 09:30:01
QuoteThat's the USER's problem!

Yeah, it is, but as there are users who do not realize this every time they are about to delete something, it caused problems.

I once screwed up my spriteset (don't remember how...), AGS crashed every time I tried to see a view which used sprites, that didn't exists, as I had place the default spriteset (from a blank game) on the game folder. Even after I had re-imported my sprites to the game, AGS crashed, because I didn't have all the sprite numbers that the views used. Thus, sometimes, if I selected a view that had used the sprites that didn't exist, I got a load of warnings, and eventually the crash. This way I was able to replace the frame sprites with the proper ones. Also, my GUIs looked really wierd, as for ex. the text window had one of the main char's walking frames as a border image.... that looked fun... but after I got the sprites back in order, AGS and my game ran normally. After that I have been careful about messing with the game data files in other programs.........
Title: Re:Can't delete useless junk from my game!
Post by: Pumaman on Sun 11/01/2004 21:15:14
Quote from: SmashManiac on Sat 10/01/2004 21:15:11
That's the USER's problem! As long there's no accidental deleting possibility, the problem you mentionned should not be a problem for an attentive user.

It is the user's problem, yes. However, even with the warning message that the Delete Sprite option has, a surprising number of people were managing to accidentally delete things, because they forgot that the sprite was used by one of their inventory items, and so on.

In a way it's a case of a minority spoiling it for the majority - but as I say, I am looking into ways to add deletion support to other parts of the game.
Title: Re:Can't delete useless junk from my game!
Post by: Gilbert on Mon 12/01/2004 05:59:24
/me is tempted to post TEH story again...


...NOT!
Title: Re:Can't delete useless junk from my game!
Post by: SmashManiac on Mon 12/01/2004 07:26:47
Quote from: TK on Sun 11/01/2004 09:30:01
Yeah, it is, but as there are users who do not realize this every time they are about to delete something, it caused problems.

I once screwed up my spriteset (don't remember how...), AGS crashed every time I tried to see a view which used sprites, that didn't exists, as I had place the default spriteset (from a blank game) on the game folder. Even after I had re-imported my sprites to the game, AGS crashed, because I didn't have all the sprite numbers that the views used. Thus, sometimes, if I selected a view that had used the sprites that didn't exist, I got a load of warnings, and eventually the crash. This way I was able to replace the frame sprites with the proper ones. Also, my GUIs looked really wierd, as for ex. the text window had one of the main char's walking frames as a border image.... that looked fun... but after I got the sprites back in order, AGS and my game ran normally. After that I have been careful about messing with the game data files in other programs.........

To avoid that I always do backups of my projects once in a while. These are useful every time there's a programming thing to do... as long as you don't delete the correct version and keep the backup as your final work!

(I can't believe my first newbie post and question has actually made all that debate!)