Giter Site home page Giter Site logo

virusgame's Introduction

virusgame's People

Contributors

ben9583 avatar carykh avatar tux9001 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

virusgame's Issues

Button offscreen

I opened the game and it cropped the window so the UGO button is offscreen

Need way to remove codons and UGOs

There doesn't seem to be a way to remove either codons or UGOs from a cell.

For codons, I would suggest "remove" and then "RGL<>"
For UGOs, I would suggest "remove" and then "Weak Loc"
Additionally, it would be neat if "remove" "inwards" removed all food, waste, and UGOs from a cell.

Cell arrangement cannot be changed without causing exceptions

First of all, I respect the effort that carykh has made in making this "simulation game" to entertain and let more people learn about biology and virology.

However I am of the philosophy that when you let people get insight on your project and let them access to your source code they should know how to build on that project and make more from it. I have tried to change the cell arrangements in the simulation to test some fun experiments (What if I fill the entire grid with living cells? What if I scale up the map and separate the cells far away from each other?). It is not possible or it's unclear from the provided code how to do that. Of course I've seen this comment in the Cell.pde file :

  /*
  0: empty
  1: empty, inaccessible
  2: normal cell
  3: waste management cell
  4: gene-removing cell
  */

But it doesn't explain clearly what each of these cell types do. 1 is black walls and 2 is living cells but where exactly do I need to put 3 and 4 cells?
I could determine that food particles can only spawn from empty cells (2) and that having none crashes the game. But why can't I manage to have a working simulation where the code for expelling waste doesn't crash the game ? I know cells can't be put on the edges else the waste can get expelled out of the map crashing instantly but theres something else I don't get, probably with those strange seemingly empty 3 and 4 cells.

Thank you again carykh for all your work but I hoped I won't have to spend hours in trial and error and I could get info about how I can modify the simulation without breaking it.
Oh and to modify the cell types I made the function "int getTypeFromXY(int preX, int preY)" in virus.pde return the cell type I want for every tile in the simulation.

Viruses created from cells bounce off of other cells even though they aren't infected.

The only way I can infect a cell is by manually throwing a virus at it. After the viruses reproduce and leave the cell, they just bounce off the other uninfected cells, as if they were infected. Redownloading the game seems fix it, but the problem is back when I close it and open it back up. So I would have to redownload it every time I want to reset the map. Also I didn't change the code at all. When I close programming 3.3.3 it doesn't say anything about saving changes like it usually would.

a WORLD_SIZE > 12 makes the game crash

