Weird impy thing
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Misc. > Everything Else > Virtual life simulation - or whatever.
 
Author
All times are GMT. The time now is 08:59. Post New Thread    Post A Reply
Katamori
Forum Staple


Posts: 2554
Registered: 08-10


I'm a wannabe programmer who's interested in artificial life. I've already made some experiments to make something, and my final aim is to create a virtual life form that can react to the environment and things like that.

Maybe it sounds like if I'd be naive but in my opinion, if there are actors on the screen which changes their moving speed and angle constantly, then we can describe them as a very simple and useless lifeform. =)

TL;DR, I need your help. Which are the preferences that I should add my "creatures" to make them more useful and efficient?

EDIT: since a lot of valuable post has come, I changed the original title - so even if you don't want to help me, you are allowed to write something related =)

__________________
Interesting stuff around me:
Channel of Doom Let's Plays
Somewhere in Time project thread
CYBERCRAFT: A cyberpunk RPG for LÍVE

Last edited by Katamori on 02-14-13 at 11:25

Old Post 02-13-13 18:23 #
Katamori is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
schwerpunk
Senior Member


Posts: 2048
Registered: 05-12


Question: Are you asking for programming advice? Because I'm useless there, unfortunately.

Generally speaking, I would advise you to include some randomness in its actions/decisions. It creates the illusion of the "creature" reacting to some unknown variable, and makes it seem more alive.

Old Post 02-13-13 18:33 #
schwerpunk is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
geo
Forum Staple


Posts: 3090
Registered: 10-05


Make it voice activated and follow your habits? Like every day at this time you open these programs. make it have them ready for you?

Is this for a game or just like a desktop helper or something?

Old Post 02-13-13 18:36 #
geo is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Katamori
Forum Staple


Posts: 2554
Registered: 08-10



schwerpunk said:
Question: Are you asking for programming advice? Because I'm useless there, unfortunately.


Of course not. =) I make stuff in a game maker app. called Stencyl. It's perfect to implement most of the logic I want to put, without the formal needs of a clear programming language.

I'm learning the language C at the university but I know the basics yet only.

Old Post 02-13-13 18:39 #
Katamori is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Katamori
Forum Staple


Posts: 2554
Registered: 08-10



geo said:
Make it voice activated and follow your habits? Like every day at this time you open these programs. make it have them ready for you?

Is this for a game or just like a desktop helper or something?



I rather want them to act to the environment (obstacles, themselves, other creatures etc.)

It's like an experimental simulation. Of course, on the level I do at the moment, it's not more than just a game, but later I want to make something more serious. Now I'm planning the basic logics to a base of an artificial life.

Old Post 02-13-13 18:42 #
Katamori is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
geo
Forum Staple


Posts: 3090
Registered: 10-05


Give it an objective. Like get from point A to B.... or kill anything within a radius of X. Or follow something. I'd say work on path finding first. Getting from point A to B. Then put an object in the way. Then determine if it can go around or over or under the object. That's a start.

If you want them to act to the environment put in variables about what they consider threats. Like do they avoid harmful gas or just run through it? Do they have self preservation where near death they'll avoid environment hazards they wouldn't while fully healthed?

When you get really complex like have an object they need to destroy... have them circle it. RTS have been doing it for decades but FPS can't seem to do it.

Last edited by geo on 02-13-13 at 19:44

Old Post 02-13-13 19:05 #
geo is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
geo
Forum Staple


Posts: 3090
Registered: 10-05


Sadly I think you lost everyone when you said Stencyl. What style would the game fit into? Top down? Side scrolling? I don't think they can do 3D, but maybe a fake 3D like Contra had.

Old Post 02-13-13 20:25 #
geo is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Maes
I like big butts!


Posts: 12264
Registered: 07-06


What about The Game Of Life or a variant thereof?

And yeah, stay away from "game maker" tools, especially if you've just begun serious programming training: they are almost as crippling as BASIC to a novice programmer, locking you into a very limited way of thinking and preventing you from grasping essential concepts and developing required programmer skills early on.

It's much better to drudge by making simple -even trivial- programs in C, even if you will be a far cry from making a game with real graphics etc. than to get trapped into the artificially inflated sense of "proficiency" a game maker tool might give you.

Old Post 02-13-13 21:42 #
Maes is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
geo
Forum Staple


Posts: 3090
Registered: 10-05


Now I think I understand better what a life simulator is. I was imagining the Sims yet putting a FPS visual in my head :-)

Old Post 02-13-13 21:46 #
geo is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Katamori
Forum Staple


Posts: 2554
Registered: 08-10


I won't lie that I make my stuff by writing codes when it's not true. =) game maker apps are good for me to try the "logic" elements, without the formal needs, as I mentioned it before. In Stencyl, I can edit a simplier kind of codes like this:

http://i.imgur.com/nf9hp.png

Sadly, I'm a beginner in C, and not the graphics are my biggest problem but the fact that I don't even know, how to create an empty window with moving elements on it, or how to create random values to variables, etc. - all these things are ready in Stencyl for me.

Oh and my plans are a bit different than the Conway's Game of Life. I want to put sense to my "creatures" - on a simple way of course. =)

Old Post 02-13-13 22:52 #
Katamori is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
geo
Forum Staple


Posts: 3090
Registered: 10-05


But what do you want them to do? Gather food... eat... mate... multiply?

Old Post 02-13-13 23:06 #
geo is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Katamori
Forum Staple


Posts: 2554
Registered: 08-10


I don't know yet. Maybe all of them...this is why I made this thread. "Which are the preferences that I should add my "creatures" to make them more useful and efficient?"

I think multiplying is important but the most important part of it. I'm thinking on that I shoudl create group behaviour: when one of them sees something (e.g. a tree) he triggers an event that effects the other creatures around him (e.g. help to cut the tree)

Old Post 02-13-13 23:27 #
Katamori is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Quast
insert title here


Posts: 2605
Registered: 09-02



geo said:
But what do you want them to do? Gather food... eat... mate... multiply?

And evolve, game already exists, and it's pretty fun to mess around with.

http://www.swimbots.com/

Although said creatures only reactions to their environment is to seek out and try to find food and mates.

Old Post 02-13-13 23:30 #
Quast is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
geo
Forum Staple


Posts: 3090
Registered: 10-05


A group behavior, so its social. Then chances are they will send out drones / scouts to randomly explore, find things and then return to the others and tell them then they'll all go.

========== multiplication and evolution

Let's say you make it random every time... how much food, air and water are needed for health? Or keep it simple. How much food do they need to be healthy? When they collect 5 bits of food then they have enough to multiply. If they don't get food they slowly die. The last one doesn't die it just splits and its offspring then require the same amount of food that the previous one did.

If there is no food then it just dies or floats to where there is food. If it had to float a long time to reach the food it will grow tentacles or fins. The offspring will have them. The further it has to go for food the longer the fins.

Then there's the issue what happens if the food is hard to reach? Then it might grow arms.

Last edited by geo on 02-14-13 at 00:07

Old Post 02-13-13 23:53 #
geo is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Katamori
Forum Staple


Posts: 2554
Registered: 08-10


Wow, that game is fantastic! I haven't heard about it before... =)

Old Post 02-14-13 00:57 #
Katamori is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Maes
I like big butts!


Posts: 12264
Registered: 07-06



Katamori said:
building blocks picture


Oh GAWD. Get away from that stuff as fast as you can. Once you see what the equivalent C code for that is (apart from the "switch animation" part), you'll never go back. This is simply holding you back, it's like building LEGO houses with ham fists. Using the BIG Lego Jumbo bricks.

On a side note, I've seen this "slot/wedge pieces of code together" approach before, in other "my first programming environment" suites. The complexity that you can reach before programs and projects become visually unmanageable are about 1-2 screenfuls, and the code complexity achievable is roughly equivalent to 100 or so lines of C code. Not really enough to do something as complex as what you want to do. To go beyond that, you REALLY need a "normal" programming language.

Really, get away from this stuff. It's like trying to learn from a pop-up book.

Old Post 02-14-13 00:58 #
Maes is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
geo
Forum Staple


Posts: 3090
Registered: 10-05


I agree with Maes. Its in your best interest to use something more commonly used. I think Stencyl is based in ActionScript 3 which is a terribly cumbersome language of Adobe Flash. ActionScript 2 was extremely easy to use... but eh Adobe took over and changed it.

Old Post 02-14-13 01:31 #
geo is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Aliotroph?
postCount++


Posts: 2583
Registered: 03-02


I agree too. If you're going to use a game maker than at least use something with a proper scripting language. The visual clutter in that screenshot is amazing. I'm legally blind and I don't keep the fonts in my code windows that big. The strange wedge structure occupying the role of tabs and braces is just crazy.

Now of course you use a game maker for the reason that John Carmack keeps reiterating when he talks about learning game programming: new tools take too much learning and setup to get anything interesting to happen. Despite what Maes says about BASIC, at least when using it on a tiny 80s computer you could put stuff up on the screen and play with it in a matter of minutes.

It's hard to do simple game stuff in C because all those kinds of things are platform dependent and can be done in a bunch of different ways. I'm not sure what tools to recommend if you want to do stuff in C. I've only used C on Linux, and not for game-esque things.

Old Post 02-14-13 01:58 #
Aliotroph? is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
geo
Forum Staple


Posts: 3090
Registered: 10-05


Although plenty of people recommend against it... I always recommend Flash / ActionScript 2 or 3 to people. Its VERY processor intense, but Super Meatboy was made with it and various other Flash games. Angry Birds too. Otherwise Java works.

While these might not make the next Gears of War, they can make quality games.

Old Post 02-14-13 02:27 #
geo is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
gggmork
If you can make any sense of this post, congratulations


Posts: 2714
Registered: 06-07


You probably want to download sdl, a 2d game/sound/visual pixel stuff library. I only used it in the 'wrapper' pygame for python so far, but its for c.

Everything in the program is artificial, so for artificial life you need an artificial environment. Make it extremely simple, just something to experiment with, like a 2d array serving as a grid which is the top down world. Now you can have a list of food/trees/etc or something, each with a grid location, and creatures of different types etc or whatever.

My basic understanding is that its about :
first make some data (like each creature has an x/y/current behavior/etc. For me, this is usually big hairy multi dimension arrays because I hate OOP). If saying myArray[4][15] is a pain to remember which number stands for what you can probably do some #defines so 15 always equals "health" or some crap and you can go myArray[4]["health"] I guess (haven't really tried that much yet). Uh, maybe a hash (python dictionary) is what I mean anyway.
now loop forever until the game quits:
1)display the data on this tic (tic, tick/whatever) of time (like print stuff to the monitor)
2)probably pause for a bit so stuff doesn't happen as fast as your computer can go
4)handle events, like if you press up whatever happens (sdl deals w/ it)
4)change the data for the next tic

To make slightly intelligent stuff happen in such a simple 2d grid, you kinda need rules or something to make it more interesting, like maybe the intelligent creature can slash with a "sword" into adjacent squares, or maybe interpret it like you're skiing downward and have to dodge trees going upward or whatever.

Real life is based on replication. Once replication starts, mutations inevitably occur because replication is almost never perfect. Then the environment does its own selecting of whichever mutants happen to be most fit, which replicate their own mutants etc. See this:

Last edited by gggmork on 02-14-13 at 06:46

Old Post 02-14-13 03:03 #
gggmork is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
geo
Forum Staple


Posts: 3090
Registered: 10-05


The competing over the green cube looks like random results. ... but how do they get smarter without you programming them? Are they programmed to learn? Isn't that kind of cheating? Does that mean it makes its own code as it goes along?

So it costs energy to have kids... that's why they can't just have kids and eat them? Why wouldn't it eat the kids always no matter what? Gotta put in a genetics to protect your young.

Do these things really have little brains or is it just variables and reactions to everything around them. How exactly would changing the hue to mimic day and night instill them to stop foraging... unless it was programmed? Why not include water would it just know oh I should drink this? What if you included jello would they know its food or do they think its a wall? Do you have to give it a variable that says jello is food? How do objects kill one another when they're just squares? Do the squares measure movement and velocity vs damage and strength? I don't get the connection. How do they eat one another with no mouth? Do they acid eat things to consume them? Why not consume them while living? They didn't evolve to be red and green... they were programmed to.

I don't understand why Ply World is considered AI evolution.

Since this has been going from 1994... does that mean they have evolved into round objects and cats?

Last edited by geo on 02-14-13 at 05:10

Old Post 02-14-13 03:29 #
geo is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
gggmork
If you can make any sense of this post, congratulations


Posts: 2714
Registered: 06-07


I'm no expert but you can probably search engine "karl sims" for more info on his experiments. Evolution is kind of a mass search algorithm; it operates on tons of individuals (dawkins says genes are the main focal point since they are the replicators, read the selfish gene; best book on evolution I've read) and can be thought of as learning in a sense. Evolution is sort of the most intelligent "thing" that exists. Its like a complete algorithmic anomaly that accidentally exploited a weird loophole in the universe allowing the effortless creation of seemingly infinitely complex things. Or something. There are ways to produce intelligent behavior without directly programming it (the universe did), such as this reinforcement learning example to make a cart intelligent enough to balance a pole:
http://www.youtube.com/watch?v=J7E6_my3CHk
(failures are punished, success is rewarded, other than that I don't remember much)

Probably on each tick of time the data just changes. But code can create other code (lisp is supposedly good at doing that and AI, but I've never used it).

I'm no expert on polyworld either, but probably a mutation could still result in a parent eating its offspring; it just wouldn't be a fit behavior due to energy costs so would die off before having many children that inherit that behavior. The brains are just bits ultimately, software, not hardware. Trying to simulate brains with neural nets. I watched the first half hour again but forget about day/night. Probably decreases how far they can "see" or something. Its just a simulation so I think what CAN evolve is programmed, like you can't just add water and expect them to do anything unless you have neurons or whatever with potential to evolve that codes to deal with it. The detailed behavior is what would evolve without needing explicit programming, like when to go toward water, how long to stay, etc. They probably kill eachother just by being removed from an array when their energy variable goes to 0 or whatever. The next tick will draw and deal with everything in that array but the dead one won't be there any more.
Real evolution took billions of years and has tons of space (the crust of the earth basically) to work with and is only limited by physics so produces much more sophisticated stuff than a simulation bound to a computer. Physics might be a "computer" too, just a much more sophisticated one. Wolfram has interesting ideas on that in the book 'a new kind of science'. His main point being that simple programs such as cellular automata are counter-intuitively capable of producing complex results such as rule 110:
http://www.foundalis.com/mat/pce/gliders.gif
therefore maybe the universe is based on a simple program, just with initial conditions so long ago that insane complexity has accumulated.

Last edited by gggmork on 02-14-13 at 06:52

Old Post 02-14-13 06:37 #
gggmork is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Katamori
Forum Staple


Posts: 2554
Registered: 08-10


Maes, geo, Aliotroph?: Okay, I tell it again. I trust you because I'M just learning programming, but exactly this is the reason, why I use Stencyl. In C, I can do the simpliest thing only: loops, conditions, "printf" and "scanf", making custom functions, binary operations, and that's all about. I can't draw anything with the program to the screen (except text and numbers of course), I can't do differences between different "actors", etc.

In Stencyl, I have less functions and options to do, but at least, I can see all of them.

However, I'm thinking on that I'll work with Microsoft Visual C# 2010 because I've worked with that previously and way easier to work with than writing a whole program from a blank file in Code:Blocks or DevC++. What do you think?

gggmork: Wow, your help was very informative and useful, thank you! The videos are interesting, especially the "learning to balance" stuff.

Old Post 02-14-13 11:03 #
Katamori is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Maes
I like big butts!


Posts: 12264
Registered: 07-06



Katamori said:
However, I'm thinking on that I'll work with Microsoft Visual C# 2010 because I've worked with that previously and way easier to work with than writing a whole program from a blank file in Code:Blocks or DevC++. What do you think?


That's already a bit better, as those environments usually have wizards that allow you to design windows and standard controls with ease. However, for any custom rendering, you will have to get your hands dirty, and for defining "actors" etc. you will also have to lay down your own structures/classes etc.

Geo's proposal of Actionscript is not a bad one: you get a "visual" environment for animations/sounds/images/resources (Flash), plus a C-like language that is closely integrated with the various "stage objects".

For all of its specialized nature, ACS is still TONS more flexible and closer to a "real" programming language than Stencyl. At least it will teach you something and will even allow you to reuse code written by others, something that you absolutely cannot do cleanly in Stencyl: you can only cobble together your own play-doh functions :-D

And yeah, even BASIC is much better. For all of its deficiencies, it remains a complete programming language, with enough "syntactic sugar" not to scare away beginners. Of course don't start with some 80s BASIC dialect....use some more modern variants.

A final word of advice, as a teaching assistant for the last 3 years: due to some academia fuck-ups, freshman Mech. Eng. students in my faculty are taught FORTRAN first (1st semester) AKA a hard-to-learn, irregular, and unforgiving compiled language and THEN MATLAB (2nd semester), which instead is a much more forgiving, interpreted, has "easy" plot functions etc. You'd think they'd benefit from swapping them around, right?

Not really: those that DO have the stuff to learn actual programming or at least to apply and study it (which is about 70-80% of alumni) do make it through the 2-stage course. The other 20%, just don't "get it" anyway. I've yet to see someone performing significantly better in the MATLAB part while flunking the FORTRAN one, so for me starting off with a neutered/"kid friendly" language has no didactic value whatsoever.

Last edited by Maes on 02-14-13 at 11:50

Old Post 02-14-13 11:43 #
Maes is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Katamori
Forum Staple


Posts: 2554
Registered: 08-10


Sounds good. But I think, I should learn C instead, no matter how hard it's gonna be, because I have to learn a lot at the university (including C) so it may worth.

Anyway, I know that the developer environment is important, but I don't want to screw around with it. I want to find out the logic of the behaviour to simulate life, evolution and things like that. On the way like gggmork has explained them.

Old Post 02-14-13 12:00 #
Katamori is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Phml
Forum Staple


Posts: 3225
Registered: 06-09



I'm legally blind and I don't keep the fonts in my code windows that big.


Do you run 640x480 on a 24 inch screen or is "legally blind" lingo for professional bullshitter here? I'm roughly at 20/25 visual acuity and this font size is about the smallest I could use. It's even a little uncomfortable and I would likely crank it up once for normal use. Neither of my parents, who are barely in their 60s, could use that size font at all even with correction. I used to have myopia as a child and I can remember what 20/200 visual acuity and below means, and this picture seems relatively accurate. No way anyone legally blind, defined as one tenth of normal vision after correction, could read the fonts in Katamori's screenshot, much less claim they're too big.

Save for that rant I agree with you regarding the visual clutter in there, although for me it has more to do with those enormous backgrounds containing comparatively little text.

Edit: retinas fried as in, moving black specks everywhere, stuff like that? No doubt that is extremely unconvenient. To be honest I'm still having a hard time understanding how anyone with eyesight as you have could use such small fonts, but thanks for the explanation nonetheless.

Last edited by Phml on 02-14-13 at 17:23

Old Post 02-14-13 12:09 #
Phml is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Aliotroph?
postCount++


Posts: 2583
Registered: 03-02


I wasn't kidding. 20/200 is probably as good as my best eye has ever tested (my bad eye has never even been able to see the big E). In addition to inheriting some nasty myopia, my retinas are good and fried. While glasses would make a chart like that razor sharp for me I still wouldn't be able to read it (yeah, I know that sounds like it doesn't make any sense).

Anyway, on having another look, that font isn't much larger than the one I'm using in Visual Studio right now. The spacing caused by all the clutter makes it feel bigger, though. It's also more difficult to read because the colours are sub-optimal.

Old Post 02-14-13 16:56 #
Aliotroph? is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 08:59. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Misc. > Everything Else > Virtual life simulation - or whatever.

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.