[Feature Request] Ability to change Object's Name at runtime

Started by lizzlebizzle, Thu 20/01/2022 04:54:55

Previous topic - Next topic

lizzlebizzle

AGS devs and friends!

The Object.Name property is currently read-only. It would be super-fun if we could change an object's name at runtime.

I know this feature has been requested and discussed in previous forum posts, both recently (https://www.adventuregamestudio.co.uk/forums/index.php?topic=38640.0) and not-so-recently (https://www.adventuregamestudio.co.uk/forums/index.php?topic=38640.0).

Just wanted to submit a feature request to show additional interest in this bad boy (as opposed to lurking the forums like I usually do). Thanks for considering. :D

Crimson Wizard

#1
Yes, also for Hotspots.

This is one of the things that are always getting postponed because of low priority, and then forgotten about.
There's already a ticket opened for this: https://github.com/adventuregamestudio/ags/issues/979
I will assign to 3.6.0, because supposedly this may be easy.


For the reference, this will increase the memory use and size of the game saves, regardless of whether the names are going to be changed at runtime or not.
My estimate of a serious case is:
let's say a name is (rather long) 20 characters on average, there are max 40 objects in the room (currently), and a large game may have, say, 100 rooms.
that gives 20 * 40 * 100 = 80000 (or 80 KB) of used memory. 160 KB if also all 40 hotspots in all rooms have names.

eri0o

Hey, do you know if it's feasible or not to make it save only when it's different from the original static value? I don't know if it could but then could be a problem if one day we make the objects/hotspots themselves dynamic. Not sure if overthinking - anyway, it's very few KBs so probably doesn't matter.

Crimson Wizard

Quote from: eri0o on Thu 20/01/2022 10:20:05
Hey, do you know if it's feasible or not to make it save only when it's different from the original static value?

Because empty string is also a valid value it cannot be used to determine this when restoring a save. So this has to be set as a flag and saved as some flags field.

Alternatively, this may be saved as a custom property with some kind of "internal name" which otherwise cannot be reproduced. As custom properties are maps, they are only applied if the keys exist.


SMF spam blocked by CleanTalk