Panda3D Code Issue

Hi i’m working on a non-profit game but the i looked on the site(about half way threw in codes avalible) but did not see everything i was looking for.

I was wondering if some 1 could tell me which codes i need and such.
(this is my first time with panda and this coding but ive already learned tons)

Heres code or questions i have

How do you make servers for your game.
How do you make character creation.
How do you make third-person character viewing and controllings.
How do you make it were other people can access and play.
How do you Connect game or give game a log-in system.
How do you add quests for your game.
How do you make a item window.
How do you make a message were you can talk in game.
How do you make NPC that you can battle.
How do you make it were you can earn exp and items from beating the things you battle.
How do you make it were you can change characters clothing and items.

and thats about all i can think of right now. if anyone can help me with this please post here or pm me or something. Thanks

:open_mouth: Um…

I don’t think Panda3D has all of that stuff built-in. It’s a 3D engine, not an MMORPG maker.

If you want all that you’ll have to program most of it yourself. Not from scratch of course, all of these things can be done in panda. Toontown (which happens to be an MMORPG) is proof of that.

First, can you write a Python script? If you can’t, learn Python! Ask and I can get you started. I think Python is pretty easy and fun.

Second, Read through the manual (It still needs some work, I know) Do the tutorials. That should give you a basic idea of how to use panda. If there’s something you’re not sure about, search the forums. You’re probably not the first person to wonder about it. If you can’t find it on the forums, post a very specific subject header (“Code Issue” is not very specific) and a detailed, specific question, and we’ll try to help you.

I’ll try to get you started.

How do you make servers for your game?
How do you Connect game or give game a log-in system?

I don’t know how, haven’t done that yet. Panda is supposed to have some networking built in. drwr would probably know more. Also check out twisted.

How do you make character creation? How do you add quests for your game?
I think you’ll have to write that completely yourself. We can help you with specifics.

How do you make third-person character viewing and controllings?
Check out the roaming Ralph tutorial, and the Point & Click Player Movement Over Uneven Terrain script in the Code Snipplets forums.

How do you make it were other people can access and play? How do you make it were you can earn exp and items from beating the things you battle? How do you make it were you can change characters clothing and items?
‘Where’ has an ‘h’ in it.

How do you make a item window? Check out direct GUI. You can probably make one with that.

How do you make a message were you can talk in game. I don’t understand the question.

How do you make NPC that you can battle? You could probably make a basic AI with the FSMs.

Thanks for replying on some of my questions and ive went about 70% threw the manual and i play toontown been a member for awhile and thats why i got all this questions about in game chat and stuff.and about the message thing you said you didnt understand what i ment was like a little bar down at the bottom where you can talk with other people thats playing the game while you are.

and whats Fms? and also im not sure how to right a code 100% myself yet ive did my own codes before but that was with graphic designs which is easier lol.

and yeah ive been playing around with python making scripts.

FSM, not fms?! FSM = Finite State Machine. I think it’s section O in the manual.

DirectEntry (in direct GUI) makes a bar you can type stuff in.

You can do everything you listed. The issue is how you implement it- how do you go about actually making it. First off, you need to have a plan about how you want things to run. You have to have some kind of mental picture about how what you want would translate into code, then while writing you’ll have to tweak things.

For example: You ask about servers. Well, making a server is pretty easy. It’s like 8 lines of code to set up to receive connections. The hard part is that the actual data transfer is mostly through strings. So you can’t just pass the different models or pandanodes across the network. You pass instead location, orientation, and hitpoints or whatever. Then on the client side you have to make that string make sense again. You’d probably want some message to trigger creation of new enemies on the client-side as well.

Internet play is going to be slightly different than LAN play due to the different IP address system and the relatively longer delay for internet play.

There are good examples people have posted both in the tutorials and here in the forum- look at how people solved their problems. You’ll learn a lot. It’s all mathematics pretty much. You ask

Well, you give the NPC a variable called “hitpoints” or “shields” or “whatever” you setup code to test for collisions, if there was a collision you subtract some value from hitpoints- then check to make sure hitpoint isn’t below 1. If it is, the dude died so you can say

self.playerscore = self.playerscore + 15

or something like that to add points.

Despite the answers already given, you’re not quite right with the statement that there aren’t any code examples to your questions.

