Generally I very much like your constraints. I always feel strongly about clearly defining how things should work and otherwise not allow it all. That way we prevent a lot of unforeseen problems.
I might have to disagree here. In some situations it might be almost impossible to change an attribute. Or it might involve a massive workaround that nobody uses after all.x3n wrote: [*]All XML attributes should be changeable after the object was created and also after the object was ticked. If we build an editor, the level creators will play with the values and they should see the result.
As much as I like the concept, sometimes it's just not worth writing 500 LOC for a feature that isn't useful at all, just because our guidelines say so and the editor would like to have it. In the past, I know I've written a lot of such code just because I thought it made the concepts look good. But in the end, I could have saved a lot of time by deeming something of little use as impossible.
In rare occasions, a reload might be unavoidable.
I agree, but it doesn't work well with the "new should be enough" constraint. So sometimes a full object creation may (and possibly will, also by careless use) involve a lot of additional steps that may even (but shouldn't) modify the object itself.x3n wrote: => No complex stuff in constructors/destructors. In particular no virtual functions.
I think we somehow should have a way to prevent this.
In general about order: I think it should be possible to (implicitly) define dependencies (and I believe that's where you're heading anyway) after all. But in order to enforce the concept, the default behavior should be to randomly change the order every time you load a level! I know that might generate additional problems for PPS students, but we will get lazy otherwise.
The same goes for attributes.
That would be a very good concept just in the C++ way. We might want to make more use of Exceptions then because that's the only way to abort a destructor.x3n wrote: So I think this gives an impression of my general mindset, but it's way too early to make any final conclusions. In my opinion, creating an object just by calling "new" should be enough. After that, the object is in a neutral state where it doesn't crash and can be modified at any later time.
Another thought about level loading might then be: Just using "new" should be enough, but of course it might be that the object has to do more computations in the first tick. As an example, take an object that does additional analysis every 10s. Having many of them, these analysis can be evenly distributed after some time by using slight randomization in update time. But at the very beginning after loading, we might have a very long first tick, making the dt in the second tick considerably large. That could already lead some unexpected behavior.
My suggestion is that any object should be perfectly comfortable with tick(0), even if the time factor is not 0. And then the object should take these 0s literally.
Currently I'm not even sure whether we have any objects that don't adhere to these rules though.
That would also allow objects to examine its surrounds, something that is not yet possible at load time.
Confusion. A game object should be configurable by XML only, whereas a control object should only have config values.x3n wrote: Just one question:I don't undestand this one. Why is that a problem?An object should never have config values and an XMLPort at the same time
This applies 99% at the moment I believe, but I would enforce it.