error: ArrayIndexOutOfBoundsException: <WORLD_SIZE>
it happens in:
cell.pde
line #329
in function: public void pushOut(Particle waste)
while(chosen == -1 || cells[y+dire[chosen][1]][x+dire[chosen][0]].type != 0){

(i know I'm talking like a compiler error)

Part of the screen is cut off

image
As you can see the right side of the image is cut off.
Although if I try to make it any wider I might have problems with #4.
image
The bottom of the screen is cut off too. (just a little bit - you might have to zoom in to see it!)

[PERFORMANCE] Use FX2D

I tested the sim with FX2D and it is considerably faster. That's all, I experienced no issues, just it being way faster, due to being rendered on the gpu.

Just make the size line say

size(1728,972, FX2D);

part of the UI is cut off

hey Carykh! your UI is too big
image

i tried using the scale(0.5) int the draw method but it didnt work

tried chanding the window resolution in the setup() to size(1280,720);

tried changing the drawUI scale to scale(0.75) it work but the buttons click is still on the original scale

image

i think this means you need to import this to unity or something hahaha
makes it easier for rendering stuff

Window too large

I ran the program on Processing and the window was too big for my 13" MacBook Pro.

Workaround: change display settings and scale everything down.

Zoom (and food amounts) do not account for larger world sizes

Problems

When world size is larger than 12, the camera will refuse to zoom above where it would in if world size was 12. The zoom that the game starts with is correct, but if you zoom in, you will never be able to zoom all the way out again. You also are able to zoom in a bit further that normally possible in a size 12 world. (After checking the code, this should al also apply inversely on smaller worlds))

I also noticed that the amount of food both initially generated and generated over time was too large for small worlds, and too small for large worlds. After poking around, it turns out that this is because the variable foodLimit in virus.pde is static and independent on world size. I'm actually not certain on whether this is unintentional, as it could be that this variable was just left to be manually edited.

I'm not here to complain and do nothing about it though, so I've worked out the solutions

Solution for the zoom problem

I looked at the zoom function and found an easy solution that only requires editing one line. It fixes both zooming in and out in both larger and smaller worlds.
Just change the if statement on line 331 of virus.pde to this:
if ((camS > 50/(WORLD_SIZE/12) || e < 0.0) && (camS < 1000/(WORLD_SIZE/12) || e > 0.0)) {
this will adjust the maximum and minimum view to the world size to make it equivalent to if it were a size 12 world

Solution for the food "problem"

If the food amount being static is unintentional, then the solution is to just scale the food limit to the world size. We can do this while retaining the ability to easily alter the food limit by splitting foodLimit into two variables, foodLimit and localFoodLimit. Local food limit should be set to whatever "foodLimit" would previously be set to in a size 12 world, and foodLimit will scale to match it.
Replacing lines 6 of virus.pde with this:
int localFoodLimit = 180;
and then add this line below it:
int foodLimit = (int) Math.round(localFoodLimit*(WORLD_SIZE/12));
here, 180 would be replaced with any positive integer.

Deletable codons.

Are the commands not supposed to be able to operate on as many things as possible? I think deleting and repairing codons (rgl values) is pretty obvious, but what about removing ugos, digesting waste, stuff like that.

RGL reads "[NOTHING]"

I've been trying to create a self replicating virus but it copies "[NOTHING]" into memory. Though the funny thing is that an RLG codon got loose in the environment & actually created new 5 codon viruses, which unfortunately didn't make it to the second generation, but it was amazing. Any suggestions on how to fix this?

Improvements: Camera follow UGO, (Key)* to toggle.

Reasons

  • It will save extra clicks navigating the environment.
  • Less fiddle.
  • Useful for following UGO through screen wrap.
  • For (Key)*, the button can be assigned to `. That way, if text is involved, there won't be much interference while another UGO is running.

Compatibility:

  • Zoom will have to follow along with this new movement.
  1. When UGO hits another cell, slowly glide/ease to the middle of the cell.
  2. When UGO Exits a cell glide/ease out of the cell.
Screen-wrap design options:
  1. teleport the camera to the other side.
When two or more UGO exits out of a cell,
  • locate the median point between the two at default.
  • Number keys to switch from 1st to 2nd UGO, or click on UGO that you want to focus on.
  • Sequence of UGO's should first be determined by which one appears first. Otherwise, Sequence them from top to bottom when they are created from the cell host; either from when they appear at first, or from where they are, relative from the top to bottom of the screen.
Extras.
  • ( ` ) key to exit UGO follow mode.
  • Indicator for follow mode. I suggest a small, unobtrusive border around the screen.

Cells on the edge of the grid causes a crash

java.lang.ArrayIndexOutOfBoundsException: 31
	at virus$Cell.pushOut(virus.java:1054)
	at virus$Cell.doAction(virus.java:911)
	at virus$Cell.iterate(virus.java:883)
	at virus.iterate(virus.java:185)
	at virus.draw(virus.java:116)
	at processing.core.PApplet.handleDraw(PApplet.java:2482)
	at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1547)
	at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:313)

I was able to fix by setting all cells on the edge to empty (type 0) in getTypeFromXY

int getTypeFromXY(int preX, int preY){
  //set all cells on the edge to  emtpy
  if ( preX >= WORLD_SIZE - 1 || preY >= WORLD_SIZE - 1 ) {
    return 0;
  }
...

Food and waste is very hard to distinguish for people with colorblindness

It's very hard to distinguish the food and waste circles for me (and probably a lot of other people). It would be great, if you could use some other color combination that is less prone to this problem. (red + blue?)
Or use different shapes to eliminate the problem altogether. (Circles and empty circles? Stars?)

2 suggestions, 1 issue

  • Reset button. There needs to be a reset button to restart the simulator
  • Save and load UGOs
  • There is an issue when I change the world size, it thows an "ArrayIndexOutOfBounds: (WorldSize)" at line 323 in Cell (while(chosen == -1 || cells[y+dire[chosen][1]][x+dire[chosen][0]].type != 0){)

error

there was a error where digest doesnt work

No comments

// This makes things more readable if used correctly
/*
  Please use those
  things because they make
  things more readable
  
  Please.
*/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.