The Gang Garrison 2 Forum

Off-Topic Discussion => Amateur Gamedev => Topic started by: Flaw on July 23, 2011, 04:55:01 am

Title: Gang Garrison Dedicated Server (GGDS)
Post 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).
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: Flaw on July 23, 2011, 04:59:12 am
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.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: MTK5012 on July 23, 2011, 05:20:39 am
both u and orpheon love Python...
got to check it out
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: notajf on July 23, 2011, 02:25:40 pm
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.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: Flaw on July 24, 2011, 03:22:04 am
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.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: notajf on July 27, 2011, 10:33:28 am
Ah, Twisted and buffers. What I did was something like this:


You have to learn to live with asynchronousness really with networking. It's never a good idea to use blocking sockets.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: dontcare4free on August 04, 2011, 07:31:35 pm
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.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: NAGN on August 04, 2011, 10:00:54 pm
I'll be anticipating once this gets released :woot:
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: Dronery on August 04, 2011, 10:37:54 pm
Wait, does this actually work?
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: dontcare4free on August 05, 2011, 03:01:31 am
Wait, does this actually work?
As he said, no, playing doesn't work yet.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: notajf on August 06, 2011, 09:18:22 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).
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
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: dontcare4free on August 06, 2011, 05:51:52 pm
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.

Quote from: TwistedMatrix.com
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.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: notajf on August 07, 2011, 03:19:44 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).
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.

Quote from: TwistedMatrix.com
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?
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: dontcare4free on August 10, 2011, 05:11:50 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).
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.

Quote from: TwistedMatrix.com
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.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: Orpheon on August 13, 2011, 04:59:25 am
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:
Code: [Select]
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?
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: Leiche on August 14, 2011, 03:53:38 pm
 get creative.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: dontcare4free on August 15, 2011, 07:12:21 am
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:
Code: [Select]
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?
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: Dusty on August 15, 2011, 09:33:07 am
Well, you could try to base it off of the gg2 map loader.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: NAGN on August 15, 2011, 01:03:30 pm
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
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: Orpheon on August 15, 2011, 01:17:37 pm
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.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: NAGN on August 15, 2011, 01:44:46 pm
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?!?!?!?
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: nightcracker on October 27, 2011, 01:32:54 pm
My problem is this:
Code: [Select]
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
Code: [Select]
.get_size().

And finally you can use Mask.get_bounding_rects() to turn a mask into rects.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: Orpheon on October 27, 2011, 01:38:32 pm
My problem is this:
Code: [Select]
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
Code: [Select]
.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 :/
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: nightcracker on October 27, 2011, 01:45:47 pm
Oh lol  :hehe16:
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: notajf on October 27, 2011, 01:52:33 pm
Can we merge this with PyGG2 yet?
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: nightcracker on October 27, 2011, 01:54:46 pm
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.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: notajf on October 27, 2011, 02:12:24 pm
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.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: nightcracker on October 27, 2011, 02:13:24 pm
Hell no. Server and client are two different things. If you keep them in one program it will only complicate coding.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: Orpheon on October 27, 2011, 02:32:27 pm
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.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: nightcracker on October 27, 2011, 02:54:27 pm
We can reuse a lot of code, but one different file isn't enough. Two different applications is appropriate IMO.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: Dusty on October 27, 2011, 05:14:34 pm
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.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: nightcracker on October 27, 2011, 07:27:44 pm
Who said the server couldn't be launched from the main menu? I just say it should be a different application.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: Orangestar on October 27, 2011, 08:57:34 pm
>Do it TF2 style
>Add an in-game "Host Server" button that uses game core files
>Add a dedicated server
> ???
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: Green Wolf on November 12, 2011, 12:15:10 am
Use gamemaker. Remove all sprites. Remove all code not  vital to networking and hosting. Done.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: billymaze on November 12, 2011, 12:22:39 am
if only it worked like that, green wolf.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: Orpheon on November 12, 2011, 04:57:41 am
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.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: notajf on November 12, 2011, 05:05:21 am
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.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: Orpheon on November 12, 2011, 05:23:35 am
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.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: Dusty on November 12, 2011, 12:49:17 pm
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.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: Orpheon on November 12, 2011, 01:38:32 pm
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.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: NAGN on November 12, 2011, 11:03:32 pm
it doesn't loolk like much work was done on this since july
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: notajf on November 13, 2011, 04:38:06 am
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.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: Orpheon on November 13, 2011, 06:33:19 am
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.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: notajf on November 13, 2011, 07:44:28 am
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:
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: nightcracker on November 13, 2011, 09:55:07 am
He appears sometimes out of nothing.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: Flaw on November 30, 2011, 07:19:47 am
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?
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: notajf on November 30, 2011, 10:20:46 am
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.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: Flaw on November 30, 2011, 10:34:18 am
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.
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: billymaze on December 05, 2011, 01:17:50 am
: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?
Title: Re: Gang Garrison Dedicated Server (GGDS)
Post by: Orpheon on December 05, 2011, 06:34:24 am
: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?