Statistics We have 1675 registered users The newest registered user is dejo123 Our users have posted a total of 30851 messages in 1411 subjects
Who is online?
In total there are
users online :: 0 Registered, 0 Hidden and 3 Guests
Most users ever online was
on Sun Mar 17, 2013 5:41 pm
Latest topics » THIS FORUM IS NOW OBSOLETE by Sat Sep 26, 2015 10:26 pm NickTheNick » To all the people who come here looking for thrive. by Sat Sep 26, 2015 10:22 pm NickTheNick » Build Error Code::Blocks / CMake by Tue Jul 28, 2015 5:28 pm crovea » Hello! I can translate in japanese by Thu Jul 02, 2015 7:23 pm tjwhale » On Leave (Offline thread) by Wed Jul 01, 2015 12:20 am NickTheNick » Devblog #14: A Brave New Forum by Mon Jun 29, 2015 4:49 am NickTheNick » Application for Programmer by Fri Jun 26, 2015 11:14 am crovea » Re-Reapplication by Thu Jun 25, 2015 10:57 pm The Creator » Application (programming) by Tue Jun 23, 2015 8:00 am crovea » Achieving Sapience by Sun Jun 21, 2015 7:03 pm MitochondriaBox » Microbe Stage GDD by Sat Jun 20, 2015 3:44 pm tjwhale » Application for Programmer/ Theorist by Wed Jun 17, 2015 9:56 am tjwhale » Application for a 3D Modeler. by Wed Jun 10, 2015 11:16 am Kaiju4u » Translator to Serbian here by Sun Jun 07, 2015 6:36 am Simeartherist » Presentation by Tue Jun 02, 2015 10:38 am Othithu » Application of Sorts by Sun May 31, 2015 5:06 pm crovea » want to contribute by Sun May 31, 2015 12:58 pm Renzope » Music List Thread (Post New Themes Here) by Thu May 28, 2015 1:06 pm Oliveriver » Application: English-Spanish translator by Tue May 26, 2015 1:53 pm Renzope » Want to be promoter or project manager by Sun May 24, 2015 9:00 pm TheBudderBros
Author Message tjwhale Theorist 87 Posts : 26 Reputation : 2014-09-07 Join date :
Subject: Cell Swarming Wed Apr 08, 2015 8:31 am
Taking this video as inspiration here is some very naive swarming mechanics.
Swarming is quite an important part of the game because it's the mechanism by which you get to the next stage so it has to be good.
Watching it made me think a lot about how fast the game is going to be, right now it's very leisurely but that ecoli video is bonkers. (It may well be sped up).
Finding the right speed is going to be difficult.
Also it would be nice if there were organisms which wanted to be close together but sat mostly still (though maybe that's just them going very slowly in this fashion).
VIDEO Code: import pygame import math import random from pygame.locals import * #setup background_colour = (255,255,255) (width, height) = (600, 300) screen = pygame.display.set_mode((width, height))#,pygame.FULLSCREEN) screen.fill(background_colour) pygame.display.set_caption('Swarming') pygame.font.init() myfont = pygame.font.SysFont("monospace", 20) def distance(i,j): return math.sqrt((i.x - j.x)**2 + (i.y - j.y)**2) class animal: def __init__(self): self.x = random.randint(-100,100) self.y = random.randint(-100,100) self.dx = 1 self.dy = 1 self.angle = random.uniform(0,2*math.pi) def display(self): pygame.draw.circle(screen, (255,0,0), [int(self.x + width/2), int(self.y + height/2)], 5) endx = self.x - 15*math.cos(self.angle) endy = self.y - 15*math.sin(self.angle) pygame.draw.line(screen, (0,0,255), [int(self.x + width/2), int(self.y + height/2)], [int(endx + width/2), int(endy + height/2)], 3) def think(self, mousepos): bros =  for i in animals: bros.append([i,distance(self,i)]) bros.sort(key = lambda bros: bros) if bros <= 20: self.dx += 0.1*(self.x - bros.x) self.dy += 0.1*(self.y - bros.y) if math.sqrt((self.x - mousepos)**2 + (self.y - mousepos)**2) <= 50: self.dx += 0.1*(self.x - mousepos) self.dy += 0.1*(self.y - mousepos) for i in bros: if i <= 100: self.dx += -0.0002*(self.x - i.x) self.dy += -0.0002*(self.y - i.y) if abs(self.dx) >= 5: self.dx = self.dx*0.9 if abs(self.dy) >= 5: self.dy = self.dy*0.9 def update(self): timestep = 0.3 self.x += self.dx*timestep self.y += self.dy*timestep if self.x >= width/2: self.x += -width if self.x <= -width/2: self.x += width if self.y >= height/2: self.y += -height if self.y <= -height/2: self.y += height self.angle = math.atan2(self.dy, self.dx) animals =  for i in range(50): animals.append(animal()) running = True while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False elif event.type == KEYDOWN: if event.key == K_ESCAPE: running = False screen.fill(background_colour) mousepos = [pygame.mouse.get_pos() - width/2, pygame.mouse.get_pos() - height/2] for i in animals: i.display() i.think(mousepos) i.update() pygame.display.flip() pygame.quit() StealthStyle L Newcomer 72 Posts : 7 Reputation : 2014-06-05 Join date : 19 Age : Behind you!!! Location :
Subject: Re: Cell Swarming Wed Apr 08, 2015 9:47 am
Huh. That's not how I pictured swarming. Interesting video.
The first one should definitely not be used for gameplay. It's far too fast for gameplay, even if it is realistic. Although I guess that's obvious. (And by the way, I don't think it's sped up, as the seconds in the top left must be there for some purpose. This is unless they were trying to fool viewers.) I would even go so far as to say the second is a bit quick too. Plus, I would assume that the numbers would have to be less than this or the computer might explode, especially if there are multiple swarms. Also, can you even zoom out enough to get this view. It would be closer up and so the microbes would flit across the screen even more. tjwhale Theorist 87 Posts : 26 Reputation : 2014-09-07 Join date :
Subject: Re: Cell Swarming Wed Apr 08, 2015 10:25 am
I hadn't noticed the timestamp, I guess it looks fast because it's micrometers.
If the gameplay is to be unrealistically slow then how slow? How should it feel? At first I thought a swarm of that speed was madness but then I thought about bison stampedes in old west films. VIDEO Maybe there could be microbes whose strategy is to trample anyone in their path. StealthStyle L Newcomer 72 Posts : 7 Reputation : 2014-06-05 Join date : 19 Age : Behind you!!! Location :
Subject: Re: Cell Swarming Wed Apr 08, 2015 10:45 am
I don't think those buffalo in that
bullalo video move as fast as those microbes. I think that speed would be accecptable. It's not unmanageably fast, but it's not slow either. It can't be too fast to be uncomfortable to view. I think your version is just a bit too fast. I'm not sure that microbes trampling microbes would be an effective method. They could, however, surround the microbe preventing an escape...which would probably require a complex signal agent. Edit: Sorry, I misread something. I think the buffalos are a fine speed. Sponsored content
Subject: Re: Cell Swarming