Tumgik
#maybe next time around I'll simplify my format
pllanarally · 6 months
Text
Infection Simulation
Assignment: Create an interactive simulation using processing.exe
My original idea was too grand in scope because I got excited (classic). I can see the potential for making all kinds of games using processing! So here's a simplified sketch.
Tumblr media
Basic concept is that there are several sections where little dots will be bouncing around off the walls, and there are gaps where the dots can pass through from one section to the next. One infected dot will bounce around and when the others are in proximity, it will have a high chance of infecting them. After a certain amount of time being infected, a dot will either become "immune" -- where it has a slightly less chance of becoming infected -- or it will die", i.e., dissappear completely. After a certain amount of time, an "immune" dot will return to a normal, "uninfected" state.
An idea if I had extra time, would be a a "doctor" dot, which will turn "infected" dots "immune" immediately upon contact.
The user would have control over the size of the gaps. The "game" can end in two ways: either all the dots have died, or all the dots have been cured!
Time to get to work.
Tumblr media
I played around a lot with how I wanted it to look, but could really only get the growing borders to work in this column-like structure. I then had an epiphany that rather than doing something like this, it might be more fun to do a pong-like structure where the user controlled two individual lines and could try and "trap" dots that way.
Tumblr media Tumblr media Tumblr media
Thinking ahead/remembering what Maxim said in class about how it might be easier to have the information formatted as PVectors for the sake of simplicity, I created a "border" class with PVectors representing the x and y positions of each end of the line. I created two instances of a "border": Horz and Vert, passing information into them in the setup.
To make them reactive to the user, I set up a "speed" variable, and set it so that when the user presses the left and right keys, the Horz's x positions would change (to newx1 instead of _x1, etc) and the Vert's y positions would change (to newy1 instead of _y1, etc).
Looks pretty good. Now comes the tough part: making the infection simulation.
Tumblr media Tumblr media Tumblr media
First part is trying to get my "people" to stay inside the window and bounce off the borders which... proved difficult. They bounce off the edges of the window well enough but getting them to respond to the borders is tricky, they have a tendancy to freak out and just vibrate in place when vaguely near the borders... hmm.
Tumblr media Tumblr media Tumblr media
The solution: turn the lines into very thin rectangles. I think the people were getting confused trying to bounce off a single line of pixels, maybe. Either way, working great now! I did have to do a whole sketch to do some basic math but ... part of the process.
But now the actual simulation bit: making the INFECTION....
Tumblr media Tumblr media
The struggle is real.
Tumblr media Tumblr media Tumblr media
I finally got somewhere with the dots changing color by creating a an "infect" function and an "update infection" function that responds to the time elapsed in the simulation. However, I couldn't get dots to infect eachother correctly or change to their "immune" or "dead" colors; they were only able to change from "infected" to "uninfected" colors (even when the immune or dead boolean was true). This led me to believe that a series of booleans was not the correct approach, and instead of each status being a boolean, a set of "enumerated types" would be more appropriate (shout out chatgpt).
Tumblr media
Success! In one aspect that is. The colors were now changing appropriately according to status. However, the "infected" dot was still not infecting the ones around it...
Tumblr media
The issue was this line! It was only checking each individual's contact against istelf rather than other people in the array. Here is the adjusted line:
Tumblr media
And now it works great!
Tumblr media
I received some feedback from Maxim in class about using a noise generator to change the infection rate and length... maybe I'll try that later but I have a double feature to catch at the New Beverly right now!
Here is the code, try it out for yourself!
0 notes
beatricethecat2 · 3 years
Photo
Tumblr media
"Another day or two?" Helena gruffs.
"Yeah, um, sorry," Myka replies.
"That storm postponing your flight was one thing, but this? You are aware our rental is expiring eminently."
"Maybe we can extend?"
"I already inquired."
"And?"
Helena grimaces, nose wrinkling.
"I-I'll find us a new one."
"No, I shall, since I've clearly been left to my own devices."
"I'm coming soon, I promise!" Myka yelps. "I'll stay wherever you want. Extend the car rental, too."
"If I must swap it at the airport, I shall be cross."
"More cross than now? How is that even possible?" Myka jabs.
"I believe you know the answer," Helena says, deadpan. "What exactly is keeping you there?"
"I'm figuring something out but it's more complicated than I thought."
"And this 'something,' how long am I to remain in the dark?"
"Not long, but..." Myka's shoulders sag. "I might as well tell you."
"If it's such a burden—"
"No! I wanted to iron out the details first." Myka heaves a heavy sigh. "Ok, here it goes...I'm figuring out how to work remotely. Mostly."
Helena perks up. "This is something you truly wish to do?"
"I..." Myka pushes a hand through her hair, stopping halfway, looking off to the side. "I've been thinking about what you said, that the Warehouse needs to evolve, that it's stuck in the nineteenth century."
"Such a travesty; agents sequestered in a boarding house with modern communication and travel as they are."
"It's not so bad, having your friends there when you need them." Myka's hand drops to her side. "I do love my family here, but if I'm honest, it hasn't felt the same since Leena died." 
"May I say again how truly sorry I am for your loss. She was an extraordinary woman."
"She really was." Myka blinks back a tear and looks down. "But it's more than that. What you said about only traveling for work, of never really visiting a place, that stuck with me, too. How you want to take advantage of all this new world has to offer, things I take for granted, because you've been given a second chance." 
"I can be quite persuasive when I wish to," Helena says, lips turning up at the ends.
"And I love you for it." Myka's smile matches Helena's.
"But those are my wishes. What are your own?" Helena asks.
"I think it's worth fighting for change, even if making up rules as we go scares me."
"You are fond of protocol."
"And you're not. So we complement each other. Or cancel each other out," Myka says, lips lifting into a crooked grin.
Helena huffs a short laugh. "And Pete? How is he faring?"
"He's super bummed, but I think he understands." Myka shifts in her seat, sitting up straighter. "You might hear from him. He said he wants to have a chat."
"What about?"
"A 'big brother' kind of thing."
"I'm surprised he's waited this long."
"Me too."
The air quiets, each waiting for the other to continue.
"There is one other thing. An, um, 'condition," Myka says.
"Just the one?"
"Hey..."
"I'd expect nothing less. Go on."
"I can't go on missions alone."
"Nor would I allow you to."
"Do you see where I'm going with this?"
"While you're working, someone will join you."
"Yeah, you."
"But I'm no longer an—"
"They want to reinstate you."
"Myka..."
"I know, I know," Myka says, waving her hands in surrender. "It'd be on your terms. I'll make sure of that. And I'll keep you in check."
"That's a tall order."
"Believe me, I know."
Helena grasps at her locket and works a thumb over its smooth metal case.
"We'd have our autonomy, mostly. Be working part-time. We're already doing it unofficially anyway. And I think we work well together." Myka flashes a smug smile.
"And the distance from the Warehouse? How will you manage?"
"Abigail agreed to be our eyes in the archive. And we already have access to the database."
Helena stares at Myka for a long moment, fingers clutching her locket. "Can this truly be?"
"I think so. I'm hashing out details with Jane, but we need a few more days," Myka says, smiling. "Find us a place to stay for a couple of weeks. We can figure out what happens next from there."
"With pleasure," Helena says.
"So...can I tell them you're Agent Wells again?"
"I've further terms to discuss."
"Send them over. I'll make sure you get what you want."
Smiles grow wider as they hold each other's gazes.
"So...what'd you get up to yesterday?" Myka asks.
"I traveled by cable car up Hyde Street. The views were breathtaking."
"You did that without me?"
"I was tired of waiting."
"Do not go to Twin Peaks or Coit Tower. We're doing those together."
"I shant. Perhaps I'll peruse City Light Books again and linger in Jackson Square."
"That's where those buildings from the 1800's survived the earthquake."
"Indeed."
"Are you feeling a sense of closure, being there?"
"I believe we could have had quite a pleasant life here in my day. But closure, that may only truly begin upon your arrival."
"I can't wait," Myka says, grinning wildly.
-END SCENE-
------------------
Bering and Wells: New Horizons ("Warehouse 13" Season 5 replacement) Season 1: Episode 8 Title: San Francisco: The 415 Blues Summary: A freak storm delays Myka's flight to San Francisco. Helena learns Myka's taken on more while home than just dropping off an artifact. New paths are revealed while working through a difficult retrieval, as well as an ask that may take them to foreign shores.
Previously: Episodes 1-7 (look in my archive as adding links broke my post last time)
------------------
Tumblr media
After assessing the scene of a retrieval, Myka and Helena duck into a coffee shop.
"That facade's massive! How would we know which one?" Myka asks.
"'It'll be obvious,' Artie said. Far from it," Helena snips.
"Maybe spray it with neutralizer and see what sparks?"
"It's a landmarked structure, too high-key."
"True," Myka says, frowning. "Artie said it was a chain reaction. One brick radiating into the others. Remove the source and the rest will calm down."
"Once one pinpoints the source."
"At least we know it's in arms reach," Myka says, sipping of her coffee. 
"Do we?"
"Someone almost burned their hand on it."
"Nothing felt even remotely hot to the touch today." Helena screws the cap onto her water bottle. "The brick responsible could be beaming down from the loftiest of places. We'd need scaffolding to check properly."
"And that hill is..." Myka motions with her hand at a forty-five-degree angle.
"Is it truly a risk if it's merely hot to the touch?" Helena says, leaning back in her chair.
"Artie's not sure. He thinks wildfire smoke is 'activating' the bricks, making them think they're in the fires after the 1906 earthquake. So it depends on which way the wind's blowing. Prolonged smoke contact equals hotter bricks, and hotter bricks mean the building might catch fire."
"Because these melted 'clicker bricks' were used in rebuilding after the earthquake?"
"Uh-huh. And Artie thinks they caused a previous fire."
"The one where those girls died trapped in the basement."
"So sad," Myka says, shaking her head. 
"I'd read it was arson, meant to discourage the Mission House staff from rescuing those poor immigrant girls from servitude."
"It probably was. But it might not have spread as fast without the clinkers."
"I see." Helena's hand tightens around her water bottle. "We cannot allow it burn again."
"We won't," Myka says, touching Helena's hand to reassure her. "Maybe we can monitor it with heat sensors. I bet Claudia has a gadget."
"I'm certain she shall," Helena says, looking as if she's combing through a catalog in her mind. "We must set up surveillance in the buildings across the street."
"Maybe we can pose as historians studying Julia Morgan, the architect," Myka says, perking up.
"What a blessing it shall be we're here for an indeterminate amount of time."
"Ooh! Maybe this can be our thing, traveling places and staying awhile, snagging difficult artifacts."
"I adore your ingenuity." Helena leans across the table, planting a kiss on Myka's lips.
"Mmm...thanks," Myka hums as Helena pulls back. She lifts her phone off the table, fingers working the keyboard, texting Claudia. "Maybe this is a good time to, um...tell you, there's a...a, um...something else the Warehouse's asked us to do."
"I knew they wouldn't release you that easily," Helena says, narrowing her eyes.
"This one's about you."
"Aren't they all, somehow?"
"Kinda?"
"Well, out with it then," Helena says, sitting back, crossing her arms over her chest.
"The artifacts you hid, the Warehouse wants them."
"They believe there are more?"
"Oh, come on."
"They've shelved the Trident and Corsican Vest."
"And the Imperceptor."
"That was not an artifact."
"Fine. Artifacts and inventions," Myka snaps. "And they want us to follow up on cold cases you left behind."
Helena shifts in her chair and looks towards the bridge in the distance. "This is punishment for my unwillingness to interact with the Warehouse. You told them of my issues surrounding Christina."
"No. I said separating your body from your mind then sending it out as a lure for Sykes really pissed you off."
"This is not untrue."
"Pisses me off, too," Myka mumbles.
"They may threaten such a thing again should I not bow to their demands."
"We."
"Pardon?"
"Should we not bow. I'm part of this, too."
"Yes, as my 'handler.'"
"Maybe. But our definition of 'handling' can be kind of fun." Myka skims a finger down Helena's forearm, prying her fisted hand apart and threading their fingers together.
Helena lets out a heavy sigh. "I may not recall everything. I'll need my diaries."
"Do you know where they are?"
"At the Warehouse, of course."
"I meant the real ones."
Helena raises a brow.
"You know they know you hid them before you were bronzed."
Helena grimaces. "I once knew where they were. There's no guarantee they're still there."
"You've already looked."
"I may have, briefly."
"And?"
Helena shakes her head in the negative.
"Then let's start with what you remember."
"Or, start with the items I've hidden since?"
"Helena!"
"Punish me later, darling. We've a smoldering building to extinguish." Helena squeezes Myka's hand and brushes a thumb under her jacket cuff. "Did Claudia get back to you?"
"No," says, checking her phone. "Maybe we should get back to the apartment and do some research?"
"'Research' is our best course of action."
Both women smile in agreement, then rise and hastily take their leave.
-END SEASON ONE-
NOTES: NOTES: And this wraps up Season 1! As you can see, it's set up to transition to a second season, one fairly independent from the Warehouse. Who knows if that will ever materialize (but I do have a few ideas). Links broke my post last time, but look up Cameron House (formerly the Mission House) in San Francisco and Donaldina Cameron for more on that organization and the deadly fire. Clinker bricks are regarded as junk bricks - warped from being fired at too high a temperature, or in this case, mangled by building fires after the 1906 earthquake. Many older buildings in Chinatown contain them as the neighborhood scrambled to rebuild after the earthquake, because white real estate developers were poised to swoop in steal their land. In the Cameron House design, clinkers were also used decoratively in an Arts and Crafts style (there are other buildings in SF like this, like 45 Upper Terrace, also designed by a female architect, Ida McCain). I dedicate this episode to @blackfoxreddog !!
41 notes · View notes