Randomly generated aliens

Share graphical tips, notes and queries related to our favourite screen layout and its editors.
Post Reply
User avatar
R-Tape
Site Admin
Posts: 6402
Joined: Thu Nov 09, 2017 11:46 am

Randomly generated aliens

Post by R-Tape »

This could equally be in programming as well as graphics I suppose.

I've messed about with this kind of thing before with Spritemaker and EFMB. I'm revisiting the idea of randomly generating alien sprites for shmups.

Image

If you take random bytes and mirror them (these pics would be for a horizontal shooter), then randomly mask the nose end to taper it, you get serviceable results IMO.

I'd be interested if anyone has any different takes on how to do this, or improve on the above. I considered inserting some pre-made graphics like a cockpit, but that would be missing the point really.
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2641
Joined: Mon Nov 13, 2017 3:16 pm

Re: Randomly generated aliens

Post by Ast A. Moore »

These look great. The tapering really helps to sell them.
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
hikoki
Manic Miner
Posts: 576
Joined: Thu Nov 16, 2017 10:54 am

Re: Randomly generated aliens

Post by hikoki »

I see a helmet and wheels on the fourth one. A Pharmula One car! The race for the cure on a microscopic scale.
Anyone a crappo to bump into the virus crowd?
User avatar
R-Tape
Site Admin
Posts: 6402
Joined: Thu Nov 09, 2017 11:46 am

Re: Randomly generated aliens

Post by R-Tape »

Cheers fellas. Here it is bundled into a .tap (zipped and unzipped options):

http://stonechatproductions.co.uk/zxgam ... erator.tap
http://stonechatproductions.co.uk/zxgam ... or.tap.zip

Press 'h' for tapered horizontal sprite, 'v' for untapered space invaders alien, or just for you hikoki - 'c' for a car!
User avatar
Morkin
Bugaboo
Posts: 3266
Joined: Mon Nov 13, 2017 8:50 am
Location: Bristol, UK

Re: Randomly generated aliens

Post by Morkin »

Works quite well.

Not sure what tweaks you could make to make them look different from each other. Maybe a different set of masks to generate 'pincers' rather than tapered noses. (If you get what I mean).
My Speccy site: thirdharmoniser.com
User avatar
R-Tape
Site Admin
Posts: 6402
Joined: Thu Nov 09, 2017 11:46 am

Re: Randomly generated aliens

Post by R-Tape »

Morkin wrote: Sun Nov 08, 2020 4:44 pm Not sure what tweaks you could make to make them look different from each other. Maybe a different set of masks to generate 'pincers' rather than tapered noses. (If you get what I mean).
Aye you could alternate between masks for variety. Clipping the back a bit if you wanted to make something more uridiumy or xenony.

I'm not sure what else there could be, but it looks like there's not much that can be done beyond random bytes and symmetry.
User avatar
Joefish
Rick Dangerous
Posts: 2058
Joined: Tue Nov 14, 2017 10:26 am

Re: Randomly generated aliens

Post by Joefish »

These look really good!
Are they really just random bytes, or is there an algorithm to restrict the changes from one row to the next?
User avatar
R-Tape
Site Admin
Posts: 6402
Joined: Thu Nov 09, 2017 11:46 am

Re: Randomly generated aliens

Post by R-Tape »

Joefish wrote: Sun Nov 08, 2020 8:59 pm These look really good!
Are they really just random bytes, or is there an algorithm to restrict the changes from one row to the next?
Other than a tapering nose mask, these are just random bytes and symmetry. In previous attempts, I put in all manner of checks and twists with no discernible benefit (things like don't insert a zero, and try inverting or negating the byte every so often).

Image

This is addictive! I can't stop watching!
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2641
Joined: Mon Nov 13, 2017 3:16 pm

Re: Randomly generated aliens

Post by Ast A. Moore »

R-Tape wrote: Sun Nov 08, 2020 9:59 pm This is addictive! I can't stop watching!
Bloody smooth, too!
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
hikoki
Manic Miner
Posts: 576
Joined: Thu Nov 16, 2017 10:54 am

Re: Randomly generated aliens

Post by hikoki »

truly terryfying and very R-Type-esque :? insects, pigs, robots, warriors, xenomorphs.. not for the faint of heart :?

What about fish?
User avatar
Morkin
Bugaboo
Posts: 3266
Joined: Mon Nov 13, 2017 8:50 am
Location: Bristol, UK

Re: Randomly generated aliens

Post by Morkin »

R-Tape wrote: Sun Nov 08, 2020 9:59 pm Image

This is addictive! I can't stop watching!
Smooth...! Though what happens when a player scores over 99,999,999? ;)

