Author Topic: Basic 2d game dev resources  (Read 708 times)

TheOldMan

  • Hero Member
  • *****
  • Posts: 958
Re: Basic 2d game dev resources
« Reply #15 on: August 08, 2013, 04:35:06 PM »
Quote
what i dont have a concept of is Game algorithms, eg dealing with gravity and velocity ...
You know how to move a sprite, correct? You add an increment to the current position to get a new position...

So, what if your increment is a variable (as opposed to a constant)? In response to the joystick presses, you update the increment variable, which then gets added to the sprite position. That's how velocity and gravity are usually done (though gravity decrements the increment variable, so you rise less and less)
The other option (which allows for fine tweaking) is to use tables. On this step, add this... works surprisingly well, and is easy to code.

Both of these methods can be quite convincing, especially if you use fixed-point values

Quote
or understanding collisions
Bounding box is simple and quick, especially for squarish sprites. Pixel collision is expensive, but if you understand boolean operations, you can test a whole row of pixels as easily as testing each individual one. The downside is setting up the correct masks.
An interesting alternative to bounding boxes is to use distance measurements. No, you don't -have- to sacrifice cycles to square things either. Comparison of the X and Y differences to a known 'hit distance' can be just as effective.

The real question, though, is how you set the origin of your sprites. From experience, using center-based coordinates works better in many cases, and leads to simpler algorithms. If needed , you can always convert to a corner based origin with a simple add/subtract.

Quote
Right now i understand and have done the basics with Yaroze ( PSX Dev in C ),
Wow. There's one I haven't heard in a while. I played with that for a couple of months, but the way the libraries and such were set up was pretty limiting, iirc. I eventually 'upgraded' to the hacked libraries. I still don't understand the decision behind those wierd fixed point numbers....

Quote
Arkhan Himself can code well in 6502 but has the impression it's for brain damaged coders....
Not really. He's from a generation that started with C, so that's more natural to him. He's used to some things being taken care of for him (Adding an int takes 2 adds? And you have to clear the carry first? Why?) What he does have a problem with is the fact that it's more difficult to debug assembler. You usually have to step through it with a debugger, instead of printing values to see what went wrong. That just takes too much time for him :)

[ Just for reference: I started with Basic, then moved to 6809 asembler. When C came out, I learned it - and liked it enough that it's my preference of languages. A full C compiler makes state machines as easy as doing them in assembler. Unfortunately HuC is not a full C compiler. I miss int  (*(move[]))()....or whatever the exact syntax is. I haven't done it in a while :)]

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Basic 2d game dev resources
« Reply #16 on: August 08, 2013, 05:54:07 PM »
Truth be told, I didn't mind 6502 on the C64 and Apple II that much at all.  The zero page and indirect indexed indirecty direct addressing is a bit out there, but other then that, it's pretty doable.

The problem with doing 6502 on PCE is that the development tools are a bit lacking.   There sure as shit isn't anything as nice as the final cartridge for it, so it makes doing everything a bit more annoying.

As far as assembly goes, I prefer the z80.  *shrug*.   It's funny too, because I learned that one second.   Having the 6502 load instructions modify flags really pisses me off.  It always has.


Either way though, yes, I started with C++.  Not even C!  So, my roots are there, and it's what I am most comfortable dealing with.


mrhaboobi, if you want to get a decent grasp of 6502 assembly, there are only two books I can recommend.

One is called Assembly Lines.  It's Apple II oriented, but covers 6502 just fine.

The other is "Machine Language for the Commodore 64 and Other Commodore Computers".   It's most commonly referred to as "The Butterfield Book".


Either one of those books (or both) will be the best things you can possibly do to learn how to program assembly. 
[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.

mrhaboobi

  • Hero Member
  • *****
  • Posts: 693
Re: Basic 2d game dev resources
« Reply #17 on: August 11, 2013, 09:45:42 AM »
thanks guys for the input.. :)  will check out those books.

Oldrover.  I still like Yaroze, mainly because i played with it so many many years ago, the psyq ( pro ) dev kit is now floating around, so you can actually do alot more than with yaroze if you want .. PSX dev is starting to pick up again..


Looking for (MINT ONLY)
US Manual : Magical Chase, Shockman 
US Box : Turrican,  Soldier Blade, New Adventure Island, Neutopia II
Other : Sapphire OBI, Turbo Play Aug/Sept 90, April/May 92, Turbo Edge Spring 90

PC Engine Special Cards : Bomberman User Battle

Alydnes Super Grafx