Why is programming taking so dang long for me nowadays?

You can talk about almost anything that you want to on this board.

Moderator: Moderators

psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: Why is programming taking so dang long for me nowadays?

Post by psycopathicteen »

So do you mean, objects pointing to another structure that has the metasprite/sprite information?
Stef
Posts: 263
Joined: Mon Jul 01, 2013 11:25 am

Re: Why is programming taking so dang long for me nowadays?

Post by Stef »

Exactly, Enemy for instance, is a specific Object, and any Object own a reference on a Sprite structure (which deal about handling the visual part).
For instance in SGDK the Sprite structure is just about displaying (meta) sprite, and so dealing about VRAM / hard sprite allocation / handling animation etc... but in my view in any game, we should have a more generic Object structure / class which allow to handle IA, logic, ... stuff and this Object structure own a reference on a Sprite internally which handle the display.

Here's the Sprite (and dependencies) structure of SGDK :

Code: Select all

/**
 *  \brief
 *      VDP sprite info structure for sprite resource definition.
 *
 *  \param y
 *      Y offset for this VDP sprite relative to global Sprite position plus 0x80 (0x80 = 0 = no offset)
 *  \param size
 *      sprite size (see SPRITE_SIZE macro)
 *  \param numTile
 *      number of tile for this VDP sprite (should be coherent with the given size field)
 *  \param x
 *      X offset for this VDP sprite relative to global Sprite position plus 0x80 (0x80 = 0 = no offset)
 */
typedef struct
{
    s16 y;          // respect VDP sprite field order
    u16 size;
    s16 x;
    u16 numTile;
}  VDPSpriteInf;


/**
 *  \brief
 *      Sprite animation frame structure.
 *
 *  \param numSprite
 *      number of VDP sprite which compose this frame
 *  \param vdpSpritesInf
 *      pointer to an array of VDP sprites info composing the frame (followed by H/V/HV flipped versions)
 *  \param collision
 *      collision structure
 *  \param tileset
 *      tileset containing tiles for this animation frame (ordered for sprite)
 *  \param w
 *      frame width in pixel
 *  \param h
 *      frame height in pixel
 *  \param timer
 *      active time for this frame (in 1/60 of second)
 */
typedef struct
{
    u16 numSprite;
    VDPSpriteInf **vdpSpritesInf;
    Collision *collision;
    TileSet *tileset;
    s16 w;
    s16 h;
    u16 timer;
} AnimationFrame;

/**
 *  \brief
 *      Sprite animation structure.
 *
 *  \param numFrame
 *      number of different frame for this animation
 *  \param frames
 *      frames composing the animation
 *  \param length
 *      animation sequence length
 *  \param sequence
 *      frame sequence animation (for instance: 0-1-2-2-1-2-3-4..)
 *  \param loop
 *      frame sequence index for loop (last index if no loop)
 */
typedef struct
{
    u16 numFrame;
    AnimationFrame **frames;
    u16 length;
    u8 *sequence;
    s16 loop;
} Animation;

/**
 *  \brief
 *      Sprite definition structure.
 *
 *  \param palette
 *      Default palette data
 *  \param numAnimation
 *      number of animation for this sprite
 *  \param animations
 *      animation definitions
 *  \param maxNumTile
 *      maximum number of tile used by a single animation frame (used for VRAM tile space allocation)
 *  \param maxNumSprite
 *      maximum number of VDP sprite used by a single animation frame (used for VDP sprite allocation)
 *
 *  Contains all animations for a Sprite and internal informations.
 */
typedef struct
{
    Palette *palette;
    u16 numAnimation;
    Animation **animations;
    u16 maxNumTile;
    u16 maxNumSprite;
} SpriteDefinition;

/**
 *  \brief
 *      Sprite structure used by the Sprite Engine to store state for a sprite.<br>
 *      WARNING: always use the #SPR_addSprite(..) method to allocate Sprite object.<br>
 *
 *  \param status
 *      Internal state and automatic allocation information (internal)
 *  \param spriteDef
 *      Sprite definition pointer
 *  \param animation
 *      Animation pointer cache (internal)
 *  \param frame
 *      AnimationFrame pointer cache (internal)
 *  \param animInd
 *      current animation index (internal)
 *  \param frameInd
 *      current frame animation index (internal)
 *  \param seqInd
 *      current frame animation sequence index (internal)
 *  \param timer
 *      timer for current frame (internal)
 *  \param x
 *      current sprite X position on screen
 *  \param y
 *      current sprite Y position on screen
 *  \param depth
 *      current sprite depth (Z) position used for Z sorting
 *  \param attribut
 *      sprite specific attribut and allocated VRAM tile index (see TILE_ATTR_FULL() macro)
 *  \param visibility
 *      visibility information of current frame for each VDP sprite (max = 16)
 *  \param VDPSpriteIndex
 *      index of first allocated VDP sprite (0 when no yet allocated)<br>
 *      Number of allocated VDP sprite is defined by definition->maxNumSprite
 *  \param frameNumSprite
 *      the number of VDP sprite used by the current frame (internal)
 *  \param lastVDPSprite
 *      Pointer to last VDP sprite used by this Sprite (used internally to update link between sprite)
 *  \param data
 *      this is a free field for user data, use it for whatever you want (flags, pointer...)
 *  \param prev
 *      pointer on previous Sprite in list
 *  \param next
 *      pointer on next Sprite in list
 *
 *  Used to manage an active sprite in game condition.
 */
