Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411644 Posts in 69395 Topics- by 58450 Members - Latest Member: pp_mech

May 15, 2024, 12:33:21 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)How castlevania bosses are made?
Pages: 1 [2]
Print
Author Topic: How castlevania bosses are made?  (Read 4524 times)
synapse
Level 1
*



View Profile
« Reply #20 on: February 24, 2010, 07:54:39 AM »

Whoever answered with things like "learn2program" is an ass.  The poster wants an example architecture/grammar for scripting behavior in a general way, not snarky remarks.

Data-driven state machines are a straightforward way to go.  Once the engine that executes that stuff is programmed, you can create new enemies pretty easily and reliably.
1) figure out what types of actions you need (shoot a laser, start flying)
2) figure out what types of triggers you need (player within 10 meters, enemy health at 50%)
3) determine your grammar using some pre-existing data format (Lua if you're hardcore, XML if you're familiar, JSON if you're in the know)
4) sketch out a few example scripts
e.g.
<enemy id='20' name='Trogdor'>
<attacks>
<attack id='burninate'>
  <triggers> <healthBelow value='50%' /> </triggers>
  <actions> <shootBreath target='player' /> <gotoAttack id='landing' /> </actions>
</attack>
<attack id='landing'>
  <actions> <playSound id='rawr.wav' /> ... </actions>
</attack> </attacks> </enemy>

5) program the interpreter


Do whatever works.  Don't try to make some super-extensible system or it'll take forever.
Logged
Pages: 1 [2]
Print
Jump to:  

Theme orange-lt created by panic