Scrolling tiles?

NecrosaJoe
Unregistered
 
Post: #16
I love Metroid so much. ^_^ I beat it a couple of weekends ago. That felt gooood. (Want some more, Mother Brain!?)

I haven't used SpriteWorld, but... is it even necessary with Cocoa? We've got such easy methods like NSImage's "compositeToPoint:" and things like that.. I had a purely graphical 2-d tile-based RPG up and running in a couple of days- my first project of the sort, even.

So... It's easy to do complex things. ^_^ And, though i'm not advocating reinventing the wheel, it's good to know how to do them. It's a fun exercise. And one's components will be reusable if done properly. Yay!

-joie
Quote this message in a reply
WFleming
Unregistered
 
Post: #17
Sadly I can't speak for Cocoa (living on a college student's budget, so i't'll be at least another couple months before I'll finally be able to afford something I'd be comfortable running OS X on). So i'm stuck with Carbon for the time being (do have limited access to an OS X box for testing purposes at least). But I digress.

There are also a few other useful things in SpriteWorld, like collision detection and quite a few blitters, and ability to easily do things like translucency effects. SpriteWorld also has a really elegant interface.

However, I forgot to mention that you can't really do anything besides 2D games. Which is fine, if like in my case, that is all you need. It would also be really useful to the programming novice.


While i'm on the subject of spritekits there is a Cocoa Sprite Kit available (haven't personally checked it out but thought i'd add a link in case anyone was interested)

http://www.sugarcubesoftware.com/csk/
Quote this message in a reply
NecrosaJoe
Unregistered
 
Post: #18
I looked at CSK about a month ago- I ended up deciding that rather than learn the as-then-unfinished(is it done yet...?) CSK API, I'd rather just make my own. That way, I'd be more familiar with it, &c. I also found a dearth of CSK documentation... the project is promising, but not usable yet(at least, not by me). Besides... doing things like collision detection and drawing code is fun. ^_^

I hope you get into Cocoa. ^_^ Objective-C is easy to learn. 'Cocoa Programming' isn't. You have to familiarize yourself with a large API, and go about things in an OOP-ier way, and(I know from experience! Do it! DO IT!!) follow the Model-View-Controller paradigm nigh-religiously. It makes things easy and fast. Custom IT database solutions? No problem. Port of Final Fantasy? Easy. Do it once, do it right. ^_^ Reusable objects are good things. I'm going to keep spewing these cocoaisms if I don't stop myself.

-joie
Quote this message in a reply
Member
Posts: 269
Joined: 2005.04
Post: #19
The problem with Cocoa is that it is *sloooooooow*. A game made entirely in Cocoa will be unplayable on slower OS X machines (unless it's very non-demanding like Hooptie, and even Hooptie becomes unplayable when too many enemies are on the screen). As a simple comparison, on a G4 OS X machine I get around 80fps with a Cocoa sprite demo. With SpriteWorld 3 alpha, I get over 1000fps (numbers may be a little off as I ran these tests a few weeks ago). On a beige G3 OS X machine the Cocoa demo runs at an anemic 6-7fps. And that's only if you turn off all the pretty effects like rotation and translucency. And this is just a small demo with few sprites, no AI, no scrolling, etc.

Jaguar may improve things, as would using OpenGL. But requiring a high-power 3D card to run a fairly standard 2D game that the SNES could run with 1/10 the processing power seems a tad wrong.
Quote this message in a reply
NecrosaJoe
Unregistered
 
Post: #20
That's true. Cocoa is really, really slow. ^^;; but it's pretty! And it has a very pleasant drawing API. ^_^ But everyone wishes it were faster... Anyway, it still doesn't negate the benefits of doing things like collision detection and simple animation and scrolling by oneself at least once. ^^

-joie
Quote this message in a reply
Feanor
Unregistered
 
Post: #21
Quote:Originally posted by Bachus
But requiring a high-power 3D card to run a fairly standard 2D game that the SNES could run with 1/10 the processing power seems a tad wrong.

Yes Quartz (not just Cocoa) is in need of serious optimizations and other things. There's some info on drawing straight to the screen with GoreGraphics on Apple's web sites to speed things up, I believe. If you're using pure Cocoa AppKit to do a game, though, yeah, it's gonna be slow. It's not designed for FPS. Apple has announced that with X 10.1.5 they have added 2D acceleration for Rage Pro graphics -- that will definitely improve the results you are seeing on beige G3s with the stock Rage chip.

But saying that OpenGL is overkill, I don't know. The problem is really that Apple doesn't accelerate OpenGL on ... Rage Pro and earlier. Mostly it's because it gives people false hope. But 2D with OpenGL is easy and very nice looking -- it also runs very smoothly and avoids the need for custom blitters and the like. Apple has a cool 2D demo called RedRocket. You get many extra features like zooming with little extra investment.

I think it's going to be commonplace, though, for people doing shareware 2D games to use Cocoa as their interface and then do CoreGraphics drawing into their drawable. I don't know any Core Graphics but it is better to use it than QuickDraw, for sure. What does the OS X version of SpriteWorld use?

Necrosa, are you Joie from CocoaDev?

FÎanor
Quote this message in a reply
NecrosaJoe
Unregistered
 
Post: #22
Funny you mention it, Feanor- I am that joie. ^_^ I haven't been around CocoaDev for a while, though. I decided I should actually find out what I'm talking about before I go pedantifying. I've spent the last three days poring over the Portland Pattern Repository, learning about Smalltalk, studying, working, designing. I'm rewriting the game I mentioned earlier in this thread in a completely good and m-v-c way. (Did you know that 'Controller' in Smalltalk means something different than 'Controller' in Obj-C? In Obj-C, it's a mediator of sorts... and in Smalltalk I can't remember what it meant. But it's different. ^^;;)

Sometime I'll go back to cocoadev, and maybe write up a tutorial on scrolling/tile-based games if there isn't one already. Maybe on animation theory? I know some of that.

I haven't used CoreGraphics either, but for me, Quartz is fine- I don't need a lot of speed. If I were doing the Dragon Warrior animation style, I'd need even less.

Hey. it can only get faster, right? ^_^ And users need not recompile to gain speed, right? If that's not nice, I don't know what is.

-joie
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Tiles are weird Coin 2 3,252 Jan 30, 2005 05:39 PM
Last Post: Coin