IC Forum Archive
Full text search
Slingshot-puzzle/action!Gamedesign&programmingadvicePLZ
   IC Forum Archive Index -> King of Development XI: Eyes of Burning Indie Go to page: 1
Author Message
ecchi



Posts: 148

PostPosted: Mon Aug 14, 2006 4:15 am    Post subject: Slingshot-puzzle/action!Gamedesign&programmingadvicePLZ

Sorry about the subject line, it just wouldn't fit.

Anyway, I decided to install SDL yesterday and I started a game with it. Maybe a little ambitious, especially considering the only other things I've made are PHP MySQL helpers and C++ sudoku solvers, but things have been going pretty well so far.

The game is called Slingshot, and my main inspiration was Orbital from the GBA Bit Generations series. The attract/repel mechanic is near-identical, but much faster and stronger. Instead of slowly picking up other planets, though, the game is about using gravity to propel oneself to a goal. Or into orbit around a goal. Or something. I haven't really gotten that far yet. How far have I gotten?



The red rectangle is the player, and the greens are non-moving planets. Attraction/repulsion works and the player can fly out into infinity -- the levels can be as large as I want.

I'm not sure of the best way to handle this game, though, from a design standpoint. Should I remove the repulsion ability and focus solely on the attraction? I think that could end up making the game much easier to balance. Should the field be done in the wraparound style of Orbital/Asteroids or should there be designated boundaries? I am leaning towards the latter. Would it be an appropriate goal to crash into an ending planet, or should I require that the player stay in a certain zone for a long enough time? Should there be any obstacles other than the planets? Heat-seeking missiles/comets like in N could be fun, especially if they were effected by your gravitational field.

Speaking of N, the Flash ninja game, I'd like to incorporate internet time rankings and a built-in level editing/sharing system.


TECHNICAL QUESTIONS:
Right now everything that makes up a level is hard-coded. Would it be worth it to use some sort of XML-parsing library to simplify the save/load process, or should I just roll my own crappy thing? Also, when loading an arbitrary number of planets, I would probably want to use a linked list, right?

Is using pure SDL going to hold me back in terms of visual appearance? Every game I can recall that used SDL for graphics looked pretty lame. Is that an issue of bad artists/programmers or are decent-looking sprite animations out of the question?


I think that's it for now. Thanks for any advice!!
Back to top
Screwtape



Posts: 81

PostPosted: Mon Aug 14, 2006 5:34 am    Post subject: Re: Slingshot-puzzle/action!Gamedesign&programmingadvice

ecchi wrote:
I'm not sure of the best way to handle this game, though, from a design standpoint. Should I remove the repulsion ability and focus solely on the attraction? I think that could end up making the game much easier to balance.

Well, that depends on what feeling you're trying to evoke. Try both, see which you like better!

Off-the-top-of-the-head guesses: with both attraction and repulsion, the player has an 'oh no!' button they can use to get themselves out of bad situations, and the game could well be faster and more dynamic. With only attraction, once you've committed to a course there's no going back, so your game will have to cater to slow, methodical play, and perhaps give players an advantage by using static levels (that they can memorise, rhythm-game-style).

Should the field be done in the wraparound style of Orbital/Asteroids or should there be designated boundaries? I am leaning towards the latter.

