May 19, 2024, 07:07:30 pm

The Gang Garrison 2 Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

NOTICE: Wondering where all the forums have gone?

Join the community Discord server!

Pages: 1 ... 11 12 [13] 14 15 ... 77

Author Topic: Official PyGG2 Development thread  (Read 143000 times)

Lorgan

  • Retired Randomizer Mod Developer
  • Resident Miku
  • *****
  • Karma: 28
  • Offline Offline
  • Posts: 3625
    • My own website
Re: Porting GG2 to another Language - New Thread
« Reply #180 on: October 02, 2011, 10:04:17 am »

sexy
Logged
Unfortunately, turning a section into a communist oppressive regime is not against the forum rules, so there is really nothing we can do.
Quote from: steam
21:08 - Hullusorsa: lorgan, when will you buy us the keys?
21:09 - Lorgan: i'm waiting for greece to collapse so the value of the euro drops
21:09 - Lorgan: not even joking

notajf

  • Guest
Re: Porting GG2 to another Language - New Thread
« Reply #181 on: October 02, 2011, 10:12:14 am »

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:

nice!
Logged

Blackbird88

  • Junior Member
  • **
  • Karma: -12
  • Offline Offline
  • Posts: 125
  • Alternate weapons are must have.
Re: Porting GG2 to another Language - New Thread
« Reply #182 on: October 02, 2011, 10:19:38 am »

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:


Holy shit yesss!
Logged

Flaw

  • Junior Member
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 109
Re: Porting GG2 to another Language - New Thread
« Reply #183 on: October 03, 2011, 10:46:45 am »

If you're wondering why I'm not collaborating much/at all yet, it's because of the following reasons:
  • School
  • Because I said I would be working primarily on gameplay-related coding (sentry logic, round managing, etc)
  • Plans for ( :woot: )
Logged

Malpracticeisdead

  • Guest
Re: Porting GG2 to another Language - New Thread
« Reply #184 on: October 03, 2011, 02:07:15 pm »

I might try to take part in this, but what I will be able to do will be incredibly limited, considering I have no experience with Python. I'm looking forward to how this'll turn out though.
Logged

Flaw

  • Junior Member
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 109
Re: Porting GG2 to another Language - New Thread
« Reply #185 on: October 04, 2011, 08:34:44 am »

I saw "nightcracker - PyGG2" on a server today. Did you actually get some networking ready, or did you just for some odd reason use that name?
Logged

nightcracker

  • NC
  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 516
  • PyGG2 dev
    • NC Labs
Re: Porting GG2 to another Language - New Thread
« Reply #186 on: October 04, 2011, 08:45:54 am »

Just for shit's n giggles.
Logged

Liam

  • New Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 16
Re: Porting GG2 to another Language - New Thread
« Reply #187 on: October 04, 2011, 09:00:36 am »

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...
Logged

Flaw

  • Junior Member
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 109
Re: Porting GG2 to another Language - New Thread
« Reply #188 on: October 04, 2011, 09:14:41 am »

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.
Logged

nightcracker

  • NC
  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 516
  • PyGG2 dev
    • NC Labs
Re: Porting GG2 to another Language - New Thread
« Reply #189 on: October 04, 2011, 09:30:00 am »

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/PyGG2

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...

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.
« Last Edit: October 04, 2011, 09:31:45 am by nightcracker »
Logged

notajf

  • Guest
Re: Porting GG2 to another Language - New Thread
« Reply #190 on: October 04, 2011, 10:37:52 am »

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/PyGG2

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...

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.
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.
Logged

Orpheon

  • Moderator
  • *****
  • Karma: 15
  • Offline Offline
  • Posts: 6409
  • Developer
Re: Porting GG2 to Python - PyGG2
« Reply #191 on: October 13, 2011, 05:12:17 pm »

Pulled in nightcrackers stuff again, and resolved to start working on this again.

Did a bit of testing around, and I noticed a few things:

1.
Code: [Select]
   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.

EDIT:
Code: [Select]
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()". ???


2.
Jumping Bug in PyGG2
« Last Edit: October 13, 2011, 05:14:00 pm by Orpheon »
Logged

nightcracker

  • NC
  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 516
  • PyGG2 dev
    • NC Labs
Re: Porting GG2 to Python - PyGG2
« Reply #192 on: October 14, 2011, 12:30:15 am »

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.

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.
« Last Edit: October 14, 2011, 12:32:41 am by nightcracker »
Logged

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12532
  • Another one --
Re: Porting GG2 to Python - PyGG2
« Reply #193 on: October 14, 2011, 01:20:51 am »

>script kiddo
>does real programming
Logged

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

Nukleus

  • Guest
Re: Porting GG2 to Python - PyGG2
« Reply #194 on: October 14, 2011, 02:03:19 am »

I've just finished my first book on python, I'm looking into pygame now, hopefully I'll be able to contribute down the track
Logged
Pages: 1 ... 11 12 [13] 14 15 ... 77
 

Page created in 0.031 seconds with 48 queries.