Thursday, November 24, 2011

Looking for a name for a new concept in JADE

I'm right now having fun with implementing armies for the "King of the Orcs" story arc in the upcoming JADE 0.2.3 release. While doing so I noticed that I need to add a new concept to maps in order to depict armies.
The currently existing programming abstractions for maps in JADE are
  1. Tiles (the basic building blocks like walls, doors, tunnels, etc.)
  2. Beings (living and undead beings moving around and having an intelligence of their own - basically single entities with some kind of sentience)
  3. Items (or rather lists of items... basically everything you can drop)
  4. MapFeatures (basically things that can be grafted onto tiles like altars, statues, etc.)
The common feature of these things is that there can be but one of each at a given coordinate position on the map (specifically one item list, not one item concerning #3).

Now armies do not really fit into this scheme (e.g. they are no basic building block, they are units of beings but not a single being, they definitely aren't items and they even aren't map features as those things usually are just non-sentient things). I pondered for a while whether to implement armies as map features (as they only would exist on the surface world and on the world map there are no statues, altars, etc.).

But then my stomach told me not to do so because domain driven design (IMHO) correctly teaches to use distinct abstractions for distinct concepts. And there are other concepts similar to armies (especially concerning the world map - e.g. crafts like boats). So what are the common features for armies (and similar conceptual entities)? IMHO the concept I am trying to name has the following common features:
  • When you try to move into a position with such an entity you might be required to confirm your intent ("Do you really want to face the orcish army?", "Do you want to unmount your horse and enter the boat?").
  • When you actually move into the given position with said entity "something" is going to happen (e.g. an encounter with the army is started or you actually enter the craft and unmount your previous craft leaving it in your old position).
  • Like the other concepts mentioned in #1 to #4 there needs to be a visual representation.
  • For some concepts (like crafts) there needs to be a "Something is here" type of message when entering the position (bullet #2 might account for that).
  • There could be more than one of these things in a given position (e.g. two boats, a horse and a wheelcart, etc.).
So I will use a separate data structure to model this kind of entity in JADE. But I am lacking a good name.  I already was tempted to call it a "Something" but that seems to be rather stretching as it applies to most of the other things mentioned und #1 to #4, too.

Any suggestions?

15 comments:

  1. This is just the first thing that comes to mind, so consider it an idea in need of further iterations... but how about an interactive obstruction? I think at first it might be an interactive object or entity, but armies aren't really objects and they represent more than one entity. I then thought of the term obstruction, as it seems to indicate that these types of things cannot just be moved through and may be interacted with if you bump against them.

    I suppose you could shorten them to obstructions, but that kind of describes terrain features like impassible mountains, too.

    ReplyDelete
  2. I would call it a Mobile Event to represent the abstractness and flexibility of the implementation.

    ReplyDelete
  3. Since an army exists in a specific location, and presumably at least some of these things will be "places" you can be that are distinct from the surrounding things (boats and carts are what I'm thinking here), I think you should call them locations.
    Some modifier might be necessary if the concept of location itself is already taken. ie mobile location, interactive location, army location, boat location.

    ReplyDelete
  4. Dynamic Entities

    dy·nam·ic (d-nmk)
    adj. also dy·nam·i·cal (--kl)
    1.
    a. Of or relating to energy or to objects in motion.
    b. Of or relating to the study of dynamics.
    2. Characterized by continuous change, activity, or progress: a dynamic market.
    3. Marked by intensity and vigor; forceful. See Synonyms at active.
    4. Of or relating to variation of intensity, as in musical sound.
    n.
    1. An interactive system or process, especially one involving competing or conflicting forces: "the story of a malign dynamic between white prejudice and black autonomy" (Edmund S. Morgan).
    2. A force, especially political, social, or psychological: the main dynamic behind the revolution.



    Couldn't really describe what you want more.

    ReplyDelete
  5. I would say a "traveling" or a "traveler" or something along those lines. (Probably traveler.)

    ReplyDelete
  6. as someone else said on facebook, they sound to me like two seperate classes. So boats would be under something like crafts or vehicles and armies under something like armed forces

    ReplyDelete
  7. Interactive Feature
    Presense
    Dynamic Entity also seems good

    The question is - boats and armies are mutially exclusive?

    ReplyDelete
  8. I would separate the concerns in a slightly different way here; not sure if it fits into your design model though.

    A MapArea models a reference to any number of locations (i.e., coordinates) on the map. It does not contain the map tiles, it just points to them.

    The event handling system of the map allows registering (possibly vetoable) event listeners for all kinds of events that happen for a given MapArea. Those might be EnterEvents, ExitEvents or others.

    In this way, you can model various aspects of the orcish army:
    - Game interface interaction: "Do you really want to..." etc.
    - Functional interaction: "The orc army attacks you" etc.

    The orc army has a functional model (how many orcs, behavioral parameters like aggressiveness etc.) and a physical model (number of map tiles occupied, graphical representation etc.). The physical model deals with moving its MapArea when the army moves. The functional model deals with reacting to events. Both are joined in a bigger model, which might be an instance of "Army" or "Collective", or something like that.

    ReplyDelete
  9. I assume this is just a schematic thing, so that you have the proper understanding for it in your own mind. Only your own mind can really tell you what to call it, and it depends on whether the existing classes you've made are conceptually sound.

    What's wrong with 'army'? You want to unite army and boat under a single concept? Like 'map_feature' or 'group' or something?

    Since you've got 'tiles' and 'beings' as separate concepts, but boats are a group of tiles and armies are a group of beings, perhaps they need uniting under a single concept. Like 'thing'. Then an army or a boat is a 'meta-thing' which you could just call a 'group'.

    But without understanding your code better I can't tell if I'm way off.

    ReplyDelete
  10. I'm thinking 'ensemble' for things that are made of many basic building blocks, like an army made of many beings or a boat made of many tiles.

    ReplyDelete
  11. To elaborate my earlier point:
    Being and tile are polymorphic subclasses of 'thing'. It's probable that youv'e already defined this since they would share common members such as 'name' and 'character'.

    'group' is a pure virtual class containing an array of 'things'. 'army' and 'boat' are subclasses of it. 'tile_group' and 'being_group' may be justifiable classes, too, of which army and boat are subclasses.

    ReplyDelete
  12. Well, unless an army can be in the same tile as a single being, I'd classify them as a new... class of creature - a container creature.

    That way, you can define armies, mobs, horses, symbotes, or anything that involves multiple thinking things in the same space using a new 'container' type of creature. Some could be controllable, like a horse, some could be automatically formed when multiple creatures step into the same square (much like a stack of items when there are multiple items in the same square).

    While awesome, I almost shudder to think of the possibilities; tension rooms where you suddenly have to fight a swarm of a dozen rats all in one square? swarms of bees? Armies of orcs?

    ReplyDelete
  13. Overworld event or overworld entity, perhaps.

    ReplyDelete
  14. Internal to the code "entity" or "dynamic whatsit" is fine. But for documentation, I suggest "encounters", that's some classic D&D. So they can be orc armies, or Kranach and his raiders, chaos monks, or a caravan of travelling merchants, or anything else that moves around which you can "encounter", which existed in the world map already and should behave similarly.

    ReplyDelete
  15. Thanks for all the ideas... many were great and the decision was truly tough. For whatever reasons I have decided to go for "mobiles".

    ReplyDelete