Orbital, at least, has a very indirect feel - I can nudge the planet, but not really control it. If it extended into infinite space, it would be very, very easy for the player to slingshot off to nowhere, with no hope of recovery (because there's nothing to 'catch' him/her) - I think that would be pretty frustrating, myself. Also, if the player *does* scoot off to the inky void, they've instantly got no reference points and can't easily make their way back to where they're supposed to be.

On the other hand, there's probably a school of thought that says that a wraparound universe is too cheesy, and the sheer emptiness of space can only properly be portrayed with a planar, infinite universe. To counter the 'getting lost' factor, you might use 'arcade physics' to make the player always get pushed back towards the centre where the fun is (picture ball-bearings in a bowl).

A third possibility is a finite, bounded universe - if you go too far, the game stops and you have to start again.

Would it be an appropriate goal to crash into an ending planet, or should I require that the player stay in a certain zone for a long enough time?

When I first read what you were trying to do, I imagined the goal would involve swinging past a bunch of set planets until you could reach some kind of goal - say, a black-hole to the next level.

Achieving orbit might also be a worthy goal, assuming you don't use Orbital's auto-orbiting system.

Another goal might be Orbital-style cleaning up debris, or clobbering enemy spy satellites. Or swinging around enough objects to achieve 88MPH so your time-machine works.

Should there be any obstacles other than the planets? Heat-seeking missiles/comets like in N could be fun, especially if they were effected by your gravitational field.

It has occurred to me that, in swinging past, you might disturb the orbits of other things, so that they run into each other and explode, providing you with another kick of speed.

TECHNICAL QUESTIONS:
Right now everything that makes up a level is hard-coded. Would it be worth it to use some sort of XML-parsing library to simplify the save/load process, or should I just roll my own crappy thing?

Uh, yuk, XML. Far more trouble than it's worth, in most situations. If worst comes to worst, you can just write binary files pretty easily, as long as you're careful about endianness (or don't care about making all the Mac PPC users frown pitifully at you). Writing a lexer/parser for your own custom text-based level format shouldn't be too hard either, especially if you know (or take the time to learn) lex/yacc.

Also, when loading an arbitrary number of planets, I would probably want to use a linked list, right?

If your file-format includes 'number of planets' before the actual planet data, you might as well use an ordinary array, unless you're going to be adding and removing planets at run-time.

Is using pure SDL going to hold me back in terms of visual appearance? Every game I can recall that used SDL for graphics looked pretty lame. Is that an issue of bad artists/programmers or are decent-looking sprite animations out of the question?

SDL is basically a system for splatting pixel surfaces at each other. You've got one big pixel surface called 'the display', and as many other pixel surfaces as you like; loaded from files, created at run-time, whatever. You can choose to call the odd-shaped surfaces 'sprites' and the square ones 'tiles', or you can make up your own names for them. If most of the SDL games you've seen look like crap, well, that's probably Sturgeon's Revelation at work.

EDIT: On the subject of 'SDL games look crap', here's a screenshot of my own "teach yourself SDL" game: Isotetanus.png

Well, I think it's pretty, anyway.
Back to top
ecchi



Posts: 148

PostPosted: Mon Aug 14, 2006 2:33 pm    Post subject:

That was pretty helpful!

A third possibility is a finite, bounded universe - if you go too far, the game stops and you have to start again.

This is actually what I meant I wanted to do. My universe is only infinite right now because I built in the capability for the background texture to scroll forever, independently from whatever mechanic I chose. I'm imagining that once you get too far out (arbitrarily set by level designer, but I'll probably choose places close to the point of no return) the screen starts changing colors and a warning appears before you are respawned.

I like your black hole idea! Maybe I will have multiple forms of goals, and each level can have its own. Before handing control to the player, the camera will pan to it and have one of those "CHECK ->" arrows.

I think I will stick with just attraction. Repulsion worked in Orbital because it's so slow and weak, but here it's simply too powerful. Maybe I will make it a smaller multiplier (-.25 of the force instead of -1) and see if that fixes the problem.

Also: your game looks pretty neat! It has renewed my faith in SDL.
Back to top
ecchi



Posts: 148

PostPosted: Wed Aug 16, 2006 5:24 am    Post subject:

Using this as a dev-journal of sorts, just to track my own progress. Hope that's okay.


I was burned-out on gameplay coding so I added graphics even though I'm not sure if the game will be fun. It's been decided that the player controls a moon that doesn't fit in with his solar system, so he sets off to find a new one. These graphics don't really mesh with that (and are ugly) so they probably will not stay, but it's all just .pngs specified by the level designer so no biggie. The moon slowly rotates based on its velocity.

I turned down repulsion's force to .05 times attraction's and it seems to work better. I may also limit its usage with a replenishing bar or something.

My friend made a couple music tracks that may or may not work!
Back to top
Screwtape



Posts: 81

PostPosted: Wed Aug 16, 2006 6:53 am    Post subject:

ecchi wrote:
Using this as a dev-journal of sorts, just to track my own progress. Hope that's okay.

Your words intrigue me, and I wish to subscribe to your dev-journal.

I mean, heck, it's not like anybody else is posting in the dev-forum. :(

Actually, I made this post to ask a simple question: if/when your game reaches a point where you're happy for other people to play it, are you likely to release the source-code so us hippie Linux/OS X types can join the fun?
Back to top
dessgeega



Posts: 3317

PostPosted: Wed Aug 16, 2006 8:42 am    Post subject:

ecchi wrote:
Using this as a dev-journal of sorts, just to track my own progress. Hope that's okay.


use you water to drink and food to eat?

(by which i mean of course it's okay, silly.)
Back to top
ecchi



Posts: 148

PostPosted: Wed Aug 16, 2006 4:18 pm    Post subject:

Screwtape wrote:
if/when your game reaches a point where you're happy for other people to play it, are you likely to release the source-code so us hippie Linux/OS X types can join the fun?

Actually, yes, I was planning on doing exactly that, for exactly that purpose! Though, my code is really really really ugly so I don't really want anyone to see it...

I don't think I'm doing anything VC++/Windows-specific, so it'd just require getting SDL to work and compiling.

Hopefully the game ends up being fun enough to make it that far!
Back to top
Mr. Business



Posts: 1530

PostPosted: Wed Aug 16, 2006 9:59 pm    Post subject:

It should, perhaps, be noted that ABA Games uses SDL on all of its games, which look pretty good from my experience (though that's probably not related to the use of SDL).
Back to top
ecchi



Posts: 148

PostPosted: Wed Aug 16, 2006 11:58 pm    Post subject:

He uses OpenGL for rendering, though -- that's why I asked. Whatever happens with this, my next project will probably be to teach myself OpenGL.
Back to top
ecchi



Posts: 148

PostPosted: Mon Aug 21, 2006 6:23 am    Post subject:

Took a break for a few days, then hunkered down and gave myself a gigantic headache with the level-loading code. Teaching myself the proper syntax for creating pointers to arrays of pointers to objects and then loading those objects from a file was pretty awful, but now loading works! The file format is terrible (plaintext) but it works and that's really all I care about right now. That lex/yacc stuff is a little too complex for me right now.

Next: level editor, field boundaries and goal code!
Back to top
ecchi



Posts: 148

PostPosted: Tue Sep 05, 2006 11:33 pm    Post subject:

I took a week off, then got sick, then finally got back to this and worked really hard only to realize that my program design really sucked. So I rewrote a lot of stuff to use linked lists, making the level editor much easier to implement. So... it's now implemented -- you can interrupt gameplay at any time by hitting an arrow key, place/remove planets, then resume the game/save the level. I also fixed a bunch of stuff that made the game feel sluggish.

I've run into a problem, though!

It's really hard to tell where, exactly, you're supposed to go. My idea was to create some sort of visual indicator of planet locations. The first draft of this idea looked like this:


In case you can't tell, each planet has a transparent circle radiating out of it. But this destroys the framerate, as SDL sucks at lots of alpha transparency. So my current idea is to have stars in the background, with different densities based on how close they are to a planet. I just don't really have any good idea on how to implement that. Any ideas?
Back to top
Mr. Business



Posts: 1530

PostPosted: Tue Sep 05, 2006 11:50 pm    Post subject:

Welp, here's a very vague idea.

You build some sort of particle engine for the stars. This particle engine will take the generic star graphic and increase the size (and maybe brightness) based on proximity to a planet. You could just calculate the distance from a planet by means of pythagorean theorem, or something like that, maybe. I'm not really sure.

I'm sure that someone else can think of a better way to do it.

I'm sorry to hear that SDL sucks for alpha.
Back to top
ecchi



Posts: 148

PostPosted: Wed Sep 06, 2006 12:41 am    Post subject:

That's basically what I was thinking -- something like any given coordinate has a point value equal to the sum of 1/(distance from each planet), and then I'd randomly sprinkle stars in some intuitive way that makes higher-scoring areas more noticable. But that 'intuitive way' is what's giving me problems, as making a star "brighter" would require alpha (can't do) or a bunch of different images... which, come to think of it, might be doable if they're small.

I'm weary of doing the scaling thing, though, unless it's really subtle. I'll see what happens.

edit: Or, maybe, I'll do some sort of "weighted random" thing -- randomly sprinkle, say, 100 particle-stars in the area of radius 100 - 200 pixels, then 100 more in 200-300, etc. Note to self: use polar coordinates! Perhaps your size/brightness thing can be incorporated also.
Back to top
vision



Posts: 472

PostPosted: Wed Sep 06, 2006 12:51 am    Post subject:

I think a dashed line between planets would work. You'd see perhaps Earth with four dashed lines jutting off into space indicating the four closest planets are in those directions. The lines could be of different width or alpha based on the distance to the linked planet.

I think that if done subtly, that might work very well towards what you are trying to accomplish.
Back to top
exodus



Posts: 385

PostPosted: Wed Sep 06, 2006 4:09 pm    Post subject:

I haven't read all of this, but you should check out WireRobo, a doujin game mentioned on ic back in uhhhhhhh 2003.

It's certainly not precisely what you're doing, but is an interesting take on the attraction thing.

http://nepiaworld.com/menu/works/wr/
Back to top
Mr. Business



Posts: 1530

PostPosted: Wed Sep 06, 2006 5:51 pm    Post subject:

ecchi wrote:

edit: Or, maybe, I'll do some sort of "weighted random" thing -- randomly sprinkle, say, 100 particle-stars in the area of radius 100 - 200 pixels, then 100 more in 200-300, etc. Note to self: use polar coordinates! Perhaps your size/brightness thing can be incorporated also.


This would probably reduce the amount of calculations to be made in general, so this might very well be the best way to go.

Are the planets going to be moving?
Back to top
ecchi



Posts: 148

PostPosted: Sat Sep 09, 2006 3:30 am    Post subject:

vision wrote:
I think a dashed line between planets would work. You'd see perhaps Earth with four dashed lines jutting off into space indicating the four closest planets are in those directions. The lines could be of different width or alpha based on the distance to the linked planet.

I think that if done subtly, that might work very well towards what you are trying to accomplish.

I liked this idea a lot, but I had a hard time making it look anything but awful. Perhaps if I revisit this project with more experience, I'll be able to pull it off.

Are the planets going to be moving?

No, thank god. They technically could but that would make things too complicated form a gameplay perspective, I think. Maybe some planets will have their own orbiting moons, though...


Anyway, after trying the line thing I gave the stars a shot. I think, with some tweaking, it will work out. From a distance, it actually works pretty well:


But when you're actually close to planets, it looks pretty ugly.


If you look closely you'll notice the random number generator isn't re-seeding properly, either. I'm really not sure why.

I'm going to attempt to have a fully-featured editor/game engine (more than two planets, support for custom filenames, win/lose conditions, etc) by next week. I want to basically finish this thing by the time I leave for college so I'm not tempted to code rather than socialize...

Thanks for the help so far! Also, Brandon, that game's pretty neat.
Back to top
Mr. Business



Posts: 1530

PostPosted: Sat Sep 09, 2006 12:46 pm    Post subject:

Actually, that does look pretty random. Truly random numbers tend to result in clusters like that.

You might consider using the Mersenne Twister that Kenta Cho uses. It's quite a miraculous piece of work.
Back to top
Zmann



Posts: 21

PostPosted: Sat Sep 09, 2006 2:54 pm    Post subject:

Mr. Business wrote:
Actually, that does look pretty random. Truly random numbers tend to result in clusters like that.


Not the exact same clusters multiple times, though.
Back to top
Sawtooth



Posts: 2350

PostPosted: Sat Sep 09, 2006 3:19 pm    Post subject:

yeah, that starfield looks itunes-random, not random-random
Back to top
Takashi



Posts: 820

PostPosted: Sat Sep 09, 2006 4:51 pm    Post subject:

i just remembered that a gravity grid, provably in a dark gray or something, would provably look nifty.
Back to top
Mr. Business



Posts: 1530

PostPosted: Sat Sep 09, 2006 5:13 pm    Post subject:

Zmann wrote:
Mr. Business wrote:
Actually, that does look pretty random. Truly random numbers tend to result in clusters like that.


Not the exact same clusters multiple times, though.


Ah, hm, I hadn't noticed that!
Back to top
   IC Forum Archive Index -> King of Development XI: Eyes of Burning Indie All times are GMT
Page 1 of 1