typedef struct _Sprite
{
    u16 status;
    u16 visibility;
    const SpriteDefinition *definition;
    Animation *animation;
    AnimationFrame *frame;
    s16 animInd;
    s16 frameInd;
    s16 seqInd;
    u16 timer;
    s16 x;
    s16 y;
    s16 depth;
    u16 attribut;
    u16 VDPSpriteIndex;
    u16 frameNumSprite;
    VDPSprite *lastVDPSprite;
    u32 data;
    struct _Sprite *prev;
    struct _Sprite *next;
} Sprite;

As you can see, it's already quite a beast but here you have the "live" Sprite structure as well as the sprite definition structure (the one that should stay in ROM, to define a sprite with its animations and frames).
Still that sprite structure just handle the sprite display, nothing else. I think it's better to separate both so you can minimize your Sprite size object for your sprites functions.
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: Why is programming taking so dang long for me nowadays?

Post by psycopathicteen »

Oh boy, I added a new boss character, and it's flickering like crazy. It's a wolf who walks on four legs, so I think I need to make the torso smaller. If that doesn't work I'll have to do more cutting around the main character's sprite.
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: Why is programming taking so dang long for me nowadays?

Post by psycopathicteen »

I thought of another reason why this year has been sluggish with programming. My Dad retired earlier this year, and so he is home more, and I don't get as much time on the main computer in my house.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Why is programming taking so dang long for me nowadays?

Post by tokumaru »

Are your parents also opposed to you getting your own computer? If you have your own laptop you'll never have to worry about someone hogging the computer ever again.
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Why is programming taking so dang long for me nowadays?

Post by tepples »

tokumaru wrote:Are your parents also opposed to you getting your own computer?
The parents might oppose not the computer specifically as much as the job to afford one.
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: Why is programming taking so dang long for me nowadays?

Post by psycopathicteen »

I have my own laptop. The front room computer has better colors though.
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: Why is programming taking so dang long for me nowadays?

Post by psycopathicteen »

During winter break I had to binge program to finish up everything I started in 2017.
https://www.youtube.com/watch?v=mDr5zHlyLSw

I mentioned a while ago about turning Alisha's Adventure into a run'n'gun game, and last year I did do some run'n'gun animation for Alisha but I held off on it because I couldn't think of a way to implement it. The hard part is having so many different animation combinations of every move, plus each shooting direction. This might sound really hacky, but I think I'll make a subroutine that takes the current "metasprite request" register, compares it with a bunch of possible values, and replace the data with corresponding "while shooting" variant.
User avatar
Bregalad
Posts: 8055
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re: Why is programming taking so dang long for me nowadays?

Post by Bregalad »

tokumaru wrote:You're getting old, I guess... It seems that at as time goes by and we become more experienced, our enthusiasm decreases for whatever reason.
Man this is quite an understatement... Since a couple of years or so I am so incapable of programming anything even simple that I feel mentally disabled whenever I try, which leads to a vicious circle of not being motivated to program anymore, etc...

And this is coming from someone who just used to love programming as a hobby a couple of years ago.
User avatar
GradualGames
Posts: 1106
Joined: Sun Nov 09, 2008 9:18 pm
Location: Pennsylvania, USA
Contact:

Re: Why is programming taking so dang long for me nowadays?

Post by GradualGames »

psychopathicteen, you're a brilliant programmer if you can make snes demos like this. I now am aware of at least 3 people in the homebrew scene who have no college degree and who basically showed their homebrew work to prospective employers and landed jobs in the it/software engineering field. Even though its not directly relevant it has that "wow" factor and says: "This guy can LEARN HARD THINGS." in spades. If you want to get a job and start a life outside your parents' home I personally think it is within your grasp.
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: Why is programming taking so dang long for me nowadays?

Post by psycopathicteen »

