Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

anyone can make it run? #9

Open
xukongwen opened this issue Jul 15, 2020 · 4 comments
Open

anyone can make it run? #9

xukongwen opened this issue Jul 15, 2020 · 4 comments

Comments

@xukongwen
Copy link

it seems, everything stop working, only one bonney and can't move or do anything at all.

@CyberDuck79
Copy link

I left a comment on the "ArgumentOutOfRangeException: Index was out of range" issue that can interest you.
With my fix all the population spawn but... the screen stay grey in the scene window. I will look into that later.
Qwak Qwak !

@CyberDuck79
Copy link

CyberDuck79 commented Oct 17, 2020

OK found, the camera is just not set correctly and there seem to have no control on it implemented into the simulation but you just need to set it with these values :
position x:160 y:140 z:-69
rotation x:40 y:0 z:0
I can see the bunnies live^^

@ninchistudios
Copy link

ninchistudios commented Oct 25, 2020

I have it running (thanks to the various fixes) but with a messed up terrain texture in Unity 2020.1.6f1

I was able to fix this by changing the X tiling on the Terrain material to 1.001 (from 1.0) shrug

xX72f6Satu

@osilkin98
Copy link

I managed to get it running, here's what I did:

1.) (Thanks to CyberDuck79) The Bunny prefab needs to its materials set manually (they are set to None by default), so you have to go into the Project view and go to Assets -> Prefabs -> Models -> Bunny and then open the one that just says Bunny in inspector view. From here, go to the Materials tab and then you'll see a list of Materials that need to be set. Drag the materials from the Project view into the slots for their corresponding names.

2.) In Scripts/Environment/Map.cs go to line 135 inside the Remove method, and replace this code:

        // If this entity is not last in the list, put the last entity in its place
        if (index != lastElementIndex) {
            map[regionX, regionY][index] = map[regionX, regionY][lastElementIndex];
            map[regionX, regionY][index].mapIndex = e.mapIndex;
        }
        // Remove last entity from the list
        map[regionX, regionY].RemoveAt (lastElementIndex);
        numEntities--;

with this:

        // make sure the map is non-empty 
        if (lastElementIndex >= 0) {
            // If this entity is not last in the list, put the last entity in its place
            if (index != lastElementIndex) {
                // Debug.Log(String.Format("Trying to access map[{0}, {1}][{2}]", regionX, regionY, index));
                // Debug.Log(String.Format("Map length: {0}", map[regionX, regionY].Count ));
                map[regionX, regionY][index] = map[regionX, regionY][lastElementIndex];
                map[regionX, regionY][index].mapIndex = e.mapIndex;
            }
            // Remove last entity from the list
            map[regionX, regionY].RemoveAt (lastElementIndex);
            numEntities--;
        }
  1. ) Go to Scripts/Behaviour/Animal.cs and on line 221, change Environment.RegisterMove (this, coord, moveTargetCoord);
    to Environment.RegisterMove (this, moveFromCoord, moveTargetCoord);

  2. ) Adjust the tiling on the Terrain material by going to Assets/Prefabs/Materials/Terrain, and using inspector mode, change the Tiling for X from 1 to 1.001.

  3. ) (optional) Adjust the main camera to be positioned at x: 160, y: 140, z: -69 with rotation x: 40, y: 0, z: 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants