DistributedNode

No problem. Thanks for looking into this.

Zanz,

Not to move backwards on you, but I am finally getting a chance to play around with this again. I am still using the May 29 code.

Have you used this on multiple computers? I cannot seem to get the connection to work between systems. It works great on each machine using multiple instances of Panda3D.

I start the code on both machines. I start the server on one and connect it to itself. So far, so good.

Next, I hit c on the other machine to connect, and I get:


C:\SpaceFlight\Distributed>python distributedNodeDemo.py
DirectStart: Starting the game.
Warning: DirectNotify: category 'Interval' already exists
Known pipe types:
  wglGraphicsPipe
(all display modules loaded.)
:util(warning): Adjusting global clock's real time by 8.31964e-006 seconds.
Warning: DirectNotify: category 'ClientRepository' already exists
DCFile::read of base.dc
DCFile::read of base.dc
:util(warning): Adjusting global clock's real time by -0.177103 seconds.
Connected to server
:distributed(warning): Could not send datagram.
:ClientRepositorywarning: Lost connection to gameserver.
Connection to server lost

I did change the host to match my IP addresses, obviously. It looks like the connection is being established, but as soon as it tries to communicate, it loses it again.

If you (or drwr) have any sugestions on where to go hunting, I would appreciate it. I am going to try digging through the API info and other code looking for the datagram warning, but I am hoping that you may have seen this and know how to get it working across machines.

FWIW: I did disable my firewall to do the testing as well.

EDIT I uncommented the line:

  self.clientRepository.setVerbose(1)

and started it again. I am getting a lot of :

:ClientRepository:debug: Heartbeats not started; not sending.

However, interestingly, I am able to stay connected now, and can actually make the demo work across 2 machines this way. Data is getting back and forth, and the demo functions just like it should.

I am off to dig into why the heartbeats arenā€™t happening. Let me know if anyone has suggestions.

I have gotten this working fine using different machines. Make sure your firewall is open on the port that you are using. The reason you are getting the datagram warning is because the connection is not open. Iā€™m not sure what the heartbeats are used for but they are disabled by default.

Changed due to solving

Found the issue. Things were trying to happen to fast. Adding the verbose messaging slowed it down enough to work.

I ended up changing

base.taskMgr.add(self.tskMonitorConnection,"tskMonitorConnection")

to

base.taskMgr.doMethodLater(0.25,self.tskMonitorConnection,"tskMonitorConnection")

and

base.taskMgr.doMethodLater(0,self.myClient.setZone,"setzone")

to

base.taskMgr.doMethodLater(0.5,self.myClient.setZone,"setzone")

and it works great.

Thanks again for all the work, zanz. I am following along anxiously! Perhaps you might consider adding these delays to your ā€œofficialā€ demo source?

Actually, what you are experiencing I think is fixed in my newer code. I fixed that problem with things happening too fast. I was actually starting the task too early before the avatar was generated. Try using the more recent version. The smoothing isnā€™t actually smoothing yet, but there are several other fixes in the code besides that. Let me know if you still run into these issues.

drwr: any word on possible solution to this yet? Will this require adding some code to the ClientRepository?

Yeah, Iā€™ve been playing with the code. It really is in kind of a sad state. Iā€™m about halfway through getting a working demo set up, but it will require some changes in several files in direct, including some C++ files.

David

Awesome! I look forward to seeing it.

Will this require recompiling from source once you are done to get these changes?

Yeah, but maybe I can make a temporary compromise fix that works but requires no C++ changes.

David

I can wait for a proper fix. I can compile the source if need be. I know there have been a lot of additions to the source lately. Maybe a minor release could be scheduled that includes these fixes too? :open_mouth:

Thatā€™s not up to me, and pro-rsoft has already been working overtime on the existing 1.6.x minor releases. Iā€™m not sure that this fix is important enough to justify a new one right away.

Still, if you can build the source, it will be helpful; and it will give us a chance to iterate together and be sure that all of the needed fixes are properly committed.

David

Just let me know when you are ready and Iā€™ll compile from the source.

Iā€™ll only make a new minor release if it contains enough significant bugfixes - not just if thereā€™s just one item to put on the changelog.

Itā€™s no problem. I can compile the source easily enough.

Any progress on this?

Still working on it. Making progress, but itā€™s slow: I can only work an hour or two a night on my own time on this.

David

OK, Iā€™m finally done! Youā€™ll need to pick up the latest Panda source code from cvs and build it.

Hereā€™s the demo programs: http://www.ddrose.com/~drose/net.zip

There are two different client/server programs, each of which has a client part and a server part. For program 1, run:

python server1.py
python client1.py
python client1.py

That is, one server, and any number of clients. This program demonstrates the use of DistributedNode and other distributed objects, and the basic use of the dc file. It also demonstrates creating/destroying objects and switching zones.

For program2, use:

python server2.py
python client2.py
python client2.py

This program adds to program 1 by adding DistributedSmoothNode, which requires the distributed TimeManager class to synchronize clocks. It also requires running an ā€œAIā€ process, which is a special kind of client that manages all of the objects in the world that are server-created (such as the TimeManager).

David

Thanks a LOT for taking the time to do this. I think a great many people will benefit from this. You rock!

David, would you mind if I included your sample into the sample programs?
That way, other users could benefit from it, too.

Not at all, though it doesnā€™t stand up to the quality of the other sample programs. Most of the other sample programs have real art, and many of them even implement something like a real game. Itā€™s my hope that someone will improve on my sample programs to bring them up to this kind of level. :slight_smile:

David