Scripting and client/server question
by Raj Sharma · in Torque Game Engine · 06/20/2007 (12:34 pm) · 0 replies
Hi,
I have a prototype for a game that is written in Python and interfaces with TGB for sprites/audio/etc using the python binding code Joshua Ritter developed. What I want to do is make the transition from the simple 2d prototype to a full-blown 3d game implemented in TGEA.
So, here are the goals I'm trying to accomplish:
1) The prototype is 100% python- I'd like to preserve as much of that code as possible.
2) Need to move to a client/server architecture
3) The prototype uses model/view architecture, which I'd like to preserve.
The reasons these seem tricky to me is that the examples I've seen so far of creating entities in Torque involve creating a C++ class derived from ShapeBase and adding a bunch of code to deal with bitstreams/networking stuff. This would take care of (2) above... However, it would mean re-implementing everything in C++, and also I don't know if it would work well with model/view, because every entity has an associated model.
Maybe it isn't even possible to have a networked TGEA game without writing all the entities in C++ because I assume they need to inherit from NetObject in order to participate in the simulation. In that case, maybe there is some way to write just a shallow skeleton of each class in C++ and keep the python script for all the actual functionality as-is?
So I know this question is somewhat vague and open-ended, but what would be a good way to make this transition? If any clarifications are needed I'd be happy to explain things in more detail.
Thanks,
Raj
I have a prototype for a game that is written in Python and interfaces with TGB for sprites/audio/etc using the python binding code Joshua Ritter developed. What I want to do is make the transition from the simple 2d prototype to a full-blown 3d game implemented in TGEA.
So, here are the goals I'm trying to accomplish:
1) The prototype is 100% python- I'd like to preserve as much of that code as possible.
2) Need to move to a client/server architecture
3) The prototype uses model/view architecture, which I'd like to preserve.
The reasons these seem tricky to me is that the examples I've seen so far of creating entities in Torque involve creating a C++ class derived from ShapeBase and adding a bunch of code to deal with bitstreams/networking stuff. This would take care of (2) above... However, it would mean re-implementing everything in C++, and also I don't know if it would work well with model/view, because every entity has an associated model.
Maybe it isn't even possible to have a networked TGEA game without writing all the entities in C++ because I assume they need to inherit from NetObject in order to participate in the simulation. In that case, maybe there is some way to write just a shallow skeleton of each class in C++ and keep the python script for all the actual functionality as-is?
So I know this question is somewhat vague and open-ended, but what would be a good way to make this transition? If any clarifications are needed I'd be happy to explain things in more detail.
Thanks,
Raj
About the author