This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's TI-BASIC subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. TI-Basic => TI-BASIC
Author Message
axcho


Active Member


Joined: 09 Nov 2004
Posts: 555

Posted: 28 Feb 2005 03:19:18 pm    Post subject:

I made a little basic program that takes two integers from 0 to 255, and uses them for a rule and seed for a 1-D cellular automata. Maybe they could be used for generating 8x8 tiles in an assembly program. This version doesn't have wrapping, but it would be pretty easy to modify it that way. Try it out.


Code:
ClrDraw
For(C,0,1
Input sub("RULESEED",4C+1,4)+":",A
For(B,7,0,\(-)\1
If A\>=\2^B
Then
Pxl-On(C,8-B
A-2^B\->\A
End
End
End
DispGraph
For(B,1,7
For(A,1,8
If pxl-Test(0,8-4pxl-Test(B,A-1)-2pxl-Test(B,A)-pxl-Test(B,A+1
Then
Pxl-On(B+1,A
End
End
End
For(A,1,8
Pxl-Off(0,A
End
For(D,0,2
For(C,0,2
For(B,1,8
For(A,1,8
If pxl-Test(B,A
Then
Pxl-On(8D+B,8C+A
End
End
End
End
End


For more information about 1-D cellular automata, see this page: http://www.mirekw.com/ca/rullex_1dbi.html
Try out the java applet and set the board size to 8x8 to see a better version of my program.

[EDIT]Wrapping is not really helpful. It decreases the diversity of tiles, with no great benefits. Also, feel free to optimize the code. I just tacked that last section on there to demonstrate the tiling.


Last edited by Guest on 01 Mar 2005 01:26:00 am; edited 1 time in total
Back to top
BarrenSoul


Member


Joined: 22 Dec 2004
Posts: 189

Posted: 28 Feb 2005 04:42:23 pm    Post subject:

*is confused* trying your prog but I don't get what it does... and how is it 1D?

never mind
http://www.brunel.ac.uk/depts/AI/alife/al-onedi.htm


Last edited by Guest on 28 Feb 2005 04:43:27 pm; edited 1 time in total
Back to top
axcho


Active Member


Joined: 09 Nov 2004
Posts: 555

Posted: 03 Mar 2005 01:54:48 pm    Post subject:

Where is everone? Anyway, here's a list of interesting rulesets to play around with. There are lots more besides this too. I've come up with lots of cool textures, including wood grain and a nice rock wall.

Multiples of 15 tend to be interesting (30, 45, 90, 135, 150, etc.)

triangles: 18, 22, 54
boxes: 109
rocks: 110, 111
grain: 177
chaotic: 89, 165, 181

Also, try 150/126 (rule/seed) for a demonic owl sprite!

I'll try and make an assembly version with more features to quickly browse through and organize them. I've been trying to figure out a good way to generate the tile in assembly. It would be easier with wrapping tiles, but since wrapping effectively decreases the number of possibilites, I'll stick to a blank-bordered tile. I might just unroll the loop then, unless anyone else can come up with a better way.


Last edited by Guest on 15 Mar 2005 03:37:35 pm; edited 1 time in total
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 03 Mar 2005 03:40:17 pm    Post subject:

254/1 Checkered Triangles
114/1 Checkered Triangles (Dotted)
126/69 Transformers?
81/19 Video Noise, perhaps?

Axcho's 177/0 Makes for a good mountain range.

Gosh, 150/126 looks like an angry chibi pengu, if you ask me. :)

These are nice. Well done. 8)

[EDIT]

I understand rules 18 and 22 are supposed to generate Sierpinski's triangles? If only the cells were given more room...


Last edited by Guest on 03 Mar 2005 05:55:02 pm; edited 1 time in total
Back to top
axcho


Active Member


Joined: 09 Nov 2004
Posts: 555

Posted: 04 Mar 2005 12:34:34 am    Post subject:

Quote:
These are nice. Well done.
Thanks. The coolest part is their potential for use in assembly games, like tile-based RPGs. They can reduce sprite memory costs to a fourth their normal size, or give inspiration to pixel artists.

165/111 Desert?
110/59 A nice rock wall
111/69 Another rock wall


Last edited by Guest on 15 Mar 2005 03:33:30 pm; edited 1 time in total
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 04 Mar 2005 04:30:58 am    Post subject:

If you comment your code I'll write a little java app that shows all of them.

EDIT: or maybe javascript/css, for fun.


Last edited by Guest on 04 Mar 2005 04:31:56 am; edited 1 time in total
Back to top
axcho


Active Member


Joined: 09 Nov 2004
Posts: 555

Posted: 04 Mar 2005 12:28:18 pm    Post subject:

Don't show all of them, let the user navigate through them like in biomorphs! But I was going to do that in assembly and get credit for the idea! :(

It's interesting that for every rule, there is an inverted version and a mirror image (and an inverted mirror image). But you can't usually flip them upside-down or rotate them.
Back to top
aforsy
the leaping penguin


Active Member


Joined: 13 Jul 2004
Posts: 653

Posted: 06 Mar 2005 07:41:06 pm    Post subject:

hmm...some of the 109s would be great sim-city tiles!
Back to top
axcho


Active Member


Joined: 09 Nov 2004
Posts: 555

Posted: 11 Mar 2005 04:15:20 pm    Post subject:

Now we get to think of what kind of games we can use these in! I'm thinking for the games whose tiles are used like textures on a map (strategy games?), wrapping tiles might look better. For example, the rock walls have black lines on both sides, so when they are put next to each other they don't tile as nicely. Using wrapping would make seamless tiling. So, it really depends on the game that is using them. It would be unnecessarily complicated to mix wrapping and bordered tiles though.

So, add wrapping to your version of the program and try out some more tiles!

[EDIT]I found another variation: meta-CA tiles!
Just change the "If pxl-Test(0,..." in line 15 to "If pxl-Test(B-1,..." so it takes the previous seed as the rule. That means the rule changes every time, and it is difficult to predict what each tile will look like. So now there are four variations: wrapping or not, and meta or not.

The meta tiles are really chaotic. It is hard not to get an interesting one. Try these out:
53/87
131/242
230/106
249/161


Last edited by Guest on 14 Mar 2005 11:19:33 pm; edited 1 time in total
Back to top
Flofloflo


Member


Joined: 07 Nov 2007
Posts: 120

Posted: 01 Aug 2009 06:20:13 am    Post subject:

HereĀ“s my Cellular Automaton:
Quote:
Clrdraw:clrhome:Prompt N: Clrhome
7-int(log(N)/log(2
augment(0seq(I,I,1,ans),int(round(2fpart(N*2^seq(I,I,ans-8,-1 -> L1
47
pxl-on(0,47
For(c,0,62
ans-1
For(D,ans,94-ans
If L1(8-4pxl-test(C,D-1)-2Pxl-test(C,D)-Pxl-test(c,d+1
pxl-on(C+1,D
end
end



I don't know if a For-loop would speed up the If statement with the 3 Pxl-tests... Would anybody know that??


Last edited by Guest on 15 Aug 2009 03:59:19 pm; edited 1 time in total
Back to top
Iambian


Advanced Member


Joined: 13 Mar 2004
Posts: 423

Posted: 01 Aug 2009 09:12:26 pm    Post subject:

I don't want to get "off topic", but HOLY HELL, that is one hell of a necropost.

Exceeds 4 years. Did anyone else beat that?

To answer the question about "fusing" lists, I'd think you want to use the augment( function. Just remember to store the output somewhere.


Last edited by Guest on 01 Aug 2009 09:15:57 pm; edited 1 time in total
Back to top
Flofloflo


Member


Joined: 07 Nov 2007
Posts: 120

Posted: 14 Aug 2009 10:40:25 am    Post subject:

People always say 'search first then make a topic' so I suppose it's better to revive an old one right??
Thanks for the Augment thing! Exactly what I was looking for.
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 14 Aug 2009 12:13:48 pm    Post subject:

Well, it's a win-win situation. If you post to an old topic, we get to say "OMG necropost!" On the other hand, if an old topic exists and you started a new one, we get to say "Use the Search feature!" It's one of the things that make moderating so fun.
Back to top
Graphmastur


Advanced Member


Joined: 25 Mar 2009
Posts: 360

Posted: 14 Aug 2009 04:21:10 pm    Post subject:

Iambian wrote:
I don't want to get "off topic", but HOLY HELL, that is one hell of a necropost.

Exceeds 4 years. Did anyone else beat that?

To answer the question about "fusing" lists, I'd think you want to use the augment( function. Just remember to store the output somewhere.

I think I saw a 7 year one on some site, from 2001, to 2008.

DarkerLine wrote:
Well, it's a win-win situation. If you post to an old topic, we get to say "OMG necropost!" On the other hand, if an old topic exists and you started a new one, we get to say "Use the Search feature!" It's one of the things that make moderating so fun.

lol. That's just funny.
Back to top
Flofloflo


Member


Joined: 07 Nov 2007
Posts: 120

Posted: 15 Aug 2009 04:01:21 pm    Post subject:

Well anyways... I think I got it pretty optimized by now!
Quote:
Clrdraw:clrhome:Prompt N: Clrhome
7-int(log(N)/log(2
augment(0seq(I,I,1,ans),int(round(2fpart(N*2^seq(I,I,ans-8,-1
pxl-on(0,47
For(c,0,62
For(D,46-C,C+48
If ans(8-4pxl-test(C,D-1)-2Pxl-test(C,D)-Pxl-test(c,d+1
pxl-on(C+1,D
end
end


Last edited by Guest on 15 Aug 2009 04:46:23 pm; edited 1 time in total
Back to top
calc84maniac


Elite


Joined: 22 Jan 2007
Posts: 770

Posted: 15 Aug 2009 04:11:36 pm    Post subject:

If you want more speed in the list generation, you can try using this awesome command: http://tibasicdev.wikidot.com/binompdf
Back to top
Flofloflo


Member


Joined: 07 Nov 2007
Posts: 120

Posted: 15 Aug 2009 04:44:51 pm    Post subject:

We did the Binompdf and the other Binom thing at school but I couldn't really be bothered back then... I mean, it was just a weird non-mathematical way of doing some some stuff that was pretty easy back then (I think I forgot about most of the complicated probability things from back then, but I know it was really easy at the time:P)...
But I guess in this case it's pretty useful...
Quote:
7-int(log(N)/log(2
augment(0seq(I,I,1,ans),int(round(2fpart(N*2^seq(I,I,ans-8,-1

Can be changed to this:
Quote:
6-int(log(N)/log(2
augment(0binompdf(ans,0),int(round(2fpart(N*2^seq(I,I,ans-7,-1
Back to top
calc84maniac


Elite


Joined: 22 Jan 2007
Posts: 770

Posted: 15 Aug 2009 05:59:33 pm    Post subject:

You can probably change the second Seq( as well. Razz
Back to top
axcho


Active Member


Joined: 09 Nov 2004
Posts: 555

Posted: 24 Aug 2009 05:17:39 pm    Post subject:

Wow. It's good to see that the cryptically-obscure-but-awesomely-optimized TI-BASIC tradition continues here at United-TI. :P

I'll have to dust off the old calculator and give this code a try. Thanks Flofloflo. :)

By the way, I ended up making an assembly version of the Cellular Automata Tiles, which you can try out here. I never officially released it or used it in a game, but the source is all there, and the editor for the tiles. Feel free to try it out.
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement