English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 24 August 2017, 12:23   #1
witchmaster
Registered User

witchmaster's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 139
Advanced enemy paths and connected sprites on old hardware

TL;DR : How were these things made back then?

Hi! In a game I'm currently making, I made a sea monster with tentacles built up of several sprites. I'm using GameMaker Studio and the available tools to create paths helped a lot.



On old hardware (like the Amiga), this wouldn't be as easy. I have done some research on how these things could have been made, and these are some ideas:
  • Arrays with relative x and y coordinates that directly sets the position of an object, or work as waypoints that the object moves between.
  • Lookup tables or approximation functions for trigonometric functions.

Examples of this are some of the bosses in R-Type, the snakes in First Samurai and the enemy flying patterns in Galaga. The snake in R-Type has a quite advanced moving pattern, flying into and out of holes, so positioning needs to be exact. From the looks of it, it either moves in a straight line or an arc (@ 3:30 in the video):

[ Show youtube player ]

It would be great to hear your thoughts on techniques used to create these things, maybe you even have direct experience and have done something similar on the Amiga!

Examples:
[ Show youtube player ] (@ 2:05 in the video)
[ Show youtube player ] (@ 20:35 in the video)

Last edited by witchmaster; 24 August 2017 at 12:31.
witchmaster is offline  
AdSense AdSense  
Old 24 August 2017, 13:23   #2
zero
Registered User

 
Join Date: Jun 2016
Location: UK
Posts: 131
In R-Type I think it is all just lookup tables with the coordinates predefined. Same in Galaga, but with the ability to specify an offset and mirroring etc.

For First Samurai it looks like they use a simple spline algorithm. You can do them pretty efficiently in assembler with integer maths and some lookup tables. An even simpler option is to have every object in the chain move slowly towards a straight line between the base and the anchor, which with movement will create nice curves.
zero is offline  
Old 24 August 2017, 13:29   #3
Old_Bob
BiO-sanitation Battalion

Old_Bob's Avatar
 
Join Date: Jun 2017
Location: Scotland
Posts: 27
Quote:
Originally Posted by witchmaster View Post
On old hardware (like the Amiga), this wouldn't be as easy. I have done some research on how these things could have been made, and these are some ideas:
  • Arrays with relative x and y coordinates that directly sets the position of an object, or work as waypoints that the object moves between.
  • Lookup tables or approximation functions for trigonometric functions.
For something like the big snake in R-Type, or the attack patterns in Galaga, I'd think a simple array would be both the easiest to program, and the fastest to execute. You have to blow a bunch of memory, of course, but there's no time consuming calculations to be done and if everything behaves the same way, every time, i'm thinking it would be the best method.

What has puzzled me for a while is stuff like the tentacle type things coming out of the Huge-Brain-With-Eyeball boss at the end of the first level of Salamander that follow you around the screen. Very mysterious. Possibly some of this trigonometry witchcraft, of which you speak?

B

Last edited by Old_Bob; 26 August 2017 at 00:37.
Old_Bob is offline  
Old 24 August 2017, 18:00   #4
zero
Registered User

 
Join Date: Jun 2016
Location: UK
Posts: 131
If you look at Galaga is seems that the enemies are programmed with a simple Logo like language. "Move x+1, y-2, repeat 25 times" kind of thing. That way only the changes in direction need to be stored.

At the time they would likely have been hand coded by the programmers, as I doubt there were any prototyping tools available.
zero is offline  
Old 25 August 2017, 00:30   #5
invent
pixels

invent's Avatar
 
Join Date: May 2014
Location: Australia
Age: 46
Posts: 167
Hi Witchmaster, you may be able to use software like this. https://phaser.io/tutorials/coding-tips-008

coders here will be able to say if this tool or others like it are useful. Good thread as it will be one of our issues for next Amiga game.
invent is offline  
Old 25 August 2017, 08:26   #6
witchmaster
Registered User

witchmaster's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 139
Thanks so far @zero, @Old_Bob and @invent, I appreciate the input. I like that simple idea of moving the sprites towards a line between the base and anchor.

About that Salamander boss, yeah, the arms are slowly changing direction towards the player. The video below shows the MSX version and by the looks of it, the parts of the boss are not updated every frame to ease up the work for the processor.
[ Show youtube player ] (@ 5:44 in the video)

@invent, that tools seems useful, I was working all yesterday on something similar for GameMaker. Good tutorial also btw.
witchmaster is offline  
Old 25 August 2017, 16:11   #7
Akira
Registered User

Akira's Avatar
 
Join Date: May 2001
Location: New York
Posts: 18,180
Quote:
Originally Posted by Old_Bob View Post
What has puzzled me for a while is stuff like the tentacle type things coming out of the Huge-Brain-With-Eyeball boss at the end of the first level of Salamander that follow you around the screen. Very mysterious. Possibly some of trigonometry witchcraft, of which you speak?
Wasn't there an Amiga game that did something similar?
I'm thinking of a Turrican boss or something, maybe. But can't quite place it.

Interesting thread all round! Looking forward to learn more.
Akira is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
vbcc multiple include paths krustur Coders. C/C++ 2 21 October 2014 00:46
relative paths do not apply to new files thomas support.WinUAE 1 13 August 2013 20:10
Relative paths (WAS: Has anybody ever gotten Shiftrix to work?) rsn8887 support.WinUAE 9 27 August 2010 07:56
Relative paths Toni Wilen request.UAE Wishlist 0 16 August 2009 17:06
paths OSH support.WinUAE 3 07 January 2009 13:31

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 21:38.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.17065 seconds with 12 queries