Guidance on various topics

Hello there, I have a test demo app. up and running using mocap software combined with basic networking and it’s great fun at the moment, however, I hope to start again from scratch and develop it into a fully-fledged game. I was hoping to get some pointers before I start re-coding:

  1. At the moment all my assets are loaded as separate eggs (house, house, church, house, windmill, road, etc) and placed on my map. Is this best performance wise or is it better to have all level assets stored in one big egg (loader.loadModel(“level”))?

  2. I hope to include shadows in my final game. I’m assuming the best way is to apply real-time shadows to only dynamic objects, everything that is static can be texture baked? I haven’t messed around with shadow generation as of yet but have texture baked to get some shadows on my static objects before. This resulted in a huge amount of textures, a separate texture for every face of geometry, am I doing something wrong (this was achieved in Max)? This resulted in very slow loading times when the assets are first loaded and generally a huge assets folder!

  3. I have a nice bloom effect in my scene. If I apply dynamic shadows to my main character can I still incorporate the bloom shader?

  4. There seems to be quite a few different shadow generation scripts out there. Is there a commonly considered “best one”?

  5. Over my time with Panda I have looked at a lot of people’s code. It seems everyone has a different way of managing classes etc. I find it far easier to have the bulk of all my code in one Class. Is this necessarily a bad thing?

  6. The game atm consists of two people firing arrows at each other over a client/server architecture. The players pos is sent across the server. Initially I also sent the arrows pos when fired. This resulted in a very “un-smooth” arrow fire due to the fast motion of the arrow combined with the speed of the server. I now have the trajectory and power sent and the arrow’s flight is dealt with client side, this seems to work far better but is perhaps a tad less accurate as the arrow pos on both clients dont match up perfectly (due to a minute change in traj). Is that an appropirate method to handle such a task? Is there another way? In what ways do commercial games tackle projectiles across a network?

  7. I have read a little about predicted data to lessen the strain on the network but didn’t grasp it entirely. Is it possible if someone could just fill me in with some basics on this?

Many thanks, would really appreciate it if someone could point me in the right direction regarding these points before I make a start.

  1. Your choice. I prefer to have one level egg file that references all the other egg files.

  2. Depends on whether you want dynamic sun and dynamic objects or not. In Panda 1.7.0 (or latest CVS version) Panda can automatically do shadows for you.

  3. Yes. With the upcoming 1.7.0 release, you can.

  4. I’d say, judge from the result. Most shadow implementations at the forums here aren’t terribly fast+optimized though (including my own).

  5. Well, it will probably get very hard to work with when your code gets bigger. OOP is probably the way to go.

  1. This is a general problem with distributed games. Messages take a while to be delivered, and you have to deal with that somehow.

There are a number of hard choices. Different games have made different choices.

(1) Make everything attempt to be as accurate as possible on every client. This means things may course-correct, resulting in weird pops or wobbles, as new information comes in.

(2) Accept that some information is inaccurate. Make as good a show around this as possible. This may mean that player X believes he has shot player Y, but player Y believes he missed. Deal with this as fairly has possible.

(3) Design a game that doesn’t rely on fast data, like chinese checkers.

In your case, though, you might be able to do a bit better than what you currently have. For instance, you can broadcast the starting position and the trajectory of the arrow, and not launch the arrow until you have both of these points of data. Then the arrow will fly smoothly everywhere, and follow the same track everywhere. Only catch is it won’t fly at the same time everywhere, so there is still some room for disagreement about what the arrow will hit.

6a. Predicted data just means that you fill in some missing data on the receiving end, for instance by guessing where the object will be going based on where it is now and how fast it is moving. Sometimes you guess wrong (the object turned unexpectedly), and you have to course-correct when you find this out later. This is an example of trying to match case (1) above.

You mainly need to use sophisticated prediction algorithms for objects whose motions are hard to predict, like a player; an arrow’s flight is easy to predict given its starting point and trajectory.

David

(1) if you ship your game or release a package for users ship your models as bam, not as egg’s, those load much faster. (maybe this has already been said)

(5) i tend to try making parts of a projects as separate class when i think of it, that it could be used as separate tool. this has proven to be very useful for mouse and keyboard controls for example. having separate files helps keeping classes separate from other stuff of the project. depending on the editor you may also be easier to navigate if you have multiple files. something you will probably run into is that sharing instances, variables etc. between object/class instances may be a bit more difficult, but this receipt helps: effbot.org/pyfaq/how-do-i-share- … odules.htm (just my 2 cents:-)

the panda way: panda3d.org/apiref.php?page=BulletinBoard
or if you deal with common options only: panda3d.org/apiref.php?page= … ageManager

thanks for the pointers guys, going to look into Panda’s shadowing capabilities and see what I can get at a stable framerate. Never used the bam utility, going to give it a go and see if that helps. The arrow’s flight is good enough atm so I guess I will just have to send an extra message to confirm to both clients that the player was successfully hit. Thanks again and thanks to Panda for being such a great and enjoyable engine to work with.

Actually, .bam is a file format, not a utility (unless you mean egg2bam).
For shadows, you would need to grab the latest CVS version of Panda, or wait till 1.7.0.