Hmm, let me just sum everything up.
The advantages of PyGG2:
- Python is a "real" programming language, unlike GML. This gives us a better chance to market the game to for example get it featured on steam. AKA more users.
- Python is free, unlike GML. This means that everyone can contribute code without having to "buy" Game Maker. AKA more contributors
- PyGG2 will have better performance than GG2, simply because Python is way faster than GML and the programmer is free to optimize in any way he wants. AKA more speed and less lag
- Because Python's object system is better designed for large systems than GML's and we have full control over the system it is easier to keep the code clean and maintain the game. AKA less bugs
- Because Python is faster and allows for more complex systems than GML it is easier to implement lag compensation. AKA less lag
- PyGG2 is built up from the ground allowing us to revise previous not-so-wise design decisions (major one: UDP vs TCP). AKA less lag, less bugs
- Because Python runs on every major platform, and so will PyGG2, PyGG2 can be run on Windows, Linux and Mac. AKA more users
- And by far the most important one, because PyGG2 runs on every major platform and we can run the game engine without the graphics engine in PyGG2 (we couldn't do this in GML due to the way GML works) we can run dedicated servers. AKA A HELL OF A LOT LESS LAG
The disadvantages of PyGG2:
- It takes a lot of time to develop, but Orpheon and I are working on it
Posting so I can follow, but AJF and Orph, is python easy to learn if you've had minimal Javascript, batch, and GML programming experience?Differences between Python and GML:
People, before doing teams and what-not, you should agree on which language you're going to use.To know what language we use, we need to know who can work on it in what language.
Either use C++ or Python. Not both, darn it. :z8:
basically speaking, this thread is all about a plan to rewrite the gg2 engine into another language?It's not like that's the thread title or anything...
The pythons that's ok too though I want to work on C++, but I'm mediocre at both so no real preferences.Ok, great.
Isn't pygame the python sdl library?
run it from your browserSexy.
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
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.
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, ???)
Ideas?
with CollisionRect
{
if point_distance(x, y, other.x, other.y) > size_of_object+a_little_constant
{
continue;
}
else
{
if rect_collide(other, id)
{
reactToCollision()
break;
}
}
}
Written in GMK syntax so that everyone can follow it, if programmed in a compiled language like C++ and packed into a dll, this could run fast as hell.Also, if Flaw every re-appears, I think he'll prefer Python too.:c1:
Welcome back!Also, if Flaw every re-appears, I think he'll prefer Python too.:c1:
Welcome back!Also, if Flaw every re-appears, I think he'll prefer Python too.:c1:
Do you know Pygame (I mean well)?
Do you know:Well, I have made some working stuff using it, so yes, I guess, kind of.Welcome back!Also, if Flaw every re-appears, I think he'll prefer Python too.:c1:
Do you know Pygame (I mean well)?
We don't need more, and this allows us to keep our pixel-based wallmasks.Brilliant
Orpheon are you suggesting that to calculate collisions we'd need to make a rect for every single pixel in the wallmask?Yes.
I suppose in reality there's no reason to calculate the rects for every pixel on the map, just the surfaces where you can stand, and we could do some light optimization to make all the wallmasks hallow shellsWell, you have to be careful you don't mess with the collision reaction code, but yeah.
I suppose in reality there's no reason to calculate the rects for every pixel on the map, just the surfaces where you can stand, and we could do some light optimization to make all the wallmasks hallow shellsWell, you have to be careful you don't mess with the collision reaction code, but yeah.
Also, the algorithm for hollow wallmask is easy.
Just check if there are rects all around you, if yes self-destruct.
We can do that later.I suppose in reality there's no reason to calculate the rects for every pixel on the map, just the surfaces where you can stand, and we could do some light optimization to make all the wallmasks hallow shellsWell, you have to be careful you don't mess with the collision reaction code, but yeah.
Also, the algorithm for hollow wallmask is easy.
Just check if there are rects all around you, if yes self-destruct.
Well, that or we can simply go through all the squares and merge them and make a few large rectangles.
Hey guys, I am back suddenly.Welcome back!
I want to help with this again. And, like some others here, I want to do it with Python/Pygame. And for networking, Twisted.
Actually no. Do networking and game stuff at the same time - we need a sensible client-server architecture. Or things get messy later.Hey guys, I am back suddenly.Welcome back!
I want to help with this again. And, like some others here, I want to do it with Python/Pygame. And for networking, Twisted.
Also, I think I'm going to purposefully ignore the networking until we got a running game engine with all the classes and so on.
Stuff dies at networking stage if there isn't a backbone.
And we also got to decide whether we stick to TCP or try the jump to UDP.
Eh..no.Actually no. Do networking and game stuff at the same time - we need a sensible client-server architecture. Or things get messy later.Hey guys, I am back suddenly.Welcome back!
I want to help with this again. And, like some others here, I want to do it with Python/Pygame. And for networking, Twisted.
Also, I think I'm going to purposefully ignore the networking until we got a running game engine with all the classes and so on.
Stuff dies at networking stage if there isn't a backbone.
And we also got to decide whether we stick to TCP or try the jump to UDP.
Success!Awesome! Now GPL and GitHub this!
(http://i56.tinypic.com/2hfnsxe.png)
The red outline above is a graphical rendering of the wallmask drawn at the top of the screen.
The rest is simply the fore-ground, if you want. Also, collision detection works flawlessly, as far as I can tell.
It doesn't lag at all either, but I suspect that's because I only have one object.
Some parts of the code:
Wallmask compiler (https://gist.github.com/1178248)
Main.py (https://gist.github.com/1178249)
importMapRects (don't really know why I made this into a separate script) (https://gist.github.com/1178250)
collision.py (I'm only using the detection function, the other one isn't tested yet.) (https://gist.github.com/1178251)
Soon. Not now though, I want to finish the odd thing before I upload it. Like cleaning my code, for example, because those scripts are an abomination, especially the collision codes.Success!Awesome! Now GPL and GitHub this!
The red outline above is a graphical rendering of the wallmask drawn at the top of the screen.
The rest is simply the fore-ground, if you want. Also, collision detection works flawlessly, as far as I can tell.
It doesn't lag at all either, but I suspect that's because I only have one object.
Some parts of the code:
Wallmask compiler (https://gist.github.com/1178248)
Main.py (https://gist.github.com/1178249)
importMapRects (don't really know why I made this into a separate script) (https://gist.github.com/1178250)
collision.py (I'm only using the detection function, the other one isn't tested yet.) (https://gist.github.com/1178251)
I am intensely interested in this thread. If GG2 is rewritten in a common language I might be able to host 24/7 on my Dreamplug (http://www.globalscaletechnologies.com/c-5-dreamplugs.aspx)!Or me on my VPS. Or anyone. That's why I'm excited about it :)
I think it would be a great boon to broaden GG's audience like that.
I am intensely interested in this thread. If GG2 is rewritten in a common language I might be able to host 24/7 on my Dreamplug (http://www.globalscaletechnologies.com/c-5-dreamplugs.aspx)!
I think it would be a great boon to broaden GG's audience like that.
Great. Would you guys like to leave it open as a community thing, or would you like to put this somewhere and organize tasks as a team?I think it would be good to have the project open to outside review and code contributions. But there should be a motivated core team that will "get 'er done".
I am intensely interested in this thread. If GG2 is rewritten in a common language I might be able to host 24/7 on my Dreamplug (http://www.globalscaletechnologies.com/c-5-dreamplugs.aspx)!
I think it would be a great boon to broaden GG's audience like that.
Whoa, I want one. I don't even know what I'd use it for but I want it, lol.
Great. Would you guys like to leave it open as a community thing, or would you like to put this somewhere and organize tasks as a team?I think we'll leave it open atm.
functions.place_free(x, y, wallmask)
Obvious, checks whether a point is free in the wallmask.objectCheckCollision(character, wallmask)
Checks whether that object hits the wallmask somewhere.Flaw (sniper) The End [be]
The End [be] (sniper) Flaw
I'll probably work primarily on gameplay most (sentry logic, weapons, kills, round management, etc). Networking isn't exactly my field.Ok. Nice idea, because those things are tedious.
OFF TOPIC: Today, as a Rifleman, I shot an enemy Rifleman the instant they shot me.Quote from: Kill-LogFlaw (sniper) The End [be]
The End [be] (sniper) Flaw
OFF TOPIC: Today, as a Rifleman, I shot an enemy Rifleman the instant they shot me.This happens because the hitscan code is called in the step and death script is called in the end step. Because of order of operation of those events, it is possible for two people to kill one another with any weapon; it happens with Rifles, Autoguns, Knives, explosives and every projectile. If we changed it to run the death script immediately after damage is dealt (I don't think you'd want to do that unless you just called a script that dealt damage that would in turn call the death script if the victim's health is low enough), that could work. Although it'd be a bit of a headache to redo, but hey, this is a rewrite, it can be done that way from the ground up if need be.Quote from: Kill-LogFlaw (sniper) The End [be]
The End [be] (sniper) Flaw
OFF TOPIC: Today, as a Rifleman, I shot an enemy Rifleman the instant they shot me.This happens because the hitscan code is called in the step and death script is called in the end step. Because of order of operation of those events, it is possible for two people to kill one another with any weapon; it happens with Rifles, Autoguns, Knives, explosives and every projectile. If we changed it to run the death script immediately after damage is dealt (I don't think you'd want to do that unless you just called a script that dealt damage that would in turn call the death script if the victim's health is low enough), that could work. Although it'd be a bit of a headache to redo, but hey, this is a rewrite, it can be done that way from the ground up if need be.Quote from: Kill-LogFlaw (sniper) The End [be]
The End [be] (sniper) Flaw
OFF TOPIC: Today, as a Rifleman, I shot an enemy Rifleman the instant they shot me.This happens because the hitscan code is called in the step and death script is called in the end step. Because of order of operation of those events, it is possible for two people to kill one another with any weapon; it happens with Rifles, Autoguns, Knives, explosives and every projectile. If we changed it to run the death script immediately after damage is dealt (I don't think you'd want to do that unless you just called a script that dealt damage that would in turn call the death script if the victim's health is low enough), that could work. Although it'd be a bit of a headache to redo, but hey, this is a rewrite, it can be done that way from the ground up if need be.Quote from: Kill-LogFlaw (sniper) The End [be]
The End [be] (sniper) Flaw
Okay.
Also, for this system, I recommend that we use a more method-based way of handling health and death.
More precisely, there's a .damage function on Character objects that can be called to inflict damage. Arguments could be amount, source and type, for example. That function would take care of subtracting health and other stuff. Then, it would also check if health was <= 0, then it would proceed to call the .kill, .onDeath, or .death (dunno about name) function which would take care of transmitting the death, removing player object, giving points, etc.
Don't forget the person dealing the damage in that too or we'd just have what people died to and not who. Also, kill assist tracking would go in there. It's not that complex, just tedious.
don't forget the person dealing the damage
Arguments could be amount, source and type, for examplesource; origin of the damage (what is dealing it)
What: a weapondon't forget the person dealing the damageQuote from: FlawArguments could be amount, source and type, for examplesource; origin of the damage (what is dealing it)
What: a weapondon't forget the person dealing the damageQuote from: FlawArguments could be amount, source and type, for examplesource; origin of the damage (what is dealing it)
There is no guarantee that the weapon exists in memory when the damage is dealt.
Who: the person using the weapon
Because it is based upon the player ID and not their physical presence, this will always work unless they leave the server before the damage is dealt. In that case, default to a constant that represents an invalid player but won't register as an error.
The initial origin of the damage is the player.This is why you don't call people "what."
The initial origin of the damage is the player.This is why you don't call people "what."
People are "who."
By the way,
for this project, I'd like it if GG2's event system was more asynchronous. We have the wonderful Twisted asynchronous networking here, why not asynchronous in-game events? Should we even keep the current step system? Although it would be quicker to copy the current design, a better, non-framerate-limited design might be a better idea.
By the way,
for this project, I'd like it if GG2's event system was more asynchronous. We have the wonderful Twisted asynchronous networking here, why not asynchronous in-game events? Should we even keep the current step system? Although it would be quicker to copy the current design, a better, non-framerate-limited design might be a better idea.
Is this port going to try and be compatible with the original GG2? As in, will I be able to host or join a game of original GG2 client players with the new port?
While that may be true, it is a common understanding that "it" refers to an inanimate object and "who" identifies as an animal. By referring to an animal as "it" degrades it to a vegetable state or lower, it is seen as an insult.The initial origin of the damage is the player.This is why you don't call people "what."
People are "who."
A person is a object, a something. A "it".
The initial origin of the damage is the player.This is why you don't call people "what."
People are "who."
The initial origin of the damage is the player.This is why you don't call people "what."
People are "who."
A person is a object, a something. A "it".
I don't really think this would be compatible with the original gg2. Would it?
Obviously *not*. There is not real point in keeping it compatible, it will just introduce headaches for us.By the way,
for this project, I'd like it if GG2's event system was more asynchronous. We have the wonderful Twisted asynchronous networking here, why not asynchronous in-game events? Should we even keep the current step system? Although it would be quicker to copy the current design, a better, non-framerate-limited design might be a better idea.
Is this port going to try and be compatible with the original GG2? As in, will I be able to host or join a game of original GG2 client players with the new port?
Obviously.
Also, my first big pull request! Yay!My first pull request at all :smiley16:.
https://github.com/Orpheon/PyGG2/pull/1
I don't really think this would be compatible with the original gg2. Would it?The thing that decides that is the networking. Since we haven't even discussed yet whether we want to stick with TCP or try UDP, it's a bit premature to answer that question, imo.
How is GG2 licensed? Do we have the blessing of the devs to go ahead?Yes, we definately do have the blessing of the devs. There's a big thread in the Beta tester forums about this, and I quoted large parts of it in the OP.
which python be you using2.x - I'm using 2.7, I'm not sure what Orpheon's using but as long as it's 2.6 or later it will probably work
Why is SCOPE_IN and out synced? Can't you simply do the same thing as for cloaking?
You still have to stick to the license if you use anything from GG2. And even if you don't, I think it would be a good idea to add a proper license file soon, so that everyone has some legal safety.How is GG2 licensed? Do we have the blessing of the devs to go ahead?Yes, we definately do have the blessing of the devs. There's a big thread in the Beta tester forums about this, and I quoted large parts of it in the OP.
which python be you using2.x - I'm using 2.7, I'm not sure what Orpheon's using but as long as it's 2.6 or later it will probably work
Tis what i was refering to syntax from 2.x is different from 3.2which python be you using2.x - I'm using 2.7, I'm not sure what Orpheon's using but as long as it's 2.6 or later it will probably work
Oh, shoot. I suppose I can rearrange things for my class to use 2.6 then. 3.2's syntax seems different in a few areas so I that'll be a problem.
I am using Python 2.7.1 64bit on LinuxMe too.
Hmm, ok. I'm not completely sure how to do it though.You still have to stick to the license if you use anything from GG2. And even if you don't, I think it would be a good idea to add a proper license file soon, so that everyone has some legal safety.How is GG2 licensed? Do we have the blessing of the devs to go ahead?Yes, we definately do have the blessing of the devs. There's a big thread in the Beta tester forums about this, and I quoted large parts of it in the OP.
What I meant is why we have to sync something that's only relevant between client and server with it's own tag. Why not simply use keyByte?Why is SCOPE_IN and out synced? Can't you simply do the same thing as for cloaking?
For 2.4, I changed SCOPE_IN and SCOPE_OUT to just a simple TOGGLE_ZOOM, it cleans up the code nicely. It's on github if you want to find that.
Cloaking is already synced, just not in the same manner. I don't know the reasoning behind it being there instead of where the special inputs (eating, build menu, scoping) are located. You'd have to ask Medo for that, although, if I'm not mistaken, Cloaking came before those other three. You could try moving it if you want, just don't break shit, I'm not cleaning up your mess if it fails.
Oh, we're literally porting the whole game graphics and all. Interesting.http://book.git-scm.com/ (http://book.git-scm.com/)
Also, anyone want to teach me how to GIT? lol
def lengthdir(x, y):
x = x**2
y = y**2
return math.sqrt(x+y)
# hs and vs is the normalized vector of hspeed and vspeed.
hs = character.hspeed/length
vs = character.vspeed/length
# hs and vs is the normalized vector of hspeed and vspeed.
hs = character.hspeed/abs(length)
vs = character.vspeed/abs(length)
I've been looking at collision.py and I'm wondering what the logic behind lengthdir()Well...Code: [Select]def lengthdir(x, y):
x = x**2
y = y**2
return math.sqrt(x+y)
acting on the hspeed and vspeed at line 40. And in the next few lines at 49-51Code: [Select]# hs and vs is the normalized vector of hspeed and vspeed.
hs = character.hspeed/length
vs = character.vspeed/length
What is a normalized vector?
I see... (http://mathworld.wolfram.com/UnitVector.html)
Then shouldn't you take the absolute value of the length there?
LikeCode: [Select]# hs and vs is the normalized vector of hspeed and vspeed.
hs = character.hspeed/abs(length)
vs = character.vspeed/abs(length)
That seems to make the sprite less sticky and I get a bounceback effect off of walls.
But when landing on a surface you'll fall through slowly after a bit
def characterHitObstacle(character, wallmask):
newX = character.x
newY = character.y
oldX = character.x-character.hspeed
oldY = character.y-character.vspeed
hspeed = character.hspeed
vspeed = character.vspeed
length = lengthdir(hspeed, vspeed)
if length == 0:# You haven't moved; if this happens something went wrong
return False
# hs and vs is the normalized vector of hspeed and vspeed.
hs = character.hspeed/length
vs = character.vspeed/length
i = 0
while objectCheckCollision(character, wallmask) and i < length:
character.rect.centerx -= hs
character.rect.centery -= vs
i += 1
# The character got pushed out, but now we need to let him move in the directions he's allowed to move.
character.rect.centerx += sign(character.hspeed)
if not objectCheckCollision(character, wallmask):
# There's empty space on the left/right
# Kill all vertical movement
character.vspeed = 0
while True:
character.rect.centerx += sign(character.hspeed)
# If the new position has met a wall too:
if objectCheckCollision(character, wallmask):
character.rect.centerx -= sign(character.hspeed)
break
else:
character.rect.centerx -= sign(character.hspeed)
character.rect.centery += sign(character.vspeed)
if not objectCheckCollision(character, wallmask):
# There's empty space on the left/right
# Kill all vertical movement
character.hspeed = 0
i = 0
while i <= vspeed:
character.rect.centery += sign(character.vspeed)
# If the new position has met a wall too:
if objectCheckCollision(character, wallmask):
character.rect.centery -= sign(character.vspeed)
break
character.rect.centery -= sign(character.vspeed)
character.x = character.rect.left-character.xImageOffset
character.y = character.rect.top-character.yImageOffset
# character.hspeed = 0
# character.vspeed = 0
# character.hspeed = oldX-character.x
# character.vspeed = oldY-character.y
return True
This is still buggy.Short question, why are you turning collision masks into many many rectangles instead of using pygame.sprite.collide_mask?
Yep, like when I discovered Python actually had a TCP Server wrapper and there was no reason to use sockets directly.Short question, why are you turning collision masks into many many rectangles instead of using pygame.sprite.collide_mask?
This is the part where they realize that there was an easy way already in existence and a few people hit themselves on the forehead for not noticing it sooner
Short question, why are you turning collision masks into many many rectangles instead of using pygame.sprite.collide_mask?Originally, I planned to do that. I went to inform myself and asked around how to collide masks with other stuff. People were telling me using rects for this would be a ton more efficient (if you only check those rects near to you), because if the wallmask was a mask, then everything who should collide with it should be one too.
Short question, why are you turning collision masks into many many rectangles instead of using pygame.sprite.collide_mask?Originally, I planned to do that. I went to inform myself and asked around how to collide masks with other stuff. People were telling me using rects for this would be a ton more efficient (if you only check those rects near to you), because if the wallmask was a mask, then everything who should collide with it should be one too.
I kinda trusted them, and also I know my way around rects much better than with masks.
Also, that part is done, as in finished in a very small time. I'm having troubles with the collision response, not with the detection (which is easy and actually quite efficient).
Collision checking is quicker with rectsShort question, why are you turning collision masks into many many rectangles instead of using pygame.sprite.collide_mask?Originally, I planned to do that. I went to inform myself and asked around how to collide masks with other stuff. People were telling me using rects for this would be a ton more efficient (if you only check those rects near to you), because if the wallmask was a mask, then everything who should collide with it should be one too.
I kinda trusted them, and also I know my way around rects much better than with masks.
Also, that part is done, as in finished in a very small time. I'm having troubles with the collision response, not with the detection (which is easy and actually quite efficient).
But a rect is just a mask with a rectangular shape :drool:
if range(left1, right1) in range(left2, right2):
{
if range(top1, bottom1) in range(top2, bottom2):
{
return True
}
}
return False
I'm just wondering aloud, wouldn't it be more efficient to do raster-rect collisions instead of rect-rect collisions where there are a shitton of rects to parse through.Collision checking is quicker with rectsShort question, why are you turning collision masks into many many rectangles instead of using pygame.sprite.collide_mask?Originally, I planned to do that. I went to inform myself and asked around how to collide masks with other stuff. People were telling me using rects for this would be a ton more efficient (if you only check those rects near to you), because if the wallmask was a mask, then everything who should collide with it should be one too.
I kinda trusted them, and also I know my way around rects much better than with masks.
Also, that part is done, as in finished in a very small time. I'm having troubles with the collision response, not with the detection (which is easy and actually quite efficient).
But a rect is just a mask with a rectangular shape :drool:
The point is we'd have to do the raster-rect collision-ing ourselves. Which I have very little idea how. Also, most rects don't even get considered, they have to be close enough.I'm just wondering aloud, wouldn't it be more efficient to do raster-rect collisions instead of rect-rect collisions where there are a shitton of rects to parse through.Collision checking is quicker with rectsShort question, why are you turning collision masks into many many rectangles instead of using pygame.sprite.collide_mask?Originally, I planned to do that. I went to inform myself and asked around how to collide masks with other stuff. People were telling me using rects for this would be a ton more efficient (if you only check those rects near to you), because if the wallmask was a mask, then everything who should collide with it should be one too.
I kinda trusted them, and also I know my way around rects much better than with masks.
Also, that part is done, as in finished in a very small time. I'm having troubles with the collision response, not with the detection (which is easy and actually quite efficient).
But a rect is just a mask with a rectangular shape :drool:
The point is we'd have to do the raster-rect collision-ing ourselves. Which I have very little idea how. Also, most rects don't even get considered, they have to be close enough.I'm just wondering aloud, wouldn't it be more efficient to do raster-rect collisions instead of rect-rect collisions where there are a shitton of rects to parse through.Collision checking is quicker with rectsShort question, why are you turning collision masks into many many rectangles instead of using pygame.sprite.collide_mask?Originally, I planned to do that. I went to inform myself and asked around how to collide masks with other stuff. People were telling me using rects for this would be a ton more efficient (if you only check those rects near to you), because if the wallmask was a mask, then everything who should collide with it should be one too.
I kinda trusted them, and also I know my way around rects much better than with masks.
Also, that part is done, as in finished in a very small time. I'm having troubles with the collision response, not with the detection (which is easy and actually quite efficient).
But a rect is just a mask with a rectangular shape :drool:
Of course. But you have to that too with masks, you know. Only you have 6 times more pixels than I have rects, and actually even more because I made the wallmask hollow shells. And it's one if loop to test the x, and if that's correct it's another if loop to test the y.The point is we'd have to do the raster-rect collision-ing ourselves. Which I have very little idea how. Also, most rects don't even get considered, they have to be close enough.I'm just wondering aloud, wouldn't it be more efficient to do raster-rect collisions instead of rect-rect collisions where there are a shitton of rects to parse through.Collision checking is quicker with rectsShort question, why are you turning collision masks into many many rectangles instead of using pygame.sprite.collide_mask?Originally, I planned to do that. I went to inform myself and asked around how to collide masks with other stuff. People were telling me using rects for this would be a ton more efficient (if you only check those rects near to you), because if the wallmask was a mask, then everything who should collide with it should be one too.
I kinda trusted them, and also I know my way around rects much better than with masks.
Also, that part is done, as in finished in a very small time. I'm having troubles with the collision response, not with the detection (which is easy and actually quite efficient).
But a rect is just a mask with a rectangular shape :drool:
You still have to technically parse through all existing rects just to identify which ones are near enough :v
So, every player checks to see which rects are around them, right? not just the client?Uhh, it's basically like this:
with GameObject:
if collisionRect != -1:
for (a=0; a<numberOfWallmaskRects; a+=1):
if abs(wallmaskList[a].centerx-self.rect.centerx) < 50:
if abs(wallmaskList[a].centery-self.rect.centery) < 50:
if self.rect.colliderect(wallmaskList[a].rect):
reactToCollision()
So, raster collision checking is slow and rect collision checking is fast. As a result, your own code for raster collision, using thousands of rect collision checks must be faster than the raster collision code in a popular library?+1
Implementing mask collision in terms of rectangles might be much more feasible if you had even a simple broadphase, but you don't. Your algorithm doggedly looks at every single rect. Thinning out the walls reduces the number of rects dramatically, but did you consider the problem of tunnelling this creates? And there are still thousands of rects left.
The most annoying thing about this is that a proper rect-mask collision code would be much simpler than what you wrote, and much faster too, at least if you assume that the rect is always axis-aligned, but that is always the case in GG2. My recommendation: Look at the first function in http://pygame.org/wiki/FastPixelPerfect (http://pygame.org/wiki/FastPixelPerfect) for a template, but leave out the check against the second mask since your entire second rect is colliding anyway.
Yes, you look about x AND y now. So what? Our characters are just a few map pixels high and wide, so it is still much less checking than with your code.
All in all, this looks very much like an example of premature (mis)optimization to me. Congratulations - you identified a suspected problem and, before ever checking that it is a real one, pored work into a solution that is probably slower than just using the simple solution: the built-in mask collision checking with a filled rectangular mask.
Why so stagnant? :(Because school and UDP gg2, for me.
Why so stagnant? :(Because school and ***** * ***** ** *****, for me.
?Why so stagnant? :(Because school and ***** * ***** ** *****, for me.
Either it's too private or it's TMI. Or it could be both. :barf:?Why so stagnant? :(Because school and ***** * ***** ** *****, for me.
def objectCheckCollision(character):
# Check if an object has hit the wallmask:
hasCollided = False
character.rect.centerx = character.x-character.xRectOffset
character.rect.centery = character.y-character.yRectOffset
clip = character.rect.clip(character.root.map.rect)
#find where clip's top-left point is in both rectangles
x1 = clip.left - character.root.map.rect.left
y1 = clip.top - character.root.map.rect.top
#cycle through clip's area of the hitmasks
for x in range(clip.width):
for y in range(clip.height):
#returns True if neither pixel is blank
if character.root.map.mask.get_at((x1+x, y1+y)) == 1:
hasCollided = True
if hasCollided:
return True
else:
return False
def characterHitObstacle(character):
# THIS IS THE NEW VERSION; STILL WITH x/y
newX = character.x
newY = character.y
hspeed = character.hspeed
vspeed = character.vspeed
length = lengthdir(hspeed, vspeed)
if length == 0:# You haven't moved; if this happens something went wrong
print "You haven't moved, yet managed to collide with something."
return False
# hs and vs is the normalized vector of hspeed and vspeed.
hs = character.hspeed/length
vs = character.vspeed/length
while True:
if not objectCheckCollision(character):
break
character.x -= hs
character.y -= vs
# return True
# This is the left-over velocity.
hs = hspeed
vs = vspeed
# The character got pushed out, but now we need to let him move in the directions he's allowed to move.
character.x += sign(hs)
if not objectCheckCollision(character) and abs(hs) > 0:
# There's still room to move on the left/right
i = 1
while i <= abs(hs) and not objectCheckCollision(character):
character.x += sign(hs)
i += 1
else:
# Stop horizontal movement
character.hspeed = 0
character.hs = 0
if objectCheckCollision(character):
character.x -= sign(hs)
character.y += sign(vs)
if not objectCheckCollision(character) and abs(vs) > 0:
# There's still room to move on the left/right
i = 1
while i <= abs(vs) and not objectCheckCollision(character):
character.y += sign(vs)
i += 1
else:
# Stop vertical movement
character.vspeed = 0
character.vs = 0
if objectCheckCollision(character):
character.y -= sign(vs)
return True
Against all odds, it works. We have a collision response code.Cool.
(even though it's a bit buggy at times)Code: [Select]def objectCheckCollision(character):
# Check if an object has hit the wallmask:
hasCollided = False
character.rect.centerx = character.x-character.xRectOffset
character.rect.centery = character.y-character.yRectOffset
clip = character.rect.clip(character.root.map.rect)
#find where clip's top-left point is in both rectangles
x1 = clip.left - character.root.map.rect.left
y1 = clip.top - character.root.map.rect.top
#cycle through clip's area of the hitmasks
for x in range(clip.width):
for y in range(clip.height):
#returns True if neither pixel is blank
if character.root.map.mask.get_at((x1+x, y1+y)) == 1:
hasCollided = True
if hasCollided:
return True
else:
return False
def characterHitObstacle(character):
# THIS IS THE NEW VERSION; STILL WITH x/y
newX = character.x
newY = character.y
hspeed = character.hspeed
vspeed = character.vspeed
length = lengthdir(hspeed, vspeed)
if length == 0:# You haven't moved; if this happens something went wrong
print "You haven't moved, yet managed to collide with something."
return False
# hs and vs is the normalized vector of hspeed and vspeed.
hs = character.hspeed/length
vs = character.vspeed/length
while True:
if not objectCheckCollision(character):
break
character.x -= hs
character.y -= vs
# return True
# This is the left-over velocity.
hs = hspeed
vs = vspeed
# The character got pushed out, but now we need to let him move in the directions he's allowed to move.
character.x += sign(hs)
if not objectCheckCollision(character) and abs(hs) > 0:
# There's still room to move on the left/right
i = 1
while i <= abs(hs) and not objectCheckCollision(character):
character.x += sign(hs)
i += 1
else:
# Stop horizontal movement
character.hspeed = 0
character.hs = 0
if objectCheckCollision(character):
character.x -= sign(hs)
character.y += sign(vs)
if not objectCheckCollision(character) and abs(vs) > 0:
# There's still room to move on the left/right
i = 1
while i <= abs(vs) and not objectCheckCollision(character):
character.y += sign(vs)
i += 1
else:
# Stop vertical movement
character.vspeed = 0
character.vs = 0
if objectCheckCollision(character):
character.y -= sign(vs)
return True
PyGG2 (https://github.com/Orpheon/PyGG2)
Uhh...I did that.Against all odds, it works. We have a collision response code.Cool.
(even though it's a bit buggy at times)Code: [Select]def objectCheckCollision(character):
# Check if an object has hit the wallmask:
hasCollided = False
character.rect.centerx = character.x-character.xRectOffset
character.rect.centery = character.y-character.yRectOffset
clip = character.rect.clip(character.root.map.rect)
#find where clip's top-left point is in both rectangles
x1 = clip.left - character.root.map.rect.left
y1 = clip.top - character.root.map.rect.top
#cycle through clip's area of the hitmasks
for x in range(clip.width):
for y in range(clip.height):
#returns True if neither pixel is blank
if character.root.map.mask.get_at((x1+x, y1+y)) == 1:
hasCollided = True
if hasCollided:
return True
else:
return False
def characterHitObstacle(character):
# THIS IS THE NEW VERSION; STILL WITH x/y
newX = character.x
newY = character.y
hspeed = character.hspeed
vspeed = character.vspeed
length = lengthdir(hspeed, vspeed)
if length == 0:# You haven't moved; if this happens something went wrong
print "You haven't moved, yet managed to collide with something."
return False
# hs and vs is the normalized vector of hspeed and vspeed.
hs = character.hspeed/length
vs = character.vspeed/length
while True:
if not objectCheckCollision(character):
break
character.x -= hs
character.y -= vs
# return True
# This is the left-over velocity.
hs = hspeed
vs = vspeed
# The character got pushed out, but now we need to let him move in the directions he's allowed to move.
character.x += sign(hs)
if not objectCheckCollision(character) and abs(hs) > 0:
# There's still room to move on the left/right
i = 1
while i <= abs(hs) and not objectCheckCollision(character):
character.x += sign(hs)
i += 1
else:
# Stop horizontal movement
character.hspeed = 0
character.hs = 0
if objectCheckCollision(character):
character.x -= sign(hs)
character.y += sign(vs)
if not objectCheckCollision(character) and abs(vs) > 0:
# There's still room to move on the left/right
i = 1
while i <= abs(vs) and not objectCheckCollision(character):
character.y += sign(vs)
i += 1
else:
# Stop vertical movement
character.vspeed = 0
character.vs = 0
if objectCheckCollision(character):
character.y -= sign(vs)
return True
PyGG2 (https://github.com/Orpheon/PyGG2)
Now STOP USING TABS DAMNIT. Set your editor to replace tabs with 4 spaces :/
Tab Width: 4
Insert spaces instead of the tabs: On
Anyone want to point me towards something they want done? I'm learning python, but I'm not far enough into the mindset to just start doing things.Umm, well...
No you didn't, the code you pasted there has tabs not spacesUhh...I did that.Against all odds, it works. We have a collision response code.Cool.
(even though it's a bit buggy at times)Code: [Select]def objectCheckCollision(character):
# Check if an object has hit the wallmask:
hasCollided = False
character.rect.centerx = character.x-character.xRectOffset
character.rect.centery = character.y-character.yRectOffset
clip = character.rect.clip(character.root.map.rect)
#find where clip's top-left point is in both rectangles
x1 = clip.left - character.root.map.rect.left
y1 = clip.top - character.root.map.rect.top
#cycle through clip's area of the hitmasks
for x in range(clip.width):
for y in range(clip.height):
#returns True if neither pixel is blank
if character.root.map.mask.get_at((x1+x, y1+y)) == 1:
hasCollided = True
if hasCollided:
return True
else:
return False
def characterHitObstacle(character):
# THIS IS THE NEW VERSION; STILL WITH x/y
newX = character.x
newY = character.y
hspeed = character.hspeed
vspeed = character.vspeed
length = lengthdir(hspeed, vspeed)
if length == 0:# You haven't moved; if this happens something went wrong
print "You haven't moved, yet managed to collide with something."
return False
# hs and vs is the normalized vector of hspeed and vspeed.
hs = character.hspeed/length
vs = character.vspeed/length
while True:
if not objectCheckCollision(character):
break
character.x -= hs
character.y -= vs
# return True
# This is the left-over velocity.
hs = hspeed
vs = vspeed
# The character got pushed out, but now we need to let him move in the directions he's allowed to move.
character.x += sign(hs)
if not objectCheckCollision(character) and abs(hs) > 0:
# There's still room to move on the left/right
i = 1
while i <= abs(hs) and not objectCheckCollision(character):
character.x += sign(hs)
i += 1
else:
# Stop horizontal movement
character.hspeed = 0
character.hs = 0
if objectCheckCollision(character):
character.x -= sign(hs)
character.y += sign(vs)
if not objectCheckCollision(character) and abs(vs) > 0:
# There's still room to move on the left/right
i = 1
while i <= abs(vs) and not objectCheckCollision(character):
character.y += sign(vs)
i += 1
else:
# Stop vertical movement
character.vspeed = 0
character.vs = 0
if objectCheckCollision(character):
character.y -= sign(vs)
return True
PyGG2 (https://github.com/Orpheon/PyGG2)
Now STOP USING TABS DAMNIT. Set your editor to replace tabs with 4 spaces :/Code: [Select]Tab Width: 4
Insert spaces instead of the tabs: On
No you didn't, the code you pasted there has tabs not spacesI still changed the options.
well, fix your code. maybe you confused tab width and tabs to spacesNo you didn't, the code you pasted there has tabs not spacesI still changed the options.
Or maybe you just read portions of code that I wrote before. :/well, fix your code. maybe you confused tab width and tabs to spacesNo you didn't, the code you pasted there has tabs not spacesI still changed the options.
well fix the old code, inconsistency is the issue hereOr maybe you just read portions of code that I wrote before. :/well, fix your code. maybe you confused tab width and tabs to spacesNo you didn't, the code you pasted there has tabs not spacesI still changed the options.
Look at the collision response.
Hey today was my first day of Programming class and we're going to learn Python a lot throughout the yearHow much indenting?
We learned loops, strings, Boolean objects (mostly did Pythonkara), functions/def?
I have a question, how do you know how how much indenting to do? Thats the only hard part so far.
I hope in 5 months or so to know enough to help you guys out with this.
-Made a character turn to face the mouse
Exceptions can easily be added later. And yes, I want to be able to change direction while taunting.-Made a character turn to face the mouse
Don't forget that certain animations will require exceptions to that such as the eating and stabbing animations (and taunt animations if you want to prevent people from spinning around while taunting).
while not kara.treeFront():
kara.move()
break
while kara.treeFront():
kara.putLeaf() and kara.move()
while True:
while no kara.treeFront():
kara.move()
kara.turnRight()
so how's the progress so far?The post above you pretty much sums it up.
Uhh...just as a general question....nope and I'm not even working on it half the time
(http://i54.tinypic.com/r729mr.png)
Is there someone other than me (and ajf) who's actually working on this?
Ya me tooI use gedit and terminal which are both default in Ubuntu :drool:.
What IDE do you use, and how exactly might one work with you from github?
Ya me tooI don't use one, just Notepad++ and a console, but I heard Komodo Edit is quite good.
What IDE do you use, and how exactly might one work with you from github?
Dems be linux hipsters.Actually not using Linux now, Windows 64-bit.
I'm using eclipse with pydev because I was too lazy to learn to use a new IDE, since I was already using eclipse for java.
I am rather excited for this.Shame, as I'm not really working on it now, and I doubt Orpheon will finish it on his own :(
Posting so I can follow, but AJF and Orph, is python easy to learn if you've had minimal Javascript, batch, and GML programming experience?Yes. Python isn't terribly difficult to learn, quite easy to pick up and its OOP system will probably feel familiar if you've used GML.
Posting so I can follow, but AJF and Orph, is python easy to learn if you've had minimal Javascript, batch, and GML programming experience?Differences between Python and GML:
>for a in range (len(mylist)) - NO. NO. for i in mylist...oh. Ok.
Alright, I've never posted on these forums before, so let me introduce myself.Welcome! I hope you have a good time here.
My name is Orson Peters and I'm 16 years old and I just LOVE GG2 (I found it after trying to play TF2 on a shitty computer).
On the other hand, I'm a (IMHO) very good programmer too, knowing Python, Lua, C/C++ and the PHP/SQL/HTML/CSS/JS package.
I have experience with Lua (http://tukui.org/ (http://tukui.org/)), Python, C & C++ (just my own little stuff). Windows and Linux platforms, WoW API Framework (if you can call it that). I have no real portfolio yet, finished projects include TukUI (coauthor/founder, inactive now): https://github.com/tukz/Tukui, (https://github.com/tukz/Tukui,) and a shameless Tetris clone (SDL messing around with C++): exe (http://www.tukui.org/files/03.05.11-16.09.55-tetris.zip)/src (http://www.tukui.org/files/03.05.11-16.09.13-tetris_src.zip).
Other than that, check out my site: http://nclabs.org/ (http://nclabs.org/).
I was amazed to see that GG2 was a game maker game, and when looking on the forums I found this thread. I'm willing to contribute on this project.
Perhaps someone can add me on MSN/Xfire/AIM to "talk me in" and explain the architecture a little bit? Thanks.
MSN: nightcracker@live.nl
XFire: nightcracker
AIM: nightcracker@nclabs.org
We don't use MSN, XFire or AIM. However, we do use the GG2 IRC (#gg2 on irc.esper.net) and Steam sometimes.Yeah. I can be found pretty much at any time I'm on the computer on the IRC channel.
Alright, I've never posted on these forums before, so let me introduce myself.Hey man, glad to see you want to help out, but I think the main method for communicating to other people who have experience with this project is the GG2 irc channel. Link should be at the top of the page. (:
My name is Orson Peters and I'm 16 years old and I just LOVE GG2 (I found it after trying to play TF2 on a shitty computer).
On the other hand, I'm a (IMHO) very good programmer too, knowing Python, Lua, C/C++ and the PHP/SQL/HTML/CSS/JS package.
I have experience with Lua (http://tukui.org/ (http://tukui.org/)), Python, C & C++ (just my own little stuff). Windows and Linux platforms, WoW API Framework (if you can call it that). I have no real portfolio yet, finished projects include TukUI (coauthor/founder, inactive now): https://github.com/tukz/Tukui, (https://github.com/tukz/Tukui,) and a shameless Tetris clone (SDL messing around with C++): exe (http://www.tukui.org/files/03.05.11-16.09.55-tetris.zip)/src (http://www.tukui.org/files/03.05.11-16.09.13-tetris_src.zip).
Other than that, check out my site: http://nclabs.org/ (http://nclabs.org/).
I was amazed to see that GG2 was a game maker game, and when looking on the forums I found this thread. I'm willing to contribute on this project.
Perhaps someone can add me on MSN/Xfire/AIM to "talk me in" and explain the architecture a little bit? Thanks.
MSN: nightcracker@live.nl
XFire: nightcracker
AIM: nightcracker@nclabs.org
I'll be away for 10 days, so I'm making ajf and nightcracker both collaborators, so you'll be able to push stuff to the main repos.At the moment it's just a text input field but I think that's all we'll really need for a while, just for testing.
Also, Kizzi is also interested in this project and is apparently working on a console of some sort.
I don't see what's wrong with using tabs.They're a mess, and inconsistent. The Python style guide recommends using spaces not tabs.
Alright, I did some major updates, got collision detection and reponse working beautifully now (you can walk up stairs and even jump on stairs), and changed the way PyGG2 was rendered. Orpheon now gets 450 FPS when we unlock the FPS limiter (standard it's on 80, anything more is overkill).nice!
A screenshot:
(http://i.imgur.com/Q6C69.png)
Alright, I did some major updates, got collision detection and reponse working beautifully now (you can walk up stairs and even jump on stairs), and changed the way PyGG2 was rendered. Orpheon now gets 450 FPS when we unlock the FPS limiter (standard it's on 80, anything more is overkill).
A screenshot:
(http://i.imgur.com/Q6C69.png)
Also, nightcracker, is your project actually in Orpheon/PyGG2's main branch? I seem to be getting some mapless, collisionless void with very glitchy shooting.
I'm so glad to see this moving ahead! I've learned a lot about Python and the Pygame library while reviewing the code put up so far. The next part is a mystery to me though. How are you going to get two people interacting with one another in a game? Is this where Twisted comes in?
That 450 fps is awesome, btw! I wonder what that number would be on less powerful hardware...
This is assuming we're only rendering 2 or 3 objects, like we are at the moment. Realistically we'll have hundreds of objects to render and a more modest framerate.Also, nightcracker, is your project actually in Orpheon/PyGG2's main branch? I seem to be getting some mapless, collisionless void with very glitchy shooting.
Nope, I usually work in my own fork: https://github.com/nightcracker/PyGG2I'm so glad to see this moving ahead! I've learned a lot about Python and the Pygame library while reviewing the code put up so far. The next part is a mystery to me though. How are you going to get two people interacting with one another in a game? Is this where Twisted comes in?
That 450 fps is awesome, btw! I wonder what that number would be on less powerful hardware...
Yes, that's were Twisted comes in (though Twisted is not necessary, it's a nice library).
And it would probably be around 100-200 FPS on less powerful hardware.
def collide(self, frametime):
GameObject.collide(self, frametime)
if objectCheckCollision(self):
self.destroyInstance = True
For some odd reason self.destroyInstance is never marked as True, even in the middle of the wallmask.class GameObject(pygame.sprite.Sprite):
def __init__(self, root, xpos, ypos):
pygame.sprite.Sprite.__init__(self)
self.root = root
self.x = xpos
self.y = ypos
self.hspeed = 0
self.vspeed = 0
self.image = None
self.rect = (0, 0, 0, 0)
self.root.GameObjectList.append(self)
self.destroyInstance = False
def beginStep(self, frametime):
pass
def step(self, frametime):
pass
def endStep(self, frametime):
self.x += self.hspeed * frametime
self.y += self.vspeed * frametime
self.x = max(self.x, 0)
self.y = max(self.y, 0)
def draw(self):
if self.image:
x, y = int(self.x), int(self.y)
xoff, yoff = self.rect[0:2]
xview, yview = int(self.root.Xview), int(self.root.Yview)
# range checking - TODO consider sprite heigth/width
if x >= xview and x < xview + self.root.Wview and y >= yview and y < yview + self.root.Hview:
self.root.Surface.blit(self.image, (x - xoff - xview, y - yoff - yview))
There is no "GameObject.collide()". ???Both aren't bugs :hehe:
1. The function was removed because the object should check for collision itself in either beginStep, step, or endStep IMO. Why? Because it will make collision resolving (what actually should be done if something does collide) much easier. I'm not saying that the .collide function is bad, I'm saying that calling it directly in the main loop was bad. As a cause of this the collision detection of bullets was temporarily disabled, causing you to think destroyInstance was never set.
I'm not saying the removal of collide() is a bug, it's the forgetting of fixing the bullet collide code.
2. The second is sort more of a known issue. The current physics are just an example implementation by me until it gets replaced with real tested code.
Ok
I've just finished my first book on python, I'm looking into pygame now, hopefully I'll be able to contribute down the trackYay. Welcome.
>script kiddo
>does real programming
???>script kiddo
>does real programming
???
Oh I'm still a script kiddo...>_>
I'm just very good at it :z5:
Weird, but not impossible.I get it when i try unzipping it, so I didn't get these when i try executing the game. What did you use to zip it?
Can you post errors/logs/anything you get?
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in dependencies.dat
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in pygg2.exe
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\collisionmaps\atalia.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\collisionmaps\corinth.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\collisionmaps\dirtbowl.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\collisionmaps\egypt.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\collisionmaps\harvest.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\collisionmaps\lumberyard.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\collisionmaps\montane.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\collisionmaps\oldfort.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\collisionmaps\orange.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\collisionmaps\sixties.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\collisionmaps\truefort.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\collisionmaps\twodforttwo.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\collisionmaps\twodforttwo_remix.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\collisionmaps\waterway.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\gameelements\creditss\0.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\gameelements\menubackgrounds\0.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\gameelements\menubackgrounds\1.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\gameelements\menubackgrounds\2.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\gameelements\menubackgroundversions\0.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\huds\classselects\0.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\huds\mvpbanners\0.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\huds\mvpbanners\1.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\huds\mvpbanners\2.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\huds\mvpbanners\3.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\huds\scoreboard\0.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\huds\teamselects\0.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\maps\atalia.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\maps\conflict.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\maps\corinth.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\maps\destroy.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\maps\dirtbowl.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\maps\egypt.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\maps\harvest.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\maps\lumberyard.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\maps\montane.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\maps\oldfort.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\maps\orange.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\maps\sixties.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\maps\truefort.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\maps\twodforttwo.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\maps\twodforttwo_remix.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\maps\valley.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\maps\waterway.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in sprites\maps\zclassicwell.png
! C:\Documents and Settings\gebruiker\Mijn documenten\Downloads\pygg2.zip: Onbekende methode in w9xpopen.exe
First release you guys can test! (more like a demo)Works great!*
Featuring no networking, one bugged class, one map and collision detection!
Instructions: unzip and start with pygg2.exe
Download (http://nclabs.org/downloads/pygg2.zip)
First release you guys can test! (more like a demo)
Featuring no networking, one bugged class, one map and collision detection!
Instructions: unzip and start with pygg2.exe
Download (http://nclabs.org/downloads/pygg2.zip)
For me, it runs perfectly at a static 83 fps (with frame limiter) with slight eventual drops to 82 at rare moments.Same here.
Same here.For me, it runs perfectly at a static 83 fps (with frame limiter) with slight eventual drops to 82 at rare moments.Same here.
# global settings
framerate = 80
....
# wait to get steady frame rate
game.clock.tick(framerate)
Code: [Select]# global settings
framerate = 80
....
# wait to get steady frame rate
game.clock.tick(framerate)
(with frame limiter)
nightcracker for most devoted programmer 2011In the case of PyGG2, that's definately true.
man this is getting interesting...Yeah, thank nightcracker for that. Interpolation's a thing o' beauty :z6:
and it's so smooth...
@Orangestar:Well that explains everything. I was wondering how the hell you hosted it on some water-purification site.
1. It's nclabs.ORG, and 2. it's my own site - I have full control over it.
The time has come to see the product of my hard labour:Love the work you did so far, while not shotting it runs at about 190-210 FPS, while holding m1 it constantly changes but it seems to be 90-110 FPS
PyGG2 - the stress-test version (http://nclabs.org/downloads/pygg2.zip)
The scattergun has been... modified :hehe16: It fires 10 $400 bullets per pellet, 20 times per second. That is 1200 RPM. It costs $96000 to fire this weapon for twelve seconds. On this Very Shitty Computer(tm) I get 80 FPS while shooting in the air (providing maximal flight time for the bullets).
Please post your results!
We don't really use an IDE, just a plain 'old code editor. I personally use Notepad++, but you can use whatever you want.
To get started just fork my repository on github and start coding. When you're done make a pull request and I'll look through the code and put it in.
My repo: https://github.com/nightcracker/PyGG2
notepad ++ has basic syntax hilighting and most of the debugging is done through python itself (console), at least from the 20 minutes of when I set everything up today (for some reason python 64 doesn't want to work with pygame and I had to downgrade)Yeah I found that out after installing too... I have 4 versions of python installed, both of the 2.7 and 3.2's because I forgot pygame doesn't work with 64
ewwww gedit.But gedit has a file browser!
notepad++ 4 lyfe
Floaty as in jumping? Our gravity and acceleration numbers aren't correct yet, so it is different from GG2 yes (and might feel floaty)....
And you are correct. On my webserver I just use one location, /downloads/pygg2.zip which I constantly overwrite with the newest version, which happens not to be a stress test.
Git.Floaty as in jumping? Our gravity and acceleration numbers aren't correct yet, so it is different from GG2 yes (and might feel floaty)....
And you are correct. On my webserver I just use one location, /downloads/pygg2.zip which I constantly overwrite with the newest version, which happens not to be a stress test.
that's gonna cause caching problems mate. might want to consider having several versions.
--snip--
Optimize this: (http://i.imgur.com/B9uCf.png)--snip--
What on earth were you trying to do?!
map...rotation...Optimize this: (http://i.imgur.com/B9uCf.png)--snip--
What on earth were you trying to do?!
No, bitmask rotation....oh
There were small FPS improvements
Oh man, 2000 FPS just ain't enough.There were small FPS improvements
Idle: switches between 1666 and 2000
shooting: ~580
that's an FPS drop of at least 500 compared to the last version :drool:
(well while shooting it improved...which is more important i would say.)
hey so how do I add the C module to pythonpython make.py build
what uh enviromental path do I need to add for make.py and build1) download mingw32-gcc (gcc for windows) from somewhere
sudo apt-get install python-imaging
Motion blur anyone?
(http://snag.gy/xfJBW.jpg)
Motion blur anyone?>11 fps
-snip-
Well, in the latest version we already split the physics from the rendering completely by splitting the whole engine. I'm not really sure what else you mean with "framerate scalibility in pygame" (note that the server won't even use pygame).Hooray for modularity :)
Also, we program like real hardcores, we program with this keyboard:Obvius stolen image form General Chatter(click to show/hide)
Uhh...You do know we double-posted?Also, we program like real hardcores, we program with this keyboard:Obvius stolen image form General Chatter(click to show/hide)
http://www.ganggarrison.com/forums/index.php?topic=22155.msg1009478;boardseen#new (http://www.ganggarrison.com/forums/index.php?topic=22155.msg1009478;boardseen#new)Uhh...You do know we double-posted?Also, we program like real hardcores, we program with this keyboard:Obvius stolen image form General Chatter(click to show/hide)
We communicate quite a lot over skype, you know.
PyGG2 PROTOCOL CONCEPT
char = 1 byte - ascii, implementation defined
byte = 1 byte - integer, range [-128, 127]
ubyte = 1 byte - integer, range [0, 255]
short = 2 bytes − integer, range [-32768, 32767]
ushort = 2 bytes - integer, range [0, 65535]
int = 4 bytes − integer, range [-2147483648, 2147483647]
uint = 4 bytes - integer, range [0, 4294967295]
long = 8 bytes − integer, range [-9223372036854775808, 9223372036854775807]
ulong = 8 bytes - integer, range [0, 18446744073709551615]
float = 4 bytes - floating point, single precision
double = 8 bytes - floating point, double precision
bin[n] = n bytes - binary data
bit inputstate {
bit left;
bit right;
bit up;
bit mouseleft;
bit mouseright;
}
struct snapshot_player_base {
bin[1] inputstate;
ushort aimdirection;
uint x;
uint y;
short hspeed;
short vspeed;
ubyte hp;
}
All: afterburn, movestatus
Scout: doublejump
Pyro: no afterburn
Soldier: ---
Heavy: Sandvich
Demo: stickies (amount)
Medic: Ubercharge, ubercharge rate, healing ramp
Engie: Nuts&Bolts
Spy: ---
Sniper: Damage(?)
Methods
def send_complete_update {
[ACKED; Server-->Client]
for player in players:
{
send: ServerPlayerJoin(player.name, buffer);
send: ServerPlayerChangeclass(id, player.class, buffer);
send: ServerPlayerChangeteam(id, player.team, buffer);
}
for player in players:
send: stats[KILLS, DEATHS, HEALING, etc...]
if player.character is alive,
{
send: player.input and aimdirection
send: player.positions and velocities
send: player.hp and weapon ammo
send: is cloaked?
send: weapon.readytoshoot
}
if player.sentry exists,
{
send: original pointing direction
send: positions
send: built y/n?
send: hp
}
::Send Gamemode information::
}
Handshake
[ACKED; 2-Way]
> client hello
name; pass if any;
> server hi
if pass = incorrect: notify incorrect pass and kick
if numplayers >= maxplayers: notify server full and kick
send: servername; numOfPlayers; mapName, version
send_complete_update()
Snapshot_update
[NOT_ACKED; Server-->Client]
Send all player positions and speed.
for player in players {
if player is alive,
{
send: player.input and aimdirection
send: player.positions and velocities
send: player.hp and ammo
send: cloaked(y/n)?
{
}
Packet pre- and suffixes:
server -> client
ushort sequence;
ushort delta_sequence;
ushort last_acked_sequence;
client -> server
ushort sequence;
ushort ack_sequence;
Today I realized something:HOW DID YOYU DO THATAT?!?!?!?
(http://i.snag.gy/bJViQ.jpg)
Doing my jobToday I realized something:HOW DID YOYU DO THATAT?!?!?!?(click to show/hide)
We found an IDE.I've already tried Komodo Edit
(http://snag.gy/5ynyo.jpg)
Slow startup? You mean the 3 seconds?We found an IDE.I've already tried Komodo Edit
(http://snag.gy/5ynyo.jpg)
I didn't like the slow startup
>visual studioWe found an IDE.I've already tried Komodo Edit
(http://snag.gy/5ynyo.jpg)
I didn't like the slow startup
even VS starts faster =/>visual studioWe found an IDE.I've already tried Komodo Edit
(http://snag.gy/5ynyo.jpg)
I didn't like the slow startup
:hehe:
I am partially alive. I'll occasionally be checking this thread to see if game structure has reached a ready point, and then start working on gameplay mechanics (rounds, autoguns, ammo, etc) and some generic stuff (health HUD, player list, etc).A health hud would be a welcome addition at this point.
white text on black background... what have you done...Found out how incredibly beautiful dark schemes are.
All right, a little test:59/60 FPS
Download (http://nclabs.org/downloads/2d_opengl.zip)
Unzip and run 2d.exe. This should open a window with 1000 quotes rendered over each other, and a console window that displays your FPS. Please test this and tell me whether it works and what FPS you get. It should look like this:
(http://i.snag.gy/Zotnv.jpg)
Yup, 60 fps for me too
mask_extension/bitmask.c: In function 'bitcount':
mask_extension/bitmask.c:74:7: warning: right shift count >= width of type
It's a warning, you can ignore it. (It's from a library that we use but we didn't write, and I get the same warning too)
MacBook-Pro:~ fakename$ /var/folders/6_/82m86h0d5fs7swwxv0psfhkw0000gn/T/Cleanup\ At\ Startup/main-345126843.489.py.command
Traceback (most recent call last):
File "/Users/fakename/Desktop/Downloaded Zips/nightcracker-PyGG2-a3e8c4c/client/main.py", line 17, in <module>
import engine.game
File "../engine/game.py", line 7, in <module>
import map
File "../engine/map.py", line 5, in <module>
import function
File "../function.py", line 6, in <module>
import mask
File "../mask.py", line 1, in <module>
import mask_extension._mask
How do I intstall this on a mac? I have pygame and 2.7 installed, but when I run main.py in terminal (cmd for mac), I get back this error:Ah, you need to compile the mask extension using gcc. You're on a mac, so it shouldn't be too hard to acquire, if you have XCode it may already be installed.Code: [Select]MacBook-Pro:~ fakename$ /var/folders/6_/82m86h0d5fs7swwxv0psfhkw0000gn/T/Cleanup\ At\ Startup/main-345126843.489.py.command
Traceback (most recent call last):
File "/Users/fakename/Desktop/Downloaded Zips/nightcracker-PyGG2-a3e8c4c/client/main.py", line 17, in <module>
import engine.game
File "../engine/game.py", line 7, in <module>
import map
File "../engine/map.py", line 5, in <module>
import function
File "../function.py", line 6, in <module>
import mask
File "../mask.py", line 1, in <module>
import mask_extension._mask
I'll try run this under wine when I get back :c1:
'scuse me pals, holding the idiot ball for the nightDefinately not. We're not even using the same network protocol (=network language), nor any similar system for syncing stuff.
Will python-developed versions of gg2 be compatible with the servers hosted on game maker ones, during the transition time and/or to test them?
we end up having to deal with external libraries and not built in functions, you know like a normal programming languageEhm, the only external libraries we use right now are pygame for drawing. GG2 has it's own share of external libraries, like Faucenet, which we don't need.
If possible, I'd like to see a progress bar or something on this page, by simply reading I can't find out how far have you got...I'm pretty new to all of this stuff, but wouldn't that be an opening to speedhackers?
- Because Python is faster and allows for more complex systems than GML it is easier to implement lag compensation. AKA less lag
I'm quite concerned about the possible decrease in mods output, given the change of language. It's my only qualm, right now.Would it be hard to first make a mod with GMK, and then just translate it to python?
Again, I've never coded anything more complicated than "Press V for taunt bubbles" and even with that I needed Lorgan :P
Would it be hard to develop a system to port already existing gg2 mods to the new version?
And what about future mods, will things be easier for them?
People would still be able to play the mod. Its not like its completely lost... Or is it? Also about the lag. How much less lag can this possibly create? Is it as drastic as a person that gets 2 seconds of delay and a lot of stutters to have .5 seconds of delay and nearly no stutters?
21 msPeople would still be able to play the mod. Its not like its completely lost... Or is it? Also about the lag. How much less lag can this possibly create? Is it as drastic as a person that gets 2 seconds of delay and a lot of stutters to have .5 seconds of delay and nearly no stutters?
The mod is completely lost.
The thing of that lag compensation is that the feeling of lag seemingly dissappears (you don't have to lead your targets), that combined with prediction and interpolating (removing stutters) mean stutterless and seemingly lagless gameplay. Most importantly, you don't have to predict your jump when jumping off a platform.
The only disadvantage that we get (we can't make latency disappear after all) is that the "shot around the corner bug" occurs. Despite shots being seemingly missed on your screen they still hit for the shooting players, and get registered as such. This will be most noticable when hiding behind boxes. Luckily, most shots in GG2 are projectiles, so we can sync them to hide the lag even more. But it would certainly be noticed for hitscans (sniper).
What for example can happen is that a rocketman shoots a rocket towards a Pyro. The Pyro player sees the rocket on his screen and reflects the rocket. But in the time it takes for the reflect to get to the server the rocket already hit! (which is also what the rocketman will see), but then the event of the reflect gets to the server, and the server goes back in time to see if the reflect was successful. It was, so history gets recalculated, and the rocket will be reflected. This might create a bit of a "WTF" for the rocketmen, because the rocket seemingly hit but then got reflected. Though weird it is fair.
All of the above described effects are about bullets and shooting. It is very well possible that we might not do lag compensation for shooting, and only for movement. On top of that, dedicated server will greatly reduce latency. It is very well possible for your latency to drop from 230ms to 40ms. Here's a little quick test for you.
Open command prompt and type "ping nclabs.org", without the quotes. It will display how much milliseconds ping you have with my dedicated server (nclabs.org). If I'd host a PyGG2 game on that server, that will be ~ the ping you'll get.
Oh alright, so it will be stutterless. But the amount of delay would remain the same? Also for the ping thing, why will it give me the ping for your server?
Ahh I got 94 ms.
I don't know the ping I get on your server though.Ahh I got 94 ms.
Oh yes, my server is EU :D
Oh alright, so it will be stutterless. But the amount of delay would remain the same? Also for the ping thing, why will it give me the ping for your server?
That's what the built-in Windows command ping does. And no, the amount of delay does not stay the same. Here let me repeat it once more:Dedicated servers reduce lag severely; PyGG2 allows for dedicated serversPyGG2 = less lag
See for yourself, type "ping nclabs.org" in command prompt (start > run > "cmd") and see how much ping it gives you.
(without the quotes ofcourse)
What is the current progress bar for gg2?wait approximately how far along is this?A progress bar is completely impossible to give until we get into later stages of development.
The best answer is the one I can give without much effort.
Oh alright, so it will be stutterless. But the amount of delay would remain the same? Also for the ping thing, why will it give me the ping for your server?
That's what the built-in Windows command ping does. And no, the amount of delay does not stay the same. Here let me repeat it once more:Dedicated servers reduce lag severely; PyGG2 allows for dedicated serversPyGG2 = less lag
See for yourself, type "ping nclabs.org" in command prompt (start > run > "cmd") and see how much ping it gives you.
(without the quotes ofcourse)
Lowest = 1400 ms... :z4:
Alright 0% would be nothing at all done. Like just thought of the idea a minute ago without any effort. 100% would be vanilla.
Alright 0% would be nothing at all done. Like just thought of the idea a minute ago without any effort. 100% would be vanilla.Vanilla isn't finished yet. Just saying.
to be a good programmer you have to be able to use a large variety of programming languagesrequoting for emphasizing the point
Hm, oddly enough I really didn't get object based programming until someone used 'object' and 'instance' (as game maker does) when describing it.
The only thing still confusing me is the creating of instances (i know you can type say shot.bullet() to create an instance of shot named bullet, but... iunno it's hard to explain my confusion), which i'm sure I'll get to in the pygame portion of learning.
Oh, and how to import pygame.
Don't know how to do that.
import pygame # import the pygame module
pygame.init() # initialize it (this must be done, but this only is the case for pygame, not in general for every library)
I've heard that only works if pygame is in the same folder as the source of your project.No, it also has a "search path" (basically a directory it will check afterwords), where pygame is installed.
Yeah, but when I said 'import pygame' (the only line in the code, if it matters), python had a fit, or the window just closed really fast.You need to install it first
Yeah, but when I said 'import pygame' (the only line in the code, if it matters), python had a fit, or the window just closed really fast.Try adding "while True: pass" at the end.
How far is the project complete, percentage style?~20%. +- 19%.
lol xDHow far is the project complete, percentage style?~20%. +- 19%.
Well, not to tell you guys how to do your job, but when the whole thing'd be like, 80% done, you should probably notify people in Mods so they can stop fidgeting with their pirated game maker 8.0s and start learning some other language so they can start mod the new, better version.
Well, not to tell you guys how to do your job, but when the whole thing'd be like, 80% done, you should probably notify people in Mods so they can stop fidgeting with their pirated game maker 8.0s and start learning some other language so they can start mod the new, better version.Python is a free programming language, so I'm not so sure if transition will be a problem unless you want to invest in an expensive python ide (if one really exists, nightcracker/orpheon have been using notepad ++)
Well, not to tell you guys how to do your job, but when the whole thing'd be like, 80% done, you should probably notify people in Mods so they can stop fidgeting with their pirated game maker 8.0s and start learning some other language so they can start mod the new, better version.Python is a free programming language, so I'm not so sure if transition will be a problem unless you want to invest in an expensive python ide (if one really exists, nightcracker/orpheon have been using notepad ++)
Everyone is welcome to pitch in in development, you know, although I haven't done jack
Secure model or not, we can still allow modding as it is now without any problem, so yeah.Well, not to tell you guys how to do your job, but when the whole thing'd be like, 80% done, you should probably notify people in Mods so they can stop fidgeting with their pirated game maker 8.0s and start learning some other language so they can start mod the new, better version.Python is a free programming language, so I'm not so sure if transition will be a problem unless you want to invest in an expensive python ide (if one really exists, nightcracker/orpheon have been using notepad ++)
Everyone is welcome to pitch in in development, you know, although I haven't done jack
In the beginning we have yes, but we've switched mostly to Komodo Edit (which is also free) because it allowed us to give a better overview of the project and it's files.
And about modding, I think we are going to try and make some secure modding model, which allows you to automatically play on modded servers without exposing your system to any risk.
Suddenly people think PyGG2 is a good idea.:drool:
I should work on my GML interpreter...
Well, not to tell you guys how to do your job, but when the whole thing'd be like, 80% done, you should probably notify people in Mods so they can stop fidgeting with their pirated game maker 8.0s and start learning some other language so they can start mod the new, better version.We've already been telling to most modders informally that learning Python would be a good idea, if only to try to attract more PyGG2 devs.
This looks really cool; I was just reading through some of the code. If you have some coding tasks that need tackling, I may be able to help.Well, not really an official one.
I definitely can't promise anything, but it would be fun to be programming (just a little bit) for GG2 again!
Is there a todo list anywhere?
cspotcode posted again
shit just got serious
This looks really cool; I was just reading through some of the code. If you have some coding tasks that need tackling, I may be able to help.Well, not really an official one.
I definitely can't promise anything, but it would be fun to be programming (just a little bit) for GG2 again!
Is there a todo list anywhere?
Seeing as nightcracker and I are the only people actually working on this now, and we meet on a daily basis on the IRC, we normally decide small stuff then and there, and then code it.
The only things where we have written brainstorming is our network protocol (https://docs.google.com/document/d/1QaH5z9ELDDKr9q02kyN3hrYd2Q-uhGBi9_XVGwB-rkA/edit), which again, is not really meant to be read without explanation. We've also decided on a lot of stuff that isn't mentioned in that document.
So yeah, best would probably be if you dropped by in IRC someday.
What woah woah. You completely misunderstood me.cspotcode posted again
shit just got serious
Don't go taking me seriously, I'll just have to disappear again :z5:This looks really cool; I was just reading through some of the code. If you have some coding tasks that need tackling, I may be able to help.Well, not really an official one.
I definitely can't promise anything, but it would be fun to be programming (just a little bit) for GG2 again!
Is there a todo list anywhere?
Seeing as nightcracker and I are the only people actually working on this now, and we meet on a daily basis on the IRC, we normally decide small stuff then and there, and then code it.
The only things where we have written brainstorming is our network protocol (https://docs.google.com/document/d/1QaH5z9ELDDKr9q02kyN3hrYd2Q-uhGBi9_XVGwB-rkA/edit), which again, is not really meant to be read without explanation. We've also decided on a lot of stuff that isn't mentioned in that document.
So yeah, best would probably be if you dropped by in IRC someday.
Ah, ok, I can't do daily IRC meetings with my schedule so I probably won't be able to help. Oh well, looks cool!
What woah woah. You completely misunderstood me.
Nightcracker and I do it. That doesn't mean you have to to help us. I mentioned it because that was my excuse to not having any real written documents apart from the code.
But anyway, if you want to help, there are a lot of stuff open.
For example, I heard you know your stuff well with the maps, programming the whole map format and maybe a new editor would be a very helpful and necessary thing that doesn't need loads of communications with us.
Would that be an idea?
Great. Good luck at getting stuff working!What woah woah. You completely misunderstood me.
Nightcracker and I do it. That doesn't mean you have to to help us. I mentioned it because that was my excuse to not having any real written documents apart from the code.
But anyway, if you want to help, there are a lot of stuff open.
For example, I heard you know your stuff well with the maps, programming the whole map format and maybe a new editor would be a very helpful and necessary thing that doesn't need loads of communications with us.
Would that be an idea?
Yeah, I actually already designed a new map format for my Garrison Builder rewrite. I can dredge up those old notes and the Garrison Builder code and see what needs to be done.
Well, you're competing against me, I'm rewriting GB and integrating it into GG2...What woah woah. You completely misunderstood me.
Nightcracker and I do it. That doesn't mean you have to to help us. I mentioned it because that was my excuse to not having any real written documents apart from the code.
But anyway, if you want to help, there are a lot of stuff open.
For example, I heard you know your stuff well with the maps, programming the whole map format and maybe a new editor would be a very helpful and necessary thing that doesn't need loads of communications with us.
Would that be an idea?
Yeah, I actually already designed a new map format for my Garrison Builder rewrite. I can dredge up those old notes and the Garrison Builder code and see what needs to be done.
Well, you're competing against me, I'm rewriting GB and integrating it into GG2...
GM in this case. https://github.com/TazeTSchnitzel/Gang-Garrison-2/tree/mapeditWell, you're competing against me, I'm rewriting GB and integrating it into GG2...
I'm interested... are you using GM or Python? Can I check out the code somewhere? What kinda map format are you using?
No sense duplicating effort; if we can work together, that'd be cool. Doubling the ol' bus factor (http://en.wikipedia.org/wiki/Bus_factor), as they say.
Well, we'd really like a Python map build for Pygg2. We want to move completely away from GM.Meh. cspotcode's is Java, the language really shouldn't matter.
Well, we'd really like a Python map build for Pygg2. We want to move completely away from GM.Meh. cspotcode's is Java, the language really shouldn't matter.
It would probably be beneficial that the map editor and the game were in the same language. For multiple reasons.Well, we'd really like a Python map build for Pygg2. We want to move completely away from GM.Meh. cspotcode's is Java, the language really shouldn't matter.
I was using Java because it's easily cross-platform, has killer GUI libraries, and I thought the most realistic GG2 rewrite would happen in Java. I was using the Netbeans Platform, which is mega-powerful for implementing complex editors, but also has a big learning curve.
I'm not opposed to Python but I'd have to research cross-platform GUI libraries. They probably won't be as 'mega-powerful' as the Netbeans Platform, but having the speed of a scripting language is a plus.
@Terry: I also hate the old map format, I'll post some of my new ideas.
To reduce code duplication etc etc. Yes.It would probably be beneficial that the map editor and the game were in the same language. For multiple reasons.Well, we'd really like a Python map build for Pygg2. We want to move completely away from GM.Meh. cspotcode's is Java, the language really shouldn't matter.
I was using Java because it's easily cross-platform, has killer GUI libraries, and I thought the most realistic GG2 rewrite would happen in Java. I was using the Netbeans Platform, which is mega-powerful for implementing complex editors, but also has a big learning curve.
I'm not opposed to Python but I'd have to research cross-platform GUI libraries. They probably won't be as 'mega-powerful' as the Netbeans Platform, but having the speed of a scripting language is a plus.
@Terry: I also hate the old map format, I'll post some of my new ideas.
What? You want to import python code of the engine and stuff in Java? Why?To reduce code duplication etc etc. Yes.It would probably be beneficial that the map editor and the game were in the same language. For multiple reasons.Well, we'd really like a Python map build for Pygg2. We want to move completely away from GM.Meh. cspotcode's is Java, the language really shouldn't matter.
I was using Java because it's easily cross-platform, has killer GUI libraries, and I thought the most realistic GG2 rewrite would happen in Java. I was using the Netbeans Platform, which is mega-powerful for implementing complex editors, but also has a big learning curve.
I'm not opposed to Python but I'd have to research cross-platform GUI libraries. They probably won't be as 'mega-powerful' as the Netbeans Platform, but having the speed of a scripting language is a plus.
@Terry: I also hate the old map format, I'll post some of my new ideas.
That doesn't mean we'll rewrite it in Python.
No, I'm saying just because we *should* avoid having seperate languages does not mean we are going to trash perfectly good existing work just because some people want it done in Python.What? You want to import python code of the engine and stuff in Java? Why?To reduce code duplication etc etc. Yes.It would probably be beneficial that the map editor and the game were in the same language. For multiple reasons.Well, we'd really like a Python map build for Pygg2. We want to move completely away from GM.Meh. cspotcode's is Java, the language really shouldn't matter.
I was using Java because it's easily cross-platform, has killer GUI libraries, and I thought the most realistic GG2 rewrite would happen in Java. I was using the Netbeans Platform, which is mega-powerful for implementing complex editors, but also has a big learning curve.
I'm not opposed to Python but I'd have to research cross-platform GUI libraries. They probably won't be as 'mega-powerful' as the Netbeans Platform, but having the speed of a scripting language is a plus.
@Terry: I also hate the old map format, I'll post some of my new ideas.
That doesn't mean we'll rewrite it in Python.
Also, why make everything more complicated for a new/GML-only modder? Whytwothree languages instead ofonetwo?
That mostly depends on the size of the work done in Java. But yeah, whatever. Do what you guys think is best.No, I'm saying just because we *should* avoid having seperate languages does not mean we are going to trash perfectly good existing work just because some people want it done in Python.What? You want to import python code of the engine and stuff in Java? Why?To reduce code duplication etc etc. Yes.It would probably be beneficial that the map editor and the game were in the same language. For multiple reasons.Well, we'd really like a Python map build for Pygg2. We want to move completely away from GM.Meh. cspotcode's is Java, the language really shouldn't matter.
I was using Java because it's easily cross-platform, has killer GUI libraries, and I thought the most realistic GG2 rewrite would happen in Java. I was using the Netbeans Platform, which is mega-powerful for implementing complex editors, but also has a big learning curve.
I'm not opposed to Python but I'd have to research cross-platform GUI libraries. They probably won't be as 'mega-powerful' as the Netbeans Platform, but having the speed of a scripting language is a plus.
@Terry: I also hate the old map format, I'll post some of my new ideas.
That doesn't mean we'll rewrite it in Python.
Also, why make everything more complicated for a new/GML-only modder? Whytwothree languages instead ofonetwo?
Off-topic, but one idea I thought of was that the GIF format would be good for GG2 maps. It's a simple format, 256-color, and its multiple frames support could be used for bg/wallmask/foreground image/item placement.PNGs can be palletized/indexed too, easily, as well as a hard 256 color restriction being bad for map makers.
also I think that PNG was chosen because of its layering system, which I don't think was actually used for the wallmasks as its just translated into bits and written directly into the metadata
My idea is just a .map format. It's just a zip file with two .png's in it (foreground and wallmask), and potentially some .metadata files or something. You get bundling for free, aswell as compression. Python (and I think Java too, but I'm not sure) can read/write zip files with the standard library.+1
Also, one thing that you must keep in mind, PyGG2 will be using the PNG alpha channel for alpha, and not the green key color. (Yes, this also means you can get semi-transparent sprites).This is already possible in GM as well.
I also had a (random) idea for the metadata, instead of making it some sort of text file we could make a third image instead. Bright red means RED's spawn, blue means BLUE's spawn, grey means bullet wall, yellow is left-to-right bullet wall, orange is right-to-left bullet wall, you get the idea. This way you also can easily overlay the maps and quickly spot any errors.Not hugely in favor of this, it would be difficult to work with entities which are supposed to overlap.
QuoteI also had a (random) idea for the metadata, instead of making it some sort of text file we could make a third image instead. Bright red means RED's spawn, blue means BLUE's spawn, grey means bullet wall, yellow is left-to-right bullet wall, orange is right-to-left bullet wall, you get the idea. This way you also can easily overlay the maps and quickly spot any errors.Not hugely in favor of this, it would be difficult to work with entities which are supposed to overlap.
random_name.zip
|- cp_foreground.png
|- cp_wallmask.png
|- cp.metadata
|- ctf_foreground.png
|- ctf_wallmask.png
|- ctf.metadata
Regarding map formats, I think you'll like what I came up with. IIRC Medo and I already talked about it way back when.We did, I'll copy the thread to this board in a moment.
It might be an advantage to support something like this on the tool side of things, but from there you can always compile to a set of individual maps.
Regarding map formats, I think you'll like what I came up with. IIRC Medo and I already talked about it way back when.
For the .metadata file, it would be a JSON file (or YAML, something simple) It would define everything about the map: entities, names, timers, game mode, and what images to use for background & walkmask. And everything would be packed in a zip.
I disagree about using a third image for metadata, for the same reason Medo does. Additionally, it would be difficult to have entities with custom properties, or complex entity-to-entity connections.
Regarding placing multiple game modes in a single file, I think it would only be worth it if those modes could somehow share resources. That is, there might be a base.metadata file that defines the placement for entities common to all game modes. Then other ctf.metadata and cp.metadata files would contain mode-specific content. The implementation details (multiple metadata files vs single file with an appropriate data structure) aren't set in stone.
What's JSON?
Easier than GML
Well not really, but close to it.
If you want to learn, read this: http://www.ibiblio.org/swaroopch/byteofpython/files/120/byteofpython_120.pdf (http://www.ibiblio.org/swaroopch/byteofpython/files/120/byteofpython_120.pdf)
what is the differents of C++,Java and Python?They're very different, in reality the speed is negligible between Java and well-optimized C++ code. The main difference though is how they work, C++ is a compiled language while Java uses a form Just-in-Time compilation for optimization
in my mind:
C++:fast as hell but very hard to code,do powerful stuff but have little functions(i learned 12%)
Java:Normal,in the middle,the reason why i don't like java is every java game i had seen had to work on browser,i want stand-alone! (not count MineCraft,that's the launcher,not the game itself)
Python:faster than gmk but slower than C++,easy to learn and has many functions
I was reading through the PyGG2 code, trying to grok everything. I noticed that, every frame, you're completely copying every single entity. Surely that won't scale well. Is there a good reason for that design decision?
I'm not trying to suggest we embark on some premature optimization, but this seems like a strange design choice and is in a core part of the engine; it would be difficult to refactor later.
Alright I've started a pyGG2 Skype conversation, so we can read over everything discussed easily and keep track of what's happening.We kinda use #gg2_dev as a channel, and it has worked fine.
NC, accept my contact request and I'll add you to it.
Anyone else that wants to join, add me as a contact :P
I was reading through the PyGG2 code, trying to grok everything. I noticed that, every frame, you're completely copying every single entity. Surely that won't scale well. Is there a good reason for that design decision?
I'm not trying to suggest we embark on some premature optimization, but this seems like a strange design choice and is in a core part of the engine; it would be difficult to refactor later.
It is a design decision. You see, we need to have the complete game state in one huge "struct". In our case that's the Gamestate class. We need to copy it for each physics frame, and we interpolate between two gamestates for the rendering. If we have this we can do lag compensation, interpolation and all kinds of nifty stuff that would be nigh impossible without it.
Or do you have some sort of genious alternative?
if id in prev_state.entities:
prev_entity = next_state.entities[id]
else:
prev_entity = entity
self.entities[id].interpolate(prev_entity, entity, alpha)
I was reading through the PyGG2 code, trying to grok everything. I noticed that, every frame, you're completely copying every single entity. Surely that won't scale well. Is there a good reason for that design decision?
I'm not trying to suggest we embark on some premature optimization, but this seems like a strange design choice and is in a core part of the engine; it would be difficult to refactor later.
It is a design decision. You see, we need to have the complete game state in one huge "struct". In our case that's the Gamestate class. We need to copy it for each physics frame, and we interpolate between two gamestates for the rendering. If we have this we can do lag compensation, interpolation and all kinds of nifty stuff that would be nigh impossible without it.
Or do you have some sort of genious alternative?
Nope, I don't have a genius alternative, just some ideas that you may or may not have already considered :D
I understand it's needed for interpolation. My concern is that it's a lot of heap allocation, and not all of an entity's members are used for interpolation. Have you considered ways to let entities only duplicate the members needed by their interpolation methods, reducing the amount of copying that happens every frame?
Of course, without a proper benchmark, I can't say for certain that my way is better. And I also understand it's important to keep code simple.
Also, I don't quite understand this code snippet from GameState.interpolate()Code: [Select]if id in prev_state.entities:
prev_entity = next_state.entities[id]
else:
prev_entity = entity
self.entities[id].interpolate(prev_entity, entity, alpha)
It looks like prev_entity will always point to an entity from next_state instead of prev_state. Thus interpolation will be performed between two identical states instead of between the previous and next states.
So, quick question before my phone dies on me. How well does python handle large arrays (100x100 and up), and can it handle 3d arrays? when using game maker's ds_grid stuff I noticed it started lagging considerably when I bumped the world size from 100^2 to 125^2.Uhh... GML does have 2d/3d/4d arrays.
array[0, 0, 0, 0] = something
So, quick question before my phone dies on me. How well does python handle large arrays (100x100 and up), and can it handle 3d arrays? when using game maker's ds_grid stuff I noticed it started lagging considerably when I bumped the world size from 100^2 to 125^2.
ds_grids are arrays, in the sense that they are two dimensional lists that can store data.So, quick question before my phone dies on me. How well does python handle large arrays (100x100 and up), and can it handle 3d arrays? when using game maker's ds_grid stuff I noticed it started lagging considerably when I bumped the world size from 100^2 to 125^2.Uhh... GML does have 2d/3d/4d arrays.Code: [Select]array[0, 0, 0, 0] = something
ds_grid is not an array.
Oh. Ok.ds_grids are arrays, in the sense that they are two dimensional lists that can store data.So, quick question before my phone dies on me. How well does python handle large arrays (100x100 and up), and can it handle 3d arrays? when using game maker's ds_grid stuff I noticed it started lagging considerably when I bumped the world size from 100^2 to 125^2.Uhh... GML does have 2d/3d/4d arrays.Code: [Select]array[0, 0, 0, 0] = something
ds_grid is not an array.
And no gml doesn't have 3d+ arrays, I've tried, and the help system even says it can't
Traceback (most recent call last):
File "C:\Workspace\PyGG2\src\make.py", line 22, in <module>
client.profileGG2()
AttributeError: 'module' object has no attribute 'profileGG2'
Had the same problem, and simply commented the profiling out.QuoteTraceback (most recent call last):
File "C:\Workspace\PyGG2\src\make.py", line 22, in <module>
client.profileGG2()
AttributeError: 'module' object has no attribute 'profileGG2'
Halp. This thing hates me TT_TT
So, how would I go about doing string comparison/editing? Is it as simple as "str1 = str2+str3" and "if str1 == str4"? Or will I need another module/extention thing?
>>> s1 = "foo"
>>> s2 = "bar"
>>> s1 + s2
'foobar'
>>> s1 == "foo"
True
>>> s2 == "ber"
False
>>> s2 < s1
True
>>> s1 * 4
'foofoofoofoo'
>>> "This is a number: %d" % (7)
'This is a number: 7'
Code: [Select]>>> s1 * 4
'foofoofoofoo'
You guys should post a progress bar in the OP.A progress bar shows something which can be mesured in percentage. This can't be.
N/A%
Native byte order is big-endian or little-endian, depending on the host system. For example, Intel x86 and AMD64 (x86-64) are little-endian; Motorola 68000 and PowerPC G5 are big-endian; ARM and Intel Itanium feature switchable endianness (bi-endian). Use sys.byteorder to check the endianness of your system.For the Player input, we even used
bytestr = struct.pack("!BH", keybyte, aim)
which I don't completely understand.The form '!' is available for those poor souls who claim they can’t remember whether network byte order is big-endian or little-endian.This doesn't forebode much good, but I'm probably missing something here. Does it try to guess what endianness we use or what?
Well, until Medo makes the lobby code sane we have to follow the lobby endianness for the server-side lobby code. In all the other cases we should decide for ourselves, and so I will:Ok. I'll go change everything to that.
Big-endian
Why? Because big-endian is the most often used for networking, and because it's an arbitrary choice anyway.
You can blame git for some things, but not for "forgetting" content that is part of the project history. If you look at the content of a commit, that is how it was committed, period. You would get SHA1 mismatch errors all over the place if anything was corrupted. In fact, the SHA1 of any commit is a digest of the *entire* history of the project (all content and metadata) that led to this point.NC and I both have access to git@nightcracker/PyGG2, and neither of us really look at what the other does in commits that exactly.
I heard there is a mac version. Can I have the latest one? It's hard to navigate all these pages looking for one thing :/The mac/windows/linux version is the same: https://github.com/nightcracker/PyGG2
I heard there is a mac version. Can I have the latest one? It's hard to navigate all these pages looking for one thing :/
@clientevent
class Client_Event_Inputstate(object):
eventid = constants.INPUTSTATE
def __init__(self, bytestr):
self.bytestr = bytestr
def pack(self):
packetstr += struct.pack(">H", len(self.bytestr)) # TODO: Implement a better system that doesn't require this length, because it shouldn't be needed.
packetstr += bytestr
return packetstr
def unpack(self, packetstr):
length = struct.unpack_from(">H", packetstr)
bytestr = packetstr[:length]
return struct.calcsize(">H")+length
Notice the TODO. I can't imagine a good system that stays clean and compatible with the rest (this shouldn't pack or unpack it, since that requires access on the game engine, which it shouldn't have, but without it it can't know the length of the event either), but this is a hacky fix. while packetstr:
eventid = struct.unpack_from(">B", packetstr)
packetstr = packetstr[struct.calcsize(">B"):]
if self.sender == "client":
packet_event = object.__new__(event.clientevents[eventid])
else:
packet_event = object.__new__(event.serverevents[eventid])
eventsize = packet_event.unpack(packetstr)
packetstr = packetstr[eventsize:]
self.events.append(packet_event)
try:
packet.unpack(data)
except:
# parse error, don't throw exception but print it
print("Parse error: %s" % sys.exc_info()[1])
continue # drop packet
# only handle this packet if we know the player
if sender in self.players:
for event in packet.events:
event_handler.eventhandlers[type(event)](self, game, self.players[sender], event)
i=0
while i < len(events):
if event_is_state:
event = events.pop(i)
events.append(event)
i -= 1
i += 1
which won't even work like that because of the end, but yeah.how do I open the files in a file explorer in komodo edit1. Open komodo edit.
multiclienting not working is a pretty big deal. What was worth sacrificing it for?It's probably possible to make it work. And it was for making a distinction between a joining player joining and a packet sent by a former joining player that took a long travel.
you know the best way to identify players is by a unique idYeah, but that's not the problem.
the easiest good way to do is to make a list or array of players like gg2 does?
How far is the core engine of this? Meaning running, rendering, networking, sound, input, etc. I'm not talking about gameplay (or anything GG2 specific), just the engine.Rendering: Done.
How do I actually install Pygrafix?
HOW TO RUN PyGG2 ON WINDOWSShould probably put this on the OP
1) INSTALLING PYTHON 2.7
Download Python 2.7 (http://www.python.org/ftp/python/2.7.2/python-2.7.2.msi)
Install it to "C:\Python27".
Go to "controlpanel>System>Advanced>Environment Variables".
In the "System Variables" box, click on "Path", then click "Edit".
In the "Variable Value" box, add to the end: ";C:\Python27;C:\MinGW\bin".
Click OK, then OK again in the system menu.
2) INSTALLING PIL, PYGRAFIX AND MINGW
Download and install PIL (http://effbot.org/downloads/PIL-1.1.7.win32-py2.7.exe)
Download Pygrafix (https://github.com/downloads/nightcracker/pygrafix/pygrafix.win32.zip)
Unzip, and move to "C:\Python27\Lib\site-packages"
Download and install MinGW (http://sourceforge.net/projects/mingw/files/latest/download?source=files)
3) INSTALLING PYGG2 AND BITMAP EXTENSION
Download and unzip: PyGG2 (https://github.com/nightcracker/PyGG2/zipball/master)
Move the folder to My Documents and rename it to "PyGG2".
Go to command prompt (start>accessories>command prompt) and type "cd " (with a space after cd).
drag the PyGG2 folder into the command prompt window and press enter.
Type in "python make.py build" and press enter.
After it is finished, exit command prompt.
4) MAKING PyGG2.bat
Go to notepad (start>accessories>notepad).
Type the following, but change <USER> to your computer's username.
cd "C:\Documents and Settings\<USER>\My Documents\PyGG2"
python make.py testclient
Click file>save, and in the "File Name" box, type "PyGG2.bat", and set the "Save as Type" box to "All Files".
Save it wherever you like.
And you're done! Whenever you want to run PyGG2, you just have to open PyGG2.bat
If you want to update PyGG2, just repeat delete the PyGG2 folder in My documents and repeat step 3.
Hey I have a question on pyGG2:
You mentioned mod lobby being disabled until you think of a policy, but how is vanilla-capable modding done? Because right now some things that should be skill indexed are easily emulated by the computer.(click to show/hide)
What Port said is mostly correct. Those two hacks are very hard to prevent, as they are completely independent of the server, and are only client-side.Hey I have a question on pyGG2:
You mentioned mod lobby being disabled until you think of a policy, but how is vanilla-capable modding done? Because right now some things that should be skill indexed are easily emulated by the computer.(click to show/hide)(click to show/hide)
Hey I have a question on pyGG2:Although I have yet to discuss this with NC, we need a policy for automatically downloading stuff (a server can tell a client "go download and execute that"). Mods like they exist now are fine.
You mentioned mod lobby being disabled until you think of a policy, but how is vanilla-capable modding done?
Hey I have a question on pyGG2:Although I have yet to discuss this with NC, we need a policy for automatically downloading stuff (a server can tell a client "go download and execute that"). Mods like they exist now are fine.
You mentioned mod lobby being disabled until you think of a policy, but how is vanilla-capable modding done?
Another solution would be to just accept what the lobby declares as legit, and then we could manually control mods who want to be distributed, and upload their hash or whatever to the lobby server (whitelist). There aren't enormous numbers of them anyways, so it would be feasible.Hey I have a question on pyGG2:Although I have yet to discuss this with NC, we need a policy for automatically downloading stuff (a server can tell a client "go download and execute that"). Mods like they exist now are fine.
You mentioned mod lobby being disabled until you think of a policy, but how is vanilla-capable modding done?
I can see how validating the safety of a downloaded script could be problematic. One solution could be running it in a virtual environment with most potentionally harmful features removed.
Instead of allowing full scripts to be downloaded, we could just simply allow only resources to be downloaded (images, sounds, etc). Then for instance, the server could manually tell the client to play a sound or create a sprite at a specific position, deciding itself whether it should have physics applied and being able to transmit velocity, position and other parameters. Possibly also being able to tell the client that a specific object (such as a character, autogun, etc) should have a different sprite.
If the latter solution was used, we could also have options such as "Download Sounds", "Download Images", "Download Cache Size" and other things to allow users to control policies themself.
The next easiest is making the server check by some hash-check whether the client is a vanilla client, which would kill any sprite-mods too, and still be hack-able by the best.This solution is something I thought about. TF2 has something similar for resources: sv_pure
Outside of VAC securing a server, the first line of defense against cheating is the server variable (console command) sv_pure. This variable controls where a client gets its information and acts as a means to restrict what kind of content and files can be modified/substituted on the player's side. This can be easily exploited by players if not configured properly. Its optional (but not vital) to set this variable to 1 or 2 if you don't want to allow any form of cheating on your servers. By default sv_pure is set to 0 which restricts nothing. Possible values are 0, 1, and 2 which are explained below.Is it possible to implement something like sv_pure 1 but with a blacklist? You only talked about something similar to sv_pure 2, which is preventing any modding.
sv_pure 0
allows the client to specify the location of ANY game file. A client can potentially use modified files to gain an unfair advantage by doing things such as replacing enemy player models with ones that use bright colored skins, make walls invisible, add beacons onto the intelligence, or just about anything else you can think of. VAC doesn't protect against these kinds of exploits because they don't modify the game process itself. It's up to the server to decide what its clients can do.
sv_pure 1
restricts where the client can get information from based on a white list (list of allowed content). The default white list is still set to allow custom player models as well as any potential exploits such as bright skins.
sv_pure 2
forces the client to ignore ALL user content, and instead forces them to use the information supplied by Steam. While this is the most secure, sv_pure 2 will prevent the use all custom skins/models and even custom sprays.
For more information on sv_pure servers, including information on the white list format, see Pure Servers (https://developer.valvesoftware.com/wiki/Pure_Servers) on the Valve Developer Wiki.
you're talking about something completely different. We're talking about the server providing recourses for the client, and not vice versa. On a scale of impossible to possible, its impossible to implement a sort of system like that without making some sort of closed-source extension which does MD5 hash checks to check to see if any data has been modified.We could do some complicated shit like making the server send some random stuff to the client, which the client then somehow adds to itself and sends back the md5 or something. Not un-hackable, but pretty damn hard.
It is impossible because the game is open source - ANY of the client's resources are easily modified, and the client can just send a fake "default" hash back to the server upon request
I can also report that pygrafix has been successfully compiled and used on Mac OS X!That's great for the nonexistant GG2 Mac users then
Like Nukleus. Like at least 5 separate people who appeared in IRC asking for gg2 on mac. Like me a few years ago.I can also report that pygrafix has been successfully compiled and used on Mac OS X!That's great for the nonexistant GG2 Mac users then
:hehe:
I can also report that pygrafix has been successfully compiled and used on Mac OS X!Not PyGG2. Pygra
Also,I am well aware of that.I can also report that pygrafix has been successfully compiled and used on Mac OS X!Not PyGG2. Pygra(ph)fix isn't just for gg2.
I added some stuff around client ID passing, and 2 players on the same server now work. 3 don't, for some reason I'll investigate, but that's secondary.OK, make it run without GUI and I can host a 24/7 test server ;)
The main point is that we should now test it on a bigger distance than loop-back. I want to see whether it works on a real connection too.
It's not even possible to run a server with GUI. :drool:I added some stuff around client ID passing, and 2 players on the same server now work. 3 don't, for some reason I'll investigate, but that's secondary.OK, make it run without GUI and I can host a 24/7 test server ;)
The main point is that we should now test it on a bigger distance than loop-back. I want to see whether it works on a real connection too.
/GG2/client_main.py", line 35, in <module>
pygrafix.resource.add_location("sprites")
AttributeError: 'module' object has no attribute 'resource'
oh goodieIt's not even possible to run a server with GUI. :drool:I added some stuff around client ID passing, and 2 players on the same server now work. 3 don't, for some reason I'll investigate, but that's secondary.OK, make it run without GUI and I can host a 24/7 test server ;)
The main point is that we should now test it on a bigger distance than loop-back. I want to see whether it works on a real connection too.
It's not even possible to run a server with GUI. :drool:I added some stuff around client ID passing, and 2 players on the same server now work. 3 don't, for some reason I'll investigate, but that's secondary.OK, make it run without GUI and I can host a 24/7 test server ;)
The main point is that we should now test it on a bigger distance than loop-back. I want to see whether it works on a real connection too.
Aww, and I just added the UUID to the list of known lobbies :PEh...We're probably going to use the standard gg2 one as soon as it stops breaking everything.
"other window"? What other window? Atm, the server doesn't open a window at all, it doesn't even load pygrafix.It's not even possible to run a server with GUI. :drool:I added some stuff around client ID passing, and 2 players on the same server now work. 3 don't, for some reason I'll investigate, but that's secondary.OK, make it run without GUI and I can host a 24/7 test server ;)
The main point is that we should now test it on a bigger distance than loop-back. I want to see whether it works on a real connection too.
WHAT!?
Why...
No host playing then?
Or the host needs to open another window to play?
for index in range(numof_players):
player = engine.player.Player(game, game.current_state, index)
player.name, player_class, character_exists = struct.unpack_from(">32pBB", event.bytestr)
player.nextclass = function.convert_class(player_class)
event.bytestr = event.bytestr[33:]
should have been for index in range(numof_players):
player = engine.player.Player(game, game.current_state, index)
player.name, player_class, character_exists = struct.unpack_from(">32pBB", event.bytestr)
player.nextclass = function.convert_class(player_class)
event.bytestr = event.bytestr[34:]
Spot_the_difference.jpg
Spot_the_difference.jpg
yes well its essential to unpacking, if you're just one byte off or on, then the whole game could crashIt's when it doesn't crash, but spawns a player a fraction of a second too soon and crashes the game 10 seconds later that it gets hard.
Seriously??
a single digit
Wow you guys have courage
Nice find! That kind of bug can be a nightmare to hunt down.Tell me about it.
I have no experience whatsoever with coding, so to me yes it is very surprising that a single little digit can create such a glitch.Seriously??
a single digit
Wow you guys have courage
A single digit that's very meaningful.
It's splitting up a packet of data, which is rigidly formatted. If you split it at the wrong place, of course it won't work as it will read the wrong data.I have no experience whatsoever with coding, so to me yes it is very surprising that a single little digit can create such a glitch.Seriously??
a single digit
Wow you guys have courage
A single digit that's very meaningful.
I have no experience whatsoever with coding, so to me yes it is very surprising that a single little digit can create such a glitch.Seriously??
a single digit
Wow you guys have courage
A single digit that's very meaningful.
1234aaaabbbb9876
into1234, aaaa, bbbb, 9876
123, 4aaa, abbb, b987, 6
Oh I see. Mmmh, I really should get into python some dayI have no experience whatsoever with coding, so to me yes it is very surprising that a single little digit can create such a glitch.Seriously??
a single digit
Wow you guys have courage
A single digit that's very meaningful.
You could see it like this, say I am splitting this string:Code: [Select]1234aaaabbbb9876
intoCode: [Select]1234, aaaa, bbbb, 9876
But I mess up in the first thing:Code: [Select]123, 4aaa, abbb, b987, 6
Quite a difference huh?
Or another programming language. Once you learn one programming language and the basics of programming, it doesn't take much work to get used to another.Oh I see. Mmmh, I really should get into python some dayI have no experience whatsoever with coding, so to me yes it is very surprising that a single little digit can create such a glitch.Seriously??
a single digit
Wow you guys have courage
A single digit that's very meaningful.
You could see it like this, say I am splitting this string:Code: [Select]1234aaaabbbb9876
intoCode: [Select]1234, aaaa, bbbb, 9876
But I mess up in the first thing:Code: [Select]123, 4aaa, abbb, b987, 6
Quite a difference huh?
Hey uh I want to help develop this againThe readme is a good dependency, as it lists the others.
Where do I start? I have Git, and Python 2.7, but what are the current other dependencies and where do I get them?
OK :c1:Hey uh I want to help develop this againThe readme is a good dependency, as it lists the others.
Where do I start? I have Git, and Python 2.7, but what are the current other dependencies and where do I get them?
No seriously, you want PIL, Pygrafix (link in the readme) and the mask script which you can compile with "python make.py build".
(http://i44.tinypic.com/34pkftx.png)is that...
what IS itIt's the effects of the use of time travel. Let me explain.
(http://i39.tinypic.com/2zzl4kx.png)looks like issues with rotations.
can anyone fix these artifacts?
Why does nc insist on reinventing the wheel with pygrafix?
If you don't like that pyglet uses ctypes, then make a wrapper for it, instead of rolling your own library which mashes together code which is under several different licenses which are potentially conflicting.
Nightcracker, get back over here and add depth in pygrafix.
I don't really see how else we can fix this intelligently.
I never said it was in pygame, I'm saying it was in Game Maker and not having it is pretty dumb.Nightcracker, get back over here and add depth in pygrafix.
I don't really see how else we can fix this intelligently.
Nope. Pygame didn't have depth either.
Pygrafix is really simple: the latest thing drawn gets drawn on top. If you want something on top you have to draw it later.
I will get back on PyGG2 Soon (tm), but currently my laptop is broken again and I'm a bit of trouble with school, so not yet.
erm watWhy does nc insist on reinventing the wheel with pygrafix?
If you don't like that pyglet uses ctypes, then make a wrapper for it, instead of rolling your own library which mashes together code which is under several different licenses which are potentially conflicting.
That there is the problem. Ctypes is a wrapper. In Python, wrapping is very expensive. Pygrafix is an effort to reduce wrapping for improved performance.
Plus I don't like some parts of pyglet.
erm watWhy does nc insist on reinventing the wheel with pygrafix?
If you don't like that pyglet uses ctypes, then make a wrapper for it, instead of rolling your own library which mashes together code which is under several different licenses which are potentially conflicting.
That there is the problem. Ctypes is a wrapper. In Python, wrapping is very expensive. Pygrafix is an effort to reduce wrapping for improved performance.
Plus I don't like some parts of pyglet.
you're using ctypes stuff anyway whether you like it or not
and furthermore, this may be premature optimisation - gg2 is not terribly graphics-heavy
Ok, added a jump event, which btw also fixes double-jump, and yeah, it didn't help enormously.
I'll work on some input prediction, but now school will start again soon, so I won't have large amounts of time.
No I did not, weekend.Ok, added a jump event, which btw also fixes double-jump, and yeah, it didn't help enormously.
I'll work on some input prediction, but now school will start again soon, so I won't have large amounts of time.
Wait you had holiday? o.0
Need any sprites done? I'm like a spriter or something.Hmm.
... Why separate legs and torso?Less sprites?
... Why separate legs and torso?Less sprites, more flexible system for changing stuff, easy way to add hats, etc...
Planning everything ahead I see...... Why separate legs and torso?Less sprites, more flexible system for changing stuff, easy way to add hats, etc...
So frankensprites. Got it.360 sprites? What?
Are you gonna stick to rotating weapons or do you wanna make an individual frame for each aim direction (via torso)
What? No. Cardinal and Intermediate directions.So frankensprites. Got it.360 sprites? What?
Are you gonna stick to rotating weapons or do you wanna make an individual frame for each aim direction (via torso)
No, we're probably going to stick to rotating weapons, unless someone finds a good reason not to.
Still am not seeing what advantages this gives over rotating weapons, and why it would be worth it.non-bitmix i guess?
Why should this influence bitmixing?Still am not seeing what advantages this gives over rotating weapons, and why it would be worth it.non-bitmix i guess?
Uh, if you make the sprites of the weapons yourself you can make sure that it isn't bitmixed. Currently the weapons are bitmixed when your aimdirection isn't 0, 90, 180 or 270 degrees because of the rotation. There is probably another reason, i dunno.Huh.
Still am not seeing what advantages this gives over rotating weapons, and why it would be worth it.Aesthetic thing.
And the satisfaction of knowing that you finally fixed the fucking arm-detachment glitch.That can be remedied easily once the torsos and legs are separated.
Uh, if you make the sprites of the weapons yourself you can make sure that it isn't bitmixed. Currently the weapons are bitmixed when your aimdirection isn't 0, 90, 180 or 270 degrees because of the rotation. There is probably another reason, i dunno.Huh.
You'd still need 180 different torso sprites for each class/weapon pair, which makes it both a pain to add and a pain to use later.
Removing bitmixing (something that's very hard to notice on that scale) isn't worth it imo.
Well, if it were the entire torso sprite (rather than just the weapon), the floating hands thing is a non-issue.You'd then have snapping when aiming between two areas. Also, we'd still need a lot more sprites, and it'll grow even bigger with more weapons, since you'll need a new set of torso for each different weapon.
Also for your consideration,
(http://i42.tinypic.com/9ade09.png)
If we make a sprite for each cardinal and intercardinal direction (8 frames)(45, 90, and etcetera), we can make it so each frame covers 15 degrees above and below them. Therefore, if someone is aiming 75 to 105 degrees (the blue area), their sprite will be aiming upward.
We would only need eight frames for this, or realistically four since it's probably just gonna be flipped or something. The only problem is a class like say, the Heavy. That minigun is fucking huge and it might just be easier to have a separate sprite in that case. That's besides the point, what I'm getting at is the relatively low number of sprites we'd need.
So, uhh, what's the progress in layman's terms?Well the flibberdy flabberdy badingle go wow-wow, but the finger gengerl not so splatsy.
Just wait until you see what we did with the yee-yo-go-tingle.So, uhh, what's the progress in layman's terms?Well the flibberdy flabberdy badingle go wow-wow, but the finger gengerl not so splatsy.
I hear it's amazing when the famous purple stuffed worm in flap-jaw space with the tuning fork, does a raw blink on Hiri-Kiri rock!
I need scissors! 61!
Uhh...yeah?Well, I will
Anyways, the current progress is at the point where we have a working engine, a working networking, and some mostly working graphics (works, but depth still isn't solved).
In other words, you can now join a server and jump around, shooting. Since there aren't any teams nor map modes yet, you can't do much, but still. The framework is there.
I'm not going to give a percentage, sorry.
Uhh...yeah?Well, I will
Anyways, the current progress is at the point where we have a working engine, a working networking, and some mostly working graphics (works, but depth still isn't solved).
In other words, you can now join a server and jump around, shooting. Since there aren't any teams nor map modes yet, you can't do much, but still. The framework is there.
I'm not going to give a percentage, sorry.
Parts of it are 100% complete, the other bits are 0% complete
:hehe:
Software projects are never finished, just abandoned.This is correct.
I was assuming 100% = as good as current GMK gg2.Well it's partially 100% :smiley16:
But whatever.
>Zelda Hacking folderIt's nothing interesting :cry:
I am so curious right now.
OF ALL THOSE BROWSERS WHY IS THAT ONE OPENSoftware projects are never finished, just abandoned.This is correct.
https://ajf.me/stuff/ihavewaytoomanyprojects.gif
IE9 is actually a pretty good browserOF ALL THOSE BROWSERS WHY IS THAT ONE OPENSoftware projects are never finished, just abandoned.This is correct.
https://ajf.me/stuff/ihavewaytoomanyprojects.gif
IE9 is actually a pretty good browserOF ALL THOSE BROWSERS WHY IS THAT ONE OPENSoftware projects are never finished, just abandoned.This is correct.
https://ajf.me/stuff/ihavewaytoomanyprojects.gif
wait.OF ALL THOSE BROWSERS WHY IS THAT ONE OPENSoftware projects are never finished, just abandoned.This is correct.
https://ajf.me/stuff/ihavewaytoomanyprojects.gif
Because you never know when one might go rogue.wait.OF ALL THOSE BROWSERS WHY IS THAT ONE OPENSoftware projects are never finished, just abandoned.This is correct.
https://ajf.me/stuff/ihavewaytoomanyprojects.gif
why does he have that many browsers.
https://github.com/nightcracker/PyGG2/commit/3a7110fcb65eaa1acf905297403beeda9314110e
Could someone take a look?
I can't really see a solution to this problem, on the other hand I'm not thinking straight atm either. So whatever.
EDIT: Actually, I'm seeing the problem:
The client takes server update, fast-forwards it like it should, and then sits on that. Problem is when the next update comes, the client takes this fast-forwarded state as a base, corrects it and forwards again.
That means that stuff that isn't corrected gets completely overcompensated.
The only solution I see would be to rewind all events back, let the server correct, and then fast-forward again. But that's a shit to do, and will probably also be buggy as hell.
Wat do.
Because I'm a web developer. I need to test my sites in multiple browser. Also I like the freedom of choice.wait.OF ALL THOSE BROWSERS WHY IS THAT ONE OPENSoftware projects are never finished, just abandoned.This is correct.
https://ajf.me/stuff/ihavewaytoomanyprojects.gif
why does he have that many browsers.
for i in range(networker.latency):
state.update(game, -constants.INPUT_SEND_FPS)
-constants.INPUT_SEND_FPS
-
…Because I'm a web developer. I need to test my sites in multiple browser. Also I like the freedom of choice.wait.OF ALL THOSE BROWSERS WHY IS THAT ONE OPENSoftware projects are never finished, just abandoned.This is correct.
https://ajf.me/stuff/ihavewaytoomanyprojects.gif
why does he have that many browsers.
And nightcracker: You haven't tried IE9, have you? It's quite nice really. IE10 though will be very good though.
It's still the only 64 bit browser iircOoh, that's true.
…Because I'm a web developer. I need to test my sites in multiple browser. Also I like the freedom of choice.wait.OF ALL THOSE BROWSERS WHY IS THAT ONE OPENSoftware projects are never finished, just abandoned.This is correct.
https://ajf.me/stuff/ihavewaytoomanyprojects.gif (https://ajf.me/stuff/ihavewaytoomanyprojects.gif)
why does he have that many browsers.
And nightcracker: You haven't tried IE9, have you? It's quite nice really. IE10 though will be very good though.
follow-up: after looking at nclabs.org, I can see you clearly know nothing about Internet Explorer
It's had some CSS3 support since, what, 1 years ago now? IE10 has full support.
Uh, so?Because I'm a web developer. I need to test my sites in multiple browser. Also I like the freedom of choice.wait.OF ALL THOSE BROWSERS WHY IS THAT ONE OPENSoftware projects are never finished, just abandoned.This is correct.
https://ajf.me/stuff/ihavewaytoomanyprojects.gif (https://ajf.me/stuff/ihavewaytoomanyprojects.gif)
why does he have that many browsers.
And nightcracker: You haven't tried IE9, have you? It's quite nice really. IE10 though will be very good though.
follow-up: after looking at nclabs.org, I can see you clearly know nothing about Internet Explorer
It's had some CSS3 support since, what, 1 years ago now? IE10 has full support.
Sadly most people don't use these versions:
http://www.statowl.com/web_browser_usage_by_version.php?timeframe=last_6&interval=month&chart_id=4&limit (http://www.statowl.com/web_browser_usage_by_version.php?timeframe=last_6&interval=month&chart_id=4&limit)[]=ie&fltr_os=&fltr_se=&fltr_cn=
The full game will be packed into an exe. You won't even need to install Python.Yeah. Although I think it's worth noting it will be more difficult to mod than before. Well, except for spritemods, since images are now external.
It would be pretty easy to make a packer (an application that will pack your modded gg2 into an exe) wouldn't it?Uh, we already have this?
It's still the only 64 bit browser iirc>>>>>
[ ] firefox-14.0a1.en-US.win64-x86_64.checksums 08-Apr-2012 05:48 3.5K
[ ] firefox-14.0a1.en-US.win64-x86_64.complete.mar 08-Apr-2012 05:48 22M
[ ] firefox-14.0a1.en-US.win64-x86_64.installer.exe 08-Apr-2012 05:48 18M
[ ] firefox-14.0a1.en-US.win64-x86_64.tests.zip 08-Apr-2012 05:48 54M
[TXT] firefox-14.0a1.en-US.win64-x86_64.txt 08-Apr-2012 05:48 70
[ ] firefox-14.0a1.en-US.win64-x86_64.zip
Huh.It's still the only 64 bit browser iirc>>>>>
http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-central/ (http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-central/)Code: [Select][ ] firefox-14.0a1.en-US.win64-x86_64.checksums 08-Apr-2012 05:48 3.5K
[ ] firefox-14.0a1.en-US.win64-x86_64.complete.mar 08-Apr-2012 05:48 22M
[ ] firefox-14.0a1.en-US.win64-x86_64.installer.exe 08-Apr-2012 05:48 18M
[ ] firefox-14.0a1.en-US.win64-x86_64.tests.zip 08-Apr-2012 05:48 54M
[TXT] firefox-14.0a1.en-US.win64-x86_64.txt 08-Apr-2012 05:48 70
[ ] firefox-14.0a1.en-US.win64-x86_64.zip
It's still the only 64 bit browser iirc>>>>>
http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-central/ (http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-central/)Code: [Select][ ] firefox-14.0a1.en-US.win64-x86_64.checksums 08-Apr-2012 05:48 3.5K
[ ] firefox-14.0a1.en-US.win64-x86_64.complete.mar 08-Apr-2012 05:48 22M
[ ] firefox-14.0a1.en-US.win64-x86_64.installer.exe 08-Apr-2012 05:48 18M
[ ] firefox-14.0a1.en-US.win64-x86_64.tests.zip 08-Apr-2012 05:48 54M
[TXT] firefox-14.0a1.en-US.win64-x86_64.txt 08-Apr-2012 05:48 70
[ ] firefox-14.0a1.en-US.win64-x86_64.zip
He's saying firefox nightly has 64 bit builds too.
When I try step 3 I get this:You apparently didn't install/configure python correctly. Did you use the standard Python installer?
(http://farm6.staticflickr.com/5151/7081147309_937b3b917a_b.jpg)
I might not have added the stuff to system variables box but the instructions on that weren't very clear. Please help :cry:
How can there be 75 people in a Development Server without it lagging? Ping: 63Wait, ping worked? But that... I ... we didn't... no ping.... how the fuck...
I used the standard installer but I don't think I did step 1 (with the system variables and stuff) correctly. Could you explain that a little more clearly, in stupid person terms?When I try step 3 I get this:You apparently didn't install/configure python correctly. Did you use the standard Python installer?
(http://farm6.staticflickr.com/5151/7081147309_937b3b917a_b.jpg)
I might not have added the stuff to system variables box but the instructions on that weren't very clear. Please help :cry:
How can there be 75 people in a Development Server without it lagging? Ping: 63Wait, ping worked? But that... I ... we didn't... no ping.... how the fuck...
PYGG2 IS DEVELOPING ON IT'S OWN!
:panic:
But anyways, ping is not lag, and is independent of lag, and of player count. It's only a distance check.
The player count doesn't really mean anything, we were and still are testing whether the servers can hold those numbers of players, or whether we made some ACK'ing error or something.How can there be 75 people in a Development Server without it lagging? Ping: 63Wait, ping worked? But that... I ... we didn't... no ping.... how the fuck...
PYGG2 IS DEVELOPING ON IT'S OWN!
:panic:
But anyways, ping is not lag, and is independent of lag, and of player count. It's only a distance check.
Oh, okay.
I opened vanilla GG2 and went to the server lobby. There were 2 Development Servers at the bottom in gray. Both had ping of 63. If ping hasn't been added yet... That's just weird. Wish I took a screenshot, but I didn't think anything of it at the time except that there were 75 players in the server, something I had never seen before.
Also, is testing PyGG2 only for the developers and beta testers for those who have Python, or is it open to the public? I'm interested in helping with testing this.
Alright. Let me know when it's playable. Once this is made, will GM GG2 be gone?We aren't doing much work at all on GM GG2 dev at the moment. The focus is shifting towards PyGG2. PyGG2 will replace GM GG2.
Can someone compile this into an exe for me32-bit or 64-bit
So instead of telling people to jump through hoops just to see how this is going
I can just send them an exe
32 bitCan someone compile this into an exe for me32-bit or 64-bit
So instead of telling people to jump through hoops just to see how this is going
I can just send them an exe
broken GUI menu and command line or command line and command line
stable or unstable
sentryspam or not
fixed fps or not
troll code included or not
ok32 bitCan someone compile this into an exe for me32-bit or 64-bit
So instead of telling people to jump through hoops just to see how this is going
I can just send them an exe
broken GUI menu and command line or command line and command line
stable or unstable
sentryspam or not
fixed fps or not
troll code included or not
broken gui
either one
sentryspam if you dont get it fixed
fixed fps
troll code included
Can someone compile this into an exe for metroll code included or not
So instead of telling people to jump through hoops just to see how this is going
I can just send them an exe
There are some jokes included in PyGG2.Can someone compile this into an exe for metroll code included or not
So instead of telling people to jump through hoops just to see how this is going
I can just send them an exe
Troll code?
There are some jokes included in PyGG2.Can someone compile this into an exe for metroll code included or not
So instead of telling people to jump through hoops just to see how this is going
I can just send them an exe
Troll code?
Sani wants it so people like you can test it.There are some jokes included in PyGG2.Can someone compile this into an exe for metroll code included or not
So instead of telling people to jump through hoops just to see how this is going
I can just send them an exe
Troll code?
:z6:
If possible, please send me the same exe file that Sani requested. I'd like to see it even though it's not much right now, as NAGN said.
Status update: currently working on sentriesWait, didn't I do that? I passed the real owner to the init code, but put self.owner_id = owner.id if I remember correctly. No? Dammit.
https://github.com/nagn/PyGG2/commit/0beab4bf55c6e82c234a4ced6d2c5322d6b4b8f0 (https://github.com/nagn/PyGG2/commit/0beab4bf55c6e82c234a4ced6d2c5322d6b4b8f0)
one thing to note to be careful about is referencing the character object. Python automatically garbage collects if, and only if, said object has no instances pointing to it. In this original case, we've accidently passed the Character object through from the Weapon to the Sentry object, which would've caused conflicts(click to show/hide)
broken GUIWait, you can host a server and connect to it via GUI? That's new.
I don't think that pygrafix is configured to handle py2exe, and to get nightcracker to do that is a stretchTbh, pygame has a legacy of problems with py2exe, and will definately won't work. Cython is probably a better idea in our case, but again, NC is the only one that knows how.
You can't. You can run the test client though, and I could easily add a bash script for running the test serverQuote from: AJFbroken GUIWait, you can host a server and connect to it via GUI? That's new.
Eh. We don't need py2exe. Package the python runtime with it and include a script. like:I don't think that pygrafix is configured to handle py2exe, and to get nightcracker to do that is a stretchTbh, pygame has a legacy of problems with py2exe, and will definately won't work. Cython is probably a better idea in our case, but again, NC is the only one that knows how.
This requires everyone to have all the dependencies, no?Eh. We don't need py2exe. Package the python runtime with it and include a script. like:I don't think that pygrafix is configured to handle py2exe, and to get nightcracker to do that is a stretchTbh, pygame has a legacy of problems with py2exe, and will definately won't work. Cython is probably a better idea in our case, but again, NC is the only one that knows how.
"pygg2/bin/python/python.exe pygg2/make.py menuclient" or something like that. You get the idea.
No. We package a python runtime with it. It's essentially doing what py2exe does except it's not a single exe, it has a bunch of stuff you need to extract together.This requires everyone to have all the dependencies, no?Eh. We don't need py2exe. Package the python runtime with it and include a script. like:I don't think that pygrafix is configured to handle py2exe, and to get nightcracker to do that is a stretchTbh, pygame has a legacy of problems with py2exe, and will definately won't work. Cython is probably a better idea in our case, but again, NC is the only one that knows how.
"pygg2/bin/python/python.exe pygg2/make.py menuclient" or something like that. You get the idea.
WHAT IS THIS UNHOLY THINGAJF's Experiments.
(https://ajf.me/stuff/gg2/pygg2-bleedz.png)
(https://ajf.me/stuff/gg2/pygg2-bleedz.png)
(https://ajf.me/stuff/gg2/pygg2-curvez.png)
servers aren't deregistered...Would do it if someone could show me a way to quitting the server and letting it execute a destroy event. CTRL-C kills the process immediately, so no use making a destroy event, and we can't poll for keyboard input either because the server doesn't (and shouldn't) even import pygrafix.
Huh? I thought stopping a Python program with Ctrl-C fires a KeyboardInterrupt that you can catch outside your main loop and react to.Exactly, why aren't we doing that?
It does?uh
Well, if someone can give me a hook which works, I'll put server disconnection.
If this is ever finished, will the development line switch to python, or will you guys have to be a separate branch?It's going to replace current GG2, GG2 development has essentially halted.
So now I'm wondering if there are any legal implications to submitting a parody game onto Steam?If you're talking about GG2, Valve are totally cool with it.
Expect for Team Fortress 2,and DOTA 2,and Spiral Knights,and Star Trek,and others,witch are completelly freeSo now I'm wondering if there are any legal implications to submitting a parody game onto Steam?If you're talking about GG2, Valve are totally cool with it.
If not, please be aware Steam is not for free games.
They're by big publishers, and notable exceptions.Expect for Team Fortress 2,and DOTA 2,and Spiral Knights,and Star Trek,and others,witch are completelly freeSo now I'm wondering if there are any legal implications to submitting a parody game onto Steam?If you're talking about GG2, Valve are totally cool with it.
If not, please be aware Steam is not for free games.
I don't like to say it, but I think it's better if we switch to pygame =/Nightcracker. Hi.
In the coming future I won't have time nor the willingness to work on pygrafix; I can't give it the featureset needed by a game like pygg2 in time.
I'm sorry guys :z7:
but pygame is god awfulEh, I could switch to pyglet for back-end if you really want me to.
We're trying to move forward, bringing a bloated, slow, piece of shit graphics library into the mix isn't going to do us justice
is pyglet actually written in something other than pythonPygame is largely C modules, I believe. It's a wrapper for SDL
then why is pygame so slow if its a straight up wrapper for sdlPygame isn't super slow. It's just as slow as Game Maker, which isn't too bad.
It's not that bad, honestlyWe won't have to switch again, btw. When I said drop-in replacement, I meant it. The code runs fine in both my [currently very slow] replacement which uses Pygame, and with actual pygrafix.
The switch to pygrafix already slowed down development a lot
Also I'll be able to help now hopefully.
Do any of you know any decent platforming games using pygame? I want to get a feel as to what non hardware-accellerated transformations will meanNAGN lemme send you 2pygrafix (my name for my pygrafix replacement)
well......yeah. I'll find a way to make it run faster. Maybe.
it runs like shit, but I guess I expected that
vanilla gg2 developent has halted because...5. GG2 is "done" as far as the "original" idea goes, everything is implemented except heavy jetpacks
1. it was already sort of slow and dead to begin with since release for many months, the most recent update was when we fixed the rocketman jumping bug, but that hasn't actually been released for some reason
2. half of the developers aren't actually working due to having a job, or doing something
3. any remaining developers have moved to pygg2 for the time being
4. all of those developers are either on study leave, on vacation, has their computer taken away, or wareya
Oh god. I go for a short hiatus, and when I come back...1. probably not
:panic:
Alright.
1. Is Pygame fast enough for PyGG2?
2. If not, are we capable of managing pygrafix/creating something new without NC?
1. OkOh god. I go for a short hiatus, and when I come back...1. probably not
:panic:
Alright.
1. Is Pygame fast enough for PyGG2?
2. If not, are we capable of managing pygrafix/creating something new without NC?
2. pyglet is certainly an option.
pygrafix for hardest to install python library 2012wat
pyglet is slower than pygame though, ctypes hurts it, I think>ctypes
pygrafix for hardest to install python library 2012wat
There's a Windows version. Extract it to the right folder and done
host a server first
python make.py test
or 2 consoles, withpython make.py testserver
python make.py testclient
I'm trying to add networking and I keep getting this error:What on earth does that have to do with networking?
http://pastebin.com/raw.php?i=tcajYUXQ (http://pastebin.com/raw.php?i=tcajYUXQ)
I'm trying to add networking and I keep getting this error:What on earth does that have to do with networking?
http://pastebin.com/raw.php?i=tcajYUXQ (http://pastebin.com/raw.php?i=tcajYUXQ)
That's a pyglet error.
OpenGL is not thread-safeI'm trying to add networking and I keep getting this error:What on earth does that have to do with networking?
http://pastebin.com/raw.php?i=tcajYUXQ (http://pastebin.com/raw.php?i=tcajYUXQ)
That's a pyglet error.
However it did start happening only as soon as I added the twisted reactor in a side thread.
OpenGL is not thread-safeI'm trying to add networking and I keep getting this error:What on earth does that have to do with networking?
http://pastebin.com/raw.php?i=tcajYUXQ (http://pastebin.com/raw.php?i=tcajYUXQ)
That's a pyglet error.
However it did start happening only as soon as I added the twisted reactor in a side thread.
Not use threads, or not use Twisted. The socket module isn't SO bad.OpenGL is not thread-safeI'm trying to add networking and I keep getting this error:What on earth does that have to do with networking?
http://pastebin.com/raw.php?i=tcajYUXQ (http://pastebin.com/raw.php?i=tcajYUXQ)
That's a pyglet error.
However it did start happening only as soon as I added the twisted reactor in a side thread.
Then what do I do if I want to run the pyglet engine and the twisted reactor at the same time?
You can integrate pyglet and Twisted, there's instructions for doing so somewhere.Not use threads, or not use Twisted. The socket module isn't SO bad.OpenGL is not thread-safeI'm trying to add networking and I keep getting this error:What on earth does that have to do with networking?
http://pastebin.com/raw.php?i=tcajYUXQ (http://pastebin.com/raw.php?i=tcajYUXQ)
That's a pyglet error.
However it did start happening only as soon as I added the twisted reactor in a side thread.
Then what do I do if I want to run the pyglet engine and the twisted reactor at the same time?
This is the most difficult code I've ever written:
if self.rotation != 0:
# get centre of image
old_centre_x = sf.get_width() / 2
old_centre_y = sf.get_height() / 2
# rotate surface
sf = pygame.transform.rotate(sf, 0 - self.rotation)
# get centre of rotated surface
centre_x = sf.get_width() / 2
centre_y = sf.get_height() / 2
# get angle in radians
a = math.radians(self.rotation)
# from anchor point and image centre, calculate distance
x = old_centre_x - self.anchor_x
y = old_centre_y - self.anchor_y
r = math.sqrt(x*x + y*y)
# offset image based on how much anchor has moved in rotation
offset_x += math.cos(a) * r - centre_x
offset_y += math.sin(a) * r - centre_y
else:
offset_x, offset_y = -self.anchor_x, -self.anchor_y
But I managed to do it :)
Your code makes no sense, I'm keeping my code :UThis is the most difficult code I've ever written:
if self.rotation != 0:
# get centre of image
old_centre_x = sf.get_width() / 2
old_centre_y = sf.get_height() / 2
# rotate surface
sf = pygame.transform.rotate(sf, 0 - self.rotation)
# get centre of rotated surface
centre_x = sf.get_width() / 2
centre_y = sf.get_height() / 2
# get angle in radians
a = math.radians(self.rotation)
# from anchor point and image centre, calculate distance
x = old_centre_x - self.anchor_x
y = old_centre_y - self.anchor_y
r = math.sqrt(x*x + y*y)
# offset image based on how much anchor has moved in rotation
offset_x += math.cos(a) * r - centre_x
offset_y += math.sin(a) * r - centre_y
else:
offset_x, offset_y = -self.anchor_x, -self.anchor_y
But I managed to do it :)
https://github.com/nightcracker/PyGG2/blob/ad5b9ad09665b8c20b0df1c52e6db5d3c3fd940c/function.py#L23
https://github.com/PyGG2/PyGG2/graphs/contributorsHuh, apparently Orpheon is most active. Makes sense.
this is easier to look at for our few people
Actually, NC would have more if he didn't do it from separate accounts or something. I'm more of a long-distance runner here, also I'm the only person that was on the project from start to now.https://github.com/PyGG2/PyGG2/graphs/contributorsHuh, apparently Orpheon is most active. Makes sense.
this is easier to look at for our few people
Wasn't I here at the start? Well, close to it...Actually, NC would have more if he didn't do it from separate accounts or something. I'm more of a long-distance runner here, also I'm the only person that was on the project from start to now.https://github.com/PyGG2/PyGG2/graphs/contributorsHuh, apparently Orpheon is most active. Makes sense.
this is easier to look at for our few people
You made a rather large pause in the middle :hehe:Wasn't I here at the start? Well, close to it...Actually, NC would have more if he didn't do it from separate accounts or something. I'm more of a long-distance runner here, also I'm the only person that was on the project from start to now.https://github.com/PyGG2/PyGG2/graphs/contributorsHuh, apparently Orpheon is most active. Makes sense.
this is easier to look at for our few people
This networking is really akward (or the physics code is). I randomly get "teleported" around (not huge random changes in position, just slightly, for example to the layer of stairs beneath the current one) the map.That's a problem with the compensation that I haven't fixed yet. I know.
so where on earth did my word wrap code goNowhere. Where did you expect it to go? There already exists a GML implementation, and no Python console.
<Orpheon> I just found out an incredibly annoying networking bug
<maciej01> hmm derpy is on?
<maciej01> what bug?
<Orpheon> that was confusing me to no end
<Orpheon> pygg2 syncs states every so often
<Orpheon> game states
<Orpheon> to do that, it just fast-fires states and the client decides whether this state is advanced enough
<maciej01> oh
<Orpheon> so the client only takes the newest state
<Orpheon> now
<Orpheon> I synced the time
<Orpheon> which is a float
<Orpheon> as an int
<Orpheon> which means the client only accepted a new state every second
<Orpheon> urg
it won't, ints are hugeints aren't that huge if the server is trying to send something every frame or so.
also I'm totally reworking the collision code but it'll take a couple days so yeah don't hold your breath
Keep an eye out for the fact that we're essentially building this off of an unstable wrapper built on top of a currently unstable projectNo, but there aren't that many distros we have to provide for, you know. Making one .deb file already solves everything Debian, which includes Fedora, Ubuntu and Debian itself, maybe something for Arch Linux and that's it.
https://github.com/bastienleonard/pysfml2-cython/issues/38#issuecomment-6443873
I'm not so sure how we're going to bundle all these dlls in the end, at least for Linux since there's so many possible distributions. Does anyone know how the package manager works?
Also, again, I want to hear everyone's opinion on how to structure teams.teams?
BooleansBooleans are useless in this case, there are 3 teams.
Motherfucking Booleans
assign a numerical value to the team variable thenBooleansBooleans are useless in this case, there are 3 teams.
Motherfucking Booleans
Yeah, of course. Thing is, not everyone agrees that making a team variable is the smartest thing in the first place.assign a numerical value to the team variable thenBooleansBooleans are useless in this case, there are 3 teams.
Motherfucking Booleans
dubm
It gives you flexibility and ease with developing and modding. Not to say people are going to actually use it, but whatever.Yeah, of course. Thing is, not everyone agrees that making a team variable is the smartest thing in the first place.assign a numerical value to the team variable thenBooleansBooleans are useless in this case, there are 3 teams.
Motherfucking Booleans
dubm
So do different classes for different teams. That is a requirement, not an argument.It gives you flexibility and ease with developing and modding. Not to say people are going to actually use it, but whatever.Yeah, of course. Thing is, not everyone agrees that making a team variable is the smartest thing in the first place.assign a numerical value to the team variable thenBooleansBooleans are useless in this case, there are 3 teams.
Motherfucking Booleans
dubm
You're gonna have to help me out with that one, because that genuinely makes no sense at all.A variable on everything is one option. The other option is to make a general "Shot" class (f.ex.), and use some two separate "Shot_red" and "Shot_blue" classes that have separate code.
team = True :x10: or False :x20: or None :ninja:put this man on the dev team
:c1:
can bools really contain nullbools are immutable
because if so then this guy is a genius
no sir that is not how data types work
and tuplesno sir that is not how data types work
Yes sir, in Python bools, int's, None, str's among others are, in fact, immutable.
I don't want to live in a world where people refer to consts while talking about storing dynamic data
I really don't
and tuplesno sir that is not how data types work
Yes sir, in Python bools, int's, None, str's among others are, in fact, immutable.
if team:
...
elif team == False:
...
else:
...
whilst with constants we would haveif team == constants.TEAM_RED:
...
elif team == constants.TEAM_BLUE:
...
else:
...
I agree with Orpheon here.*Marks this in the historical PyGG2 chronicles.*
I agree with Orpheon here.*Marks this in the historical PyGG2 chronicles.*
uh yeah^ Pro problem solving.
you know what fuck pygrafix; today I'm going to rework the font system so we can eliminate that dependency all together just so I don't have to compile it on my ubuntu laptop
:D
okay.Ah damn. I was hoping it would be more stable than pygrafix. Whatever, at least it's being developed, contrarily to pygrafix.
1. it runs twice as fast
2. it has interpolation and lag compensention
3. right now it has some stuttering issues. Also there's a lot of bugs in the library we're using
we probably wouldn't be able to get a stable release until after pysfml/sfml 2 has stabilized
this is why your "rewrite client history" networking solution is a horrible idea compared to classical interpolation (which your arguments against are trivial when you add input prediction)My "rewrite client history" networking solution is standard extrapolation and has been used in literally every big FPS game since Quake 3.
the only lag compensation that will solve this problem is the client telling the server exactly what to do, and nobody wants that anywhere.
Wareya I'm pretty sure that we do the same thing as the half life 1 docs except that we have the client store everything (which is stupid and broken, but I won't get into that)The book of hook article: http://nclabs.org/articles/5 (http://nclabs.org/articles/5) (I asked NC to saveguard and host it again)
Orpheon the server must never be "on-par" (ahead) of the client, and I'm not so sure how this could be possible, judging from my previous knowledge of the half life 1 interpolation (book of hook quake 3 seems to be down, so idk)
How can the server determine that the client has not jumped in state 44 without acking the packet first? iirc the server probably shouldn't be interpolating states ahead of the client
4th time^^^^^wat
If you combine all your alt accounts this is the eight time by my count4th time^^^^^wat
there was ajf
then there was notajf
then there was ajf
›implying you didnt have alts4th time^^^^^wat
there was ajf
then there was notajf
then there was ajf
watIf you combine all your alt accounts this is the eight time by my count4th time^^^^^wat
there was ajf
then there was notajf
then there was ajf
this is my favorite threadYou should look at the Skype log, everything from number-induced madness to bloody power struggles.
nerdfights starring our lovable pygg2 development staff and wonderful welcome wagons, all in one thread
I thought this was supposed to be the "serious" subforum.It is.
I thought this was supposed to be the "serious" subforum.Not on my watch
So are you guys going to do it by the game's current scale or 50% smallerWe were doing it with the current sprites and the current scaling. But changing that scaling means adding one function call everywhere, so it's doable and also doable later.
Because it'd be nice if the rotating weapon sprites didn't have that bitmixing effect because that's what happens.
pygg2 is bad, the way it does a lot of thingsWhy is packet construction fucked up?
- packet construction is as fucked up as it is in GG2
- lots and lots and lots of needless, unmaintainable code duplication
- etc
if you want your networking bugs to go away then use a buffering method that makes sense and doesn't try to do black magicEasy, comment out the lines 93 to 103 in client/event_handler.py.
I can't work on the collision because the game stutters enough to make it so I can't test for minor obscure bugs
It's lots of code duplication and a class per packet, when in reality I think it could be a lot simpler and less error-prone if you did it lower-level.pygg2 is bad, the way it does a lot of thingsWhy is packet construction fucked up?
- packet construction is as fucked up as it is in GG2
- lots and lots and lots of needless, unmaintainable code duplication
- etc
All those classes are in one nice file, they abstract packing very nicely and it isn't any more error-prone than what gg2 has now (which is the lower-level variant).It's lots of code duplication and a class per packet, when in reality I think it could be a lot simpler and less error-prone if you did it lower-level.pygg2 is bad, the way it does a lot of thingsWhy is packet construction fucked up?
- packet construction is as fucked up as it is in GG2
- lots and lots and lots of needless, unmaintainable code duplication
- etc
http://madlag.github.com/jarvis/ (http://madlag.github.com/jarvis/)i don't understand french
All those classes are in one nice file, they abstract packing very nicely and it isn't any more error-prone than what gg2 has now (which is the lower-level variant).It's lots of code duplication and a class per packet, when in reality I think it could be a lot simpler and less error-prone if you did it lower-level.pygg2 is bad, the way it does a lot of thingsWhy is packet construction fucked up?
- packet construction is as fucked up as it is in GG2
- lots and lots and lots of needless, unmaintainable code duplication
- etc
Also, breaking news:
http://c9.io/ (http://c9.io/)
They finally released Cloud 9. Their catch phrase "It's like Google Docs for code" describes it quite well, I'm for that we take a look at this again. NC and I considered it back then when we were choosing IDEs, but it didn't have the collab editing yet, which is a -massive- feature.
Also, breaking news:Out of curiosity, can you use this if you code with a programming language they don't support ? I'm thinking about GML here.
http://c9.io/ (http://c9.io/)
They finally released Cloud 9. Their catch phrase "It's like Google Docs for code" describes it quite well, I'm for that we take a look at this again. NC and I considered it back then when we were choosing IDEs, but it didn't have the collab editing yet, which is a -massive- feature.
obviously, no.Also, breaking news:Out of curiosity, can you use this if you code with a programming language they don't support ? I'm thinking about GML here.
http://c9.io/ (http://c9.io/)
They finally released Cloud 9. Their catch phrase "It's like Google Docs for code" describes it quite well, I'm for that we take a look at this again. NC and I considered it back then when we were choosing IDEs, but it didn't have the collab editing yet, which is a -massive- feature.
damn, you are hilariousikr
The details :hehe:We're not using pygrafix anymore, so it's not really more than a bad memory now.
(http://i.snag.gy/iYTSp.jpg)
Kind of expected a "fuku nc" / "fuk pygrafix" in there but didn't find it.
I guess you must have screamed at NC if he's actually active in this thread.He's reading this over my shoulder....
Hey! Nightcracker! Stop lazing around spying on Orpheon and work on PyGG2 or something!I guess you must have screamed at NC if he's actually active in this thread.He's reading this over my shoulder....
Hey! Nightcracker! Stop lazing around spying on Orpheon and work on PyGG2 or something!I guess you must have screamed at NC if he's actually active in this thread.He's reading this over my shoulder....
>posting from non-mobile siteHey! Nightcracker! Stop lazing around spying on Orpheon and work on PyGG2 or something!I guess you must have screamed at NC if he's actually active in this thread.He's reading this over my shoulder....
No internet =/
mobile site is fucking terrible why would use thatit loads faster on slow connections and on limited power phones
who says he has a slow connection or limited power?good point
No internet =/this implies he has at least a slow connection
and if it's on a phone he has no excuse, git isn't exactly bandwidth-heavy and you can tether iPhones and Android devicesNo internet =/this implies he has at least a slow connection
I can only see your IP and only if someone reports the post
I didn'taren't you like some community bullshit or were
also that's only in some weird boards where I have moderator privilages regardless of being a moderator and I'm not sure that this is one of them
Gang Garrison 2 ALPHA JAVA REMAEK EDITION!!111.avi (http://www.youtube.com/watch?v=aRnxYuCPiAs&list=UUlGyzRbPrwpRGP_fZJmj9TA&index=6&feature=plcp#)wat
are you guys even trying
Gang Garrison 2 ALPHA JAVA REMAEK EDITION!!111.avi (http://www.youtube.com/watch?v=aRnxYuCPiAs&list=UUlGyzRbPrwpRGP_fZJmj9TA&index=6&feature=plcp#)We built the engine before anything else. Graphical Schnickschnack comes later.
are you guys even trying
def Server_Snapshot_Update(client, networker, game, event):
# Copy the current game state, and replace it with everything the server knows
packet_time = round(struct.unpack_from(">f", event.bytestr)[0], 3)
event.bytestr= event.bytestr[4:]
if len(game.old_states) > 0:
tmp = game.old_states
tmp.sort(key=lambda x: x.time)
#if tmp != game.old_states:
# print([s.time for s in game.old_states])
old_state_times = [old_state.time for old_state in game.old_states]
if max(old_state_times) > packet_time:
if packet_time in old_state_times:
# The packet time miraculously is equal one of the stored states
state = game.old_states[old_state_times.index(packet_time)]
else:
# it isn't, we gotta interpolate between the two nearest
sorted_times = old_state_times
sorted_times.sort(key=lambda state_time: abs(state_time - packet_time))
state_1 = game.old_states[old_state_times.index(sorted_times[0])]
state_2 = game.old_states[old_state_times.index(sorted_times[1])]
state = state_1.copy()
state.interpolate(state_1, state_2, (packet_time - sorted_times[0]) / (sorted_times[1] - sorted_times[0]))
else:
state = game.current_state
# Delete all the old states, they are useless. Remember that list is chronologically ordered
while len(game.old_states) > 0:
if game.old_states[0].time <= packet_time:
game.old_states.pop(0)
else:
break
# Also delete those too far ahead
server_current_time = packet_time + networker.estimated_ping
while len(game.old_states) > 0:
if game.old_states[-1].time >= packet_time + min(networker.estimated_ping, constants.MAX_EXTRAPOLATION):
game.old_states.pop(-1)
else:
break
else:
state = game.current_state
if state.time < packet_time:
state.update_all_objects(game, packet_time-state.time)
#try:
# print("game.old_states: {}\n".format([s.time for s in game.old_states]), "{0} < {1} < {2}\n".format(state_1.time, state.time, state_2.time), "packet time:{}\n".format(packet_time), "server time:{}\n".format(packet_time+networker.estimated_ping))
#except:
# print("game.old_states: {}\n".format([s.time for s in game.old_states]), "state.time:{0}\n".format(state.time),"current_state.time:{}\n".format(game.current_state.time), "state.time-current_state.time:{}\n".format(state.time - game.current_state.time), "packet time:{}\n".format(packet_time), "server time:{}\n".format(packet_time+networker.estimated_ping))
# State should now be exactly what the client thinks should happen at packet_time. Now let the server correct that assumption
for player in state.players.values():
length = player.deserialize_input(event.bytestr)
event.bytestr = event.bytestr[length:]
try:
character = state.entities[player.character_id]
length = character.deserialize(state, event.bytestr)
event.bytestr = event.bytestr[length:]
except KeyError:
# Character is dead; continue
pass
# Now we have exactly what happened on the server at packet_time, update it to packet_time+ping (which also happens to be the length of all old_states)
#state.update_all_objects(game, networker.estimated_ping)
# Update this state with all the input information that appeared in the meantime
for old_state in game.old_states:
state.update_synced_objects(game, min(constants.PHYSICS_TIMESTEP, old_state.time - state.time))
old_player = old_state.players[client.our_player_id]
input = old_player.serialize_input()
player = state.players[client.our_player_id]
player.deserialize_input(input)
game.current_state = state
...
game.old_states: []
state.time:30.417
current_state.time:30.417
state.time-current_state.time:0.0
packet time:30.417
server time:30.517
game.old_states: []
state.time:30.467
current_state.time:30.467
state.time-current_state.time:0.0
packet time:30.467
server time:30.567
game.old_states: []
state.time:30.517
current_state.time:30.517
state.time-current_state.time:0.0
packet time:30.517
server time:30.617
Traceback (most recent call last):
File "make.py", line 60, in <module>
client_main.GG2main(skipmenu=True)
File "/home/user/Programming/Python/GG2/client_main.py", line 22, in GG2main
cm.run()
File "/home/user/Programming/Python/GG2/client/handler.py", line 30, in run
while self.handler.step() and not self.quitting:
File "/home/user/Programming/Python/GG2/client/main.py", line 161, in step
self.game.update(self.networker, frame_time)
File "/home/user/Programming/Python/GG2/engine/game.py", line 47, in update
self.current_state.update_all_objects(self, constants.PHYSICS_TIMESTEP)
File "/home/user/Programming/Python/GG2/engine/gamestate.py", line 21, in update_all_objects
for entity in self.entities.values(): entity.endstep(game, self, frametime)
File "/home/user/Programming/Python/GG2/engine/character.py", line 131, in endstep
if game.map.collision_mask.overlap(self.collision_mask, (int(self.x), int(self.y))):
ValueError: cannot convert float NaN to integer
user@patience:~/Programming/Python/GG2$
Great.
Code: [Select]...
Great.
game.old_states: []
state.time:30.417
current_state.time:30.417
state.time-current_state.time:0.0
packet time:30.417
server time:30.517
game.old_states: []
state.time:30.467
current_state.time:30.467
state.time-current_state.time:0.0
packet time:30.467
server time:30.567
game.old_states: []
state.time:30.517
current_state.time:30.517
state.time-current_state.time:0.0
packet time:30.517
server time:30.617
Traceback (most recent call last):
File "make.py", line 60, in <module>
client_main.GG2main(skipmenu=True)
File "/home/user/Programming/Python/GG2/client_main.py", line 22, in GG2main
cm.run()
File "/home/user/Programming/Python/GG2/client/handler.py", line 30, in run
while self.handler.step() and not self.quitting:
File "/home/user/Programming/Python/GG2/client/main.py", line 161, in step
self.game.update(self.networker, frame_time)
File "/home/user/Programming/Python/GG2/engine/game.py", line 47, in update
self.current_state.update_all_objects(self, constants.PHYSICS_TIMESTEP)
File "/home/user/Programming/Python/GG2/engine/gamestate.py", line 21, in update_all_objects
for entity in self.entities.values(): entity.endstep(game, self, frametime)
File "/home/user/Programming/Python/GG2/engine/character.py", line 131, in endstep
if game.map.collision_mask.overlap(self.collision_mask, (int(self.x), int(self.y))):
ValueError: cannot convert float NaN to integer
user@patience:~/Programming/Python/GG2$
The problem is another, the interpolation is still borking on some rare cases. Most of the time it works, but not always.Code: [Select]...
Great.
game.old_states: []
state.time:30.417
current_state.time:30.417
state.time-current_state.time:0.0
packet time:30.417
server time:30.517
game.old_states: []
state.time:30.467
current_state.time:30.467
state.time-current_state.time:0.0
packet time:30.467
server time:30.567
game.old_states: []
state.time:30.517
current_state.time:30.517
state.time-current_state.time:0.0
packet time:30.517
server time:30.617
Traceback (most recent call last):
File "make.py", line 60, in <module>
client_main.GG2main(skipmenu=True)
File "/home/user/Programming/Python/GG2/client_main.py", line 22, in GG2main
cm.run()
File "/home/user/Programming/Python/GG2/client/handler.py", line 30, in run
while self.handler.step() and not self.quitting:
File "/home/user/Programming/Python/GG2/client/main.py", line 161, in step
self.game.update(self.networker, frame_time)
File "/home/user/Programming/Python/GG2/engine/game.py", line 47, in update
self.current_state.update_all_objects(self, constants.PHYSICS_TIMESTEP)
File "/home/user/Programming/Python/GG2/engine/gamestate.py", line 21, in update_all_objects
for entity in self.entities.values(): entity.endstep(game, self, frametime)
File "/home/user/Programming/Python/GG2/engine/character.py", line 131, in endstep
if game.map.collision_mask.overlap(self.collision_mask, (int(self.x), int(self.y))):
ValueError: cannot convert float NaN to integer
user@patience:~/Programming/Python/GG2$
Check all places where sqrt, log, etc is used - they can return NaN for invalid input.
hello nagn here with a playable beta
https://dl.dropbox.com/u/92157440/PyGG2.zip (https://dl.dropbox.com/u/92157440/PyGG2.zip)
host a server, then launch the test client (connects to local host by default so you won't crash)
right now game's a piece of shit but I hope to fix that eventually
also if someone has an issue with running the game, please tell me, and if running vcredist_x86 helped you in any way
no, it's an alpha^
basically, if there was something more alpha status than alpha, pygg2 would be thatprealpha?
What were all those 72 person server tests yesterday about?NAGN not being able to dis-host.
The efficiency of this thread probably doesn't matter.
i have a question, why do you need an image library while you have pygame?
pygame is slow^ This.
The efficiency of this thread and the progress of development probably aren't related and it probably doesn't matter. I'm just tossing that out there.^ This.
ihawoirhvaiwdhv stop calling it extrapolationhttp://nclabs.org/articles/5 (http://nclabs.org/articles/5)
extra. is an arithmetic/algebraic prediction and usually SIMPLIFIED SIMULATION OF COMPLEX SYSTEMS
what you're doing is (or should be - if you're not, do it) calculuses are in the realm of simulation prediction, because you have to uh, simulate the system, to do it.
The rundown is:
Extrapolation makes new data based only on that relevant data. Predicting new positions based wholly on positions of the past. Simulation is basing new positions off the system that made the old positions to begin with.
And everyone else calls it prediction because his term is ambiguous, questionable, and estranged.Also, if you want to go by definition, what I'm doing is estimating the value (=state) of a function I don't know all parameters of (the other players input), so I approximate it with a (simpler) function outside the sampled values on the base of those sampled values.
And everyone else calls it prediction because his term is ambiguous, questionable, and estranged.
Also NC, do the polygon collision dangit.And everyone else calls it prediction because his term is ambiguous, questionable, and estranged.
No it's not. What you do is based on the previous data guess (or better, extrapolate) the next position. Extrapolation is exactly what we're doing.
i have a question, why do you need an image library while you have pygame?I don't see how pygame is relevent to the imaging library
lemme explain the dynamics; the op of this thread and moderator is having a discussion with someone and you interrupt because you seen to believe a forum thread directly affects development. We have enough regular moderators, we dont need any in the back seat.but its tiscooler
Orpheon, if you're fast-forwarding other people, you're doing something seriously, seriously wrong.Not doing so but fast-forwarding yourself creates an inconsistent state, which is probably the worst thing that can possibly happen.
You're not supposed to fast forward /anything/. That's unavoidably buggy and flawed. If you have something moving in a curve it'll extrapolate a bunch of tangents, if someone jumps or fires at you at point blank you can't predict that, then once you get the shot or jump they're suddenly in the future, etc. You're supposed to /rewind the client state/ to compare it to the newest state from the /server/.The client state is (in normal cases) at the same time as the packet state, and far behind the server state.
I figured out how to lag compensate projectiles anyway so if they do interpolation it's possible to make it not ruin rockets etcHow?
Every single time you step a projectile, rewind player position by how much the attacker was lagging when they fired the projectile. Alternatively, just by how much they're lagging at the very moment, but that's harder and fininicky because of the second thing. In order to make collision realistic for the person being hit, extrapolate the projectile position on the client side by how much the attacker was lagging. Just store the projectile's "lag" while you sync it.Hmm...
ITT: (and section)You, sir, have made my day.
(http://upload.wikimedia.org/wikipedia/commons/9/9d/Papyrus_Ani_curs_hiero.jpg)
ok now... wheres the serversNo-one is hosting this. Why do that, when damage isn't even implemented?
then what was with the >100 person development serverA bug/mistake no-one ever cared enough to fix.
then why were there about 80 people in the server leaving al the other servers empyIt is a bug in the player number count sender. There weren't 80 people.
ur a bug llldo you not like
October 10? Can I be hopeful?pygg2 isn't going to be ready for a very long timeIf with "very long time" you mean 3 months, ok.
Not a chance for before christmas. Not unless every single one of the devs lets everything fall and rushes to it.October 10? Can I be hopeful?pygg2 isn't going to be ready for a very long timeIf with "very long time" you mean 3 months, ok.
there is a slight problem with the development uh what was it o yea NOT MANY PEOPLE KNOW PYTHON so therefore it would not finish ever^^Kid that doesn't understand the term "Independent Development"
The problem is that everyone is too lazy/doesn't have time to develop, not Python.you should use go
Enough know python, and tbh it's not the hardest language to learn, especially if you already know (and I mean know, not just barely understand) a language.
I lost all faith and love of go as soon as I noticed that C curly bracket style is illegal.uh, they mandate a style, so?
did they fix the pkg-config issue with win32 go and legacy libraries yet?dunno 'bout dat
Python doesn't enforce a bracket style, it removes them altogether. Also, I like python indentation system, I don't like the java (and go) bracket system. Taste is taste.I lost all faith and love of go as soon as I noticed that C curly bracket style is illegal.uh, they mandate a style, so?
why are you using python then?
:Ddid they fix the pkg-config issue with win32 go and legacy libraries yet?dunno 'bout dat
No such thing as C/Java-style. Code written for both uses multiple styles.Python doesn't enforce a bracket style, it removes them altogether. Also, I like python indentation system, I don't like the java (and go) bracket system. Taste is taste.I lost all faith and love of go as soon as I noticed that C curly bracket style is illegal.uh, they mandate a style, so?
why are you using python then?
:Ddid they fix the pkg-config issue with win32 go and legacy libraries yet?dunno 'bout dat
I think you could call this (http://www.oracle.com/technetwork/java/codeconv-138413.html) the official Java style at least.Nah... something done by the makers of Java?
I think you could call this (http://www.oracle.com/technetwork/java/codeconv-138413.html) the official Java style at least.http://www.oracle.com/technetwork/java/javase/documentation/codeconventions-142311.html#449 (http://www.oracle.com/technetwork/java/javase/documentation/codeconventions-142311.html#449)
7.4 if, if-else, if else-if else Statements^ I hate this. Go enforces it.
The if-else class of statements should have the following form:
if (condition) {
statements;
}
if (condition) {
statements;
} else {
statements;
}
if (condition) {
statements;
} else if (condition) {
statements;
} else {
statements;
}
if (condition)
{
statements;
}
else if (condition)
{
statements;
}
else
{
statements;
}
I lost all faith and love of go as soon as I noticed that C curly bracket style is illegal.Actually... wait, what?
hahyou're kidding me
wasn't orpheon the one who argued against setup specific code formatting to begin with?
nagn, the thing is languages don't specifically "support vs no support" thingsWhich is perfectly fine by me because it makes style discussions unneccessary, and thus thousands of programmer-hours around the world were saved.
in cases like this they are literally just forcing people to use one style
I still want to see a language have a feature for enforcing custom formatting styles.
guys less drama more progress demarked by screenies and servers that accidentally have 100 player slotsYou are welcome to contribute.
hahI don't want a specific code formatting, I want freedom.
wasn't orpheon the one who argued against setup specific code formatting to begin with?
Doesn't give them the right to decide for all programmers. If I don't agree with their decision (I don't), then I just don't use Go anymore.nagn, the thing is languages don't specifically "support vs no support" thingsWhich is perfectly fine by me because it makes style discussions unneccessary, and thus thousands of programmer-hours around the world were saved.
in cases like this they are literally just forcing people to use one style
guys less drama more progress demarked by screenies and servers that accidentally have 100 player slotsdevs youre not allowed to have non dev conversations anymore instant ban
I still want to see a language have a feature for enforcing custom formatting styles.yes
we make a game for windowsok
You are welcome to contribute.
devs youre not allowed to have non dev conversations anymore instant bani know i'm being unrealistic and demanding here and it's really none of my business if i'm not helping but i just had my hopes up for this thing coming through and it sounded so cool, and everyone seems like they're arguing and it's just not going to happen
we make a game for windowsNo, we make a game for everything.
Us arguing or not arguing actually has very little effect on this project.You are welcome to contribute.devs youre not allowed to have non dev conversations anymore instant bani know i'm being unrealistic and demanding here and it's really none of my business if i'm not helping but i just had my hopes up for this thing coming through and it sounded so cool, and everyone seems like they're arguing and it's just not going to happen
https://github.com/wareya/b43.jsoh lol that
python is horrifyingnah, it makes gui development incredibly sexy
watpython is horrifyingnah, it makes gui development incredibly sexy
basically what's happening is that no one's working on it right now. That doesn't mean its abandoned per-say, but if you look at video games as far as how things are looked at from a surface (we're not a bureaucracy, everything's open on github), yes we're pretty much bullshitting around.wat
Any argument that's going on in this thread that's about "restarting the project," or something silly like coding conventions simply reflect a lack of work, and attempts to excuse ourselves from working on it.wat
That being said, Wareya and AJF have already chosen to abandon the project. That doesn't mean that they're not welcome back, but it also means that we don't really have much to do with whatever side projects they're doing (b43.js, and whatnot)yes
I'm not so sure what AJF is doing right now, but whatever it is, its probably nothing to do with PyGG2okay yes that's true
I've been playing a bit of dota 2 recently. ITs a real good time waster, but I should probably go back to working on this now that L and everyone's going to college, or finish up the Garrison Builder rewritewat
Replace "dota 2" in here with minecraft and you have my situation.python is horrifyingnah, it makes gui development incredibly sexy
basically what's happening is that no one's working on it right now. That doesn't mean its abandoned per-say, but if you look at video games as far as how things are looked at from a surface (we're not a bureaucracy, everything's open on github), yes we're pretty much bullshitting around.
Any argument that's going on in this thread that's about "restarting the project," or something silly like coding conventions simply reflect a lack of work, and attempts to excuse ourselves from working on it.
That being said, Wareya and AJF have already chosen to abandon the project. That doesn't mean that they're not welcome back, but it also means that we don't really have much to do with whatever side projects they're doing (b43.js, and whatnot)
I'm not so sure what AJF is doing right now, but whatever it is, its probably nothing to do with PyGG2
I've been playing a bit of dota 2 recently. ITs a real good time waster, but I should probably go back to working on this now that L and everyone's going to college, or finish up the Garrison Builder rewrite
Hey, this thread isn't as derailed and ADD as pygg2's engine structure is.GM already has. We just need mac/iOS/HTML5/Android versions of faucet networking.
Honestly, GM will go cross-platform before GG2 does.
Also, if you guys find the structure so flawed, then giving concrete examples help a lot more.
Apart from the completely inconsistent naming, I know that.
inconsistent naming
inconsistent naming, fucked up scoping to work around python's handling of scope, inconsistency and bad data shuffling due to said scope and naming problems, that were never fixed, the hilarious issues with trying to get the god damn thing even to workNone of these are concrete examples. Give code.
Well, they could work off someone else's engine from the get-go and re-write it as they go. There's absolutely no shame in that.>implying there are free, good and open game engines in Go.
Doesn't matter what bloke writes the code; it all works the same either way to the players, you know?
C++ was also suggested. I know some guys that could help out with that, if they can get past Wareya's severe autism.Well, they could work off someone else's engine from the get-go and re-write it as they go. There's absolutely no shame in that.>implying there are free, good and open game engines in Go.
Doesn't matter what bloke writes the code; it all works the same either way to the players, you know?
There's nothing wrong with starting, as I don't think there's a huge concurrence yet.C++ was also suggested. I know some guys that could help out with that, if they can get past Wareya's severe autism.Well, they could work off someone else's engine from the get-go and re-write it as they go. There's absolutely no shame in that.>implying there are free, good and open game engines in Go.
Doesn't matter what bloke writes the code; it all works the same either way to the players, you know?
what are the maps based on? Are the tile collisions rasterized?let's see...
EDIT: Also, orpheon, remember that you can split this if it gets out of handYeah, I just like deleting. :P
AJF, I wish you luck in your endeavors, but I'll stick to this project for the moment.yayEDIT: Also, orpheon, remember that you can split this if it gets out of handYeah, I just like deleting. :P
There is a free and open-source game with a weird name I can't remember that involves blobs that jump around and shoot things. I would probably use whatever engine it uses.I am pretty sure that teeworlds is nothing like gg2.
Edit: TEEWORLDS. That's it.
Edit 2: It has shooting, it has physics, it has custom maps, it has two teams, it has CTF. I'm sure it could be adapted to serve gg2's needs.
AND WITHOUT REWRITING THE WHOLE BLOODY THING.
:D
dusty that is not how game engine building worksthe reason why I said that is because I could understand trying it out if the games were similar in physics and mechanics
open-source ctf multiplayer shootemup tile-basedThere is a free and open-source game with a weird name I can't remember that involves blobs that jump around and shoot things. I would probably use whatever engine it uses.I am pretty sure that teeworlds is nothing like gg2.
Edit: TEEWORLDS. That's it.
Edit 2: It has shooting, it has physics, it has custom maps, it has two teams, it has CTF. I'm sure it could be adapted to serve gg2's needs.
AND WITHOUT REWRITING THE WHOLE BLOODY THING.
:D
Google Python Class Day 1 Part 1 (http://www.youtube.com/watch?v=tKTZoB2Vjuk#)Seems like a pretty good course. Good luck.
I am planning to watch all of this just to learn this and contribute to this. I am currently at 13:00 and I will watch the rest later
considering that pygg2 is in an urgent state of "bad networking", you should probably just do it.Alright, if both you and AJF tell me to pull, I will.
def step(self, game, state, frametime):
# FIXME: MAKE THIS WORK FOR NEGATIVE frametime!
# GMK-GG2 tried to emulate basic acceleration and air resistance with two simple instructions:
# [execute 30 times per second]
# speed += 1
# speed *= 0.92
# Underneath is the same thing converted to work with frametime.
# PS: If you ever have the chance, please bash whoever had the idea of a non-standard exponential function for a rocket in an 8-bit game on the head. Thank you.
self.speed /= 30
n = 30 * frametime
self.speed = (0.92**n) * self.speed + 0.92*((1 - (0.92**n))/(1 - 0.92))
self.speed *= 30
self.hspeed = math.cos(math.radians(self.direction)) * self.speed * function.sign(frametime)
self.vspeed = math.sin(math.radians(self.direction)) * (-self.speed) * function.sign(frametime)
Finally, I don't understand the collision code well enough to make be 100% sure that what I did fixed the issues it had with negative frametime.
Guys. I found the secret of productivity: Isolation. Go for a few days in the mountains with nothing but headphones and a laptop with no games on it, and wonders shall occur.thanks orpheon, wareya and ajf aren't on the project anymore, so you don't really need to wait on their approval, though I probably should have looked this over before you forced pushed
That's what I did these last few days, and the result is 24 commits achieving a completely working interpolation and smooth networking.
https://github.com/PyGG2/PyGG2/pull/11
Giving you guys (in case anyone has time to) a few days to check it before I pull.
Hey NAGN, could you implement map entities in pygg2 that are compatible with your GB? That would be the next thing to do imo, barring maybe polygon collision.Guys. I found the secret of productivity: Isolation. Go for a few days in the mountains with nothing but headphones and a laptop with no games on it, and wonders shall occur.thanks orpheon, wareya and ajf aren't on the project anymore, so you don't really need to wait on their approval, though I probably should have looked this over before you forced pushed
That's what I did these last few days, and the result is 24 commits achieving a completely working interpolation and smooth networking.
https://github.com/PyGG2/PyGG2/pull/11
Giving you guys (in case anyone has time to) a few days to check it before I pull.
possibly, but my version of Garrison builder isn't complete yet, and I'm busy dealing with a lot of other thingsOk. Lets get GMK gg2 update rolling out first, and then do this.
I realise this must have been said 100 times in this thread already and it must be getting tiring to hear, but Python is a terrible choice. First of all because who knows Python (lots of people do, but still only a fraction of programmers, whereas nearly all understand C/C++ for instance) and then because as a user you have to jump through many hoops to get the thing running, kinda gets in the way of adoption. It goes without saying but if I'd made and distributed my main program this way well I would have had to get a real job by now.Actually, for the end user there will be no difference at all, and we chose python mainly because everyone who wanted to work on this preferred it.
Anyway, I also have something almost constructive to say: Can we translate this thing into C/C++ using the assistance of something like Cython/PyPy/Nuitka/shed skin? If so I'd be willing to help (and I'm sure more non-Python developers would like to do that too), right now I'm working on making vector games out of my 2D/3D vector engine, but I'd love to contribute to working on GG2 in C or C++. If not then screw you guys I'm going home and I'll make a half vector half pixel art (maybe even half 3D, you could turn maps 3D by turning floor/wall pixels into extruded cubes and leaving the rest of the background maps on a 'wall') ripoff of GG2 as soon as I can figure out how to read map PNGs (I know how to load regular PNGs with libpng but how the heck do you get the wallmask and the entities out of the PNG file? Honestly I have no idea how this is stored and after googling it I couldn't find anything about it).
Actually, for the end user there will be no difference at all, and we chose python mainly because everyone who wanted to work on this preferred it.Alright, well I'm on an extremely slow and flaky connection right now so I can't really download anything, so here's what I've got so far, let me know if that might be of any use:
And yes, of course you can contribute in C. The entire mask code is Cython for example, and it would be superb if you could make a vector collision engine in any (fast) language, as long as it lets itself get called by python (which is definitely the case for C, very probably C++ as well).
Translating the whole thing in C++? That would mean I'm out of the picture, which means only you and possibly NAGN would work on it, as there aren't so many other programmers interested in helping here. It would also mean rewriting almost the entire codebase, and although I'm not sure about Cython/etc, I don't think you can just wave them at the code and get something maintainable.
// This calculates point (x,y) at the intersection of infinite lines defined by four points
void line_line_intersection(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4, double *x, double *y)
{
*x = ((x1*y2-y1*x2)*(x3-x4)-(x1-x2)*(x3*y4-y3*x4)) / ((x1-x2)*(y3-y4)-(y1-y2)*(x3-x4));
*y = ((x1*y2-y1*x2)*(y3-y4)-(y1-y2)*(x3*y4-y3*x4)) / ((x1-x2)*(y3-y4)-(y1-y2)*(x3-x4));
}
// Tells you where point (x,y) is on the line (x1,y1) to (x2,y2) line as a fraction (0 is on (x1,y1), 1 is on (x2,y2), 0 to 1 is in between, outside of [0,1] is outside of the line)
double pos_on_line(double x1, double y1, double x2, double y2, double x, double y)
{
return ((x-x1)*(x2-x1) + (y-y1)*(y2-y1)) / ((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
}
// returns 1 if two segments collide
int32_t check_line_collision(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4, double *u, int32_t exclusive)
{
double x, y, v;
if ((x1==x2 && y1==y2) || (x3==x4 && y3==y4))
return 0;
line_line_intersection(x1, y1, x2, y2, x3, y3, x4, y4, &x, &y);
*u = pos_on_line(x1, y1, x2, y2, x, y);
v = pos_on_line(x3, y3, x4, y4, x, y);
if (exclusive==0)
if (*u>=0. && *u<=1. && v>=0. && v<=1.)
return 1;
else
return 0;
else
if (*u>0. && *u<1. && v>0. && v<1.)
return 1;
else
return 0;
}
// Dumbly checks a given segment against all the lines in 'vector object' o (which is basically just an array of two-line segments)
// returns the ID in the segment array of the first segment that did the collision (there maybe be many which collide but you only care about the first)
int32_t check_obj_collision(double x1, double y1, double x2, double y2, vobj_t *o)
{
int32_t i, mini=-1;
double x3, y3, x4, y4, u, umin = 1.;
for (i=0; i<o->count; i++)
{
x3 = o->seg[i].rx1;
y3 = o->seg[i].ry1;
x4 = o->seg[i].rx2;
y4 = o->seg[i].ry2;
if (check_line_collision(x1, y1, x2, y2, x3, y3, x4, y4, &u, 0))
{
if (u <= umin)
{
umin = u;
mini = i;
}
}
}
return mini;
}
Nice. How many layers can a person add? I'm thinking with enough layers, and a bit more detail then 6x, you could conceivable create a fully 3D map.I second that, I was just thinking that it would be great if you could give different depths to let's say a close background wall from the distant background or sky. Maybe it could be done if we exploited the alpha 'layer' for that?
I second that, I was just thinking that it would be great if you could give different depths to let's say a close background wall from the distant background or sky. Maybe it could be done if we exploited the alpha 'layer' for that?Oh goodness no. Alpha is alpha, and in parallax alpha is a very useful feature. Don't butcher it.
Oh goodness no. Alpha is alpha, and in parallax alpha is a very useful feature. Don't butcher it.Oh okay, if you want to use the alpha for something, but as of now we don't really use it do we?
why do that instead of specifying it in a text like entities areYou're right, I guess that makes more sense!
Except for the inherently required transparency in parallax layers, unless you mean you want a single layer with varying depth (do not want, means cannot have anything hidden behind something, looks awful)Oh goodness no. Alpha is alpha, and in parallax alpha is a very useful feature. Don't butcher it.Oh okay, if you want to use the alpha for something, but as of now we don't really use it do we?
It does, the other solution makes no sense.why do that instead of specifying it in a text like entities areYou're right, I guess that makes more sense!
Except for the inherently required transparency in parallax layers, unless you mean you want a single layer with varying depth (do not want, means cannot have anything hidden behind something, looks awful)Okay yeah I wasn't talking parallax, more like first-person 3D in an extruded world, just to see how it's like, I've always wanted to see a 3D game made to represent what side scrollers show you. It could be horrible or it could be funny.
it would make no sense to do that over an archiveBecause then you can still view the background and have it embedded in forums and what not... Although if you actually do multi-layer parallaxed stuff then I guess it makes decreasing sense.
if you store everything in png metadata why not just do a binary blob???
hey orph don't get discouraged because people say python is horribleafter seeing that parallax demo I'm inclined to work on it again.
keep it up man
Great idea, do that. My first reflex would be cython, as pySFML is already cython and so is guaranteed compatible.hey orph don't get discouraged because people say python is horribleafter seeing that parallax demo I'm inclined to work on it again.
keep it up man
First thing I'd do would be make an installer or working executable so people can actually try it.
And a working update mechanism.
Also, re: map format, Python has excellent built-in JSON support.
Of course. It's a wonderful, lightweight-yet-flexible serialisation format, and it's human-readable!Also, re: map format, Python has excellent built-in JSON support.
Aww yisss, all my old map format ideas were JSON-based.
For easy map sharing, you could make a map-sharing webapp (maps.ganggarrison.com or ganggarrison.com/maps?). Users upload their maps and get a nice URL where people can view a written description, see thumbnails, and download the map. Garrison Builder could generate the thumbnails and store them into the zip, meaning the webapp wouldn't have to do any fancy rendering.
Although I don't see the advantage of JSON for wallmask data, that would be better done in a raw byte string.
JSON is simpler to parse and code for when you want to expand it.A wallmask is an image. What do you want to expand about that? You can reference it from the JSON if you want, and add metadata about it there (same with other images btw, think custom entity graphics), but what do you gain in expandability by storing the image data itself in JSON?
After my (failed) map hosting service, I've had this idea for a while. gg2maps.ajf.me may become a reality if we get a new format.For easy map sharing, you could make a map-sharing webapp (maps.ganggarrison.com or ganggarrison.com/maps?). Users upload their maps and get a nice URL where people can view a written description, see thumbnails, and download the map. Garrison Builder could generate the thumbnails and store them into the zip, meaning the webapp wouldn't have to do any fancy rendering.
This sounds like the perfect job for AJF if he's interested.
Yeah, and that's where the fatal flaw in communication here lies.It still is practically binary data, unpacking every vector is not going to happen.
If it is a text-based vector format (e.g. SVG) or even a JSON-structured format it has fewer things speaking against having it in the main JSON imo, but some still stand:Yeah, and that's where the fatal flaw in communication here lies.It still is practically binary data, unpacking every vector is not going to happen.
Wait, why do you guys want to change the map format again??^
Because the current one is an unextendable hack.Well sure it's not very conventional but it has its charms (mostly the part where it seems like a regular picture file) and in what way would we like to actually extend it?
You can keep things embedded in the image file if you really want, even if you change the data format to include for ex other layers etc, but that just makes it really hard to do things without specialized tools.Oh okay then I vote for a format which is just a zip file containing many PNGs (background.png, wallmask.png, or maybe layer###.png, possibly even animated layers for example for snow or rain, or even animated everything, like an animated wallmask so you could have moving platforms), a config file (that could specify parallax for each layer and whatever other parameter necessary) and either a .ENT file as GB uses now or we find a better way to store entities (I was thinking of a colour-coded PNG but then there's the problem of entity overlap, so no). This way you could do most everything using an image editor and text editor and a ZIP thing, save maybe for placing entities, and you could go from basic BG/WM/entities if you're lazy to a very fancy multi-layer parallaxed and animated world, and you could even probably throw some of your own sounds with it, like a global loop (for an ambient sound like the sound of rain and thunder (synchronised with the animated layer that represents thunder for instance), local sounds defined in either the map's config file or their own config file by their position and spatial range/loudness/whatever, maybe even event-based sounds (like for walking on snow). Maybe you could even throw some scripts in there (LUA maybe?). That'd be a pretty nice format. One small technical detail though is the animations, GIF kinda sucks, but what else is there in 24 bits?
APNG?I guess, but support is poor, even Photoshop and GIMP need a third-party plugin for it, but I guess that would be the best option.
The more people that use it, the better support that will exist.APNG?I guess, but support is poor, even Photoshop and GIMP need a third-party plugin for it, but I guess that would be the best option.
Yeah. Anyway I tried setting up the whole thing but I got stuck at the SFML part, that part is a real PITA. I don't get why we are basing this game "off an unstable wrapper of an unstable library". We could have just done the whole thing in SDL... Also what was wrong with Pygraphix? By the way if there's any need for help with doing raster graphics I'm sure I can help, I usually do entire GUIs with my own code onto a framebuffer, even for variable-width fonts (here's an example http://photosounder.com/splineeq/images/screenshot.png (http://photosounder.com/splineeq/images/screenshot.png))Why we didn't do things through SDL/pygame: It was way too slow.
What kind of problems are you getting?Well I don't even know what to do. I've got "pySFML-0.2.1", first of all I had to add "SET VS90COMNTOOLS=%VS100COMNTOOLS%" before running "python setup.py install" (both commands which I had to figure out on my own) and now it says I need SFML. Now I'm confused, where do I get it/which version do I get (on this page http://sfml-dev.org/download.php (http://sfml-dev.org/download.php))? I would have tried some but I'm on an extra slow 3G connection so if I try getting any of those it's gonna take an hour if it even completes, so I'd like to know what I'm doing first.
Oh, isn't there a link to the docs somewhere?What kind of problems are you getting?Well I don't even know what to do. I've got "pySFML-0.2.1", first of all I had to add "SET VS90COMNTOOLS=%VS100COMNTOOLS%" before running "python setup.py install" (both commands which I had to figure out on my own) and now it says I need SFML. Now I'm confused, where do I get it/which version do I get (on this page http://sfml-dev.org/download.php (http://sfml-dev.org/download.php))? I would have tried some but I'm on an extra slow 3G connection so if I try getting any of those it's gonna take an hour if it even completes, so I'd like to know what I'm doing first.
Also just had a quick look at the code, why are angles always converted back and forth between radians and degrees, wouldn't it be simpler to have it all in radians? That's what I do usually, leave it all in radians and define my angles as 2.*pi*x.
Oh also SDL is not slow at all for me but then again all I use it for is writing straight to the window's framebuffer.
Oh, isn't there a link to the docs somewhere?I should have tried the installer. For some reason the other download doesn't actually include SFML even though it says it does (unless I missed something). Now it's working.
http://pysfml2-cython.readthedocs.org/en/latest/building.html# (http://pysfml2-cython.readthedocs.org/en/latest/building.html#)
Ok, sorry then for not being clear enough on the OP.Oh, isn't there a link to the docs somewhere?I should have tried the installer. For some reason the other download doesn't actually include SFML even though it says it does (unless I missed something). Now it's working.
http://pysfml2-cython.readthedocs.org/en/latest/building.html# (http://pysfml2-cython.readthedocs.org/en/latest/building.html#)
We should make the GitHub page readme the proper home for doc links etc. atm.I think it is.
Needs a proper setup guide. A lot of my GitHub projects do this:We should make the GitHub page readme the proper home for doc links etc. atm.I think it is.
Someone needs to add a checklist of what is done and what needs to be done somewhereThat checklist is me. I can give you a lot of things to do if you ask.
Write it down. Preferably into a system where you can manage priorities, milestones and assignments, but just a Google Doc would be much better than having only one person with "the plan".The problem is that it boils down to the same thing as only one person will ever look at it and only one will ever update it. But whatever.
File "X:\Desktop\PyGG2-master\client\spritefont.py", line 26, in __init__Wrong pySFML version I think, try using the binary one or something.
self.chars.append(sprite.copy())
AttributeError: 'sfml.Sprite' object has no attribute 'copy'
help
MedO's right, using an Issue Tracker is a good idea. Even if only one person ever uses it (which I doubt will be the case) it makes it easy to assign tasks to specific people, track progress and completion of new features, and focus your development efforts on the most important tasks at any given time.Uhh...sure, I'll get around to doing it...soon(tm).
Also, writing stuff down in a public place increases your transparency. Increased transparency increases interest in the project. It lowers the barrier to entry for new people interested in helping out. It also decreases your bus factor (http://en.wikipedia.org/wiki/Bus_factor), which is always a good thing.
GitHub's issue tracker would work well, or Launchpad, or maybe even an open-source license of JIRA onDemand.
what was I saying about no binaries of recent versionsFile "X:\Desktop\PyGG2-master\client\spritefont.py", line 26, in __init__Wrong pySFML version I think, try using the binary one or something.
self.chars.append(sprite.copy())
AttributeError: 'sfml.Sprite' object has no attribute 'copy'
help
For windows, something wrong: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pysfml (http://www.lfd.uci.edu/~gohlke/pythonlibs/#pysfml)what was I saying about no binaries of recent versionsFile "X:\Desktop\PyGG2-master\client\spritefont.py", line 26, in __init__Wrong pySFML version I think, try using the binary one or something.
self.chars.append(sprite.copy())
AttributeError: 'sfml.Sprite' object has no attribute 'copy'
help
why'd nobody tell me about demFor windows, something wrong: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pysfml (http://www.lfd.uci.edu/~gohlke/pythonlibs/#pysfml)what was I saying about no binaries of recent versionsFile "X:\Desktop\PyGG2-master\client\spritefont.py", line 26, in __init__Wrong pySFML version I think, try using the binary one or something.
self.chars.append(sprite.copy())
AttributeError: 'sfml.Sprite' object has no attribute 'copy'
help
I'm not sure about the other OS's though, and I'm not sure whether that's even the cause of Nukleus's issue.
...You realise this is linked and quoted in the pySFML docs?why'd nobody tell me about demFor windows, something wrong: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pysfml (http://www.lfd.uci.edu/~gohlke/pythonlibs/#pysfml)what was I saying about no binaries of recent versionsFile "X:\Desktop\PyGG2-master\client\spritefont.py", line 26, in __init__Wrong pySFML version I think, try using the binary one or something.
self.chars.append(sprite.copy())
AttributeError: 'sfml.Sprite' object has no attribute 'copy'
help
I'm not sure about the other OS's though, and I'm not sure whether that's even the cause of Nukleus's issue.
It is? I only saw the other binaries link when I looked :(...You realise this is linked and quoted in the pySFML docs?why'd nobody tell me about demFor windows, something wrong: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pysfml (http://www.lfd.uci.edu/~gohlke/pythonlibs/#pysfml)what was I saying about no binaries of recent versionsFile "X:\Desktop\PyGG2-master\client\spritefont.py", line 26, in __init__Wrong pySFML version I think, try using the binary one or something.
self.chars.append(sprite.copy())
AttributeError: 'sfml.Sprite' object has no attribute 'copy'
help
I'm not sure about the other OS's though, and I'm not sure whether that's even the cause of Nukleus's issue.
Completely no progress for 6 months?It will probably start again during the summer.
D:
Please do so in a different thread then.Will do ;)
when you talk about udp vs tcp dont you mean combining both? why would you make the game with only one or the other, udp is faster but it is less secure and you cant control the packet flow as much, causing it to have to check the packets while tcp is slower but more reliable in handling packets in the right order. (maybe udp for players to server and a combination of both for the server software?)Give me a case where order if packets is important enough to warrant a second socket per player.
Order of packets is *imperative* to input. You cannot skip any and they must be processed in order.No. Half the input is in the gamestate and is independent of order, and the rest are events, who are order and time-dependent, but packets don't care about that.
Half the input is in the gamestate and is independent of orderwat
Movement input is instantaneous, skipping a frame is not noticeable, so no need to make it reliable.Half the input is in the gamestate and is independent of orderwat
1) how is that possibleWith input we mean the same thing, right? I am only talking of left/right acceleration, and possibly about jumping which is a special case.
2) how does movement prediction work
3) do you even run inputs on the server like a normal modern game engine
4) also if the answer to 3 is "yes" then you do need to make sure that input messages are received in the correct order with none missed
This may be a dumb question, but how "done" is this as of now. It seems like there is some cool stuff in there and a lot less dumb-shit stuff, so having something like a percentage to know would be nice.The game itself I would estimate at around 50-60%, barring big surprises.
I happen to be close to finishing the python course in codecademy.com, which I realize is not much experience, but I'd like to assist in the development of pygg2. I will probably have to learn a lot and do things I've never done before but I can't think of any way to learn programming better.
I'm likely way out of my depth, so tell me if I am but I thought I'd ask. I'm willing and eager to learn anything and everything.
I happen to be close to finishing the python course in codecademy.com, which I realize is not much experience, but I'd like to assist in the development of pygg2. I will probably have to learn a lot and do things I've never done before but I can't think of any way to learn programming better.
I'm likely way out of my depth, so tell me if I am but I thought I'd ask. I'm willing and eager to learn anything and everything.
Same
Well it might be very hard to get the original team to work on it; Wareya and AJF refuse to work on it, nightcracker has disappeared, I think NAGN said he would be willing to work on it but he isn't around much anymore, and Orpheon might work on it but I'm not so sure.I happen to be close to finishing the python course in codecademy.com, which I realize is not much experience, but I'd like to assist in the development of pygg2. I will probably have to learn a lot and do things I've never done before but I can't think of any way to learn programming better.
I'm likely way out of my depth, so tell me if I am but I thought I'd ask. I'm willing and eager to learn anything and everything.
Same
Now if we can get the help of somebody who knows what they're doing, maybe we can make some progress :panic:
Well it might be very hard to get the original team to work on it; Wareya and AJF refuse to work on it, nightcracker has disappeared, I think NAGN said he would be willing to work on it but he isn't around much anymore, and Orpheon might work on it but I'm not so sure.I happen to be close to finishing the python course in codecademy.com, which I realize is not much experience, but I'd like to assist in the development of pygg2. I will probably have to learn a lot and do things I've never done before but I can't think of any way to learn programming better.
I'm likely way out of my depth, so tell me if I am but I thought I'd ask. I'm willing and eager to learn anything and everything.
Same
Now if we can get the help of somebody who knows what they're doing, maybe we can make some progress :panic:
I've also been working through codecademy; however haven't had motivation to push through all six lessons. If you guys need it I can probably contribute stuff because next year I'm taking a class in computer science at my high school.
but as inconceivable said, we'd need an experienced coder to supervise/mentor us newbies so we don't screw up the work so far. Optimally, that would mean that the mentor wouldn't have to actually do a lot of work, instead distributing the coding jobs to those who have time.
Do you know how git/github works?In general, yes, but I have not used it heavily. I'm sure I will figure it out as I go.
The Readme on github has a basic list of the dependencies but no instructions on installing them. pySFML and PIL have their own installation instructions, but the bitmask library is custom-built and has to be compiled yourself. The compilation is scripted in install.py, but you'll need MinGW if on windows (which you should have anyway). Tell me if you have any problems.
Jumping into an unfamiliar codebase is hard, I know. PyGG2 is structured so that the core game engine, the rendering and the client/server-specific parts are as separate as possible, and there are a lot of abstractions. I don't know your preferences, can't really recommend a specific part. Things to do are myriad, even very simple things like fixing the weapon sprite offsets as well as more difficult things like HUDs or adding classes/weapons.
If you have any questions, asking here will get them answered eventually, alternatively asking on the IRC (if I or someone else happens to be active) can get you answers faster.I will definitely use that help.
Start by getting the game to run. That's (sadly) already somewhat of a hurdle, especially on windows.Okay, I will try my best. I am currently on a trip and only have my iPad with me but when I get back on Monday and have access to my laptop, I will get started on it with the many things I am going to be starting. I look forward to the climb.
(http://puu.sh/adzcx/c5cf4812b7.png)I'm sorry, I'm new to the whole computing world from the development side. I fail to understand what you mean by this code. Please explain.
Don't use Vim if you've just started. In general, it's only useful for the few that are used to it.I got N++ and it seems to work well. Thank you.
Usually I just use N++ or gedit and the command prompt or bash in Windows or Linux respectively, I do this for most work I do which includes C/C++ but if I were to do some Python I'd probably just do the same.
I'm not trying to communicate via code. That's just a vim screenshot. Obviously, it's not friendly to people who don't know it very well.(http://puu.sh/adzcx/c5cf4812b7.png)I'm sorry, I'm new to the whole computing world from the development side. I fail to understand what you mean by this code. Please explain.
I think you can't communicate the newbie VIM experience via anything but VIM itself.xD
"Ok, let's just type something in."
BEEP!
(five lines of text disappear from the file)
"Augh, I just wanted to..."
BEEP! BEEP! BEEP!
"Ok, I got it, I have to..."
(Vim suddenly goes into splitscreen)
BEEP!
"AUGH!"
I think you can't communicate the newbie VIM experience via anything but VIM itself.https://www.gnu.org/fun/jokes/ed-msg.html (https://www.gnu.org/fun/jokes/ed-msg.html)
"Ok, let's just type something in."
BEEP!
(five lines of text disappear from the file)
"Augh, I just wanted to..."
BEEP! BEEP! BEEP!
"Ok, I got it, I have to..."
(Vim suddenly goes into splitscreen)
BEEP!
"AUGH!"
heheI think you can't communicate the newbie VIM experience via anything but VIM itself.https://www.gnu.org/fun/jokes/ed-msg.html (https://www.gnu.org/fun/jokes/ed-msg.html)
"Ok, let's just type something in."
BEEP!
(five lines of text disappear from the file)
"Augh, I just wanted to..."
BEEP! BEEP! BEEP!
"Ok, I got it, I have to..."
(Vim suddenly goes into splitscreen)
BEEP!
"AUGH!"
(http://puu.sh/bssv5/82fb0a7d24.gif)You're lagging fps-wise pretty hard there.
(http://puu.sh/bstps/7e2483f119.gif)
(http://puu.sh/bst6J/8bf934e3f5.gif)
So I played around with the source again, fixed a few bugs, and successfully managed to freeze (ie. link and put into an exe) pygg2.
Download (https://www.dropbox.com/s/974ry6p7le6hx17/PyGG2.7z?dl=0)
Doubleclick both batch files and enjoy. Press number row to change classes, some are not available yet and soldier crashes.
This is obviously not playable yet, nor do I really need bugtesting. I'm mostly posting this to show that yes, it can be done, there is hope.
You're lagging fps-wise pretty hard there.Derp did mention that the first gif was 33fps and the others were 10fps
Derp did mention that the first gif was 33fps and the others were 10fpsWell, I use Youtube to demonstrate things, but it sometimes requires more effort than is actually worth.
Somehow his PC is worse at recording than mine is
how much work is it to port gg2 to udp then concentrate the efforts on just the pygg2 server?too much