Posted By
|
Message
|
J.C
Registered 22/03/2013 05:18:14
Points 118
|
6th July, 2013 at 06/07/2013 02:29:18 -
Hi.
I'm talking about a platformer boss fight and not the scrolling shooter types that move around the screen.
But let's say I want to program the enemy to be knocked back by the player every time the player attacks, and what if I want to program the enemy so he moves towards the player, attacks and then walks back to his last position, how would I go about doing that?
If anyone has any boss fight examples that I could look at for reference that would be very helpful.
n/a
|
AndyUK Mascot Maniac
Registered 01/08/2002
Points 14586
|
6th July, 2013 at 06/07/2013 04:14:20 -
In that case what i would do is recreate the main player platform movement events for the boss. Or perhaps a simpler version.
Then create a few 'go to' points. Active objects in the frame that you can tell it to move towards
You'll then need to have the boss have a few states such as
.Attack player
.Run to point 1
.Run to point 2
.knocked back when attacked from the left
.knocked back when attacked from the right
Then you need some conditions to tell the boss what he wants to do, for instance if he has really low life he might want to never attack the player.
And then perhaps other additional events
.Jumping over obstacles
.trying to avoid player's attacks
.do a jump if below the point you want to go to
A good starting point would be to store the X and Y value of all of the objects (Go to points, Boss, Player) in their own Alterable values, then you can check to see if say, the boss is to the left of the player.
About knocking back the boss, if their platform movement includes inertia you can knock them back.
Say you've programmed the movement so it walks relative to a counter between -10 and 10. Check to see if the boss is attacked, and also check which way the player is facing. If the player is facing right and attacks the boss, knock the boss back by settings his walk movement counter to 10.
.
|
J.C
Registered 22/03/2013 05:18:14
Points 118
|
6th July, 2013 at 06/07/2013 23:13:37 -
That's a good place to start. But I'm still stumped as to how to code it in.
Let's say I want to use on of the built-in movements to code the boss's actions. Which one would work best? Bouncing ball? Path?
If not, then how would I go about coding the boss's movement myself? Though I would much prefer to use built in movements as my coding experience is very minimal.
Again, if you have an example I can look at it would help a lot.
n/a
|
AndyUK Mascot Maniac
Registered 01/08/2002
Points 14586
|
7th July, 2013 at 07/07/2013 15:30:22 -
I don't have an example file, sorry.
I think path movement is your best bet if you really don't want to code it in yourself. I haven't actually used path movement before!
I'm not sure you can make the boss get knocked back from getting hit on a path movement as he will be stuck to the path. You can add pauses to the movement and reverse the direction at the end of the line.
.
|
J.C
Registered 22/03/2013 05:18:14
Points 118
|
7th July, 2013 at 07/07/2013 16:42:37 -
I don't think that path movement would work too well with what I want to make. Path is too restrictive and I only use it on characters/objects for cutscenes.
So, do you remember a boss you created that used a built-in movement for its AI? Like Bouncing Ball? Or do you code them in yourself?
n/a
|
AndyUK Mascot Maniac
Registered 01/08/2002
Points 14586
|
7th July, 2013 at 07/07/2013 19:45:02 -
Yeah I always code stuff like that myself now. It's a lot more work but there just aren't suitable built in movements for things like that, sadly.
To be honest I hate coding bosses because it's a lot of work for something you'll see in your game once for about 2 minutes.
.
|
lembi2001
Registered 01/04/2005
Points 608
|
8th July, 2013 at 08/07/2013 22:55:33 -
You could always use the PMO and a bunch of counters/Alt vals to control the boss.
For example:
Alt val A = 1 Boss moving right
Alt Val A = 2 Boss moving left
Alt Val A = 0 Boss stopped
It can work this way and then you have direct control over the boss AI. You could create a boss script too using this method.
Have a number of alt strings setup like this:
0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,1,1,1,1,1,2,2,2,2,2
You could then parse this into the string tokenizer and then on each frame have the PMO handle the next entry in the string.
This method/engine would take a lot of setting up but then you would have the base system for other in game bosses
n/a
|
nivram
Registered 20/07/2006
Points 171
|
9th July, 2013 at 09/07/2013 15:32:50 -
This open source example on my website might help with the basics:
Programmable Move By Letter Example
Author: nivram
Genre: example
Extensions Needed: String Parser
Description:
This is a Programmable Move By Letter Example using a Edit Box to program movement of an active object. It can be adapted for boss movement or robot programming.
Instructions:
In the top Edit Box, type in letters (up to 20) seperated by commas (u,d,l,r). Click on the red active.
Link:
http://castles-of-britain.com/mmfexamples-o.htm
Marv
458 MMF2 & CTF 2.5 examples and games
http://www.castles-of-britain.com/mmf2examples.htm
|
lembi2001
Registered 01/04/2005
Points 608
|
9th July, 2013 at 09/07/2013 16:11:55 -
I should have known Marvin would have an example which explains my gobbledy-gook better
n/a
|
nim
Registered 17/05/2002
Points 7234
|
9th July, 2013 at 09/07/2013 17:37:09 -
Originally Posted by lembi2001 You could always use the PMO and a bunch of counters/Alt vals to control the boss.
For example:
Alt val A = 1 Boss moving right
Alt Val A = 2 Boss moving left
Alt Val A = 0 Boss stopped
It can work this way and then you have direct control over the boss AI. You could create a boss script too using this method.
Have a number of alt strings setup like this:
0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,1,1,1,1,1,2,2,2,2,2
You could then parse this into the string tokenizer and then on each frame have the PMO handle the next entry in the string.
This method/engine would take a lot of setting up but then you would have the base system for other in game bosses
Good advice. This is the method I use, although I just use numbers without commas and use the left$() expression. It's better to set up a "script" because relying on random() to choose a boss pattern could result in the same patterns being used twice, three times, or more in a row.
I always use Alterable Value A for the "phase" (walking left, attacking, etc) and Alterable Value B for a "countdown" timer; the time limit for each pattern.
//
|
lembi2001
Registered 01/04/2005
Points 608
|
9th July, 2013 at 09/07/2013 18:25:22 -
In all honesty, this is something that just came to me when i replied lol. I've never used this method before but the logic works (at least on paper)
n/a
|
|
|
Post Reply
|
|