HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: [Resolved] Deleting Specs  (Read 2181 times)

TGSRofar

  • General Accounts
  • *
  • Posts: 153
    • View Profile
[Resolved] Deleting Specs
« on: Feb 21, 11, 08:01:37 PM »

What is the correct way to delete specs?

This question is related to development of a SpecOracle and its related Editors.  During this development, I will always create some dummy specs for testing everything out but will want to get these cleaned up when the system is complete.

It appears to me that this could be accomplished by deleting the server prototypes (created specs, specoracle, and specoracleDataCache) and deleting the repository spec definitions for created specs.  Then re-create the SpecOracle server prototype.

Is this correct or is there some other way to "clean" up the junk created during development?
« Last Edit: Nov 01, 12, 11:13:36 AM by HE-Cooper »
Logged
Ron Farrell
Lead Programmer
Triad Game Studios

HE-CHRISTOPHER

  • HeroEngine
  • *****
  • Posts: 424
    • View Profile
Re: Deleting Specs
« Reply #1 on: Feb 21, 11, 08:39:11 PM »


By design, deleting of specs is not supported without manipulating the internals of the system (hope you know what you are doing :) ).  The reasoning is that in a running game it is almost difficult to impossible to know when you no longer have any objects referencing a particular spec (and will never have any references if you happen to for example restore a character from a backup).

When you KNOW that no references to a particular spec can ever be valid, you can safely delete the prototype and manually (whether via the CLI or script) modify the SpecKeyMap on the SpecOracle prototype that maintains the mapping of SpecKey to prototype ID to remove that ID.  It is not generally recommended that you attempt to reuse old SpecKeys as the ID Space used by a SpecOracle is expected to be a monotonically ascending value.

If you REALLY want a fresh start, you would want to delete anything you no longer want (probably renaming the "old" spec oracle so you can reference is data while you transition) and then create a new SpecOracle prototype and reindex all specs (updating their SpecKey fields to the new ID, this also requires you mess with the ID space that manages ID allocation for SpecKeys see HSL ID Spaces).  Please note this is a basically nuclear option and if any existing spec derived object references the old spec keys it will be very confused by referencing a totally new spec that happens to reuse that old spec key.

Logged
Christopher Larsen
CTO
HeroEngine

TGSRofar

  • General Accounts
  • *
  • Posts: 153
    • View Profile
Re: Deleting Specs
« Reply #2 on: Feb 22, 11, 05:01:37 PM »

Thanks for the thorough explanation.  At this point, I don't think I will worry about a few junk specs hanging around.  I can mark them as "deleted". 
Logged
Ron Farrell
Lead Programmer
Triad Game Studios