16
DF Modding / Re: Stonesense - Official thread -
« on: December 31, 2009, 03:15:45 am »
Regarding objects in DF itself:
I've only done basic programming and I've got no idea how DF works, so I may be way off, but wouldn't it make more sense for object updating to be tied to actions instead of the object itself?
IE. No object gets checked unless an interaction occurs to change the state or position of that object.
Examples in plain language:
Eg. if carpenter chops tree then update object: remove object.
Eg. if tile falls and object exists on tile then update object position: -x z-levels.
Eg. if dwarf picks up object or if dwarf is carrying object then update object: position = dwarf's position.
Of course the above cases already happen in DF, but there doesn't seem to be a need to check objects continuously unless something happens to it or if DF needs to check for the existence of an object (for stock levels or available building stone etc).
Other objects that change over time need only be updated every so often as Impaler[WrG] suggested, such as grass tiles becoming dirt or trees changing colour with the seasons etc.
Like I said I've only done basic programming (literally DarkBasic Pro), so I'm probably better off leaving thoughts to the pros
I've only done basic programming and I've got no idea how DF works, so I may be way off, but wouldn't it make more sense for object updating to be tied to actions instead of the object itself?
IE. No object gets checked unless an interaction occurs to change the state or position of that object.
Examples in plain language:
Eg. if carpenter chops tree then update object: remove object.
Eg. if tile falls and object exists on tile then update object position: -x z-levels.
Eg. if dwarf picks up object or if dwarf is carrying object then update object: position = dwarf's position.
Of course the above cases already happen in DF, but there doesn't seem to be a need to check objects continuously unless something happens to it or if DF needs to check for the existence of an object (for stock levels or available building stone etc).
Other objects that change over time need only be updated every so often as Impaler[WrG] suggested, such as grass tiles becoming dirt or trees changing colour with the seasons etc.
Like I said I've only done basic programming (literally DarkBasic Pro), so I'm probably better off leaving thoughts to the pros


