VertPingouin

Members
  • Content count

    12
  • Joined

  • Last visited

Everything posted by VertPingouin

  1. Using python for mobile GameDev

    Pygame might have a version 2 in a near future with support of SDL2 with android and eventually ios support. But it's not ready to go yet.   Here is what was posted  on pygame mailing list last week.  
  2. Hello everyone,   I was trying to implement some sort of global directory for my game where all actors are registered with some tags. For example, all objects I need to update over timùe are tagged UPDATABLE, ennemies are tagged too... so with a simple getbytag function, I can get an iterable list of these, or single.   Groups are pre constructed when objects are registered to improve speed as I'm in python and it works pretty well.   But now, I wan't to implement a positionning grid and add some functions like : is_there_a(tag, direction distance) (returns True if there is an object with tag within a direction in a certain distance) get_the_nearest(tag, direction, distance) (returns gameobject) But I'm stuck with my first implementation, I had a dictionnary by object and a dictionnary by tag, but If I add a position criteria, it's naturally getting more like a relationnal database. Besides, I'll need to update positions maybe 2 or 3 times by seconds. Could be a performance bottleneck for sure...   My question is what data structure to use in this case. Maybe sqlite living in memory but in this case I've no idea how to store an object refernce in it, and no idea whatsoever of the perfs...   Thanks in advance for your answers !
  3. Game directory data structure

    For what I've tried, sqlite in memory seems affordable. For 50 objects I get the nearest object with a certain tag : results are thrown in less of 1/100 seconds. So doing it 2 or 3 times by seconds won't be an issue.
  4. Making Games is Hard

  5. Hi everyone,   This post is really like a message in a bottle, I not really looking for a unique absolute answer, more advises and game making wisdom !   For 4 months now I'm trying to develop an engine for a 2d action platformer with pygame library en pyopengl. I've got all the tools in terms of library but I'm really missing conception experience in object oriented programming. For now, I seem to go deeper every day, and the more I dig the more difficulties I encounter. I often restart for zero.   Thing is I don't really know how to describe my game actions in the first place so I run into programming just to realize that I forgot a huge thing. Now I'm stuck again (just forgot to implement an artificial intelligence decision system...)   The traditionnal object oriented methodology (user story, sequence diagram etc...) seems to not fit completly the conception needs for a game. So I ask you how you work !   When you start a new game engine totally from scratch (I mean no game maker or unity, not necessarily a very low level language), how do you plan your developpement ?   (For now it is just trial and error, but it's hard to ascertain wether or not I made a mistake sometime !)    
  6. General advises on conception of a game engine

      Yep (pong, arkanoid clone, simple platformer...), even it's almost 2 month I've not create something functionnal. I'm ok on some topics like collision, sprites, state machines and event handling (not enough on this last one !)... That's why I'm now stuck in conception problems. I know what to do, it's more a matter of where to do it and how to split repsonsabilities among my classes.     I have a precise and documented idea on how the game works... so I thought. For example, I worked hard on how the player behave, but not so much the ennemies, that's why they're now lacking a brain !   The next aim for me is to provide a functionnal level of my game. I think I'll need more specifications. Though my previous so called games were clearly "Creeping Featuritus" , I'll try to avoid that now (but all short sometimes !)
  7. General advises on conception of a game engine

    Thank you for your answers.   It makes me feel I'm on the right path (which was in fact what was behind my question I think !) The book suggested by axefrog is really great and I read things that also makes me feel I'm working the right direction.     I've indeed a precise idea of the game I'm developing. I spend much time writing down things on my white board !
  8. General advises on conception of a game engine

    Wow... well... that was a thousand pages advice ! I would have preferred a methodology or as the topic's title says general advises... no offense intended.   But, indeed, after reading some pages on amazon, it seems simple enough to pick some topics. I'll give it a go maybe.    My question is maybe too generic...
  9. Hi everyone, I'm having trouble designing my 2d engine when it comes to displaying animation. I'm not quite sure if what I do is good in terms of object oriented conception and I need a little advice on it. I've got thes objects : FrameSet : a set of frames, each frames contains picture to display, hitboxes (created from white rectangles in images) and movement vector. It is created based on a xml file which is pretty self explanatory :   <frameset> <framenumber>5</framenumber> <framewidth>17</framewidth> <frameheight>15</frameheight> <mode>loop</mode> <picturefile>test_picture.png</picturefile> <hitboxes> <hitbox file="test_hitbox0.png" name="body" /> <hitbox file="test_hitbox1.png" name="weapon" /> </hitboxes> <frames> <frame number="0" duration="2" /> <frame number="1" duration="1" /> <frame number="2" duration="3" /> <frame number="3" duration="4" /> <frame number="4" duration="1" /> </frames> <events> <kickvector frame="0" x="100" y="100" /> <fixvector frame="0" x="20" y="20" /> </events> </frameset> Animation : It has a FrameSet as attributet, it adds a clock to it and it provides proper information whenever it is called.   Activity : Instancied by gameobject when gameobject has a certain state, it applies information given by animation (self.target.picture = self.animation.getpicture(), self.target.move(self.animation.kickvector etc...)   GameObject : moving object in the game with movement vectors, statemachines and one activity. A game master clock asks it to update periodically. When it does, it updates the activity, which apply information got from animation to GameObject.     The problem with all thes objects is they're so tied together that not a single one is functional when took apart and I'm not sure this is the way to do this. Another thing is that I've got one clock per animation, but also have a master clock that would be sufficient but my game (cpuspinner with clock asking for draw and updates) never asks things directly to the animation.   Thanks for your help.
  10. What is game maker?

    Gamemaker has been really underestimated though it exists before the crazy indie game rush. GML scripting is indeed very well done. I tried it several years ago, then tried it now.   Except the exepensives new export function (html5, android... which I know is nearly mandatory), the application hasn't evolved much. It is still good, but I doubt its functionnality will grow aside of the exports.   If you want to make a little game quickly and learn some tricks at a scripting level, it is for you. If you really want to learn programming game to move forward to other, more complicated, tools or language, it may not be the best choice.
  11. Precision on StateMachines

    Hi everyone, I'v a little issue on how I should implement a state machine logic in my game. (as described in http://www.gamedev.net/page/resources/_/technical/game-programming/state-machines-in-games-r2982)   I'm programming a platformer and state machine logic seems fine for it except for one particular case. Let say I've three states for the player, idle, walk and attack idle is the beginning state. walk is triggered when pressing a direction and end when this direction is released or when another state is called. attack is triggered when attack button is pressed. All of thes states are neighbors from each other : each of them can transition to one another. But if I press a direction, then the attack button (without releasing direction), when attack state is expired, the character should transition back to walk. There's a bunch of solution tha crosses my mind for that but I'm not sure what's the best : character has an internal state walking or not triggered by direction down and direction up, which is used to choose the next state after attack. It seems a little clumsy as it is kind of a parallel state machine. adding an input event "direction pressed" in addition of "direction down" and "directionup" which is fired in event queue from the moment direction is pressed until it is released, walk event should be now triggered by this event. or other things I hevn't thought of. What do you think ?  
  12. Precision on StateMachines

    Thanks for thes enlightening answers. I know have a clearer vision of what I need to do :   2 state machines : action and movement (where attack is an action and walk a movement), and a bunch of activities corresponding to combination of states. A can have object can have of course only one activity at a time. Player start moving : action = Idle, movement = walk >> walk activity player pushes the attack button without releasing direction : action = attack, movement = walk >> attack activity attack animation ends, action return to idle and movement still = walk >> walk activity
  13. Precision on StateMachines

    Sorry, my bad, the link wasn't the intended one. I corrected it.   Thank you for you're answer, I'll look a deeper into it.   1,2) I consider more and more having two state machine because the case I described is not really the only one after all. I realized that in 2). As my game is 2d, there is actually two direction to attack so instead of just having an attribute facing left or facing right, it could be another state machine... Then I realized there are more states than I thought (attack while in mid air, facing left, right etc...). Even if sprite and hitboxes will be the same inverted, that's different states !    The fist would be conditionned by my movement vector (walking_right walking_left, falling, ascending...) The second by the input (attacking, jumping, countering etc...). Another way to do things when I look at 3), is having more states with different default next state. In my case, a attack (idle neighbor) that leads to idle state and a walkattack (neighbor of walk) that leads to walk state, even if these two states are resulting in the same animation...   4) The stack thing is tempting but seems too generic for what I want to acheive. I'll think of it if I ever tried to do a versus fighting game ! 5) I really want it to be explicit because I'm working in collaboration with another game designer, who's not a programmer at all.     States machines are more complex than I thought, but I still stick to it because I feel it might prevent complex bugs (which is worse !).