The AI routines were just about complicated as I imagined at first, but not exactly as I thought.
Adding a specific path finding routine seemed an easier task in the present time, with the internet and such. But the reality is that the algorithms are too heavy for 68000 based machines, specially the lower 7mhz ones. And the only saving grace was that I didn't had movement in real-time but turn-based with individual unit handling.
The approach here would probably be different as the original with the amount of memory would probably work with tables to use path-finding, and the Amiga does an adapted version (by me) of the famous A*.
I opted for a trying to develop a somewhat simplified and rough version of that (taking in account different unit type movement restriction and cost). That made my find-path code is memory hungry (almost 100kb just for variables) and slow on modest hardware (got up to 40 seconds in the most extreme condition for the map on A500). So, I optimized them with some unit area bounds and some specific table creation for lower models.
With the path-finding and line of sight routines in place it was actually easier to setup a sort of behavior for the computer units to follow.
That was a major milestone for me and allowed me to concentrate on establishing AI behavior for both the Aliens and the Raiders (which is more difficult since they are outnumbered and have more objectives than just kill on sight and drag the game). Also having them handle objects and have different specific purposes. Even when to decide to escape to the Shuttle!
The original
Naturally I didn't have the original source code when I developed it. After having it all running and having a feeling for it, I did wonder if it was too different from the original...
At one time I remembered that maybe I should take a look onto Rebelstar inner workings, so I emailed William Fraser famed by his rendition of LS on java and his site on Laser Squad in general (he did have a small mention to Rebelstar):Laser Squad Home Page
I asked William Fraser for his input, as he developed the original JAVA versions of both Rebelstar and Laser Squad for JAVA, based on the disassembled original code. He gently provided me his JAVA source code, as well as providing the original disassembled ASM. While I did this because of weapon damage soft stats and damage calculation regarding the original, and allow me to take a look onto another stuff.
What I found in term of path finding was as I expected a table of routed and region importance. Which makes sense - in the original the aliens can go pretty much anywhere apart from the trees and walls. The only exception is the swamper which only moves on the river.
I wasn't going back on my code now, but in a hindsight somehow, I felt it was the easier route (not necessarily the best - that's debatable).
Naturally other differences stood out on the unit next command selection, something I noticed but never paid too much attention as it seemed not relevant, but after verifying the internal works how it searched through the map and how AI units were handled, it made perfect sense.
Regarding the AI behavior, well my code while different did mimicked in broad terms the original behavior, except for unit entering cover mode. In mine brute implementation the computer AI is more aggressive and persistent. While I knew that was a thing, as I had experienced on the original Rebelstar (not so much on the 2), hadn't thought much about it - as it was much more in with Chaos Theory, let the chips fall where they might... But I should take some notes and come up with my own implementation.
Other stuff stood out such as the computer opponents do not pick up items. In fact, apart from reload they don't really change stuff. So, there's where my version definitely improves! As well as having different AI behavior for type of units and both sides, as well as threat assessment (instead of random enemy unit targeting - which admittedly actually worked very convincingly)!
And if you take in consideration the tools and limited memory Julian Gollop had to contend (and all is Assembly), you got to be impressed. That's when people mention best game creators / designers / programmers his name springs first into my mind. Rebelstar would be topped shortly by Laser Squad on the ZX-Spectrum by the his very own hand.
In a nuttshel - Amiga Rebelstar 2 is not a port of the original. Apart from the name and stats which were public in gameplay, it follows my interpretation of the original - while not trying to be to different. You can still lear something from the Master himself, and I'll be sure to revisit his work and if possible improve on it. Some game mechanics are similar, but others have a different twist (I'll do an article on that later). And while it would be (a lot) easier to port and then add features, now it's done my way...
So, thanks William Fraser - your help was invaluable and has been an eye opener for me!
(Edit) - Additional GFX
Since the early days, I had the idea to add AGA graphics. Actually that was going to be the main version. But after having so successfully upgraded the 15 colour ZX minimal gfx to a 32 colour, I thought that was good enough.
Later on AcidBottle kept pestering about we should be doing AGA graphics, he even take a stab at it. And that kept poking my brain. I left the AGA dir on the game, and even the game option, although it was just ECS repeated. I even forgot to update it, and everyone testing the game would report the game crahsing when AGA was selected.
So I took another attempt (an engineer one rather than a creative one) and well it's not bad. It's got a textured feeling to it, and I accomplished to reduce the almost 256 colour to 128 at the moment. And maybe I'll try to reduce to 64 later on.
AGA Screenshot in current form (128 colours)
It still requires some tinkering, but that may actually make improve some original gfx routines. So, maybe Rebelstar II will have AGA mode after all...
If you a take a small piezoelectric buzzer and place it on a computer what do you got? Yes - the popular Sinclair ZX-Spectrum 48k. That's what the original Rebelstar contended with... But you know what? - It had a very distinct and characteristic sound, minimalistic in some aspects, and it actually worked...
What could be re-used, repurposed, altered or thrown away would come with time.
But first we had to add Amiga music - that's a must! And like I posted previously for that purpose I reached JMD (Simone Bernacchia) which at this stage has a lot of experience with retro Amiga game music (both commercial and non-commercial) - Check it out!
Music
All the original had was the end/start turn jingles and a end game jingle (not nothing that could be described as music), that meant nothing to cling to. So, that meant a clean slate!
I started by just putting some in-place tunes - such as the Reunion In-game music. It was helpful as I could start to sort places, moments and amount of tunes.
Talking with Simone (JMD /Saimon), he agreed on helping, and he quickly realized I had not a real style or essence established.
There was nothing to adapt or inspire, apart from the Rebelstar games in Gameboy advance - that we both were shocked with excellent audio quality, (I knew it was really good audio chip, but wow...). And it was clear that this GBA title style did not really fit the retro nature of the original (more UFO vibes than the original Rebelstar lore). So, he chose to go with a synthwave style more akin to the Amiga.
From the man himself (Simone Bernacchia):
"When [Hardwired] asked me to contribute to the game, I had to do some research: while I kinda know the original series - which Lazer Squad belongs to - I did not knew this particular game. Rebelstar, as tactical RPG from the 80s, has lot of things that got improved further on, and which more modern games as Shining Force owes to.
Not a big player but this stuff is right down my alley so I happily cooperate! I decided to approach the music from an 80s B-movie atmosphere point of view: synths and steady rythm machines.
Memory constraints might limit on how much instruments to use but is not necessarily a bad thing: this forces me to be more creative with the effects and make it sound like it could not! I do my job using milkytracker, that I consider superior to the original protracker thanks to xm support, multithreading (can have more than one song open at once) and lately also scripts that help to process sounds."
At first, we established 2 tunes (as it was divided by a main event) for in-game, and one smaller for briefing/debriefing (as well as start-menu and A500/A600/lower mem models in-game). As the game progressed, we then agreed on three major ingame tunes context sensitive (and two very minor ones), along the briefing one, and two lighter ones for Title screen / start menu and another for the Outro.
As for in-game music the instruments were shared as much as possible, and it was possible to make one music file having all 5 tunes, that made disk access less necessary during game and save space on it. Naturally since protracker does not support multi-song support it was basically a question of mapping the pattern sequences and call them (accordingly to context) from the music routines.
Here's an audio preview of the music style in RebelStar 2
Sound effects
One thing I planned at first was amiga specific sounds. Initially, I just sampled the original sounds in emulation. Some were scrapped (such as the end turn and the end game sounds) as it seemed repetitive.
I wished to actually make the sound from data/equation functions, so it would save more space on disk, but while I managed some sounds like that, it proved too much fuss. So, for now I'm keeping as it is.
For now the sounds will be like the original
While it would be good to have more variety, and more broad sound situations it would probably require more thought put into it. Amiga specific sounds may or may not happen. It sure won't be me doing that...
Maybe JMD might be inclined to do that, but seems to me that he is happy with current sounds. Besides there's the size of data to consider. We'll check in the end...