Finished Game: DemonStrike

Started by iWasAdam, January 22, 2024, 08:28:01

Previous topic - Next topic

iWasAdam


Here's a finished game written with my 2d engine and full audio synthesis using the TIA2 engine.

Take a trip back in time to the Atari 2600 and get your trigger fingers itchy.
https://adamstrange.itch.io/demonstrike

Matty

That was one of my favourite Atari 2600 games, in our country it was released as "Phoenix". One difference from yours is that the 'birds' that you shot - you could shoot the left and right wings off and they would still keep attacking if you didn't hit them dead on the centre. I prefer yours over the original Atari version, looks, sounds great..almost hypnotic.

iWasAdam

Thanks Matty. Yep I used to play Phoenix at a local chipy back in the day - lol.

The core concept was to go back to the 2600 and start from restricted playfield and graphics. focus on the game loop and what made the game playable. TBH the base game has been finished for a year or so. What I needed was a way to recreate the TIA sounds. which lead to the creation of Alias (the sound generator)

All the sound was done over the last week with the new TIA2 engine - so there are no samples, everything is realtime synthesis bases on the Atari Tia chip output - but on steriods. I'm particularly fond of the little musical parts as these were created from the internal voice sequencer - not an external one:
This is the TIA2 engine on the top with the sequencer below:


It gives an idea of the underlying audio engine.

What I have found is the TIA2 engine is sort of similar to the commodore SID. Using it has given me a couple of ideas on how to extend things slightly...

Matty

Looks complex, audio is beyond my ability, but it's pretty good what you've accomplished.

mainsworthy

the 80s rule, looks super dooper. really good

Steve Elliott

Oh a version of Demon Attack, I remember it from the Atari 8-bit computer version with it's fancy silver box.

Looks like a great conversion with the distinctive Atari crunchy bass I always loved.
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

Xerra

Yup, I remember this as Phoenix as well. Classic arcade game and this is great work, Adam.
M2 Pro Mac mini - 16GB 512 SSD
ACER Nitro 5 15.6" Gaming Laptop - Intel® Core™ i7, RTX 3050, 1 TB SSD
Vic 20 - 3.5k 1mhz 6502

Latest game - https://xerra.itch.io/Gridrunner
Blog: http://xerra.co.uk
Itch.IO: https://xerra.itch.io/

iWasAdam

Yep it's a version of DemonAttack with some Phoenix thrown in...

The history of DemonStrike is tied in to Wonkey (Monkey2 version 2). There was always a nagging doubt about something nasty inside the renderer of monkey2. Stuff I couldn't track down, strange behaviour, etc. You know the feeling: Something just 'smells off', So I went on a hunt for a replacement of the graphics core: Mojo.

What I found was a tiny graphics layer called Sokol. This directly targets opengl (windows and linux and others) and Metal (MacOS) for the render targets. Basically setting up the initial window and leaving you to figure out the rest. Metal was what I was after. so I took the plunge, dealt with the Wonkey wrapper and started work. The first thing you need is a 2d rendering system...


2d rendering system:
My thoughts about mojo were based on strange memory issues and I knew that mojo uses linked lists and memory allocation and these are the usual causes, so I went back and checked my own arraylist codes. this uses arrays and predefined blocks of memory so there can't be leaks, mallocs, etc

In essence any modern UI is just a 2d layer of 3d objects. The objects referencing fonts, etc. This can be abstracted down into a simple arraylist of objects. Per frame this list is reset, filled, and then with a single call outputted to the GPU. You only need the correct shaders and you have basic output.

So I needed to decode/abstract the metal and opengl and write shaders for both which did alpha, color, etc. this then formed the basic 2d object list.


Bitmaps
Alongside of the shader and 2d/3d code, you need bitmap support. In this case I am using my tried and trusted FontSprite system. This meant loading and sending bitmaps into the 2d/3d pipeline. and meant and 2d object needed uv and color data and the shaders adjusted. The end result being a hyper fast fontsprite rendering system. what was needed was a good way to test it...


The tests:
Once everything was up and running graphics wise. I started writing tests. I should add that along with all of this work is ongoing with the other 2 Wonkey team members.

The tests covered a lot of things: modern UIs, particle render systems, and games. I decided to go back to things like pacman, pitfall, demonattack, berzerk, etc. I would start with recreating the sprites, feeding them into the graphics system and begin working out how they worked and implementing all of it

Here is the fontsprite for demonstrike:


DemonStrike:
So the game in essence was finished. it just needed all the sparkle added, menus, sound etc.
But I didn't want standard sound - via samples. Why couldn't I use the QasarBeach concepts to reproduce the actual Atari sound? So I researched that classic Atari sound and found the TIA chip. Took the technical documents, poured over them until I understood what was going on: 15 custom sounds that were created by a very clever bitmasking technique to create the 15 sounds. These could be further broken down into the square waves and these could be dealt with as wavetables with the correct system.

So... I wrote the initial version of Alias - this is the audio engine. it uses all the stuff from QasarBeach, but streamlined with a very specific approach: audio generator > audio shaper > audio fx. These all have control parameters that are fed via programmable functions, lfo, seq, and envelopes. each being able to be fed by the others. In essence a hyper synth... with the first generator being able to reproduce in realtime that distinctive Atari sound...

DemonStrike uses the TIA2 generator which is an advanced dual TIA approach. this is more like a commodore SID chip.

Now as you can imagine writing the Alias core wasn't a quick process, so DemonStrike sat around forlornly until I got everything sorted and mashed them together, added the menus and voila DemonStrike...

MrmediamanX

It's a thing that doe's when it don't..

iWasAdam

V1.02 now ready
https://adamstrange.itch.io/demonstrike

windows 10 compiled
audio tweeks
extra bird added

Matty

Comments about store page:

Looks good, written well..couple of spelling errors:

"lose" not "loose"

"tweaks" not "tweeks"


iWasAdam


Baggey

This is a really nice game. Pheenix on retro ATARI steroids. Just love the retro sexynes of it. TIA sounding good from your audio engine.

the 2D engine you used on this would be excellent for a load of retro remakes. Especially being able to use TIA-Pokey, SID and AY/FM sound engine.

I dabbled at making an Atari 2600 Emulator but realized quickly emulating the racing beam was beyond my limited programming skills! :(

Would be nice to be able to redefine the keys thou. A and D are the wrong way round. ;)

Kind Regards Baggey
Running a PC that just Aint fast enough!? i7 4Ghz Quad core 24GB ram 1TB SSD and NVIDIA Quadro K620 . DID Technology stop! Or have we been assimulated!

ZX Spectrum 48k, C64, ORIC Atmos 48K, Enterprise 128K, The SID chip. Im Misunderstood!

iWasAdam

QuoteI dabbled at making an Atari 2600 Emulator but realized quickly emulating the racing beam was beyond my limited programming skills!
The key I found to all of this is to go back to the original documentation - figure out what was possible and create your engine to approximate it.
The 2600 had 3 key areas:
1. a flipped (mirrored) block based background layer - ignore the mirroring, just uses the blocks - If I remember correctly the block were all the same color as well.
2. mono 8x8 sprites- the could be horizontally stretched, so 8x8, 16x8, 24x8
2a. more advanced techniques allowed sprites to be colored per vertical line.
3. screen res was 160x192 with loads of colors...
so...
If you follow those general guides, plus paying attention to how the games looked. you can get a good feel for any new versions of games.

The original programmers were trying to push the hardware, now we are trying to limit ourselves... ;)

iWasAdam

QuoteEspecially being able to use TIA-Pokey, SID and AY/FM sound engine.
Yup, the Alias audio engine currently has 6 inbuilt cores:
1. TIA - this is just the 2600 with 2 noise generators
2. TIA2 - this has 2 oscillators plus noise and is more like the SID
3. ASYN - this is a realtime additive synth, sort of a bit like a synclavier. very strange and etherial
4. SAMP - dual sample engines with advanced looping, tuning, panning, etc. A Fairlight on steroids. it can play virtually any format from Amiga, to binary to commercial libraries
5. TABLE - 3 oscillator wavetable synth. with 128 waveforms per oscillator. sort of advanced PPG
6 - DFM - stands for dirty FM synth. 4 operators with 12 algorithms. think DX7 AY/FM. Very hard, very dirty, but can be as clean as glass...