Page 2 of 2
Re: Component based behaviorless entity systems and scriptin
Posted: Wed Nov 02, 2011 12:07 pm
by Rebornxeno
lol.
Re: Component based behaviorless entity systems and scriptin
Posted: Thu Nov 03, 2011 9:16 am
by Aleios
Rebornxeno wrote:lol.
Well, i was going to tell you to fuck off since our last little conversation but... oh fuck it,
FUCK OFF!
Anyway...
midix wrote:
Let's say, I want my entire game logic to be scripted (with Lua or C#/Mono, I guess). The game engine itself should not know anything about particular game, the engine just can supply some optimized algorithms, like pathfinding, some predefined generic AI algorithms etc.
Hmm, i guess it would be somewhat useful, but the purpose of scripting is usually to add a few smaller components or 'pieces of logic' (for lack of a better word). Scripting is, in comparison to compiled c++ code, way slower. For example i generally use scripting for simple tasks such as adding an NPC and most of the time i just end up using it as a debug console (kind of like what gyro did in). Im not saying you should not give it a shot, but rather that i believe you will start to see the side-effects of relying on scripting as you require more complex operations, though this is assuming that it's the path you wanted to take.
Most of the rest of your post i did not understand too good, im still improving my English
Re: Component based behaviorless entity systems and scriptin
Posted: Thu Nov 03, 2011 8:41 pm
by CC Ricers
Scripting is good when it's done to speed up development time. That's really the appeal of using a scripting language for your program. I agree that it should be nowhere near touching the lower-level stuff like moving NPCs around, calculating matrices or swapping the render order of sprites, but as far as
modifying content or high level gameplay mechanics, it's all good.
That GameDev article that midix posted is very good, by the way. I ran across it two years ago and it got me moving away from rigid hierarchical based structures and more into aggregate components, where game entities are literally a sum of their parts. The most problematic issue, to me, is specifying an order of priorities in which the order that components communicate with each other. There's this
example of how to organize the flow out a certain way, but I wasn't able to find a basic code sample of such a component based system anywhere on the net. Maybe I'm just wrong in thinking that the horizontal axis represents the time and order of execution? (also I'm wondering in the world would he want the alien to not have a physics component, but still gave one to the grenade
)
Re: Component based behaviorless entity systems and scriptin
Posted: Thu Nov 03, 2011 9:57 pm
by dandymcgee
CC Ricers wrote:Maybe I'm just wrong in thinking that the horizontal axis represents the time and order of execution? (also I'm wondering in the world would he want the alien to not have a physics component, but still gave one to the grenade
)
There is no time in that figure. It simply provides you with a few examples you may relate to and shows what components such an example might logically aggregate. Honestly I'm not sure why the dotted lines or arrows are even there at all, it would be less confusing if there were excluded completely. As far as the alien not having a physics component, that's completely up to the designer. Maybe in this particular game an alien fizzes out of sight when hit by any weapon, rather than flying across the room and bouncing off a wall. I did start work on a component-based engine solely for demonstration purposes. As a matter of fact, I've recently been considering reviving the project. It was definitely one of the more interesting designs I did work on.
Re: Component based behaviorless entity systems and scriptin
Posted: Fri Nov 04, 2011 11:01 am
by TheBuzzSaw
I am at the "exciting" part of connecting Lua to my C++ engine right now. My philosophy is essentially to let Lua make all the "slow decisions". For example, HP is a slow decision. HP is not something that is updated 60 frames per second. HP is something that is updated periodically (during a collision event, during a poison update, etc.). On the other side, C++ makes all the "fast decisions". Whereas Lua might say "this asteroid has a mass of 40 kg", C++ correctly applies the asteroid's mass and velocity in a collision and keeps everything smooth.
C++ is the master violinist. Its job is to know how to play any sheet music placed before it. Lua is the one choosing the song.
Re: Component based behaviorless entity systems and scriptin
Posted: Fri Nov 04, 2011 6:20 pm
by XianForce
I feel slightly ashamed because I tried to "like" your post, TheBuzzSaw...
Re: Component based behaviorless entity systems and scriptin
Posted: Fri Nov 04, 2011 6:38 pm
by GroundUpEngine
TheBuzzSaw wrote:...
C++ is the master violinist. Its job is to know how to play any sheet music placed before it. Lua is the one choosing the song.
That was beautiful man.