Code Design and Library Experiments

Added by Marenz about 1 year ago

Currently I am doing small experiments to find out specific things about the libraries.

Very fast objects are mostly a problem in physic engines as those update the simulation in certain timesteps, so it could happen that a fast objects is in front of a wall/player and in the next step it is already through. No collision was detected because it was just to fast.
Now to overcome this problem physX provides a mechanism called Continious Collision Detection. The collision here is not callculated in steps but in a continious stream. This requires more calculations but is absolutly reliable.

Now, to detect if an object is near you (for example a ball lying around in your 'catch' radius) you can use physX's trigger. Those are objects that don't have a real body that can collide. Instead, those objects call a previously specified callback function when ever something enters/leaves them. That way you can find out when something is within a certain object. So each player should have an invisible 'catch' object bound to the callback functions.

Now the problem was, that in the manual they say that Triggers don't take part in CCD. What ever that means.
And I needed to be sure what it means, so I tested it. What we need works: an object with enabled CCD does trigger the callback function on enter.

Now, about the scripting engine. It has a neat feature called Interfaces. You can specify an Interface from the host-application and the script can implement it. So, we provide the scripter with these interfaces:

  • Controller
  • Trigger
  • Contact

Trigger has functions that will be called when something enters/leaves the associated object and
Contact has functions that will be called when something touches the associated object.
Controller allows the scripter to react on userinput (keyboard, mouse), how exactly is not sure yet.
Maybe we provide some functions to the scripts that allows them to specify certain commands like move,strafe,shot,pass and those can then be set in the configuration menu. Then a function of Controller will be called, everytime a key that was associated with a command was pressed.
Needs some work.

A angelscript class can also implement several interfaces.
Additionally, we should provide some functions to load and display a model and its animations, I haven't checkout that part yet.

Well, everything that was not mention that is part of a game needs still some thinking work sofar.

What I wish from you: get a working development enviroment and check out the libraries APIs and the tools (git, cmake). Compile small examples, get used to the API.

and send me your god damn public keys or you won't be able to commit sourecode.

--Marenz


Comments