I guess you could even set a seed for the generation of the graphics so that the same 'sequence' of ships gets created?
My Speccy site: thirdharmoniser.com
hikoki
Manic Miner
Posts: 576
Joined: Thu Nov 16, 2017 10:54 am

Re: Randomly generated aliens

Post by hikoki »

I guess you could even set a seed for the generation of the graphics so that the same 'sequence' of ships gets created?
Broilliant! What about an all-you-can-eat mode aka buffet libre? the player would press a key to run into that bug again.
Hehe this reminds me of the alexa thing, please serve me "toothy bugeyed seafood"
User avatar
evilpaul
Manic Miner
Posts: 244
Joined: Tue Jul 28, 2020 8:04 am
Location: Espoo, Finland
Contact:

Re: Randomly generated aliens

Post by evilpaul »


Image

This is addictive! I can't stop watching!
Lovely!

If you could also generate behaviours* based on the random sprites then you could make an interesting endless-shooter. The gameplay of this could be fun - you'd see the enemy wave appear and then have a split second to try to figure out their behaviour. Over time the player would get better at guessing how the behaviour algorithm worked and thus a better chance at surviving for longer.

* Some simple ideas:
- Sprites with more pixels overall move slower than ones with fewer pixels
- Sprites with lots of pixels in the central "spine" tend to move straight forward, others move up and down too
- Annnndddd.. I'm out of ideas already, but hopefully you get my idea :)
User avatar
R-Tape
Site Admin
Posts: 6402
Joined: Thu Nov 09, 2017 11:46 am

Re: Randomly generated aliens

Post by R-Tape »

It could be smoother! These sprites are preshifted in 2 pixel jumps. However I'm pleased that nowadays I can easily get 5 sprites and all the necessary into 1 frame. I know that's not a big technical achievement, but I used to really struggle to fit the sprite draw/delete in time.
Morkin wrote: Mon Nov 09, 2020 9:47 am Though what happens when a player scores over 99,999,999? ;)
A message pops up saying "Hello clebin"
I guess you could even set a seed for the generation of the graphics so that the same 'sequence' of ships gets created?
That would be as easy as a RANDOMIZE statement. As long as nothing else is using that RN generator subroutine, you can just set the same seed and get exactly the same again.
hikoki wrote: Mon Nov 09, 2020 10:45 am Broilliant! What about an all-you-can-eat mode aka buffet libre? the player would press a key to run into that bug again.
Hehe this reminds me of the alexa thing, please serve me "toothy bugeyed seafood"
I like the idea of a 'like' key. It's probably beyond what I'll be using it for this time, but I think that would work well as part of a blind spritemaker routine. You 'like' (or collide with?) the one you like, and that becomes the seed to breed and mutate from.
User avatar
R-Tape
Site Admin
Posts: 6402
Joined: Thu Nov 09, 2017 11:46 am

Re: Randomly generated aliens

Post by R-Tape »

evilpaul wrote: Mon Nov 09, 2020 11:22 am
Lovely!

If you could also generate behaviours* based on the random sprites then you could make an interesting endless-shooter. The gameplay of this could be fun - you'd see the enemy wave appear and then have a split second to try to figure out their behaviour. Over time the player would get better at guessing how the behaviour algorithm worked and thus a better chance at surviving for longer.

* Some simple ideas:
- Sprites with more pixels overall move slower than ones with fewer pixels
- Sprites with lots of pixels in the central "spine" tend to move straight forward, others move up and down too
- Annnndddd.. I'm out of ideas already, but hopefully you get my idea :)
Cheers. That's a great idea. I can only add colour as an indicator of something.