GradualGames wrote:psychopathicteen, you're a brilliant programmer if you can make snes demos like this. I now am aware of at least 3 people in the homebrew scene who have no college degree and who basically showed their homebrew work to prospective employers and landed jobs in the it/software engineering field. Even though its not directly relevant it has that "wow" factor and says: "This guy can LEARN HARD THINGS." in spades. If you want to get a job and start a life outside your parents' home I personally think it is within your grasp.
Thanks. What jobs would I be able to get?
User avatar
GradualGames
Posts: 1106
Joined: Sun Nov 09, 2008 9:18 pm
Location: Pennsylvania, USA
Contact:

Re: Why is programming taking so dang long for me nowadays?

Post by GradualGames »

psycopathicteen wrote:
GradualGames wrote:psychopathicteen, you're a brilliant programmer if you can make snes demos like this. I now am aware of at least 3 people in the homebrew scene who have no college degree and who basically showed their homebrew work to prospective employers and landed jobs in the it/software engineering field. Even though its not directly relevant it has that "wow" factor and says: "This guy can LEARN HARD THINGS." in spades. If you want to get a job and start a life outside your parents' home I personally think it is within your grasp.
Thanks. What jobs would I be able to get?
I can't make any guarantees for anybody, but my expectation is that you may be able to get in to an entry level software engineering job. Given your experience with assembly, you could probably pick up java or C# or php or what not on the job. Entry level positions often don't care that much if you have a lot of depth of experience in the specific field they are hiring for. I didn't know a lick of C# when I got my first job, I did know a tiny bit of C and BASIC though and could show them personal projects I made. They were just happy to see I was eager to learn and that I was able to program, period. Employers vary a lot in their interview style. If you can find one who is interested in seeing your personal projects, it should be impressive to many of them. The type of work available out there is typically something kinda sorta boring maybe? Involving forms and databases and what not, but it can be interesting work if you have the right attitude.

There's all kinds of other types of work out there too, you may wish to seek additional advice on this matter wherever you can find it. After all I don't know very much about you personally except what you've chosen to share here on this forum.
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: Why is programming taking so dang long for me nowadays?

Post by Oziphantom »

Bregalad wrote:
tokumaru wrote:You're getting old, I guess... It seems that at as time goes by and we become more experienced, our enthusiasm decreases for whatever reason.
Man this is quite an understatement... Since a couple of years or so I am so incapable of programming anything even simple that I feel mentally disabled whenever I try, which leads to a vicious circle of not being motivated to program anymore, etc...

And this is coming from someone who just used to love programming as a hobby a couple of years ago.
This is the Snr Coders dilemma.
What you love about coding, is working out and solving problems. When you are jr everything is something that needs to be worked out and you spend more time on the problem than you do on the making a .h/.cpp file, writing the docs, pushing pull things of a stack, working out which bank to put it in etc all the "leg work".. as you get more experienced, solving the problem becomes easier and easier till you hit the point where you know how to do it all, and you spend a few minutes on the problem but the legwork doesn't change, so now the fun to leg ratio is 1:100 when before it was 3:2
User avatar
GradualGames
Posts: 1106
Joined: Sun Nov 09, 2008 9:18 pm
Location: Pennsylvania, USA
Contact:

Re: Why is programming taking so dang long for me nowadays?

Post by GradualGames »

Oziphantom wrote:
Bregalad wrote:
tokumaru wrote:You're getting old, I guess... It seems that at as time goes by and we become more experienced, our enthusiasm decreases for whatever reason.
Man this is quite an understatement... Since a couple of years or so I am so incapable of programming anything even simple that I feel mentally disabled whenever I try, which leads to a vicious circle of not being motivated to program anymore, etc...

And this is coming from someone who just used to love programming as a hobby a couple of years ago.
This is the Snr Coders dilemma.
What you love about coding, is working out and solving problems. When you are jr everything is something that needs to be worked out and you spend more time on the problem than you do on the making a .h/.cpp file, writing the docs, pushing pull things of a stack, working out which bank to put it in etc all the "leg work".. as you get more experienced, solving the problem becomes easier and easier till you hit the point where you know how to do it all, and you spend a few minutes on the problem but the legwork doesn't change, so now the fun to leg ratio is 1:100 when before it was 3:2
It seems to me one can continuously increase the scope and complexity of what one is working on, augmenting the challenge of what one has achieved previously. Programming/game development can be made arbitrarily hard if one is feeling bored. I think about my dad, who has been a math professor since 1970, he still hasn't retired and still has new challenges. I feel programming/game development can be the same way, it's all about attitude.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Why is programming taking so dang long for me nowadays?

Post by tokumaru »

I do get the fun to legwork ratio thing, but I don't agree that the legwork didn't change... the truth is that I didn't care about the boring stuff at all when I was younger! As long as the on-screen results were good, I couldn't care less about how things were under the hood. Everything was fun because everything immediately translated into on-screen results. As I got older, I started caring about standards and good practices, and only then did the legwork become a problem.
Post Reply