I’ve decided I might try my hand at some networking with panda3D. Here’s the basic idea behind the project:
The application will be based on a simple concept, that being an individual I’ll call a ‘char’, short for character. There will be multiple chars, and each char will be under the control of a single user. The application will work on the basis of turns, meaning only one user will be doing things at a time, and only when that user performs an action will the data for any chars require updating. All of the users will be able to view the current data for a char at any time.
The data for the chars can be readily represented by simple strings, numbers, and booleans. It will include things like position, stats for dealing, receiving, or avoiding damage, and other basics for a game.
Ideally, I would like to be able to create a class for chars that has all of the data a char might need in it, and when that data is altered, all of the users immediately receive the changes.
I’d bet dollars to donuts that Panda3D can do this with distributed objects, but given my education as an artist rather than a programmer, the vast majority of the networking implementations and examples I’ve found go way over my head.
To dumb things down, what I need is a way I can create a class that looks like this:
class Character:
def __init__(self):
self.statistic1 = 10
self.statistic2 = 20
self.statistic3 = 100
self.boolean1 = True
self.boolean2 = False
self.boolean3 = True
And allow multiple users on multiple computers to access and alter the data in various instances of that class, and have the alterations they make show up on all of the connected computers.
I honestly don’t know how difficult it would be to do something like that. Could anyone provide a code example on how that would work?