Archived

This topic is now archived and is closed to further replies.

Boss Scripting?

This topic is 5382 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

im making a 2d space shooter (side scrolling) and i got everything down pretty much, but now i need to create a boss. right now there is only one level, and im trying to create a boss for it. i have a level class. you can pass specific level graphics to it, the number of enemy types, the number of powerup types, the enemy formations, and basically anything needed to run a level. should i create a boss class, and make it so the level has a pointer to a boss instance? the problem with this is that i would have to derive from the boss class with a virtual function every time i want to create a new type of boss (For each level, because their actions and AI would be different). is there another, more precise and effiecent way of doing this? thanks! ---------------------- i code therefore i am. Aero DX - Coming to a bored Monitor near you!

Share this post


Link to post
Share on other sites
Well, you could create an AI Agent class, and derive from it to form the specific AI behaviours for each boss. This''d prolly be more OOP, but you''re gonna have to derive and use those dreaded virtual functions whatever you do OOP has it''s advantages and disadvantages.

Share this post


Link to post
Share on other sites
Well you could do it either way.

There won''t be to much of a performance hit.
You could always impliment a a boss class which has a small script engine.

This could even be hard coded for speed value.
When you create a new Boss you then pass it it''s "brians" which is an array of dessions steps.

Armand.

Share this post


Link to post
Share on other sites
I had a similar type of thing. But I took a different approach with the bosses. I made it completely scripted. Every comp ship AI was loaded from seperate files. How they moved, randomly, or fixed, how they leave the place, when they take themselves from memory, What happens when the ship is shot down by the player''s ship, etc. It''s not really AI, but you get the point. I then just made the same for the bosses. How they moved, when they shoot, and from where.

I made the bosses essentially a normal enemy ship. Just had to do some modifications on the AI. There was also one addition. I had a boss flag which made it so that it would display its health at the top of the screen.

... And the moral of the story is: Recycle your code as much as possible.

_____________________________

- Rob Loach
Current Project(s): Upgrade to .NET and learn DX 9

Share this post


Link to post
Share on other sites
Hey Neen10do, the time difference advice you gave me for my game worked out extrememly well! If you can't recal...link.

Question: Did you start your game before you read my post? I just wondered if my game gave you the inspiration Shooters rule!

I'm still using structures for my bosses so I can't really help out with your question, I just wanted to say thanks for the advice. It really saved me a lot of time spent researching the issue.

-Q

[edited by - qa303asmguru on March 24, 2003 3:35:11 PM]

Share this post


Link to post
Share on other sites