The example seen in the picture will feature as part of something else in Woot this December, so I won't be able to include many ideas (you'll see why), but this is something for a standalone project next year.
User avatar
uglifruit
Manic Miner
Posts: 703
Joined: Thu Jan 17, 2019 12:41 pm
Location: Leicester
Contact:

Re: Randomly generated aliens

Post by uglifruit »

Have you considered a 16x16 version of "the blind spritemaker" - which is excellent by the way.
CLEAR 23855
User avatar
R-Tape
Site Admin
Posts: 6402
Joined: Thu Nov 09, 2017 11:46 am

Re: Randomly generated aliens

Post by R-Tape »

uglifruit wrote: Mon Nov 09, 2020 1:02 pm Have you considered a 16x16 version of "the blind spritemaker" - which is excellent by the way.
Cheers. I did a 16 x 16 version years ago, but I wasn't happy with it enough to release it. I'll have another bash when I get a sec. I don't know about you, but I struggled to breed a decent shape with the UDG version, a 16 x 16 one should work a lot better.
User avatar
Joefish
Rick Dangerous
Posts: 2058
Joined: Tue Nov 14, 2017 10:26 am

Re: Randomly generated aliens

Post by Joefish »

I'm going to spill an idea I'm probably never going to get round to now...

The title of the game should be something corny like "Abey Seedy and the Eyeff of Gee" (or something really sweary) but the the player can edit the title to be "Something Something and the Something(s) of Something. You have all the fonts to display whatever the user types in as a snazzy title (maybe limit each word to 10 characters, maybe have a few fonts on standby and pick different colours) then you combine the characters to form the seed of the random number that generates the levels.

Be careful, maybe use different seeds for different jobs; don't tie that particular random number generator to a timer or other user input, and always re-initialise it at the start of the game. The idea is that anyone who types in that same title on any machine gets exactly the same game (down to title presentation, attack waves, everything), then people can share their favourite titles and compare hi-scores.

For a bit more variation, have some random scenery chunks ready to throw at the player too. But select a theme with the random generator too (e.g. top or bottom mountains or both, machinery, biological junk, angular slopes/columns, free-floating asteroids) as well as any randomisation of the graphics. Maybe have some pre-drawn shapes in different styles and randomly assemble them into larger scenic chunks..?
catmeows
Manic Miner
Posts: 716
Joined: Tue May 28, 2019 12:02 pm
Location: Prague

Re: Randomly generated aliens

Post by catmeows »

evilpaul wrote: Mon Nov 09, 2020 11:22 am

Image

This is addictive! I can't stop watching!
Lovely!
...
Exactly what I thought.
Then color encoded tokens for weapons/ lives/ shields, shuffle them at the start of game session and you have roguelite shmup. :D
Proud owner of Didaktik M
User avatar
Joefish
Rick Dangerous
Posts: 2058
Joined: Tue Nov 14, 2017 10:26 am

Re: Randomly generated aliens

Post by Joefish »

Yes, I've always wanted to take the 'Rogue' style further, with dungeons more like those of a Zelda game, where the layout of a (randomly-generated) dungeon maze is carefully 'gated'. By which I mean that there are specific objectives to achieve down side-branches, to allow progress along the primary path.

At a simple level, there'd be a locked door obstructing you part-way along the main path through the maze, and a generic dungeon key placed down one of the dead-ends on your side of the door. It'd need careful tracking and probably some quite complex logic to work out where such obstructions can be placed, how many dead-ends can be exploited beforehand, and whether to put keys, treasure, magic-lock-tokens of some kind, or switches down each one. Maybe even trimming off dead-ends if there are too many. You could also have a type of gateway or obstruction that needs a specific tool-weapon to get past, then you guarantee to place the weapon (like a key) before the point it's needed.

It might also be neat to make the maze as a map of cells on a grid, then combine some of those cells into larger scrolling areas if they are all joined by open doors anyway. And impose restrictions to get particular shapes of mazes when you look at the map, or impose symmetry, or place the final room at the top.

Problems come if you place locked doors down side-branches, as you may use a key on the main path and miss a side-branch (a side-branch where you could have got another key), meaning that part of the maze is forever inaccessible. There's a bit in the Gerudo maze in Ocarina of Time that's like that, although it's not game-breaking. You just miss a bit of treasure and another key, which would be used up anyway.
Post Reply