|
|||||||
![]() |
|
|
Thread Tools |
|
||||
|
Well, here is the link: Creating a Server for a (Blender) Game
The updated tutorial was too large to post on the forum so I moved it to my website. Here is the introduction to the tutorial: Quote:
Last edited by andrew-101; 04-Nov-08 at 07:11. |
||||
|
#1
|
||||
|
|
|
||||
|
well, i don't really get it but good work! i was under the impression servers had to be purchased... don't they? I don't really get the internet
............................................
<<<Watching a ping pong match <<<Watching a smokin hot chick run in circles. <<<Trying to see his eye-brows <<<Smokin hot chick found a trampoline. <<<Beneful? Wanna go to the park? Beneful?SAVE THE POLAR BEARS!!! http://www.reverbnation.com/theregoesthestudio http://www.myspace.com/sevendaysuntillnextweek |
||||
|
#2
|
|
||||
|
Thanks. I'll be keeping an eye on this thread.
Here's another one I had bookmarked on network gaming: http://blenderartists.org/forum/showthread.php?t=109123 |
||||
|
#3
|
|
||||
|
Hey, is LAN networking possible?
I have several PC's at my house and all are linked up on a LAN network. We play games like Starcraft together, so why not a Blender game?
............................................
This is my sig. Feel free to use my texture repository: http://www.cdupload.com/browse/Minifig/3913_FKSa1 Please don't call me mini. Last edited by Minifig; 06-Oct-08 at 16:27. |
||||
|
#4
|
|
||||
|
I think so, you have to make the host in blender be the ip address of the machine that the server is running on, so instead of locahost 127.101.51 or something
|
||||
|
#5
|
|
||||
|
My guess would be that for a local (within a single network) game, you would need to give it a local ip address. so 192.168.xxx.xxx (whatever is assigned by the router).
|
||||
|
#6
|
|
|||
|
Every computer in any TCP/IP network ... like the Internet, or the network in your home ... has an IP-address. The address is, no doubt, a set of 4 numbers (each one in the range 0-255... that is to say, four bytes).
There are a few "special" addresses:
Your entire house has only one IP-address, though, as far as the Internet-at-large is concerned. That address is held by, and known only to, your "router." What the router does, then, is to distribute inbound and outbound traffic between "the Internet" and "your home network." (They are, and they remain, two separate networks. Your router serves as the so-called gateway between them.) If you want to game within your home, it's easy: the IP-addresses are unique and they are confined to your home. If you want to game with your neighbor, however, the traffic will have to go through two routers... yours, and your neighbor's. The trick is, you won't see the IP-addresses within your neighbor's network. Instead, the traffic will come from the (Internet...) IP-address of your neighbor's router, and a particular port-number, which is rather like a telephone "extension." (Port-numbers are assigned by the router, and they are actually "how routers know how to distribute the traffic.") In a small game, the computers can talk directly to one another ... so-called peer-to-peer. But as the number of players increases, it becomes more efficient to route all the traffic to a central server, a so-called socket server, whose job is to maintain the state of the game and to send-and-receive appropriate notification messages from the players. In effect, the socket-server(s) "run" the game, while the individual client-computers manage the drawing of what you see. There are many commercial socket-servers, but there are open-source ones too. The programming required to implement such a server is both "not trivial" and "highly repetitive," since it is the necessary-foundation upon which the game-specific logic is based. That's why you usually see games being constructed around such a foundation, and maintained by vendors who license them for their profit. Last edited by sundialsvc4; 08-Oct-08 at 12:53. |
|||
|
#7
|
|
||||
|
Ok all I want to do for now is a simple proof of concept IM.
All I need is to (it doesn't have to work in blender, just in terminal) to have a live session via: lan connection. All it has to do is this: user1 = raw_input("User %: ") user2 = raw_input("User %: ") print user1 print user2 how would I get it to work right? (from there I'd just loop the script) It's for me and my brothers evergoing game project Jedi Battles (It's so we can have a python IM client run during the game [like STEAM]) Just PM me if you have the solution. (btw: it would be nice to print the date [ie: user1 entered the chatroom 1.3.2009 [8:30PM]])
............................................
Omg, I finally changed my avatar again! Yes, that's me With my guitar and before you ask, yes I have makeup on.NEED MORE UPLOAD SPACE FOR YOUR BLENDER FILES? CLICK HERE TO GO TO THE BLENDER FILE UPLOADER!!!!! Resources: Real-Time Motion Blur, Ragdoll, Maze AI, GeFX Blender Artists Free Script Repository Tower Siege 2 MEDIACHICKEN BLOG |
||||
|
#8
|
|
||||
|
Hey everyone,
(thanks for the info on ip addresses sundialsvc4) I've been doing some more research on this and will be updating the tutorial and including an example of a chat system in blender and some better examples of structuring your game to work with a server. |
||||
|
#9
|
|
||||
|
I've done this before, and I might wanna warn you, that "localhost" is well, local. My friend spent a frustrating week trying to get an interent connection to work. instead of "localhost" enter your computer name. That what you need for LAN anyway.
............................................
I scream, You scream, We all scream for.... Blender?! |
||||
|
#10
|
|
||||
|
Really cool, well done!
Servers' anything that connect the internet, you need supercomputers to make a webpage for millions of people. For just two guys playing, you can use a normal computer.
............................................
Where to start in Python |
||||
|
#11
|
|
||||
|
I am no expert but i think there is a difference between a hardware server and a software server. The hardware server is what is bought. A software server is like a background process on your computer that sits there and waits for clients to "serve" I can't explain it too much as it has been awhile since I've read about socket programming.
|
||||
|
#12
|
|
||||
|
Any computer can be a server. Those big fancy ones just do the job better. But I've got a 2.1ghz Athlon 64 X2 with one gig of ram acting as an SVN, Unreal Tournament, and what ever I feel like messing with server. Granted I don't run too much at once, like the UT server I usually leave off until I play.
Thanks for the info andrew-101. This will come in handy when I get around to tackling networking in my current project. |
||||
|
#13
|
|
||||
|
Well the software server is just a program to receive information and process commands then re send information.
In the update on the tutorial I will be using TCP sockets and threads. |
||||
|
#14
|
|
||||
|
Tutorial is updated
|
||||
|
#15
|
|
|||
|
Quote:
Code:
Last edited by TheSambassador; 10-Oct-08 at 20:35. |
|||
|
#16
|
|
||||
|
The 'lines' are the lines that chat is displayed in, n is the length of the chat log (n = len(GameLogic.chat_log) ) I should of put that up top, so the code is checking how many lines there are then displaying the last message in line0, 2nd last on line1.
Quote:
|
||||
|
#17
|
|
||||
|
hi where do i put the server.py script in??
and on your client how do i type the pass in when i start up by the login??? |
||||
|
#18
|
|
||||
|
You put the server.py script anywhere you want, just make sure its running when you start the blend.
Choose any user name you want, but just make the pass what the user was, so if I used 'andrew' as my user my pass would also be 'andrew'. |
||||
|
#19
|
|
|||
|
Quote:
Quote:
............................................
Here is my thread for BGE demo files |
|||
|
#20
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|