[project1dev] [combat] design question!

  • From: Alan Wolfe <alan.wolfe@xxxxxxxxx>
  • To: project1dev@xxxxxxxxxxxxx
  • Date: Sat, 18 Apr 2009 12:51:08 -0700

Hey, ok so check this out...

In an enemy's tick function (the tick function is called every frame), an
enemy checks the player's distance, and if the player's distance is less
than a certain amount (definable by each enemy since different enemies are
different sizes) it does this...

1) Puts you into combat mode
2) Spaws combat mode enemies for you to fight
3) despawns the current enemy from the world (since if you beat it, it
shouldnt be in the world anymore, and if you die, you wont be going back to
that map anyways!)
4) yields control to combat mode logic

Ok so question...

I was wondering about how exp, item, and money rewards were going to work?

2 options i see...

#1 -rewards are defined by the combat enemy scripts

How this would work is if you bump into a rat in the map, it puts you into
combat mode and spawns between 2 and 4 rats (randomly chosen how many).

Inside of the rat combat scripts it says...
* each rat drops 5 to 10 gold peices
* each rat gives 100 exp

so, in this case, if 3 rats spawn, after you kill them it will give you 15
to 30 gold peices and 300 exp

if 4 rats spawned, you'd get 20-40 gold and 400 exp.

#2 - rewards are defined by the map enemy scripts

How this works is if you bump into a rat in the map, the rat you bumped into
not only says how many and what types of monsters that spawn, it also says
what the rewards will be.

So, it might spawn 2 rats and say you will get 10-20 gold and 200 exp, but
if you bumped into a different enemy that also spawned 2 rats, that battle
might give you 20-30 gold and 250 exp.


Basically, this is just a question of who should set what the rewards of a
battle will be?

Should it be the monster you bump into in the map that defines the rewards?
(the 2nd option)

Or, should it be the monsters you actually fight that define the rewards?
(the 1st option)

From a technical standpoint i like #1 more because it would be less work,
when you went into combat you would just say what enemies spawn and it would
take care of the exp and loot details.

Anyone care either way?

Other related posts: