Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Erarnitox

  1. Erarnitox

    Galactic Battles 2018

    hope so he really deserves it for this awesome work. Like to see it is growing now at 6k still not a lot but i can see it getting rolling
  2. Erarnitox

    Galactic Battles 2018

    how this only has 4k views?
  3. Erarnitox

    Loading Scene

    Very simple script you can just paste into a scene to make it a loading scene for a bigger Level/Scene to follow. using System.Collections; using UnityEngine; using UnityEngine.SceneManagement; public class AsyncLoad : MonoBehaviour { [Header("Name of the Scene to be loaded:")] public string sceneToLoad = "Map"; //Name of the Scene we want to load. [Space(10)] public GUISkin myskin; //Our GUISkin to use for the text and loading bar. private float progress = 0; //progress in % void Start () { //use a Coroutine to handle the loading: StartCoroutine(LoadNewScene()); } #region Loading IEnumerator LoadNewScene() { AsyncOperation loading = SceneManager.LoadSceneAsync(sceneToLoad); while (!loading.isDone) { progress = 100*loading.progress; yield return null; } } #endregion #region Display private void OnGUI() { GUI.skin = myskin; //Set the style to our GUISkin GUI.Box(new Rect(Screen.width / 2 - 500, Screen.height - 40, 1000, 20),""); //background Box GUI.color = Color.cyan; //Color for the loading bar GUI.Box(new Rect(Screen.width / 2 - 500, Screen.height - 40, 10*progress, 20),""); //loading bar GUI.color = Color.white; //color for the display test GUI.Label(new Rect(Screen.width / 2 - 100, Screen.height - 45, 200, 30), progress + "% Loaded..."); //display text } #endregion } nothing special but i hope its useful for some of you.
  4. Erarnitox

    Texel Density Checker

    hey, i wrote a quick and simple editor window that lets you check your texel density by replacing each texture with a checker texture in the same size to make it clear which textures have too much and which too little resolution !!Warning!! 1.Back up your project so you can restore your materials if they get messed up 2.only works with square textures with a power of 2 resolution(16x16 - 4096x4096) 3.not debugged only a very fast script i put together so please, please do 1. first Code here: using UnityEngine; using UnityEditor; using System.Collections.Generic; public class XenoTexelTool : EditorWindow { int c = 0; List<Texture> CheckerTextures = new List<Texture>(); List<Texture> OrginalTextures = new List<Texture>(); [MenuItem("Erarnitox/XenoTextelTool")] public static void Menu() { XenoTexelTool window = (XenoTexelTool)GetWindow(typeof(XenoTexelTool)); window.minSize = new Vector2(300, 120); window.maxSize = new Vector2(300, 120); window.Show(); } private void LoadCheckers() { CheckerTextures.Add(Resources.Load<Texture>("check16")); CheckerTextures.Add(Resources.Load<Texture>("check32")); CheckerTextures.Add(Resources.Load<Texture>("check64")); CheckerTextures.Add(Resources.Load<Texture>("check128")); CheckerTextures.Add(Resources.Load<Texture>("check256")); CheckerTextures.Add(Resources.Load<Texture>("check512")); CheckerTextures.Add(Resources.Load<Texture>("check1024")); CheckerTextures.Add(Resources.Load<Texture>("check2048")); CheckerTextures.Add(Resources.Load<Texture>("check4096")); /* Debug.Log("Loading Checkers..."); if (EditorGUIUtility.FindTexture("Checker/check16")){ Debug.Log("Check16 found!"); CheckerTextures.Add(EditorGUIUtility.FindTexture("Checker/check16") as Texture); } */ } void OnGUI() { GUI.color = Color.cyan; GUILayout.Box("XenoTexelTool"); GUI.color = Color.white; GUILayout.Space(10); GUILayout.Label("This tool lets you check your texel density:"); GUI.color = Color.green; GUILayout.Space(5); if (GUILayout.Button("Set Checker Texture")) { if (CheckerTextures.Count < 1) { LoadCheckers(); } SetAllMaterialsInSceneToChecker(); } if (GUILayout.Button("Set Original Texture")) { SetAllMaterialsInSceneToOriginal(); } } void SetAllMaterialsInSceneToChecker() { if (OrginalTextures.Count == 0) { foreach (Material mat in Resources.FindObjectsOfTypeAll(typeof(Material)) as Material[]) { if (mat.HasProperty("_MainTex")) { if (mat.GetTexture("_MainTex") != null) { if (!mat.mainTexture.Equals(null)) { OrginalTextures.Add(mat.mainTexture); switch (mat.mainTexture.width) { case 16: mat.mainTexture = CheckerTextures[0]; break; case 32: mat.mainTexture = CheckerTextures[1]; break; case 64: mat.mainTexture = CheckerTextures[2]; break; case 128: mat.mainTexture = CheckerTextures[3]; break; case 256: mat.mainTexture = CheckerTextures[4]; break; case 512: mat.mainTexture = CheckerTextures[5]; break; case 1024: mat.mainTexture = CheckerTextures[6]; break; case 2048: mat.mainTexture = CheckerTextures[7]; break; case 4096: mat.mainTexture = CheckerTextures[8]; break; default: mat.mainTexture = CheckerTextures[0]; break; } } } } } } } void SetAllMaterialsInSceneToOriginal() { if (OrginalTextures.Count>0) { c = 0; foreach (Material mat in Resources.FindObjectsOfTypeAll(typeof(Material)) as Material[]) { if (mat.HasProperty("_MainTex")) { if (mat.GetTexture("_MainTex") != null) { if (!mat.mainTexture.Equals(null)) { mat.mainTexture = OrginalTextures[c++]; } } } } OrginalTextures.Clear(); } else { Debug.LogWarning("Warning: Can't restore Textures since they have not been replaced!"); } } } Download with checker textures and everything set up for lazy ppl. like myself: https://mega.nz/#!BY9GmawZ!K50VZGxbk08S2J16oRSuKVq1OEvOkGkDBcHJCS4IIE0 Please have a look at it and tell me what i can improve This is a must have for every leveldesigner etc. so i was surprized i couldnt find anything like that script online meaning: i will probably improve it so if you dont need it right now ill be working on a stable/tested version of this script. Thanks for the read
  5. @OcularCash even tho this is kind of a workaround and could get messy when you have multiple objects you want to do that for, i still love this idea cuz its so simple <3 so now... first of all if a pbr material looks wrong but every other pbr material in the scene looks fine the material is most likely wrong and your first thing to to would be to check if all the textures are correct (is the albedo to bright maybe?) So if you dont care about physical accuracy you can download the standard shader and add a float to the material 0-1 where 1 would be recives the full light and 0 would be none. There should be a line col = ... in the function the vertex color gets calculated now just multiply by the float you defined .... shaderlab is a bit tricky i guess you have to declare that you want to actually use the float somewhere and this method is like a tint im sure you can actually calculate the light better but im not a shader pro. Pro: to this would be that you can set the light for every material differently without the need of an extra layer or light. Con: you actually have to understand some shaderlab to get this working (i could do it for you as soon i got time tho.) edit: download shaders from here and Tutorial on shaderlab here and especially on how to add a tint to the shader here (note: im sure there is a better way to do this tho.) hope this helped somewhat
  6. Erarnitox

    Decoding string empty output

    hey ive got a problem when i try to restore my original seed from the "shortened" one. Shortened Seed/Inut is (cant copy/paste the exact string since it uses unicode): ǻM߸ࡪʙŅࠚœՈϰňfҬ̓ࡒ߮Ϝר£Ӹτ߻ݍєࡪݍ̟[¡Lτ߽ņ Output sould be: 003i50i0i99i2i30i173i0.01020087i53i1.700173i4.7i20i0.54i87i0.6729521i-0.37699i-0.6940705i0.5029541i1i1 The long seed only uses 13 different chars (so i theated it as a base 13 number) and converted it to a higher base to shorten it and get the shortSeed. (egs. like you would do to convert from binary to octal) here is the code: private void RestoreSeed(string shortSeed) { char[] toDecode = shortSeed.ToCharArray(); char[] seed = new char[toDecode.Length * 3]; int value = 0; int counter = 0; for(int i=0; i< toDecode.Length; i++) { value = toDecode[i]; counter = 0; //3rd letter: while(value >= 169) { value -= 169; counter++; } if (counter < 10) { seed[i * 3] = (char)counter; } else if (counter == 10) { seed[i * 3] = '-'; } else if (counter == 11) { seed[i * 3] = '.'; } else { seed[i * 3] = 'i'; } counter = 0; //2nd letter: while (value >= 13) { value -= 13; counter++; } if (counter < 10) { seed[i * 3+1] = (char)counter; } else if (counter == 10) { seed[i * 3+1] = '-'; } else if (counter == 11) { seed[i * 3+1] = '.'; } else { seed[i * 3+1] = 'i'; } //1st letter: if (value < 10) { seed[i * 3 + 2] = (char)value; } else if (value == 10) { seed[i * 3 + 2] = '-'; } else if (value == 11) { seed[i * 3 + 2] = '.'; } else { seed[i * 3 + 2] = 'i'; } } string Seed = new string(seed); Debug.Log("Seed:"+ Seed); } in debug log i get an completely empty seed and i wonder why that is since i have no clue thanks for your help guys (If any information on how i created the seed etc. is needed feel free to ask and i will provide additional information for better understanding.)
  7. Erarnitox

    Advanced Foliage Pack 1 vs GeNa

    this is really no eather or question since GeNa has its focus clearly on the coding side to place objects in a natural way while ADPI is a pure asset pack. So it would be also possible to combinde both to get the best of both, just replace the "placeholder" assets from GeNa with the ones from ADPI. If i had to decide to pick one i would probably go with ADPI since it looks fantastic and you can still "hand craft" your level with it. (Dont get me wrong: they both look very well made and worth the money it just depends on what you need.)
  8. Erarnitox

    People like this trigger me so much you can't even believe

    oh damn ... if he was like an indie who just started but "so i can present that to the chair of my dissertation committee" really got me thinking
  9. Erarnitox

    massive map generation

    Hey im searching for good tutorials/books/lessons or documentation, technical showreels of how AAA games use streaming, procedural generation, object pooling etc. for gigantic maps basicly anything that gives an idea on how to generate a better/more natural looking environtment or anything that would make it more optimized. please post any links you have somehow related below thank you very much would also appreciate if the sources where free but you can also post links to paid products on that topic if they are very good. Thank you very much
  10. Erarnitox

    Hoi !

    Hoi, enjoy your stay
  11. Erarnitox

    fpskit 1.6 referring to player clone

    have to agree with OMA here. You should really watch a java or c# playlist on youtube first or sth. to get the basics down, (i liked: after that maybe work through the tutorial section on the unity website (https://unity3d.com/learn/tutorials) (note: i didnt do the unity tutorials but even the beginner ones appear to be helpful and look like they can really teach working with unity) but all in all i dont have a problem with using kits but you should be able to undestand everything of the kit to really make use of it and make your own project out of it. And i also dont have a problem with answering questions. Sometimes the fastest way to learn is to ask somebody who knows it (but in most scenarios this wouldnt be the case.... however when your really stuck there shouldnt be a reason not to ask) well good luck and you dont have to go through all of this at once, everybody of us is still learning and hopefully progresses every day.
  12. Erarnitox

    Bugs after upgrading Unity

    well what i would suggest you to do is to check for changes they made here: https://unity3d.com/de/unity/whats-new/unity-5.3 (this is the version the project was still working) and go through every release since then and check for changes that could affect your project... i know kind of tedious process but i think youll be able to find and fix everything within 1-2h Good Luck like the project ( Y )
  13. Erarnitox

    fpskit 1.6 referring to player clone

    im actually too lazy to read through all of this comments etc. but the way i would access an object spawned by another gameobject that is already in scene would be: 1) in the gamemanager class declare a global public variable of type gameobject like this: public GameObject Player = null; 2) assign sth. to it when you spawn the player like that in your gamemanager: Player = Instantiate(PlayerObject,new Verctor3(0,0,0), Quaternion.identity); 3) In the script you want to access the player from declare a global variable of type gamemanager: public gamemanager gm; //assign in inspector!!! 4) now you can access the Player through: gm.Player in the whole script: if(gm.Player != 0) //tests if PlayerObject was Spawned { //Do stuff! } Notes: 1) just to make sure set Player back to null when the player dies /despawns /gameobject gets deletednot sure how c# takes care of this and where the addy pointing after deleting the object, so just set it to null to make sure! 2) ofc. a better practise would be to use a gatter since you dont want to be able to set the object from outside (just dont mess with it and it ll do)
  14. Erarnitox


    thanks, looks interesting
  15. Erarnitox

    Giant Terrain Generator

    Hey, iwanted to share something with you that you might find useful. Im working on a Terrain Generator for my game and had some problems due to a lack of documentation of the TerrainData methods so i decided to share a working WIP version of my Terrain Generator. Note that the scripts are early wip and do contain some bugs and has some poor coding style at some points. But i think they are a good reference if you want to build a Terrain Generator yourself or even build further on this one. First of all here is a small preview: So here is the Script for the Texture Data: Here is the main Terrain Generator Logic: Note: you can see its still wip and includes empty methods but i left everything as it is if you want to expand it. And finally here is the Custom Inspector for the Terrain Generator: I hope you like this one since it took me longer that expected to create Also please share any improvements that would be great (Y) Thanks for the read and let me know if there are any major flaws/bugs as well if there are any questions -> feel free to ask
  16. brent farris has a youtube channel where he explains some stuff but yeah not nearly as much documentation as unet or photon but i like the concept better and its even free and very scaleable
  17. great (Y) thanks for the share. Since im using forge as well this is very interesting to me
  18. Erarnitox

    Place Buildings on Terrain

    nah thats fine ... at least to my understanding.... it should check if its too close to the lower edge, so even if it was +3 instead of -3 it would just deny the execution of some valid cases so even if i got that wrong there shouldnt be a problem ... so well i have some time now i guess i will go through this step by step again ^^
  19. Erarnitox

    Place Buildings on Terrain

    hey i wrote this code to place Buildings on my Terrain but the code seems to take for ever or ends up with an array index error. i hope you can help me //Place the Buildings: while (counter <= BuildingsPerTerrain) { posx = Random.Range(terrainPosX, terrainPosX + terrainWidth); posz = Random.Range(terrainPosZ, terrainPosZ + terrainLength); posy = Terrain.activeTerrains[i].SampleHeight(new Vector3(posx, 0, posz)) - 37; if (Terrains[i].terrainData.GetSteepness(posx, posz) < 0.1f) { rotation = Random.Range(0, 360); c = Random.Range(0, BuildingObjects.Length); if ((posx-terrainPosX) < size - 1 && (posy-terrainPosZ) < size - 1 && (posx-terrainPosX - 3) > 0 && (posy-terrainPosZ - 3) > 0) { for (int x = (posx - 2 - terrainPosX); x < (posx + 3 - terrainPosX); x++) { for (int y = (posz - 2 - terrainPosZ); x < (posz + 3 - terrainPosZ); y++) { //flatten the ground where the building stands: heightMap[x, y] = posy; //array index error here---------------------------------------------------------- //remove vegetation where the Building stands: for (int g = 0; g < Grass.Length; g++) { grassMap[g][x, y] = 0; } } } //Place the Building on the Ground: NewObject = Instantiate(BuildingObjects[c], new Vector3(posx, posy, posz), Quaternion.Euler(0.0f, rotation, 0.0f)); NewObject.transform.parent = Terrains[i].gameObject.transform; NewObject.isStatic = true; counter++; } } } -the variable size is just terraindata.alphamapheight -Terrains[] is an Array with all Terrains in the scene in it (so Terrains is just a simple Terrain) -TerrainPosX is the global x position of the terrain in worldspace -TerrainPosZ is the same for Z Got really stuck on this one :/ Thanks for your help ... if you do need more context please let me know and ill be happy to provide it... i just wanted to keep the snipped short n simple (still hope that im just too dumb to spot something obvious)
  20. Erarnitox

    Place Buildings on Terrain

    it should already be that size but ill double check that later. and for the edges i have this if statement: (which should do the same job (posx-terrainPox should be posxterrainPosx-1 if you want to be exact)) if ((posx-terrainPosX) < size - 1 && (posy-terrainPosZ) < size - 1 && (posx-terrainPosX - 3) > 0 && (posy-terrainPosZ - 3) > 0)
  21. Erarnitox

    Place Buildings on Terrain

    thank you i was literally watching this code for about 1h and didnt see this lol edit: still got the same problem tho.
  22. Erarnitox

    Unity error with with a message

    i actually assume that your mono installation is broken... I would try to reinstall Unity with the VS2017 as editor and get rid of mono develop... I dont know tho. this ist just a random guess i made.
  23. Erarnitox

    Hello guys, I have a problem :/

    First of all this should be posted in the "need help" section. Now to the 2nd point: we dont know your project. How should we know how you programmed that? So now... im gonna assume your talking about the FPS KIT by oma? As far as i know there should be a manager objects with a Player spawner component or sth. simmular. Just search the project for scripts and i think you can guess by the name of the script which one is for spawning the player. In scene you can find the spawner object by searching for "t:Scriptname". And for the enemy part there is a FPS KIT tutorial section on this forum where you can find topics like this: Note that the links/topics might be outdated. You might have to do some searching there but im sure you ll be able to find this information pretty fast on this forum. Good luck
  24. Erarnitox

    Bullet Penetration

    have a look at this: https://www.indiedb.com/games/wilderness/features/bullet-pentration