• Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By BigJiggly
      Hello! So, I've been the leader of BJP for a while now. I'm a bit bored of taking the role I always take, leader. I was hoping someone out there is looking to forge a team maybe and needs a programmer. 
      I have experience mainly in the Unity engine(C# intermediate) and I have a very small amount of knowledge on Shaders, as well as experience on developing games(usually end up stuck in dev hell) and leading experience from my last team which at one point reached 11 people. I personally love the Unity engine and prefer to use it as it's the development environment I'm comfortable with. 
      I have used Unity for over a year and a few months, I'd consider myself an intermediate at the Engine, but to this day Unity still surprises me. 
      I live in the United Kingdom, I find it a bit strange to work with other programmers as the ones I've worked with tend to leave their code heavily unoptimised and I'm a on the go optimise kind of guy, I also like to get things done quickly.
       
      If you're a new team and need a programmer that has high levels of ambition and strives to maintain the motivation throughout the team, then I'm your guy. I don't care if you're just beginning because I'm all for helping people learn!
       
      To finish this off: I like to get things done and I like to get them done right the first time, if I fail I will do it again and again, etc, until I loose all motivation. So if you're a modeller or an artist, please don't leave me to do all the modelling/art as well as the programming and sound. I do have experience in all those areas but my main power is in programming and I'd prefer to keep it that way.
       
      [If this was posted in the wrong forum, sorry, I don't really know the layout of this website yet]
    • By Kristiyan21
      Hello guys,i am writing this topic to get to the opinion of more people.I have just released my first game for android(worked on it for about 5-6 months in my spare time) i used Unity framework and i am planning to make it a big project but i had to release 1.0 version so i am 100% sure i wouldn't quit the project at some time.What i am asking any of you guys is to give me your opinion about the game. What do you like,what you don't , is the ad too irritating?is the GUI okay?any information you might consider usefull for me would be helpful,thanks in advance!
      the game on google play:
      https://play.google.com/store/apps/details?id=com.KindieGames.PlaneDash
    • By ethancodes
      I've got a custom Brick class. I need at least one other type of Brick subclass, maybe more. These classes should do most of what the Brick class does, but have a bit of modified or added behavior. Normally I would assume inheriting from the Brick class would be the best choice for this, but when I tried to do it I was having some issues because of having to make additional instances of variables referencing manager objects. I'm not sure if I was just doing it wrong, or if maybe inheritance isn't the right solution here. Here is the Brick class:
      using System.Collections; using System.Collections.Generic; using UnityEngine; public class Brick : MonoBehaviour { public AudioClip crack; public Sprite[] hitSprites; public static int breakableCount = 0; public GameObject smoke; private LevelManager levelManager; private int timesHit; private bool isBreakable; private float delay = 1.5f; //Delay till bricks move down 1 row. private float timer = 0; // update ever frame and compare to delay. // Use this for initialization void Start () { isBreakable = (this.tag == "Breakable"); //keep track of breakable bricks if (isBreakable){ breakableCount++; } timesHit = 0; levelManager = GameObject.FindObjectOfType<LevelManager>(); } // Update is called once per frame void Update () { timer += Time.deltaTime; if (timer >= delay) { transform.Translate(0.0f, -1.0f,0.0f); timer = 0; } } void OnCollisionEnter2D (Collision2D collision) { if (collision.gameObject.tag == "EndScreen") { levelManager = GameObject.FindObjectOfType<LevelManager>(); levelManager.LoadLevel("Lose"); } AudioSource.PlayClipAtPoint (crack,transform.position); if (isBreakable) { HandleHits (); } } void HandleHits () { timesHit++; int maxHits = hitSprites.Length + 1; if (timesHit >= maxHits) { breakableCount--; levelManager.BrickDestroyed(); PuffSmoke(); Destroy (gameObject); } else { LoadSprites(); } } void LoadSprites () { int spriteIndex = timesHit - 1; if (hitSprites [spriteIndex] != null) { //if statement keeps it from loading nothing if level designer forgets to assign a sprite this.GetComponent<SpriteRenderer> ().sprite = hitSprites [spriteIndex]; } else { Debug.LogError("Brick sprite missing"); } } void PuffSmoke () { var smokePuff = Instantiate(smoke, transform.position, Quaternion.identity); var effect = smokePuff.GetComponent<ParticleSystem>().main; effect.startColor = GetComponent<SpriteRenderer>().color; } } What I need is for a different kind of brick to destroy all other adjacent bricks when the ball hits it. I considered just adding this functionality in to the brick class, and have it activate based on tags, but that didn't seem like the best solution. I'm open to any ideas. Thanks!
    • By Epicghost 505
      Hello,
      We are looking for people to be apart of a team, to help create a horror game we are looking for 3d modelers, coders, artist, animators, fx artist, level designers, and audio design, there will be a payment plan once release of game                                                                                                                                                                                                                                                                                              if your interested come join our discord                                                                                                                                                                                                                                                                         We hope to see you there
      https://discord.gg/6rcc6xr
      -Epicghost505
    • By ethancodes
      I'm having a weird issue with detecting a collision. I've tried everything I could find online but nothing seems to work. I have a brick object. It has a 2D Collider attached and I have also attached a 2D Rigidbody on it. I also have an EndScreen 2D Collider. The EndScreen 2D collider is tagged with "EndScreen". I am trying to detect when a brick collides with the end screen collider and simply print "game over" in the console. 
      This is my current code for this part of the program, it is attached to the bricks:
      void OnCollisionEnter (Collision2D collision) { if (collision.gameObject.tag == "EndScreen") { Debug.Log("Game over"); } } Several things have happened depending on the set up. If I have the rigidbody 2D set as static, my ball object can still collide with the bricks, but I get no Log message. If I set it to Kinematic or Dynamic, I get absolutely no interaction between the ball and the bricks, and nothing when the bricks pass through the collider. I have tried to set the collider to a trigger and use OnTriggerEnter2D, no change. I have tried to put the rigidbody on the EndScreen object and tried to set it's body type to all 3 settings, no change. The only thing I can think of that I have not done is put the script on the EndScreen object and switch the tag to the bricks. The reason I have not done this is because I will have several types of bricks, some of which will have different tags. 
       
      Please tell me somebody can see what I'm doing wrong here, because I'm losing my mind over something I feel should be ridiculously simple. Thanks.
  • Advertisement
  • Advertisement
Sign in to follow this  

Running out of memory prematurely

Recommended Posts

Sometimes I get an out of memory exception when I don't think I should.  It's been happening when I try to write a file to the hard drive.  For analytical purposes I have to have all the data loaded into ram before writing it, and it is several dozen megabytes.

 

However, I know that I have 16 gigabytes of ram and I'm hardly running any other programs, certainly not anything that would take a significant fraction of it.  Isn't memory first-come first-serve, meaning that Windows should let me have however much I need until I've used it all and then run out?

 

Also, it oddly occurs while I'm writing the file.  The data is already in ram, and I'm not allocating any more.  I thought that the only thing that could cause that exception was a memory allocation, or am I wrong?

 

And by the way, I know that the stream and everything is working, because if I use smaller files with the same function, it works fine.  The problem only happens when I use a huge file, and it tends to happen late in the process when it's near the end of writing the file.

Share this post


Link to post
Share on other sites
Advertisement

Firstly, you've been told before not to throw all your questions into For Beginners. I'm moving this to the general programming forum.

Secondly, show code, and explain exactly what this exception is that you see. We're not here to second-guess what you're doing which may or may not be wrong.

 

Share this post


Link to post
Share on other sites
3 hours ago, Kylotan said:

Firstly, you've been told before not to throw all your questions into For Beginners. I'm moving this to the general programming forum.

 

OK, sorry.  I wasn't sure where it belonged because it seems like a relatively simple problem and people used to keep telling me that the things I post should be moved to beginners.  So for future reference, what kinds of things are intended for the beginners forum?

 

3 hours ago, Kylotan said:

Secondly, show code, and explain exactly what this exception is that you see. We're not here to second-guess what you're doing which may or may not be wrong.

I don't know why everyone ALWAYS expects me to post code.  Yes, I understand that in many cases it can be more convenient, but doesn't anyone else understand the concept of confidentiality?  I narrowed the problem down to a specific line.  I KNOW for certain that nothing else is causing it either directly or indirectly, because as I said, the stream works for all but the largest files.  And all the line does it write data from an already existing array into a file.  So here's the line, or something so similar that you wouldn't be able to tell the difference:

 

fs.WriteByte(bytes);

 

fs is a file stream, bytes is an array of bytes, and i is the index of a for loop.  Happy now?

 

And the exception is called OutOfMemoryException.  I thought that was a common enough one that pretty much anyone would recognize it.

Share this post


Link to post
Share on other sites
1 minute ago, myvraccount said:

So for future reference, what kinds of things are intended for the beginners forum?

If you visit the For Beginners forum, there is a thread about this.

 

2 minutes ago, myvraccount said:

I don't know why everyone ALWAYS expects me to post code.

Because that's where the errors are.

 

2 minutes ago, myvraccount said:

Happy now?

No. Post a proper question with some decent context or don't waste our time.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement