pouët.net

Go to bottom

Cycles (a bit like Conway's Game of Life)

category: general [glöplog]
I was just too pissed off.

To be honest, I do not have any other places where I communicate in the Internet. For many years I have been connected with the scene, actually, my first Internet needs were to browse mod music sites. Nowadays my interests might be a bit off, but this community is basically the only place at the moment where I sort of feel myself at home. And besides, not many forums in the Internet today are as active. Lots and lots of forums are empty and lifeless.

I really did not mean to be too much. Also, I saw that this forum is basically ok with some silly humorous topics. Somehow my topics are considered offbeat and not as funny as some random image thread. I am ready to conclude I am missing something here.

As for the amount of info laid out - I thought the engine needed description. As I said when I gave it to people with no description or brief description they did not get what it does. It is not a simple cellular automata, it is pretty confusing if you do not know how to start it.

rydi: I am using a wxTimer and it cannot go faster than 10ms. So I am not yet sure how can the process be sped up further. But I will certinaly research that.
As for it being beautiful, I am a novice coder now and it took me a long time to code this, so design will be done later )
please take this bus:
BB Image
LV: I think wxTimer events are processed at the windows taskswitching rate, which is in the neighborhood of 10ms, I believe.
added on the 2009-06-05 14:07:22 by trc_wm trc_wm
Yeah, question is - is it possible to make it faster? Use threads instead?
LV: no threads have the same problem.

There isn't an easy way to do this, except for a spin-loop:

Code:for(int i=0; i<large_number; i++) { waste time here.. };


which will give you 100% CPU load. Spin loops are evil.
added on the 2009-06-05 14:25:52 by trc_wm trc_wm
Preacher: I appreciate it, but as Havoc said, I didn't say such a thing. There's a difference between "creating a new thread about whatever interests you even remotely and pushing it down the throat of people" and "adding a little variety to the ongoing randomness of the BBS from time to time".

But let's zip it up here. I hope something has changed at least.
added on the 2009-06-05 14:32:02 by decipher decipher
trc_wm: does it mean that I cannot accelerate the app any further?
For a coder "connected with the scene" you sure code some very un-scene-connected things. Why not have a go at demo coding?

Quote:
I am using a wxTimer and it cannot go faster than 10ms.


As for that I sure didn't get 100 generations per second. More like 1 generation per second.

Quote:
So I am not yet sure how can the process be sped up further.


Don't do the bulk of the application's work in a timer widget. In fact try not to use timer widgets at all. Trigger the simulation from the program's main loop. It's straightforward then to limit the speed to X generations per second using GetTickCount(), for example. Here's pseudocode:

Code:int lastFrameTime = 0; int startTime = GetTickCount(); int generations = 0; while( !quit ) { pumpMyMessages(); // Update the display every 100 ms if( GetTickCount() >= lastFrameTime + 100 ) { lastFrameTime = GetTickCount(); updateDisplay(); } int currentTime = GetTickCount() - startTime; if( generations < generationsPerSecond * currentTime / 1000 ) { runAnotherGeneration(); generations++; } else { Sleep( 1 ); } }


Doesn't allow for changing the speed while the simulation is running but it could with a few tweaks and you get the idea. Note that display and generation are interleaved, not actually asynchronous, so it's all very straightforward.
added on the 2009-06-05 14:34:55 by doomdoom doomdoom
As for speed, I didn't bother to read the full description (tl;dr for sure), but at a glance it looks like a simple enough process. You say wxTimer so I'm thinking wxWidgets which AFAIR means you're working in C++. So all in all, even if it's poorly coded you should be getting at least thousands of generations per second, and with "proper hard work" you might be able to get close to millions per second. But you need to lose the timer widget.
added on the 2009-06-05 14:41:27 by doomdoom doomdoom
Quote:
As for that I sure didn't get 100 generations per second. More like 1 generation per second.


This is because not every move places a generation. A generation is only when an X or O are placed.

I see about the main loop, thanks for that advice - will research this.
Quote:
No, not really. This is a list of threads I have started on this BBS. And so? The BBS is full of threads and each thread is started by someone. Each person can make such a list. What is your point? That those threads are bad? I do not agree. I like them just like any other "random stupidity thread".

Let's see the fucking topics I discussed.

1. I want an edit button.
I really do. It is a good suggestion. Lately lots of people started bringing this up and I decided to create a thread on the matter. I really do think an edit button is a good idea.

2. Almost useless software.
Funny topic. A lot of people liked it. You are telling me I shouldn't have written it? Why?

3. Making an ambient pad out of a jazz loop.
Yep. Guess what - I decided to share something I did musically. What, demoscene has no musicians? I dunno, I got responses. Some negative, some positive. People did respond.

4. Random "good mod" music thread.
Don't tell me it is a bad thread. It can't be!

5. Scream Tracker 3
Well.... bringing up a topic about a tracker program on a demoscene related forum is absolutely... a good idea! Is it not?

6. Pirate Bay trial.
Current events. It was interesting to discuss. Are you saying that because it is a demoscene BBS you cannot bring up topics which are not 100% demoscene related?

7. A text game
Yep, presented a small game, got 3 responses, no harm done to the world.

8. Screwdriver.
One of my best threads to this day. Or not. Just a funny thingy like any "random" thread out there. Actually, did not get much response, just some poems )

9. Proprietary Text Editor: some free software humour
The free software multipage thread. Might not've been entirely pleasant but useless? I don't think so.

Should I go on?


i hope it gets better for you man
Louigi: i dont know anything about the design in your code. but I should suggest you get your timer up working properly without any problems before you head on to any further automata-coding.
added on the 2009-06-06 09:17:43 by rudi rudi
louigi, i was going to say that i'm sure you're a nice guy but think you're just not very good at assessing which of your interests are of interest to many others and how to present them. but,

Quote:
this is getting quite tiring - fuck off with your witty comments. if you have nothing to say, just don't fucking say it.


i changed my mind. you're so undeservedly arrogant that it hurts.
added on the 2009-06-06 10:22:45 by skrebbel skrebbel
Quote:

Disclaimer

The oldskool pouët BBS is not the demoscene, please visit a demoparty. This is merely a forum for sceners, with obviously too much free time, to release their frustrations and request salted communitary feedback, as opposed to polluting the prod comments section.

New users: please take your vaccines before entering, don't expect instant praise, and try not to feel easily insulted.
Old users: please don't feed the trolls. Reoccuring annoying behavior will result in a heavily subjective ban. Just try not to piss off 90% of our active users with childish and/or idiotic behaviour and you should be safe.

You have been warned.

Also, copycat threads are the equivalent of putting glow and ribbons in your demo.

added on the 2009-06-06 19:46:49 by rudi rudi
quoting the disclaimer is 2001... :(((
added on the 2009-06-06 19:50:22 by havoc havoc
+so
added on the 2009-06-06 19:50:32 by havoc havoc
i really should change that text anyway :/
added on the 2009-06-06 20:13:38 by Gargaj Gargaj
that wouldn't stop fagtards from quoting it tho ;(
added on the 2009-06-06 21:39:09 by havoc havoc
Rowley Birkin: you're starting to get really annoying. you know that? do you have a problem or are you just plain stupid?
added on the 2009-06-06 23:50:59 by rudi rudi
oh BOO HOO HOO
didn't read that disclaimer, did ya? :)
added on the 2009-06-07 00:07:18 by havoc havoc
See gargy, here's the problem:
Quote:
Just try not to piss off 90% of our active users with childish and/or idiotic behaviour and you should be safe.

90% of our active users are displaying childish and/or idiotic behaviour. As I said elsewhere, we should all get banned and leave Pouët to Optimus as a blog.
added on the 2009-06-07 01:40:33 by decipher decipher
decipher: you tear me up dude :))
added on the 2009-06-07 02:13:44 by havoc havoc
I tried a different approach eventually. Just during the OnTimer event made a 100 interactions, so it's like

OnTimer(){

(for int x=0; x<100; x++) {

DoStuff();

}


New version - very fast, thus much more visual and life usually ends within 10 cycles.
http://www.cathyportal.ru/files/Cycles.zip

Screenshot:

BB Image
yeah, now its starting to get somewhere. that's actually quite cool to look at, except for the blocky style. :)
added on the 2009-06-10 22:31:08 by rudi rudi

login

Go to top