So a friend and I have been working on an engine to get more experience working on games. We got our engine to the point where we made a really basic and junky pong game, we did it because we realized that there were alot of design flaws in our engine that we had not thought about, so decided to try and make something even remotely interesting out of it before we stopped and actually designed what we need out of an engine.
One thing that I felt clueless about, was how games define individual actor behaviors. For instance in our tiny game, we had a 6 walls that formed a container, ok easy enough, we loaded it in from an xml level file, they don't do anything either than interact via the physics system with collisions. Next we had the paddles, this was easy, as the behavior of these objects were controlled through a game view, whether it is a Human, AI, or Remote view.
The thing that I couldn't figure out, is how do I make actors, that are not attached to a game view, behave differently. A good example is our 'Pong' ball, it does not need to be attached to a AI view, as it is simply an object that moves with the paddles.
I hard coded the movement as it was the only actor in our demo that needed movement without a View attached. This seems sloppy as I don't think (maybe I'm wrong), that you need to hold things like the balls movement vector directly in the game logic class. This required me to also hold a pointer to the ball directly in the game logic. On every logic update, the ball's movement vector was hard coded to apply force to the ball's rigid body. I also added a listener in the Logic class to reverse the recieved collision normal and change the balls vector upon a collision.
I think if I am understanding correctly, with this component based Actor architecture I should be using processes. I'm just not sure how to go about it, how would I define in say, a Lua Script, to make one specific instance of a ball move each frame in the direction of it's movement vector?
One thing that I felt clueless about, was how games define individual actor behaviors. For instance in our tiny game, we had a 6 walls that formed a container, ok easy enough, we loaded it in from an xml level file, they don't do anything either than interact via the physics system with collisions. Next we had the paddles, this was easy, as the behavior of these objects were controlled through a game view, whether it is a Human, AI, or Remote view.
The thing that I couldn't figure out, is how do I make actors, that are not attached to a game view, behave differently. A good example is our 'Pong' ball, it does not need to be attached to a AI view, as it is simply an object that moves with the paddles.
I hard coded the movement as it was the only actor in our demo that needed movement without a View attached. This seems sloppy as I don't think (maybe I'm wrong), that you need to hold things like the balls movement vector directly in the game logic class. This required me to also hold a pointer to the ball directly in the game logic. On every logic update, the ball's movement vector was hard coded to apply force to the ball's rigid body. I also added a listener in the Logic class to reverse the recieved collision normal and change the balls vector upon a collision.
I think if I am understanding correctly, with this component based Actor architecture I should be using processes. I'm just not sure how to go about it, how would I define in say, a Lua Script, to make one specific instance of a ball move each frame in the direction of it's movement vector?
PC - Custom Built
CPU: 3rd Gen. Intel i7 3770 3.4Ghz
GPU: ATI Radeon HD 7959 3GB
RAM: 16GB
Laptop - Alienware M17x
CPU: 3rd Gen. Intel i7 - Ivy Bridge
GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
RAM: 8GB Dual Channel DDR3 @ 1600mhz
CPU: 3rd Gen. Intel i7 3770 3.4Ghz
GPU: ATI Radeon HD 7959 3GB
RAM: 16GB
Laptop - Alienware M17x
CPU: 3rd Gen. Intel i7 - Ivy Bridge
GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
RAM: 8GB Dual Channel DDR3 @ 1600mhz