Game
Gunship Souls
11 years ago

Day One: look at all the stars!


Hi

24 hours into my #indievspewdiepie game. I’ve got circles that shoot bullets at you, a circle that is you, and a nice red reticle. The circles are generated by a (currently invisible) mother ship. The art is all just drawing primitives, and I think I will probably keep it that way for the jam.

I worked super hard on the infinite starfield. It probably took, like 4 hours or something stupid. I went off of a helpful article, but encountered many tricky tricks along the way.

The technique, basically, is to imagine an infinite square lattice. Each lattice point is indexed uniquely by a point in Z^2 — such as -2, 7. When you draw the screen, you first ask which lattice point will be in the upper left corner of the drawable space (maybe a little off the screen), and then iterate over enough lattice points to paint the whole screen.

Now the interesting part is the stars, of course: each lattice square has an index, as I mentioned. Pass the lattice square’s unique integer coords and a seed into a hashing function, and you will get a big ol’ 32 bit integer that is guaranteed to be unique for each lattice square. Use that 32 bit integer to choose the positions for a couple of stars (relative to the top left corner of the lattice) and you are good to go.

What is super duper cool about this is that, if the player leaves and returns to the same part of space, they will see all the same stars! So you’ve basically got an infinite expanse of randomly generated stars that never change or get lost or regenerated. Layer them for paralax if you care to! (I did, but you can’t see that from the screen shots)

Depending on how I feel, I might further customize it so that the stars closer are actually more pixellated. I kind of think that, since the rest of the game’s art will be rough edged geometry, the stars should fit the mold.

Finally, here is a link to the original article, and here is a link to a gist with my (lua) implementation. Feel free to offer criticism! I love you!

z.



0 comments

Loading...

Next up

skipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskipskip TL;DR Think before skipping skippable text in games.

Fixation (2D Array) When life feels like a puzzle-platformer

Soft Chambers A clever human can name the things we've always known in our hearts in a way that makes them new again.

Outer Space 15 Drift alone, in the void of space.

A Pretty Odd Bunny A stealth game about navigating social pressures.

Been working lately on lots of 'behind-the-scenes' boring stuff that no one really cares about, so here’s a guy playing the sax for some reason.

#screenshotsaturday

I have added rewards for quests so that villagers can give you something in return for your hard work helping them. 🥳

I want to know - what's your favourite quest reward?

"Our work is never over" they said.

Back in my art school days I used to ride the 710 COPSA line from Parque Del Plata to Montevideo almost everyday. This is the Marcopolo Viaggio G4 Mercedes Benz model from the late 80s, one of the older bus models that was running on the line.

Spaaaace~

These are background sprites I've created for a game I'm working on at school ^w^ Click on the post to see how the sprites connect. You won't regret it! (personally, I think it's pretty heheh)

Drawn in Piskel using my mouse. Whaddya think?