There are several threads dealing with this topic. You’ll find at least enough network code here to get you started.

I don’t know exactly what you mean with this question. But you could start by writing a class that holds all the neccessary variables and objects your characters need.

Here you might want to have a look at the roaming ralph example that comes with Panda itself. (check your panda install folder for the samples folder, there you’ll find it)

That’s the network topic again, right?

That might become the hard part. How to write a quest system is entirely up to the programmer. And this task also depends on how your game is written. So I suggest you write some basic stuff first.

Have a look at the DirectGUI Class in the manual.

There’s some sample code for a chat system written in Panda. Search the forums.

To make NPCs you’ll need to write your own AI (Artificial Inteeligence) Class. You’ll find something to get you started on this topic in the forums. It’s a thread about implementing steering behaviour.

Simple, that’s all about variables. There’s not much to answer here, unless you want us to write the game for you. Start learning Python&Panda and the answer will just come to your mind.

The answer to your clothing question could be found in the joint manipulation sample code, that can be found in your panda sample folder.
But again, what your characters wears, what items he owns, it’s all about variables. This is a perfect task for Dictionaries and Lists.

If you have never programmed something before, you might want to check the Python tutorials on http://www.python.org
There you’ll learn some basics about programming

Oh,okay and yeah ive got a idea about how i want the game to run and stuff and thxs for the hitpoint code.

im going to work on game later.

Just seen your post Legion i must have been typing when you posted.

And i’ve did some programming before i’ve been playing around with panda and the ralph walking code quite a bit to get the hang of tweaking stuff and such.
But on the clothing like how how do you make it where you put the clothing on in the game.
and on creating a character (if you ever played star wars galaxies well like that when you make a player)
but im starting to understand abit more about how to do this now.

self.playerscore += 15
# does the same thing as
self.playerscore = self.playerscore + 15

But 1 other thing. how do you make the NPC attack you and how do you make it where you can attack it.

for NPC… let them make decisions based on what they see/hear. very simple example. if you are closer than 10m to a npc he’ll start to attack you. just ask for the distance and decide on the distance if he attacks or not.

and the “where” well you can set up collision solids and depending on your weapon you can for example cast a collision ray on the solids which would be simmilar to a shot with a single bullet.

there are many documents on those basic game-programming subject on the web :slight_smile:

One other thing is i’ve been trying to tweak the roaming ralph abit to work with my environment and actor/model but i keep having problems with the environment part do you use a jpg or a egg file? im currently useing a egg file for the environment.

Oh okay gothca.(I know seems like i dont know anything but i think im doing pretty well for 13 years old lol)

And i’m Dl’ing maya right now cause i messed up the first download but i hate how it works. i found a really good 3D program but it dont save in egg.

I started programming when I was 13 :slight_smile: .
There is a nice 3d program you could try:
blender.org
there are lots of tutorials available and there is an egg-exporter called “chicken” for it somewhere on this forum.

Good luck!

jep… if you are fresh and up to learn something then learn blender. its open source,free,very very good, has a gread exporter for panda (and many other formats), and its well documented/tutorialed.
and the later version have really nice features like sculping mode, normalmap generation, lightmap bakeing… and lots more =)
in one phrase. the best thing you can use in combination with panda=)

13… reminds me when i started with game-development. thought i never coded until half a year ago^^ makes more than 8 years in 3d-modelling,animatiions,texturing, and theory behind games :slight_smile: i missed a lot of fun skipping codeing :smiley:

Hmm i think ill try blender out then sounds pretty cool.

EDIT: I think ill either start working on some game designs tonight or tomorrow wish me luck lol.

I’m having a problem with my roaming ralph coding im tweaking and im not quite sure what to do.

when i try to run my script it says there a problem with that but ive tryed all i can think of and nothing seems to make the error message go away.

Could you post the error message?

Yeah sure ill post a image of it.

But now there seems to be a diffirent error but it is still pointing towards that same code.

It could be a problem on the line before it. Like if you forgot a “,” or “)” or “:” or something somewhere. It might still be valid until that line, although the line by itself is correct. Also make sure to indent using only spaces, never tabs! If you mix them together Python can’t tell where your blocks begin and end. Some IDE’s can take care of this for you, so check the documentation.