Thinking about what to do next. (While thinking about how to optimize the
overdraw eliminating parallax scroller…
Probably a sprite example based on code ripped from my upcoming Project
Spitfire port, but do I focus on the rendering or the control system, or
perhaps something else?
I’ve seen a few articles on scrolling, tiles advanced multilayer map
techniques, sprites and all sorts of other things, but very little on how to
get these subsystems to work together in a real game. It’s pretty easy to
hack a program that bounces some sprites around (especially using SDL! :-),
but it gets a lot more complicated when it’s time to get them to interact
with eachother, the map and the player, and even more so when it’s time to
render them on top of (or in the middle of!) a parallax scrolling background.
On this level, everything I’ve seen has been very basic, and there’s usually
no source code demonstrating how the more interesting/complicated problems
are solved. I’ve seen theory on how to implement advanced 3D physics engines,
but no practical example of implemanting the much simpler “physics” of a
Break-Out style game…
In short, 2D games programming seems to be a fogotten art form, known only by
the ones who created it back in the 8 and 16 bit days. Those who know the
basics seem more interested in discussing advanced 3D programming these days,
so there’s no way in for the beginner… The result is slow 2D games using
brute force rendering methods, if there is any result at all!
Oh well, where do I start? What’s the first problem that stops the beginner
from getting sprites to do something useful (ehrm… on the screen?
I think that it’s more often the spaghetti around the control “system”,
than it is getting the sprites rendered properly. Animation also seems to be
problematic, although that might have to do with the amount of work required
to create the artwork for it.
Collision detection is handled by some libraries, but it might be a good idea
to cover shortcuts that might help games with lots of objects a great deal.
(As an example, Project Spitfire has a special pixel/sprite collision
detection call, as an alternative to the much heavier full sprite/sprite
method. Works fine, and makes the game feel less over sensitive as a bonus
effect.)
Has anyone ever seen the source of something like the contol systems used in
the 8 and 16 bit games? I’m interested in how it was possible to make control
systems feel that accurate and powerful with that limited CPU power - and it
all being written in asm… The C64, for example, couldn’t have had much time
left when doing a scroller and multiple sprite reuse at full frame rate, but
it still did keep track of every single sprite. Look at Armalyte, for
example. How does it keep track of the “reused” sprites [it has >8 sprites on
screen at the same time] when it comes to collisions?
I’d like to answer a few questions that can make the difference between a
playable game and a pure source of frustration;
* How do I check for collisions?
* How do I get objects to react properly to collisions?
* What actually makes a game feel truly *interactive*?
* How do I keep animations in sync with movement, even
when movement is controlled by "external" events?
* How to chain objects into "dragon necks" and similar
classical arcade game effects?
* How do I make an object "walk around" the map?
* How to keep helper droids from walking/flying through
walls and enemies? (Well, they might be *supposed* to
do the latter sometimes... :-)
* How do I program a homing missile? ;-)
Further, I’d also like to address advanced audio/video integration and other
issues that seem to be totally ignored in anything but commercial top titles.
Why doesn’t anyone play anything more interesting that music + one-shot
sampled sound effects? With the CPU power we have nowadays, there should be
no problem having every single event affect the sound effects dynamically;
space ships should have engine sound that’s directly affected by the movement
of the ship, doppler effect etc.
I’ll probably just hack away on something basic and simple related to this,
but I’m open to suggestions. Of course, the opinions I’m mostly interested in
are those of people who hasn’t already done all of this - that is, the
opinions of those who need the examples!
As to the rest of us, who have already seen and done everything ;-), I think
this “SDL programing examples” effort could serve as a common ground for more
advanced stuff, such as the things mentioned above. (Some of it applies to 3D
games as well, but it’s usually a lot easier to understand and experiment
with the methods in 2D first.) Something like a cut’n’paste code resource for
serious game projects…
It might turn into a bunch of libs for SDL, but that doesn’t necessarilly
work for everything and everyone - small working examples might be more
useful in some cases.
//David
.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------> http://www.linuxaudiodev.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |
--------------------------------------> david at linuxdj.com -’