Environment rules
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 4 1234 LastLast
Results 1 to 15 of 48

Thread: Environment rules

  1. #1
    Join Date
    Aug 2002
    Location
    Madrid
    Posts
    4,588

    Environment rules

    Please post here your ideas about the rules of the game. The basic ideas include:

    Creatures:
    • Move into any of the 8 directions in the grid or stand still.
    • Harvest food from a food resource.
    • Attack each other, which would cost some resources. Maybe get resources if they manage to kill another creature.
    • Duplicate themselves (i.e. breeding), which costs resources as well.
    • Die as a result of an attack, a natural hazard or lack of food.
    • Scan their environment for sources of food / foes / hazards.

    This list is not comprehensive and further ideas are welcome. The world itself will be a grid with some wall tiles, some food tiles, some hazard tiles (things like holes would be static, but stuff like fire could move and spread).
    Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
    Supports C++ and VB out of the box, but can be configured for other languages.

  2. #2
    Join Date
    Nov 2001
    Location
    Beyond Juslibol
    Posts
    1,688
    Only few things about Yves post:

    I think it's to late for talking about duplicating and breeding. As Brad said, It's better to mantain the initial project simple and once working, complicate it.

    In this sense I think is better to make initially simple rules. There would be time after this for complicate the project.

    About the rules I have think this

    Scan their environment for sources of food / foes / hazards.
    Have you ever played X-COM? The scan capabilities of the soldiers is only in one of the eight directions of the grid. They can see only the things they have in front of them covering certain angle. I think this would made the movements and the scaning more realistic.

    But this is only my opinion

  3. #3
    Join Date
    Aug 2002
    Location
    Madrid
    Posts
    4,588
    Nothing is too late, there has not been any coding yet So yeah, maybe breeding should be left out for a first version.

    Yep, I was also thinking of restricting the view of a creature to be only forward (with some viewing angle of course).
    Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
    Supports C++ and VB out of the box, but can be configured for other languages.

  4. #4
    Join Date
    Oct 2001
    Location
    Dublin, Eire
    Posts
    880
    Originally posted by Doctor Luz
    I think it's to late for talking about duplicating and breeding. As Brad said, It's better to mantain the initial project simple and once working, complicate it.

    In this sense I think is better to make initially simple rules. There would be time after this for complicate the project.
    I agree with that. In a first version, it will probably be simpler to let a few features out: breeding, natural hazards, ...

    The first version may be better if just made of moves, feeding and fights. We should concentrate on some basic creature definition:
    - How does it feed.
    - How much does it cost to move, strike an opponent, scan the environment, do nothing.
    - How do we define the creature characteristics (weight, size, strenght, ...).

    This will be a good start before adding all the other things.

    All the differenty creature characteristics will influence their resource consuption (speed, size, strenght, ...). A heavy creature will probably be harder to kill, but it will need more resources to survive.

    Have you ever played X-COM? The scan capabilities of the soldiers is only in one of the eight directions of the grid. They can see only the things they have in front of them covering certain angle. I think this would made the movements and the scaning more realistic.

    But this is only my opinion
    As all functions, this must be studied as well. We can image "creatures" with eyes in all directions that can scan all the environement at a time. This will cost most resources than a creature that can scan only one direction at a time.

    But all this has to be defined. And all this can also be adjusted. If later we see that having this feature gives too much advantage, we can do it more costly: use 1 resource to scan 1 direction at a time. use 3 (1+2) resources to scan two directions at a time, 6 (1+2+3) for three directions or any other adjustment that seems fair. A way to "balance" these feature would be to write to creatures that would be exactly the same exept for this feature and see what resource is required to make it even when they compete. The same principle can be applied for most other features.

    That is another good thing as well. If the rules are adjusted, a creature that won by using some feature will get weaker in the next round if this feature is adjusted, so the programmer will have to adjust its AI to deal with that.

    I guess the FAQ (or any other thread) will keep the programmers updated about the last features adjustments.
    Elrond
    A chess genius is a human being who focuses vast, little-understood mental gifts and labors on an ultimately trivial human enterprise.
    -- George Steiner

  5. #5
    Join Date
    Nov 2001
    Location
    Beyond Juslibol
    Posts
    1,688
    Sorry, Whith "resources" do you mean "time units", so the creatures have a limited number of time units to do things each turn?

  6. #6
    Join Date
    Aug 2002
    Location
    Madrid
    Posts
    4,588
    Ok, so I'll propose some things.
    • Creatures start with something like 40 power points. They can be allocated in the following characteristics:
      * weapon strength. A stronger weapon will do more damage
      * weapon resistence. This will be used to take off damage that would be caused otherwise. Sort of like a shield.
      * food consumption. If more points are in here, the food consumption for firing weapons and moving will be lower.
      * life points. This determines how much damage a creature can take before it dies
    • A creature feeds by going to a food square and sit a turn (or more turns) there doing nothing else.
    • In a turn one of the following actions are possible
      * Move forward by 1 square
      * Turn any angle (90, 180 or 270 degrees)
      * Scan forward
      * Harvest food
      * attack an opponent in the square in front of the creature
    • The powerups could include the following:
      * additional power point(s) (in the range of 1 to 5 points maybe)
      * life regeneration (gradual or complete healing)
      * food squares

    For damage calculation I would propose the following formula:
    damage = (attack + defense) / defense. So each creature has to have at least a few points in defense and a few life points, otherwise it would die instantly.

    Creatures would start off with 100 food units. Moving around, turning or scanning would require 4 food. Attacking would require (attack characteristic) / 2 food units. The food consumption characteristic would be used to diminish these by the follwoing formula:
    actual consumption = (theoretical consumption) * 10 / (food characteristic + 10). So having 10 in the characteristic halves the food consumption of each action.
    The number of life points is double the number of points spent in that characteristic.
    In a food square, a creature can harvest 10 food per turn.
    Life regeneration squares regenerate about 5 life points per turn.

    And maybe regenerate 1 life point every 20 / (food characteristic) turns by itself.
    Last edited by Yves M; January 15th, 2003 at 01:01 PM.
    Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
    Supports C++ and VB out of the box, but can be configured for other languages.

  7. #7
    Join Date
    Nov 2001
    Location
    Beyond Juslibol
    Posts
    1,688
    Yves, It seem you have been doing this all your life.

  8. #8
    Join Date
    Aug 2002
    Location
    Madrid
    Posts
    4,588
    Here a very simplistic design. All creatures are equal and have only the life points attribute. Moving / turning / scanning and attacking do not cost any energy (but each takes a turn). Each attack takes away about 1/5 of the opponents life points. If the creature just sits there doing nothing it will regenerate 1/20 of its life points in a turn.

    So no concept of power ups here.
    Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
    Supports C++ and VB out of the box, but can be configured for other languages.

  9. #9
    Join Date
    Aug 2002
    Location
    Madrid
    Posts
    4,588
    Originally posted by Doctor Luz
    Yves, It seem you have been doing this all your life.
    I've played a few RPGs and know their point systems pretty well, that helps
    Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
    Supports C++ and VB out of the box, but can be configured for other languages.

  10. #10
    Join Date
    Aug 2002
    Location
    Madrid
    Posts
    4,588
    Here is a sample of a grid with a robot and its viewing angle. Any square that is partially visible is marked as visible.
    Attached Images Attached Images  
    Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
    Supports C++ and VB out of the box, but can be configured for other languages.

  11. #11
    Join Date
    Aug 2002
    Location
    Madrid
    Posts
    4,588
    Ok, this seems too complicated, so maybe we'll just stick with "seeing" up to two squares in front of the robot, like in the attachment.
    Attached Images Attached Images  
    Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
    Supports C++ and VB out of the box, but can be configured for other languages.

  12. #12
    Join Date
    Sep 2002
    Posts
    1,747

    let me see...

    Just to see if I have things right so far .

    We have two different states that will be implemented: creature and environment.

    Creature state includes:
    • Power points allocated to attack strength.
    • Power points allocated to defense strength.
    • Power points allocated to "food consumption." This one is a bit unclear to me, but I guess it has to do with effiency of life point use?
    • Life points, like a health indicator.
    • Current food carried.


    Environment state is a grid that cotains grid objects like the creatures (and their orientations!), blocks, food, other hazards.

    Both states change on a turn basis. Each turn, a creature has actions they can do: Move, Scan, Turn, Harvest (and/or sit?), and Attack. Moves change the environent's state for the position of the creature and consumes food. Scan returns some of the environment's state to the creature scanning, and consumes some of their food. Turn changes the environent's state for the orientation of the creature (consuming food). Harvesting or sitting increases the creature's available food. Attacks take free life points from the target and food from the attacker. Plus, life points regenerate or deteriorate depending on the position of the creature (are they on a life regeneration grid point, a hazard, or something innocuous)

    If I have this right so far, then I have some questions.
    • How does scanning get blocked by obstacles in the adjacent three squares (ie. do diagonal obstacles block only the furthest diagonal or also the square next -- for hiding around the corner type things -- and does an obstacle directly head block scanning of 1, 3, or 5 squares in the back)?
    • Food is only used for the turn mechanism and not to regenerate life. Is this correct?
    • Is it possibly to dynamically reconfigure your creatures power point distribution among its first four state members (possibly consuming food)?

    There are a couple of other things, but I think this is a good start...

    *** galathaea pulls out a golden morph-o-ray and turns all other creatures into gigantic chickens ***
    */*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/

    "It's hard to believe in something you don't understand." -- the sidhi X-files episode

    galathaea: prankster, fablist, magician, liar

  13. #13
    Join Date
    Aug 2002
    Location
    Madrid
    Posts
    4,588

    Re: let me see...

    Originally posted by galathaea
    Power points allocated to "food consumption." This one is a bit unclear to me, but I guess it has to do with effiency of life point use?
    It has to do with the efficency of how the food is spent. If this stat is high, your creature consumes less food for each action it takes.

    How does scanning get blocked by obstacles in the adjacent three squares (ie. do diagonal obstacles block only the furthest diagonal or also the square next -- for hiding around the corner type things -- and does an obstacle directly head block scanning of 1, 3, or 5 squares in the back)?
    A square that is partially visible should be all visible, but blocking still occurs. I'll draw some pictures of this to illustrate my point.
    Food is only used for the turn mechanism and not to regenerate life. Is this correct?
    Yes, but if you run out of food, your creature is dead (since it can't do any more moves).
    Is it possibly to dynamically reconfigure your creatures power point distribution among its first four state members (possibly consuming food)?
    I don't think that this would be a good idea, since it's more logical that your creature has to be balanced enough to survive all kinds of foes. Otherwise you could figure out where an opponent is, allocate every stat point in strength and slay him from behind in one turn.

    I want to avoid 'winning combinations'. There sure are some combinations of stats that will make more sense than others, but I hope that we manage to have a balanced enough system so that wildely different creatures and approaches have a chance of winning.

    *** galathaea pulls out a golden morph-o-ray and turns all other creatures into gigantic chickens ***
    *** and galathaea gets crushed by a giant chicken foot ***
    Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
    Supports C++ and VB out of the box, but can be configured for other languages.

  14. #14
    Join Date
    Oct 2001
    Location
    Dublin, Eire
    Posts
    880

    About scanning

    I have an idea about the scanning thing. As any normal creature, they should not require time to scan ahead of them. Real creature usually don't have to stop to see what's in front of them, and then continue acting.

    I think every creature should be made aware when its turn begins of what is in front of them (say up to 2 squares in distance, like suggested by Yves M). This is not scanning but just keeping the eyes opened.

    Then there can be two types of sanning:
    The first is like making a turn aroung to see all that is around you (up to 2 squarres).
    The second allows you to see further ahead of you (like using a telescope).

    I think this would make more sense.
    Elrond
    A chess genius is a human being who focuses vast, little-understood mental gifts and labors on an ultimately trivial human enterprise.
    -- George Steiner

  15. #15
    Join Date
    Sep 2002
    Location
    Belarus - Tirol, Austria
    Posts
    647
    I agree mostly with Yves and corrections from Elrond.
    Yeh, every creature before making some step must analyze situation around. Elso I can add such possibility like HEAR, because even if creature can see only what takes place before it, but it can hear on some territory around it.
    But all this depends of such thing like: how our host plans all.
    Does every creature get fixeing time slot for the next step? It must be so. Because otherwise it can spend to much time for analyzing of the next step and this is not like in true nature.
    "UNIX is simple; it just takes a genius to understand its simplicity!"

Page 1 of 4 1234 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center