What I'm working on now in my RL.
By the way, thanks for all the help so far all r.g.r.d. -ers.
This might be a bit scattered, bear with me...
History up to now
=================
Here is/was my current implementation. I divided the world space into
three parts. A Map, mobs, and items.
- Maps : List of game spaces (inclusively 'The world') in which all
other things existed.
- Mobs : List of existing creatures.
- Items: List of existing items.
Then I created:
- some maps with walls, trees, water, open/close doors, etc.
- some mobs, including the player @, and couple monsters with a few
simple AI types.
- message list along the side.
- multiple light sources (any mob or item could be shining)
- fighting, dying.
Side note -- I decided to model the entire UI under the feature of a
mobs AI type, namely AI_PLAYER. This allows me to easily use one set
of procedures for all mobiles. When the game loop is moving down the
list of all active mobs, and calling their AI routines, if that mob
has AI of type AI_PLAYER, then the UI updates the screen and takes
player input.
So far so good. Now that I want to add in more effects, I began to
consider how I had implemented all the previous effects. I realized
they were strewn all though the code. Even though I had made a
module specifically for effects, it didn't turn out that I used it well.
(As of this writing I'm a novice hobby programmer.)
Some mob actions (like a prompt for direction when given an open/close
command with two or more valid targets) made their way into the
effects module, and some effects (setting visible map cells and light
casting) were implemented inside the fov/los module.
So I took a step back from the project to consider how I want to
abstract effects. I went though my notes and reviewed my want-list
of effects. My goal was to get a general idea of what each/any effect
would need so I could build a common 'effect' interface.
Below is this brainstorm / work-in-progress.
Considering RL game effects
===========================
I consider effects for my RL game using this working definition:
"An effect is a discernable change in the game world."
This means everything in the game world space that happens could be
abstracted as an effect. This doesn't provide a useful abstraction yet
-- I'm nowhere closer to solving my problem of modeling these effects.
I made a decision that I don't want to model anything that the player
can't potentially expereince.
Implementing any effect implies modeling some change. This works well
with my current game, which is broken out into a data set, which holds
the current world state, and procedures which operate on that data.
I realized that each turn some mobs might not act (produce change; i.e.
an effect). And what about a burning door? This would be an
effect that might be initiated by the player or a creature, but would
have a lifespan of its own, acting until it burned out. Thus I have
added another idea, which I call Anima... a list of things that are
active. Most mobs would be on the anima list, and some other effects,
like clouds of smoke or fires. If/when something was no longer active
(producing effects), it would remove itself from Anima's list.
I arbitraily decided to name any non-mob action effect an 'Event.'
Timer(which tracks game time) tells Anima what the current time is.
Anima tells active mobs or events to act.
A more detailed abtraction of my game world model using this idea;
-------------------
Game World
- Maps
- Mobs
- Items
- Events
-------------------
Timer <--> Anima
-------------------
Effects
-------------------
The ways effects can be modeled depend how the RL programmer or
designer allows to change, and how they model, measure, implement, and
balance those changes.
A quick review of the effects I had done so far showed that most
required different code of varying complexity, but there were some
very defined
Review of effects implemented so far
====================================
Open or Close
-------------
These were quite similar, easily factored together into one proc.
I imagine many more effects like these will require a simple change
of a state variable or flag. The complex part of implementing these
(as I did it) was not applying the effect itself, but checking
whether the (action's) effect was valid, and if so, was there more
than one valid target that reqired an additional choice.
This is an example case of applying an effect to an adjacent map
cell location.
Wounding and Dying
------------------
Very similar to the open, close above. Decide on a valid target,
and then apply the effect. The difference is that a mob is the
target instead of a door. This means that a general 'apply effect'
abstraction would need to either take into account different types
of targets, or make all game entities use the same type structure.
(As far as I know... there are most surely options I'm not aware of
yet.)
Build Field of View or Shine Lights
-----------------------------------
Again, applying this effect to each map space was easy, setting a
state variable or flag. This required setting the boundry of the
area to be tested, and then applying an algorithm that scanned the
entire space defined, using various checks to determine whether or
not any givin space was in view or lit. These were similar.
This is an example case of applying an effect selectivly to an area
of varying size.
Common elements of effects
==========================
I brainstormed and gathered ideas for effects to consider for
roguelike games. I thought of ifferent abstractions I might use to
help implement them. I tried to extract what I thought might be
common components of all effects, so as to create a common
nterface for applying them, and ease of adding them to a RL game.
I came up with the following common elements so far.
TARGET:
-------
- What will be affected by this effect?
- [ SINGLE | MULTIPLE ] [ AREA | ITEM | MOB ]
RANGE:
------
- How far away will this effect travel from it's source?
- [ SELF | ADJACENT | n DISTANCE | SIGHT | MAP | WORLD ]
FORM:
-----
- How does this effect manifest inside the gamespace?
- [ INTANGIBLE; SPECIFIC TARGET(S) AFFECTED DIRECTLY ]
- [ TANGIBLE_BLIND; PASS THRU AREA AFFECTING ALL TARGETS ]
for example; tidal wave, wind, forest fire, bullet
- [ TANGIBLE_SELECTIVE; PASS THRU AREA AFFECT CERTIAN TARGETS]
for example radio waves only discernably affect
recievers tuned in to their station..
Examples; CELL|BOLT|BEAM|BALL|FIELD|CONE|BLAST|STORM|CLOUD
ACTIVATION:
-----------
- What does a mob/item/event/God do to make this effect occur?
- [ SINGLE_ACTION | SUSTAINED_EFFORT | BOTH ]
Must eat, concentrate/chant, let go, etc.
-[ INTERRUPTABLE? ] -- Is the action stoppable and if so,
by what under what conditions? [ FORM + CIRCUMSTANCE ]
DELAY:
------
- How much time passes after activation before effect occurs?
- [ NONE | X TIME ]
DURATION:
---------
- For how long will this effect remain active?
- [ PERMENANT_LINGERING | PERMENANT_INSTANT | DECAYING_TIMER ]
REPETITION:
-----------
- Does the effect happen more than once?
- [ SINGLE | n TIMES | PERMENANT ]
RATE:
-----
- If it does repeat, how fast does it repeat?
- [ FREQUENCY OF REPETITION ]
The effects list
================
Here are the different effects I have found so far. Some of these
might not be appropriate for certian genres. Maybe someone will get
a useful idea from this list, that is my hope.
One of my primary concerns with this brainstorm was increasing the
levels of options, randomness, and potential interactions.
MOVE
----
change location; teleport, telekinesis, walk,
fly, fall, etc. variation, swap locations of
things... could be dangerous
CREATE
------
change by adding to what exists; conjure,
summon, etc. could be mobiles, items, natural
disasters, other effects, etc. could be a
temporary thing made of some element for n time.
BANISH
------
change by removing existance of somthing;
dismiss, banish, etc.
remove self from memory of other/ others
BUILD/MIX
---------
change by combining things into other things
MODIFY NATURAL(GAME UNIVERSE) LAWS
----------------------------------
change how effects are implemented...
laws of nature; gravity, magic essence, mana
recovery, whether magic even exists... etc.
POLYMORPH/REPLACE/CHANGE
------------------------
change by replacing something with something
else of a similar, or different type. Turn
enemy into a toad or sheep, etc. Swap AI_Type...
INCREASE/ENHANCE
----------------
aka enhance/bless + bonii (above normal)usually
affects skills. may be healing, likeability, charm
DECREASE/REDUCE
---------------
aka decrease/curse - penalty (below normal) usually
affect skills, hate effect (reverse charm)
STASIS
------
keep something the same, unable to be changed
PROTECTION/PREVENTION
---------------------
like stasis but allowing beneficial effects
LIMITATION
----------
like stasis but allowing harmful effects
DISABLE/PREVENT
---------------
disallow a behavoir, changes, or effects.. like
stasis but affecting activations/activities rather
than effects. general cases of this; paralysis, mute
ENABLE
------
add an allowable ability/behavoir.. granting
intrinsics is a common example of this one
RANDOMIZE
---------
randomize something.. by remapping actions to other
action each turn the confusion/ hallucination effects
are general cases of these
'random effect' of specific type
specific effect of 'random type'
OBSCURE/HIDE
------------
change by preventing or reducing chances of
being sensed ... or reducing sensory output;
silence/mask scent/sound.. bend light,
invisibility might be a form of this,
LOCATE/FIND/DETECT/REVEAL/PERCIEVE
----------------------------------
by changing vision, by telepathy, read minds,
etc... change by increased knowledge of something
RESTORE TO DEFAULT/REPAIR
-------------------------
change to default value, remove wounds/fatigue/
poision/disease... regenration is a healing with
a small effect repeated over time may either affect
everything, or just one select attribute/state
RESISTANCE
----------
reduce severity/power of some negative change
option: might affect positive changes as well!
SUSCEPTABILITY
--------------
increase severity/power of some change
DRAIN/STEAL
-----------
take x from a and give x to b
mixed increase/decrease self/other
PROPIGATION
-----------
spread something through an area. Take an effect
thats already present and cause it to expand.
DECISION MAKING
---------------
change the AI states, pacify, berserk, charm, hate
CONTROL
-------
allow the player to inhabit/control/possess
another creature.. like a shapeshifter etc. maybe
by temporaily or permentantly changing bodies
BODILY HARM
-----------
breaks, punctures, cuts, bruises, burn, freeze,
sickness, dizziness, bleeding, starvation, etc.
MENTAL HARM
-----------
psychosis, fears, hallucinations, obsessions
EFFECTS BY SENSE
----------------
any of the above might also generate a flavorful
message to the player depending on how the player
senses it.. and how the game models information
and learning to the player's character.
SENSE - EFFECTS
SIGHT - COLOR & LIGHT ... DARKNESS
HEARING - NOISES/SILENCE (talking, etc. )
SMELL - SCENTS
TASTE - FLAVORS
TOUCH - TEXTURES/FORMS/TEMPERATURE/IMPACTS/
BLOWS/WOUNDS/IMPACTS
ELEMENTS and MAGIC SCHOOLS
--------------------------
Most RL's have elemental spells, usually wizards
attack like spells( each having its own effect
dependant on how it is implemented.. sometimes
these are also used as magical schools under which
other effects or spells are placed; I have not
listed these out, since each implementation would
be different, but they are here for sparking
ideas...
FIRE, WATER, AIR, EARTH, SOUND, CLOUD, STEAM,
DUST, ICE, ROCK, EARTH, LAVA, NETHER, POISON,
DISEASE, DARK, LIGHT, GRAVITY, ACID, KNOWLEDGE,
HOLY, UNHOLY, TIME, SPACE, VOID, PLANT, ANIMAL,
BODY, MIND, SPIRIT, WEATHER, LIGHTNING, STORM,
METAL, SAND, ELECTRICITY, ARCANE, MANA, DEATH,
LIFE, NATURE, etc...
ADDITIONAL CONSIDERATIONS
-------------------------
Any of the above effects or might be modified to find
more variation by considering the following influences or
factors when combined with them alone or in combination.
- FIXED
- RANDOM
- SCALING
- DECAYING
- GEOMETRIC
- EXPONENTIAL
Things that could change; which effects act upon
================================================
This list might describe what is needed in a data set to model
different effects. In order to implement an effect we need to track
what changes... hence some kind of flag, variable, list of objects,
etc. is needed. Hit points and mob x, y are probably most common
examples of these.
EXISTANCE
---------
- does it exist?
LOCATION
--------
- where is it?
FORM
-----
- what is it? (shape, species, type of tool, material, etc.)
ABILITIES
---------
- what can it do? (what can't it do?)
STATUS
------
- what are it's present stats, intrinsics, etc.?
GEAR
----
- what stuff is it using now? (equiped items, etc.)
INVENTORY
---------
- what it's carrying that it isn't using? (loot, treasure)
---
Elsairon