General > Off Topic

How to use my new features.

(1/3) > >>

PurpleYouko:
New features for 2.37

First there is the shape settings.

You probably all know by now that pressing the smiley face on the tool bar, your robots all change to triangles.

Well it doesn't quite do that any more.
What you get now is a random number of sides between 3 and 5....

unless.......

You use the new feature in your robot's DNA file that allows you to select the number of sides for the robot to have.

To use this, just add a line at the beginning of the robot's DNA using the new "shp" feature. Here is how you do it.


--- Code: ---shp 4

cond
'your condition
start
'your action
stop

etc.'
--- End code ---
This will give youa square robot.
shp 3 will give you a triangle and so on.


The second new feature relates to ties. These days robots can have 4 ties (rather than 3 like they used to)
Each of these ties is held in a small array inside the robot structure. Besides each tie having a unique (or sometimes not so unique) address number, they each have a totally unique ID within the robot's own structure. They are automatically assigned numbers from one to four as they are created.

2.37 uses these ID numbers in 8 new sysvars to directly manipulate the angle and length of each of the four ties.

.tieang1 sets the angle of the robot with respect to tie number one.
.tieang2 sets the angle of the robot with respect to tie number two.

And so on

.tielen1 sets the length of tie number one.
.tielen2 sets the length of tie number two.

And so on

Where with the old system of .tienum, .fixlen, .fixang, the ties could only be addressed at a rate of one per cycles (because of the .tinum address system), with the new system we have a seperate sysvar for each one so they can all be addressed on every cycle.

In case you didn't download my temporary 2.35.7 last week (and therefore didn't get my tie tesrer bot) here it is again.

Light:
what happens if say you have 4 ties and tie 2 gets deleted do the other ties remain numbered 1,3,4 and if another tie is created it would become tie 2?

PurpleYouko:
To be absolutely honest I don't know. I haven't tracked the old code through that far yet.
It will be made such that they retain their id but I'm not sure that they do right now.

Carlo:

--- Quote ---To use this, just add a line at the beginning of the robot's DNA using the new "shp" feature. Here is how you do it.


CODE 

shp 4

cond
'your condition
start
'your action
stop

etc.'
 
This will give youa square robot.
shp 3 will give you a triangle and so on.
--- End quote ---

Hmm. I hope this shall have effects ONLY on the simulation appearance. First, because having three options (triangle, square, pentagon) is not exactly what I'd call "open ended"; second because otherwise you should invent some strange rule to take shape in account. By the way, that shp 4 instruction, if I'm not wrong, just breaks the structure of dna. What is it? Not an executable istruction, it is outside genes, and the correct syntax for this kind of information would be

'#shp: 4

as for color, mutations, generation, etc, in the beginning of the dna. There's a useful routine for dealing with those robots parameter at the beginning of the dna files. So use it!

Numsgil:
shape works like def.  That is, it's a command to the parser instead of the DNA execution.

I'd recommend adding shp 1, which is a circle.  You were talking about shape effecting how many ties you can have (1 tie per side, right?).  Are you still thinking along those lines?

A pentagon, when drawn, looks alot like a misshapen circle.  I think triangle, square, and circle should be enough.  Maybe a 2 sided gum drop shape, although that's harder to represent visually.

Navigation

[0] Message Index

[#] Next page

Go to full version