The Gang Garrison 2 Forum
Off-Topic Discussion => Amateur Gamedev => Topic started by: Flaw on July 23, 2011, 04:55:01 am
-
GGDS is going to be a dedicated server software for GG2 servers with no graphical interface or local player. The entire application will be made in Python (python.org), using only (so far) default modules.
A Git repository is available at https://github.com/Flawium/GGDS.
Current server functionality includes a configuration file, the actual server socket listening, accepting connections, kicking clients, actually joining (not playing yet, though).
-
In case you didn't know, Python is cross-platform. There's versions for Windows, Mac and GNU/*nix. Most Linux distributions even come with Python pre-loaded.
-
both u and orpheon love Python...
got to check it out
-
GGDS is going to be a dedicated server software for GG2 servers with no graphical interface or local player. The entire application will be made in Python (python.org), using only (so far) default modules.
A Git repository is available at https://github.com/Flawium/GGDS.
Current server functionality includes a configuration file, the actual server socket listening, accepting connections, kicking clients, actually joining (not playing yet, though).
Hi Flaw. I have also wanted to create a Python dedicated server for a long time. Since you seem to have got started already and at some level of usability, can I join and contribute to your project?
I would particularly like to transition to using Twisted. It is a much better choice for big networking projects like this than using sockets raw (I have learned this from experience...)
Also, I have some experience with networking projects (I have written a fully functioning Minecraft classic server, https://github.com/TazeTSchnitzel/SchnitzelCraft (https://github.com/TazeTSchnitzel/SchnitzelCraft)).
Thanks.
-
Hi Flaw. I have also wanted to create a Python dedicated server for a long time. Since you seem to have got started already and at some level of usability, can I join and contribute to your project?
I would particularly like to transition to using Twisted. It is a much better choice for big networking projects like this than using sockets raw (I have learned this from experience...)
Also, I have some experience with networking projects (I have written a fully functioning Minecraft classic server, https://github.com/TazeTSchnitzel/SchnitzelCraft (https://github.com/TazeTSchnitzel/SchnitzelCraft)).
Thanks.
Yes, do you have a Github account? (silly me) Then I'll add it to the list of contributors. Added.
Also, I've tried using Twisted for this a bit, but hit a rock because how asynchronous it is (you can't request data, only do stuff when you recieve data), and I'm not that familiar with buffers.
If you could help a bit with that, that would be great, too.
-
Ah, Twisted and buffers. What I did was something like this:
- Upon receiving data, add to the buffer
- Parse the packets in the buffer by looking for the packet type, then seeing if there was enough space after it (complete or incomplete)
- If packet is complete, send it to packet parsing function
- Keep on doing this until no packets remain or one incomplete packet
- This process is repeated each time data is received
You have to learn to live with asynchronousness really with networking. It's never a good idea to use blocking sockets.
-
GGDS is going to be a dedicated server software for GG2 servers with no graphical interface or local player. The entire application will be made in Python (python.org), using only (so far) default modules.
A Git repository is available at https://github.com/Flawium/GGDS.
Current server functionality includes a configuration file, the actual server socket listening, accepting connections, kicking clients, actually joining (not playing yet, though).
Hi Flaw. I have also wanted to create a Python dedicated server for a long time. Since you seem to have got started already and at some level of usability, can I join and contribute to your project?
I would particularly like to transition to using Twisted. It is a much better choice for big networking projects like this than using sockets raw (I have learned this from experience...)
Also, I have some experience with networking projects (I have written a fully functioning Minecraft classic server, https://github.com/TazeTSchnitzel/SchnitzelCraft (https://github.com/TazeTSchnitzel/SchnitzelCraft)).
Thanks.
AFAIK Twisted is a pain to set up under 64-bit Windows, however.
-
I'll be anticipating once this gets released :woot:
-
Wait, does this actually work?
-
Wait, does this actually work?
As he said, no, playing doesn't work yet.
-
GGDS is going to be a dedicated server software for GG2 servers with no graphical interface or local player. The entire application will be made in Python (python.org), using only (so far) default modules.
A Git repository is available at https://github.com/Flawium/GGDS.
Current server functionality includes a configuration file, the actual server socket listening, accepting connections, kicking clients, actually joining (not playing yet, though).
Hi Flaw. I have also wanted to create a Python dedicated server for a long time. Since you seem to have got started already and at some level of usability, can I join and contribute to your project?
I would particularly like to transition to using Twisted. It is a much better choice for big networking projects like this than using sockets raw (I have learned this from experience...)
Also, I have some experience with networking projects (I have written a fully functioning Minecraft classic server, https://github.com/TazeTSchnitzel/SchnitzelCraft (https://github.com/TazeTSchnitzel/SchnitzelCraft)).
Thanks.
AFAIK Twisted is a pain to set up under 64-bit Windows, however.
Provide some proof please. Surely it will work out of the box if this is py2exe packaged?
Disclaimer: Ubuntu 64-bit is my main OS atm
-
GGDS is going to be a dedicated server software for GG2 servers with no graphical interface or local player. The entire application will be made in Python (python.org), using only (so far) default modules.
A Git repository is available at https://github.com/Flawium/GGDS.
Current server functionality includes a configuration file, the actual server socket listening, accepting connections, kicking clients, actually joining (not playing yet, though).
Hi Flaw. I have also wanted to create a Python dedicated server for a long time. Since you seem to have got started already and at some level of usability, can I join and contribute to your project?
I would particularly like to transition to using Twisted. It is a much better choice for big networking projects like this than using sockets raw (I have learned this from experience...)
Also, I have some experience with networking projects (I have written a fully functioning Minecraft classic server, https://github.com/TazeTSchnitzel/SchnitzelCraft (https://github.com/TazeTSchnitzel/SchnitzelCraft)).
Thanks.
AFAIK Twisted is a pain to set up under 64-bit Windows, however.
Provide some proof please. Surely it will work out of the box if this is py2exe packaged?
Disclaimer: Ubuntu 64-bit is my main OS atm
I mean, installing it for development, with 64-bit Python.
Q: Why am I getting a "Python does not appear to be installed" error message on Windows?
A: Twisted requires a 32-bit version of Python for Windows. Using a 64-bit version of Python will result in this error message.
-
GGDS is going to be a dedicated server software for GG2 servers with no graphical interface or local player. The entire application will be made in Python (python.org), using only (so far) default modules.
A Git repository is available at https://github.com/Flawium/GGDS.
Current server functionality includes a configuration file, the actual server socket listening, accepting connections, kicking clients, actually joining (not playing yet, though).
Hi Flaw. I have also wanted to create a Python dedicated server for a long time. Since you seem to have got started already and at some level of usability, can I join and contribute to your project?
I would particularly like to transition to using Twisted. It is a much better choice for big networking projects like this than using sockets raw (I have learned this from experience...)
Also, I have some experience with networking projects (I have written a fully functioning Minecraft classic server, https://github.com/TazeTSchnitzel/SchnitzelCraft (https://github.com/TazeTSchnitzel/SchnitzelCraft)).
Thanks.
AFAIK Twisted is a pain to set up under 64-bit Windows, however.
Provide some proof please. Surely it will work out of the box if this is py2exe packaged?
Disclaimer: Ubuntu 64-bit is my main OS atm
I mean, installing it for development, with 64-bit Python.
Q: Why am I getting a "Python does not appear to be installed" error message on Windows?
A: Twisted requires a 32-bit version of Python for Windows. Using a 64-bit version of Python will result in this error message.
Erm, why does that even matter? You can't handle two installs of Python?
-
GGDS is going to be a dedicated server software for GG2 servers with no graphical interface or local player. The entire application will be made in Python (python.org), using only (so far) default modules.
A Git repository is available at https://github.com/Flawium/GGDS.
Current server functionality includes a configuration file, the actual server socket listening, accepting connections, kicking clients, actually joining (not playing yet, though).
Hi Flaw. I have also wanted to create a Python dedicated server for a long time. Since you seem to have got started already and at some level of usability, can I join and contribute to your project?
I would particularly like to transition to using Twisted. It is a much better choice for big networking projects like this than using sockets raw (I have learned this from experience...)
Also, I have some experience with networking projects (I have written a fully functioning Minecraft classic server, https://github.com/TazeTSchnitzel/SchnitzelCraft (https://github.com/TazeTSchnitzel/SchnitzelCraft)).
Thanks.
AFAIK Twisted is a pain to set up under 64-bit Windows, however.
Provide some proof please. Surely it will work out of the box if this is py2exe packaged?
Disclaimer: Ubuntu 64-bit is my main OS atm
I mean, installing it for development, with 64-bit Python.
Q: Why am I getting a "Python does not appear to be installed" error message on Windows?
A: Twisted requires a 32-bit version of Python for Windows. Using a 64-bit version of Python will result in this error message.
Erm, why does that even matter? You can't handle two installs of Python?
Not in the %PATH%, at once, no.
-
An idea about collisions:
Using masks to check would probably be too slow, so I thought we could do it like this.
Map Wallmasks would be passed at compile time in a special script that checks each pixels and creates a rect there if it is black/opaque/whatever.
This also allows us to scale the maps, which is not easy to do otherwise. Now we just have to scale the surface before drawing.
The string of rects would then be saved and embedded into the .png or even kept as separate file.
It can then be loaded without much problems and without much lag, and suddenly you have rects to collide with instead of masks.
(which, if you only check the rects in the area around the Character, is much faster)
My problem is this:
import os
import glob
import pygame
from load_image import load_image
from pygame.locals import *
surface = pygame.Surface()
path = 'Maps/'
for infile in glob.glob( os.path.join(path, '*_wm.png') ):
image, rect = load_image(infile)
# Loop through all the pixels and create a rect per black pixel
for a in range(0, ???)
There is no built-in function of pygame.Image to determine it's size, so I either have to guess a very large number or get creative.
Ideas?
-
get creative.
-
An idea about collisions:
Using masks to check would probably be too slow, so I thought we could do it like this.
Map Wallmasks would be passed at compile time in a special script that checks each pixels and creates a rect there if it is black/opaque/whatever.
This also allows us to scale the maps, which is not easy to do otherwise. Now we just have to scale the surface before drawing.
The string of rects would then be saved and embedded into the .png or even kept as separate file.
It can then be loaded without much problems and without much lag, and suddenly you have rects to collide with instead of masks.
(which, if you only check the rects in the area around the Character, is much faster)
My problem is this:
import os
import glob
import pygame
from load_image import load_image
from pygame.locals import *
surface = pygame.Surface()
path = 'Maps/'
for infile in glob.glob( os.path.join(path, '*_wm.png') ):
image, rect = load_image(infile)
# Loop through all the pixels and create a rect per black pixel
for a in range(0, ???)
There is no built-in function of pygame.Image to determine it's size, so I either have to guess a very large number or get creative.
Ideas?
PIL?
-
Well, you could try to base it off of the gg2 map loader.
-
Simulating Game Maker's physics would be a problem
unlike using a conventional engine, you'd have to make sure that everything, from the way it handles explosions to how the bullets rotate behave just like they do in Game Maker, which isn't exactly open and portable as to how it works
or we could run the collisions in the Game Maker game outside of Game Maker using another language
-
Simulating Game Maker's physics would be a problem
unlike using a conventional engine, you'd have to make sure that everything, from the way it handles explosions to how the bullets rotate behave just like they do in Game Maker, which isn't exactly open and portable as to how it works
or we could run the collisions in the Game Maker game outside of Game Maker using another language
Why, oh why, should we have to simulate Game maker? A collision is a collision, here and there, or one of the two systems is buggy and therefore not usable.
-
Because if the collisions are consistently wrong then the physics will be pretty much broken?
Actually we're better off in that case just rewriting the whole movement and physics from another engine, box2d anyone?!?!?!?
-
My problem is this:
import os
import glob
import pygame
from load_image import load_image
from pygame.locals import *
surface = pygame.Surface()
path = 'Maps/'
for infile in glob.glob( os.path.join(path, '*_wm.png') ):
image, rect = load_image(infile)
# Loop through all the pixels and create a rect per black pixel
for a in range(0, ???)
There is no built-in function of pygame.Image to determine it's size, so I either have to guess a very large number or get creative.
Ideas?
Err, the second you load an image it gets loaded as a pygame.Surface and every surface supports .get_size()
.
And finally you can use Mask.get_bounding_rects() to turn a mask into rects.
-
My problem is this:
import os
import glob
import pygame
from load_image import load_image
from pygame.locals import *
surface = pygame.Surface()
path = 'Maps/'
for infile in glob.glob( os.path.join(path, '*_wm.png') ):
image, rect = load_image(infile)
# Loop through all the pixels and create a rect per black pixel
for a in range(0, ???)
There is no built-in function of pygame.Image to determine it's size, so I either have to guess a very large number or get creative.
Ideas?
Err, the second you load an image it gets loaded as a pygame.Surface and every surface supports .get_size()
.
And finally you can use Mask.get_bounding_rects() to turn a mask into rects.
Uhh...I solved that problem like ages ago. You were the one that erased that part of the code :/
-
Oh lol :hehe16:
-
Can we merge this with PyGG2 yet?
-
Not very useful. I guess we'll first do some more work on the PyGG2 client, and then fork it and make a server program too.
-
Not very useful. I guess we'll first do some more work on the PyGG2 client, and then fork it and make a server program too.
No fork, they should stay the same but have a command line option to run without graphics.
-
Hell no. Server and client are two different things. If you keep them in one program it will only complicate coding.
-
Hell no. Server and client are two different things. If you keep them in one program it will only complicate coding.
Uhh...Both will need the same basic core files anyway, can't we simply add a Server.py and a Client.py that do the rest?
Plus, in gg2 currently the host is considered another client and does things through the same objects as every other player and sends stuff over loopback.
You might want to change this in PyGG2, but I don't really see a good reason why server and client shouldn't be together.
It's really not that much code that's not required by both.
-
We can reuse a lot of code, but one different file isn't enough. Two different applications is appropriate IMO.
-
Maybe for a dedicated server, but I'm sure some hosts would still enjoy playing from the same application as the one that launched it.
-
Who said the server couldn't be launched from the main menu? I just say it should be a different application.
-
>Do it TF2 style
>Add an in-game "Host Server" button that uses game core files
>Add a dedicated server
> ???
-
Use gamemaker. Remove all sprites. Remove all code not vital to networking and hosting. Done.
-
if only it worked like that, green wolf.
-
Use gamemaker. Remove all sprites. Remove all code not vital to networking and hosting. Done.
Please explain how you want game maker to do any collisions without the sprites.
-
Use gamemaker. Remove all sprites. Remove all code not vital to networking and hosting. Done.
Please explain how you want game maker to do any collisions without the sprites.
GG2 uses bounding boxes for all collisions except the map.
-
Use gamemaker. Remove all sprites. Remove all code not vital to networking and hosting. Done.
Please explain how you want game maker to do any collisions without the sprites.
GG2 uses bounding boxes for all collisions except the map.
Oh ok.
-
Actually, gm would still need the sprites. All the collision data for everything, even the maps (custom maps as well), is stored in the sprites.
-
Actually, gm would still need the sprites. All the collision data for everything, even the maps (custom maps as well), is stored in the sprites.
You could make all the sprites transparent.
-
it doesn't loolk like much work was done on this since july
-
it doesn't loolk like much work was done on this since july
That's because PyGG2 has similar goals and more devs, and active development.
-
it doesn't loolk like much work was done on this since july
That's because PyGG2 has similar goals and more devs, and active development.
It's mostly because Flaw was the only person that did anything to this and he disappeared.
-
it doesn't loolk like much work was done on this since july
That's because PyGG2 has similar goals and more devs, and active development.
It's mostly because Flaw was the only person that did anything to this and he disappeared.
He disappeared?
:cry: :cry: :cry:
-
He appears sometimes out of nothing.
-
He appears sometimes out of nothing.
This is completely true. A moment like this is for example now. I may be gone in two seconds or three days. Who knows?
-
He appears sometimes out of nothing.
This is completely true. A moment like this is for example now. I may be gone in two seconds or three days. Who knows?
...all we know is, he's called the Stig.
-
He is a puzzle, wrapped in an enigma, shrouded in riddles, lovingly sprinkled with intrigue, express mailed to Mystery, Alaska, and LOOK OUT BEHIND YOU! but it is too late.
-
:offtopic:
Couldn't we just remove all of the unneccisary sprites and 'simplify' the needed ones? Like for instance just have everything either matte black or white for the hitboxes?
-
:offtopic:
Couldn't we just remove all of the unneccisary sprites and 'simplify' the needed ones? Like for instance just have everything either matte black or white for the hitboxes?
It wouldn't make ~any~ difference beyond removing any transparencies, which could help.
Why not make the game window size 1x1 while we're at it with that?