A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 29

Thread: digital environment

  1. #1

    resolved

    Hi all!
    I think it was here in the games-section....
    Some peaple spoke (better: wrote) about a project called x-m or something like that. Its was about an digital environment. It enspired me to do something similar:
    http://www.xyankali.de.vu/portfolio/environment.html
    When you`ve read the rules, please press space to start.
    Hope to get some feedback,
    thx in advance, xyan

  2. #2
    Flying on Herbal Tea
    Join Date
    Jun 2002
    Location
    Scotland
    Posts
    469
    Thats petty neat

    you need something to make the player/viewer want to wath longer-
    I suggest making 2 animals and creating the food chain kinda thing...animal 1 when it meets a tree eats it or passes it. animal 2 when meets animal 1 eats it or passes it.

    to me I think this would make it more intriuging

  3. #3
    Senior Member
    Join Date
    Jun 2002
    Posts
    113

    i like it

    hey mad metal i like your idea man thats cool

  4. #4
    Senior Member
    Join Date
    Jan 2002
    Posts
    149
    since this is a Digital environment.. i guess I will show mine off too..

    the green block moves and spins around. Every now and then he gets hungry and goes to eat a piece of food. He sleeps too (turns blue) and then wakes up. I am still working on giving birth because of current problems with canabilism.. (eehh..he.. mm.. they like to kill each other .. not good).
    Don't pay attention to the numbers in the corner, .. but since your probably curious anyways the top one is a second counter.

    http://www23.brinkster.com/d3sinc/first-AI.html

    <www.d3s.net>

  5. #5
    SaphuA mosterdfles_flash's Avatar
    Join Date
    Jan 2002
    Location
    Tha Couch
    Posts
    935
    DethDesign thats a pretty dumb animal ... it's just a robot he doesn't do anything by 'himself'.

    I figured out how his life is:
    He sleeps 10 sec's when he's awake he walks around and after 5 sec's he walks to a food thing. (that code is made pretty good, but he should go to the nearest food thing) and then he walks agan 5 sec's and then it's time for another sleep etc. etc.

    I sugest you should make a random number for how long he walk's then devide that number with something and every full number (no commas) is the food he needs.

    I dont want to be bad to you but its just an idea

  6. #6
    ASR | FlashComm Ceasar Aware0's Avatar
    Join Date
    Aug 2002
    Location
    Aurora, Colorado, USA
    Posts
    110
    Damn.....you all respond to this post...no one to my AI? I know it's crappy at the moment, but we're coming along quite nicely. Just thought i would leech this post to mine:
    http://board.flashkit.com/board/show...hreadid=356181



    Sorry for the spam but it does fall under the cat. for this thread


  7. #7
    Senior Member Olorin's Avatar
    Join Date
    Aug 2000
    Posts
    1,151
    Xyankili> try to add some more things to make it more realistic, there's so much you can do with this.

    Always an interesting thing, artificial "life" simulation. I decided to try something myself, being inspired by what you've come up with:

    http://www.onetwofree.nl/flashkit/life4.html

    yellow dots: female creatures
    red dots: male creatures
    green dots: plants (food)

    creatures walk around ramdomly, eating food till they are full. Food grows constantly and shrinks when it is being eaten. Creatures die when they starve and mate when they're well fed and meet someone of the opposite sex.

    warning: gets very slow after a while.

    Olorin

  8. #8
    SaphuA mosterdfles_flash's Avatar
    Join Date
    Jan 2002
    Location
    Tha Couch
    Posts
    935
    Do they eat when they are hungry or if they walk next to it?
    Same with paring?

  9. #9
    SaphuA mosterdfles_flash's Avatar
    Join Date
    Jan 2002
    Location
    Tha Couch
    Posts
    935

    ???

    And how did you make the movement?

  10. #10
    Senior Member Olorin's Avatar
    Join Date
    Aug 2000
    Posts
    1,151
    are you asking me ? They just eat when they touch something, but only when they are hungry, and they mate when they touch, but only when they're well fed. They just move around randomly, chosing a new direction every few seconds.

    Olorin

  11. #11
    HI all!
    Thanks for all the comments!!!
    I ve added some features now and I will add more in the next time.
    The idea with the femals is very good.
    I will probably put that in.
    For now I've switched the animals and plants to germs.
    And now the green germs make a "nest" and the new germs come out of it after a while.
    The red germ will be a killer who kills the blue germs when he hits them....
    Thats a few things `'ve added so far, but more things will come.
    http://www.xyankali.de.vu/portfolio/environment.html
    press "space"...
    And don't look at the things I've written in the first frame...they aren't right anymore.

    Now to the movement question: Its an moving engine written by myself. It uses vector-addition. It doesnt always work 100% right but it works.

    Any other comments?
    [Edited by Xyankali on 08-16-2002 at 02:35 PM]

  12. #12
    OK I think everything works right now. If anything doesn't, please tell me.
    My next creature will be a worm which eats the blue germs.

  13. #13
    SaphuA mosterdfles_flash's Avatar
    Join Date
    Jan 2002
    Location
    Tha Couch
    Posts
    935

    well...

    I'm asking everyone about the movement...

    When I make a movement with random ending's they never walk in 1 straight line... how is that made?

    BTW: All the things are lookin good! I like that

  14. #14
    ok, I use this code:
    Code:
    if (Math.random()*200<1) {
    setProperty("MC", _rotation, (Math.random()*360)-180);
    }
    You see I use Math.random()-functions to make them go in one straight line. the chance that he changes his direction is 1 to 200. But if you loop that frame, the code will be executed about 10 times per second I think. Of course this depends on the system and how big the amount of code is.

    The new direction is also calculated out of a Matzh.random()-function.
    Hope this helps, xyan

  15. #15
    Hi again!
    I want to code an animal that moves like a worm:
    When the first part of it moves, the other ones follow in line. Has anyone done such a thing before or is there a tutorial? I hope at least a few know what I mean.
    Thx in advance, xyan

  16. #16
    ASR | FlashComm Ceasar Aware0's Avatar
    Join Date
    Aug 2002
    Location
    Aurora, Colorado, USA
    Posts
    110
    like this?

    http://12.253.240.154/hybrid/assets/swf/Worm-Basic.swf

    yea, Somar, my friend made this one, and others similar.

  17. #17
    SaphuA mosterdfles_flash's Avatar
    Join Date
    Jan 2002
    Location
    Tha Couch
    Posts
    935

    ???

    Originally posted by Xyankali
    ok, I use this code:
    Code:
    if (Math.random()*200<1) {
    setProperty("MC", _rotation, (Math.random()*360)-180);
    }
    You see I use Math.random()-functions to make them go in one straight line. the chance that he changes his direction is 1 to 200. But if you loop that frame, the code will be executed about 10 times per second I think. Of course this depends on the system and how big the amount of code is.

    The new direction is also calculated out of a Matzh.random()-function.
    Hope this helps, xyan
    I dont understand that man... I need a script so that the thing walks in a straigh line from point to point???

  18. #18
    I wanted to tell you earlier: your hybrid page is down.

  19. #19
    Oh sorry than we were missunderstanding each other.
    Code:
    // 
    var speed = 1; // the speed
    var gotoSpotX = bla;//the xpostion of the place you want it to go
    var gotoSpotY = bla;//the ypostion of the place you want it to go
    // calculate angle of current position to target position
    delta_x = getProperty("MC", _x)-gotoSpotX;
    delta_y = getProperty("MC", _y)-gotoSpotY;
    targetRotation = -Math.atan2(delta_x, delta_y)/(Math.PI/180);
    //
    // 
    // move MC toward the target and stop when it gets there
    if (Math.sqrt((delta_x*delta_x)+(delta_y*delta_y))>speed) {
    getProperty("MC", _y) -= speed*Math.cos(targetRotation*(Math.PI/180));
    getProperty("MC", _x) += speed*Math.sin(targetRotation*(Math.PI/180));
    }

  20. #20
    SaphuA mosterdfles_flash's Avatar
    Join Date
    Jan 2002
    Location
    Tha Couch
    Posts
    935

    :)

    cool...

    thnx for the script... thats a pritty cool thing

    I go work on my own digital enviorment now (dont expect to much... i'm still learning )

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center