I am working on a small game engine for practicing purpose and also for putting some of my ideas into action. What I have so far is a couple of systems for rendering, sound etc. The next step is to put all these things together. I already looked into entity component systems, in particular the following article: http://www.gamedev.net/page/resources/_/technical/game-programming/implementing-component-entity-systems-r3382
I think that this approach would suit my needs to a certain level, but I also would like to implement the game logic itself inside scripts. I came up with a slightly different approach:
The rendering, sound, physics, input and simulation systems perform actions on the data, which is basically a level object and a list of entities (for technical reasons I have to distinguish between entities and level geometry). The particular systems only perform actions on those entities which match their criteria (e.g. the physics system only handles entities with a bounding volume). In my approach the systems do not directly implement behavior. Instead they are either creating output (rendering, sound) or input (physics, input). The simulation system manages the scripts which may be assigned to entities. The script of an entity consists of two parts, first the initialization code which is executed when the entity is added to the scene, and second the code which is executed once per frame (or less, depending on whether the code contains a wait-statement). Additionally every entity may implement event handlers which are called whenever the input or physics system throws an event (e.g. a CollisionEvent, KeyDownEvent etc.). Entity scripts may define parameters, which can be modified inside the level editor.
My question is, whether this architecture has some severe weaknesses. Since I want to avoid threading, my scripts will be scheduled by the simulation system, which lead me to the restriction that an entity script is called once per frame (which means that loops should be avoided, since basically everything already is inside a big loop). Is this reasonable or is there any better way?