• Advertisement

Search the Community

Showing results for tags 'C\#'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

  • Audio
    • Music and Sound FX
  • Business
    • Business and Law
    • Career Development
    • Production and Management
  • Game Design
    • Game Design and Theory
    • Writing for Games
    • UX for Games
  • Industry
    • Interviews
    • Event Coverage
  • Programming
    • Artificial Intelligence
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Engines and Middleware
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
  • Archive

Categories

  • News

Categories

  • Audio
  • Visual Arts
  • Programming
  • Writing

Categories

  • GameDev Unboxed

Categories

  • Game Dev Loadout

Forums

  • Audio
    • Music and Sound FX
  • Business
    • Games Career Development
    • Production and Management
    • Games Business and Law
  • Game Design
    • Game Design and Theory
    • Writing for Games
  • Programming
    • Artificial Intelligence
    • Engines and Middleware
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
    • 2D and 3D Art
    • Critique and Feedback
  • Topical
    • Virtual and Augmented Reality
    • News
  • Community
    • GameDev Challenges
    • For Beginners
    • GDNet+ Member Forum
    • GDNet Lounge
    • GDNet Comments, Suggestions, and Ideas
    • Coding Horrors
    • Your Announcements
    • Hobby Project Classifieds
    • Indie Showcase
    • Article Writing
  • Affiliates
    • NeHe Productions
    • AngelCode
  • Workshops
    • C# Workshop
    • CPP Workshop
    • Freehand Drawing Workshop
    • Hands-On Interactive Game Development
    • SICP Workshop
    • XNA 4.0 Workshop
  • Archive
    • Topical
    • Affiliates
    • Contests
    • Technical

Calendars

  • Community Calendar
  • Games Industry Events
  • Game Jams

Blogs

There are no results to display.

There are no results to display.

Marker Groups

  • Members

Developers

Developers


Group


About Me


Website


Industry Role


Twitter


Github


Twitch


Steam

Found 200 results

  1. I'm doing a test quest. The player gets a quest from an NPC to bring him fish. Once the player picks up the fish, the original NPC gets replaced by a new one with a new conversation trigger. The NPC tells the Player "Well done" and should give 200xp. The script tells the xp counter to go up by making a reference to the gameobject that holds the text component But it throws this error: I'm aware that the error may hide in plain sight. I just have to sort this out, since I'm writing the AI at the same time, and the time it takes to resolve everyone of these errors is tremendous. Plus, I think I'll learn something. I've been having trouble with some basic functionalities recently. There might be something wrong with my understanding on how programming works. Glad if someone could help (: Edit: I'm fully aware that the update function requires an input. I call the function in the editor when the dialogue ends, it still doesn't work.
  2. Hi fellow game devs, With the help of @CombatWombat in my previous post about clutch modeling, I now have a solid direction for the modeling the clutch. The way I'm doing it is having 2 clutch states: locked and unlocked. EngineRPM and torque will be calculated separately in each state. My problem right now is the logic and code for specifying locking and unlocking. The condition for locking is when (engineSpeed - drivetrainSpeed) in previous update cross zero (different sign) with the current update (to determine if engineSpeed = drivetrainSpeed or not in-between updates) and engineTorque <= clutchTorque. The condition for unlocking is when engineTorque > clutchTorque. The diagram looks roughly like this (taken from matlab website with the similar implementation): However, the 2 conditions are triggers for switching states, not for determine the current state to be in, so in the end my clutch state just jumped around. I don't have a lot of experience in doing state machine, so can some one give me rough code of how to implement this? Below is my rough code: speedError = engineSpeed - drivetrainSpeed; if ((Math.Sign(speedError) != Math.Sign(deltaW) && currentTotalEngineTorque <= clutchReactTorque)) { clutchLocked = true; } else clutchLocked = false; deltaW = speedError; //end of update I think the main struggle is the cross zero. Because cross zero is the "trigger condition" to check if the clutch should lock when it is slipping, not the condition for continuous locking, while the code I have above is the "continuous condition" saying "this condition is true then it is locked/unlocked". Another word, if the clutch is slipping, the condition above would decide if it's locked or not, but once it is locked, the cross zero condition is not true anymore (since speedError and deltaW have same sign as engineSpeed == drivetrainSpeed when clutch is locked). I'm sorry that I cannot explain this better as English is not my first language.
  3. C# Peek through door

    I need help on a script. I am recreating a scene from A Hat In Time where Hat Girl goes into Queen Vanessa's manor. She has to collect keys and avoid Queen Vanessa. How would I script the door where you can open it and peek through it without actually going out the door? Any help is appreciated. Thanks!EDIT: Not peeking throught the keyhole, just poke your head out the door
  4. Simple Json Lib.

    I went looking for Json. But there wasn't a simple Json. I just wanted to change Class to Json and change Class back to Json. So I made it myself. zJson.cs 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 /* code by eekdro@gmail.com */ /* zJson is a simple Json library */ /* Just Class to Json, Json to Class, Haven't Depth*/ using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; namespace AliceUtil { /// <summary> /// Json to Class , Class to Json 을 지원하는 Class /// </summary> public class zJson { public static string MakeJson<T>(List<T> jsonClassList, string FileName ) where T : new() { string Result = MakeJson(jsonClassList); zUt.SaveTextFile(FileName, Result); return Result; } /// <summary> /// List를 Json으로 만들어준다. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="jsonClassList"></param> /// <returns></returns> public static string MakeJson<T>(List<T> jsonClassList) where T : new() { string ResultStr = "{\n"; Type ClassType = typeof(T); ResultStr += "\t\"" + ClassType.Name + "\":["; foreach (T jsonClass in jsonClassList) { string JsonStr = MakeJson(jsonClass).Replace("\t", "\t\t"); ResultStr += "\t" + JsonStr.Insert(JsonStr.Length - 1, "\t") + ",\n"; } if (ResultStr[ResultStr.Length - 2] == ',') ResultStr = ResultStr.Substring(0, ResultStr.Length - 2); ResultStr += "\t]\n}"; return ResultStr; } public static string MakeJson<T>(T jsonClass, string FileName) where T : new() { string Result = MakeJson(jsonClass); zUt.SaveTextFile(FileName, Result); return Result; } public static string MakeJson<T>(T jsonClass) where T : new() { string ResultStr = "{\n"; Type ClassType = typeof(T); FieldInfo[] fields = ClassType.GetFields(); PropertyInfo[] Pinfo = ClassType.GetProperties(); foreach (FieldInfo f in fields) { if (f.FieldType == typeof(string)) { string value = f.GetValue(jsonClass) == null ? "" : f.GetValue(jsonClass).ToString(); ResultStr += "\t\"" + f.Name + "\":\"" + value + "\",\n"; } else if (f.FieldType == typeof(DateTime)) ResultStr += "\t\"" + f.Name + "\":" + ((DateTime)f.GetValue(jsonClass)).Ticks.ToString() + ",\n"; else if (f.FieldType == typeof(int) || f.FieldType == typeof(long) || f.FieldType == typeof(float) || f.FieldType == typeof(double) || f.FieldType == typeof(bool)) ResultStr += "\t\"" + f.Name + "\":" + f.GetValue(jsonClass).ToString() + ",\n"; else if (f.FieldType == typeof(int[])) ResultStr += "\t\"" + f.Name + "\":" + "[" + string.Join(",", ((int[])f.GetValue(jsonClass)).Select(x => x.ToString()).ToArray()) + "],\n"; else if (f.FieldType == typeof(long[])) ResultStr += "\t\"" + f.Name + "\":" + "[" + string.Join(",", ((long[])f.GetValue(jsonClass)).Select(x => x.ToString()).ToArray()) + "],\n"; else if (f.FieldType == typeof(double[])) ResultStr += "\t\"" + f.Name + "\":" + "[" + string.Join(",", ((double[])f.GetValue(jsonClass)).Select(x => x.ToString()).ToArray()) + "],\n"; else if (f.FieldType == typeof(float[])) ResultStr += "\t\"" + f.Name + "\":" + "[" + string.Join(",", ((float[])f.GetValue(jsonClass)).Select(x => x.ToString()).ToArray()) + "],\n"; else if (f.FieldType == typeof(bool[])) ResultStr += "\t\"" + f.Name + "\":" + "[" + string.Join(",", ((bool[])f.GetValue(jsonClass)).Select(x => x.ToString()).ToArray()) + "],\n"; else if (f.FieldType == typeof(string[])) ResultStr += "\t\"" + f.Name + "\":" + "[" + string.Join(",", ((string[])f.GetValue(jsonClass)).Select(x => "\"" + x + "\"").ToArray()) + "],\n"; } if (ResultStr[ResultStr.Length - 2] == ',') ResultStr = ResultStr.Substring(0, ResultStr.Length - 2); return ResultStr + "\n}"; } static string GetTokenString(string Source, string StartStr, string EndStr) { int Openidx = Source.IndexOf(StartStr); int Closeidx = 0; while (true) { Openidx = Source.IndexOf(StartStr, Openidx + 1); Closeidx = Source.IndexOf(EndStr, Closeidx + 1); if (Closeidx == -1) return ""; // 여기로 온다는 것은 정상적인 Json 이 아니라는 것을 의미한다. if (Openidx == -1 || Openidx > Closeidx) break; } return Source.Substring(1, Closeidx - 1); } public static List<T> PaserListFromFile<T>(string jsonFilename) where T : new() { return PaserList<T>(zUt.LoadTextFile(jsonFilename)); } public static List<T> PaserList<T>(string jsonStr) where T : new() { List<T> ResultList = new List<T>(); int idx = jsonStr.IndexOf("\"" + typeof(T).Name + "\""); if (idx == -1) return ResultList; jsonStr = jsonStr.Substring(idx); idx = jsonStr.IndexOf("["); if (idx == -1) return ResultList; jsonStr = jsonStr.Substring(idx).Trim().Replace("\t", "").Replace("\n", ""); ; jsonStr = GetTokenString(jsonStr, "[", "]"); while (true) { if (jsonStr.Trim() == "") break; string ItemStr = GetTokenString(jsonStr, "{", "}"); if (ItemStr == "") break; ResultList.Add(Paser<T>(ItemStr)); jsonStr = jsonStr.Substring(ItemStr.Length + 2); } Console.WriteLine(jsonStr); return ResultList; } public static T PaserFromFile<T>(string jsonFilename) where T : new() { return Paser<T>(zUt.LoadTextFile(jsonFilename)); } public static T Paser<T>(string jsonStr) where T : new() { T nJsonClass = new T(); Type ClassType = typeof(T); FieldInfo[] fields = ClassType.GetFields(); PropertyInfo[] Pinfo = ClassType.GetProperties(); foreach (FieldInfo f in fields) { int idx = jsonStr.IndexOf("\"" + f.Name + "\""); if (idx == -1) continue; string rs = jsonStr.Substring(idx + ("\"" + f.Name + "\"").Length).Trim().Replace("\t", "").Replace("\n", ""); if (rs[0] != ':') continue; if (f.FieldType == typeof(string)) { int ix = rs.IndexOf("\""); int chix = rs.IndexOf(","); if (chix != -1 && chix > ix && ix != -1) { rs = rs.Substring(rs.IndexOf("\"") + 1); string value = rs.Substring(0, rs.IndexOf("\"")); f.SetValue(nJsonClass, value); } else f.SetValue(nJsonClass, null); } else if (f.FieldType == typeof(int[]) || f.FieldType == typeof(string[])) { int ps = rs.IndexOf("[") + 1; rs = rs.Substring(ps, rs.IndexOf("]") - ps).Trim(); if (rs == "") continue; string[] datas = rs.Split(','); if (f.FieldType == typeof(int[])) { var temp = new int[datas.Length]; for (int n = 0; n < datas.Length; n++) temp[n] = int.Parse(datas[n].Trim()); f.SetValue(nJsonClass, temp); } else if (f.FieldType == typeof(string[])) { var temp = new string[datas.Length]; for (int n = 0; n < datas.Length; n++) temp[n] = datas[n].Trim().Substring(1, datas[n].Trim().Length - 2); f.SetValue(nJsonClass, temp); } } else { // 마지막이 , } ] 중 가까운 문자위치가 마지막이라고 판단해야된다. int[] EndPos = { rs.IndexOf(","), rs.IndexOf("}"), rs.IndexOf("]") }; int ps = 99; foreach (int ix in EndPos) if (ix != -1 && ix < ps) ps = ix; if (ps == -1 || ps == 99) continue; string value = rs.Substring(1, ps - 1).Trim(); if (f.FieldType == typeof(int)) f.SetValue(nJsonClass, int.Parse(value)); else if (f.FieldType == typeof(DateTime)) f.SetValue(nJsonClass, new DateTime(long.Parse(value))); else if (f.FieldType == typeof(double)) f.SetValue(nJsonClass, double.Parse(value)); else if (f.FieldType == typeof(float)) f.SetValue(nJsonClass, float.Parse(value)); else if (f.FieldType == typeof(long)) f.SetValue(nJsonClass, long.Parse(value)); else if (f.FieldType == typeof(bool)) f.SetValue(nJsonClass, bool.Parse(value)); } } return nJsonClass; } } } for coffee 0x4C668AeBB9Facd8ecE8764AaAC48B7186130C411 약간 이해가 안되는 내용이 있다면 나는 Datetime 을 Tick로 보관한다. 이유는 단순하다. 다국적 처리를 할때 Datetime를 String로 바꾸면 문제가 생길 수 있기 때문이다. If there is something special code, I use Tick to keep Datetime. The reason is simple. Because changing Datetime to String can cause problem when dealing with multinational process. Test Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 using System; using System.Collections.Generic; using System.Text; using AliceUtil; namespace JsonTest { class Person { public bool ok; public int Id; public string Name; public DateTime Ddate; public int[] intArray = { 1, 2, 3, 4 }; public string[] strArray = { "1", "2", "3", "4" }; } class Program { static void Main(string[] args) { List<Person> tbPerson = new List<Person>(); for (int n = 0; n < 3; n++) { tbPerson.Add( zJson.Paser<Person>(("{'Id' : " + n + ", 'Name' : 'Alex', 'ok':true}").Replace("'", "\"")) ); } string result = zJson.MakeJson<Person>(tbPerson); Console.WriteLine(result); Console.WriteLine("---------------"); List<Person> PList = zJson.PaserList<Person>(result); foreach( Person ps in PList) { Console.WriteLine(zJson.MakeJson(ps)); } } } }
  5. So I am building a survival / roguelike? (not sure of the "real" definition of that but the game has perma-death, randomly / procedurally generated worlds, etc.) and I am starting to prototype item decay. Let me example how the turn based system is currently simulated as that is probably important for this discussion. The way the turn based simulation works is there is a singleton GameActionManager object that keeps track of the action units that have pasted since the being of the game. 1 action unit = 1 second in the game and generally this is progressed from the the player performing an action. When the player does anything that has an action unit cost associated with it, it calls a method on the GameActionManager to increase the current action units. The other things the GameActionManager exposes are methods to register / unregister "event listeners" (currently using delegates). When the GameActionManager increases the action units, it notifies all of these listeners so the can perform the right action (like a burning tile decreasing the health of the structure that is burning, an enemy can move toward or attack something, etc.). I am also only simulating a small portion of the world at a given time since well, the world eventually will be huge and well computers can only do so much. My current goal for the simulated area is 120 x 80 tiles (with is a total of 9600 tiles). So as the player moves, game entities (enemies, structures, items, etc.) come in and out of the simulation area (and register / unregister with the GameActionManager). With this size in mind, none of the things that currently attach listeners to the GameActionManager has the chance of getting big enough to have me think that I really need to think about an alternative solution for when it becomes an issue because I don't see it becoming an issue any time soon (at least at the current stage of development). Items however is a different story. The game is going to have a ton of different items and 1 or more items can be on any tile. If each tile averaged 2.5 items (which I will grant you seem ridiculous but I always think crazy extremes when it comes to this kind of thing), that would be close for 25000 items that would possible have to manage decay. So instead of having each item attach a "listener", since the action for managing decay is going to be exactly the same thing for each item (just a method call), I figured having 1 listener that knows about all the items would be better. The general approach that I am taking for this first prototype is to have a singleton manager class (lets call it ItemDecayManager). Any time a item that has decay come into the simulated area, it would register itself with the manager and when it leaves the simulated area, it would unregister itself (which would just add and remove itself from a private List the manager is maintaining). Any time the action units are increased, the ItemDecayManager's listener on the would fire and just loop through the List of registered item and just perform the required function call. I have done some crude benchmarking and it currently can handle 100000 items at which point it starts to have a little effect on the FPS (but still around 80) even when moving about 15 times per second (and each move causes an action unit increase). Also bear in mind these numbers of from running the game in the Unity editor which has a bit of extra overhead that running the real game build not not have. While I am going to run with this solution for now I want to throw out this idea and get any kind of feedback i can because I imagine when more is happen as the action units increase (and even imagining the process for managing decay become more even just slight more complex than the current simple calculation), this solution might not hold up and I would like to have so ideas ready for the situations. I also think of anything that is going to be simulation, this is going to be the first things to have issues from the shear number of items that could be in the simulation area. Thanks in advance for any and all comments.
  6. COMPANY AND THE PROJECT We are an indie game studio consisted of professional and skilled artists who are dedicated indie enthusiasts. Our current project is INT, developed on Unity Engine 5 for platforms Windows, Linux, and Mac. We are recruiting a few more members on the team to finalize our playable demo. INT is a 3D Sci-fi RPG with a strong emphasis on story, role playing, and innovative RPG features such as randomized companions. The focus is on the journey through a war-torn world with fast-paced combat against hordes of enemies. The player must accomplish quests like a traditional RPG, complete objectives, and meet lively crew members who will aid in the player's survival. Throughout the game you can side and complete missions through criminal cartels, and the two major combatants, the UCE and ACP, of the Interstellar Civil War. Please note that all of our current positions are remote work. You will not be required to travel. For more information about us, follow the links listed below. INT Official website Steam Greenlight IndieDB page Also follow social media platforms for the latest news regarding our projects. Facebook Twitter UNITY ENGINE PROGRAMMER We are looking for Unity Programmers. You will be working with our Coding team Lead to implement systems and mechanics using C# language. Your duties will include: Attendance of regular team meetings. Timely completion of implementation of assets. Direct contact with Project Lead and other Department Leads for the implementation process. Utilization of version control suites. Utilization of our project management boards (Trello) and communication channels to obtain up-to-date assets. REQUIREMENTS To be successful in this position, following requirements apply: Clear communication and self starter - pushes to meet deadlines and contribute to the project. Ability to complete tasks with limited input/direction from management. Comfortable with working with people remotely and via Trello management system. Good internet connection with ability to update assets/builds quickly, with large dependencies. At least 15 hours of availability each week. Proficient experience using the Unity Game Engine. Proficient experience in implementing assets into the Unity Game Engine. REVENUE - SHARE This is the perfect opportunity to get into the game development industry. We have the majority of our art assets completed and are marching towards our crowd-funding campaign, currently planned for mid 2018. We are unable to offer wages or per-item payments at this time. However revenue-sharing from crowd-funding is offered to team members who contribute 15-20 hours per week to company projects, as well as maintain constant communication and adhere to deadlines. Your understanding is dearly appreciated. TO APPLY Please send your Cover Letter, CV, Portfolio (if applicable), and other relevant documents/information to this email: JohnHR@int-game.net Thank you for your time! Please feel free to contact me via the email provided should you have any questions. We look forward to hearing from you! John Shen HR Lead Starboard Games LLC
  7. Hi! As many beginners here, I want to ask a little bit subjective question. But first of all, I will share my story with you. I used Java for something like 2 years now, I consider myself quite a proficient Java programmer. I've created a chess game using pure Java (probably the worst quality of code I've ever written tbh). Now, I'm looking to develop myself further. I've read a lot of articles about it, even asked a few questions by myself. But now, I'm even more confused than I was at the beginning. From many tips I got, I thought the best way for further development would be learning C++, then using SFML library (or something similar) for some time, and then at last learning C#/staying with C++ by using an engine like Unity or Unreal - I'm quite unsure with the choice in last step, but that's not the point now. Currently, I'm learning C++. Honestly, I'm not feeling this language as much, as I feel Java (doing the same simple tasks in Java take me much less time than in C++). More honestly, I would abandon it and go straight to C#. Is it worth to lose my nerves for C++ these times? I'm aiming for professional career in future (so in about 5-6 years I guess). I know, that the best way of learning to make games is to make games etc, the language doesn't matter etc, you don't have to explain me this subject. Summarizing what I am actually up to, I want to know, if learning C++ is still a better idea than learning C# for game-dev nowadays? I don't want to feel stupid in your eyes. I'm just feeling really confused and lost in tons of people own opinions and tips, that I had to ask more experienced developers. Thanks for your answer and sorry for actually wasting your time reading all of this.
  8. Vector3 How does it move?

    if (!_ReachedDestination) { // I'm not sure why you need to subtract the TranslationVector from the Waypoint which is the point you need to go to in world space? var Direction = _Waypoint - Unit.Transform.WorldMatrix.TranslationVector; // I'm not sure why you would divide the length here for the direction? // Get distance towards next point and normalize the direction at the same time var LengthToDestination = Direction.Length(); Direction /= LengthToDestination; // Check when to advance to the next waypoint bool WaypointAdvance = false; // Check to see if an intermediate point was passed by projecting the position along the path if (_PathToDestination.Count > 0 && _WaypointIndex > 0 && _WaypointIndex != _PathToDestination.Count - 1) { Vector3 PointNormal = _Waypoint - _PathToDestination[_WaypointIndex - 1]; PointNormal.Normalize(); // I think the Unit part is where the unit is in world space so we are doing a dot method to find the distance from our waypoint? float Current = Vector3.Dot(Unit.Transform.WorldMatrix.TranslationVector, PointNormal); float Target = Vector3.Dot(_Waypoint, PointNormal); // If we are at our waypoint or passed it advance to the next waypoint? if (Current > Target) { WaypointAdvance = true; } } else { // Check distance to final point if (LengthToDestination < _DestinationThreshold) { WaypointAdvance = true; } } // Advance waypoint? if (WaypointAdvance) { _WaypointIndex++; if (_ReachedDestination) { // Final waypoint reached Stop(_ListUnit); return; } } // Calculate speed based on distance from final destination // Slows the unit down or speeds it up...? based on how far away from the end point it is? float moveSpeed = (_MoveDestination - Unit.Transform.WorldMatrix.TranslationVector).Length() * _DestinationSlowdown; if (moveSpeed > 1.0f) { moveSpeed = 1.0f; } // Slow down around corners // I know this puts an arc in the path but i dont understand why you would want that for a straight line on my 3d plane it still arcs a bit to its destination // I need to figure otu how to make it go straight if there are no corners float cornerSpeedMultiply = Math.Max(0.0f, Vector3.Dot(Direction, _MoveDirection)) * _CornerSlowdown + (1.0f - _CornerSlowdown); // Allow a very simple inertia to the character to make animation transitions more fluid // Adds everything up to try to provide a direction on the update game loop _MoveDirection = _MoveDirection * 0.85f + Direction * moveSpeed * cornerSpeedMultiply * 0.15f; // Using the default character component to do the moving _CharacterComponent.SetVelocity(_MoveDirection * _Speed); // Make the unit face the direction its traveling but at the end when it gets to its end point rotates back to the -z axis... not sure why it reverts to facing that way instead of just facing the way it was going if (_MoveDirection.Length() > 0.001) { _YawOrientation = MathUtil.RadiansToDegrees((float)Math.Atan2(-_MoveDirection.Z, _MoveDirection.X) + MathUtil.PiOverTwo); } Unit.Transform.Rotation = Quaternion.RotationYawPitchRoll(MathUtil.DegreesToRadians(_YawOrientation), 0, 0); } else { Stop(_ListUnit); } } Below is some code I pulled from our current project. I'm trying to figure out how in the world it works. Can someone take a look at my comments and tell me if its right or shine some light on the question I commented out?
  9. A new player of my game reported an issue. When he starts the game, it immediately crashes, before he even can see the main menu. He sent me a log file of my game and it turns out that the game crashes, when my game creates a 2D render target. Here is the full "Interface not supported" error message: HRESULT: [0x80004002], Module: [General], ApiCode: [E_NOINTERFACE/No such interface supported], Message: Schnittstelle nicht unterstützt bei SharpDX.Result.CheckError() bei SharpDX.Direct2D1.Factory.CreateDxgiSurfaceRenderTarget(Surface dxgiSurface, RenderTargetProperties& renderTargetProperties, RenderTarget renderTarget) bei SharpDX.Direct2D1.RenderTarget..ctor(Factory factory, Surface dxgiSurface, RenderTargetProperties properties) bei Game.AGame.Initialize() Because of the log file's content, I know exactly where the game crashes: Factory2D = new SharpDX.Direct2D1.Factory(); _surface = backBuffer.QueryInterface<SharpDX.DXGI.Surface>(); // It crashes when calling this line! RenderTarget2D = new SharpDX.Direct2D1.RenderTarget(Factory2D, _surface, new SharpDX.Direct2D1.RenderTargetProperties(new SharpDX.Direct2D1.PixelFormat(_dxgiFormat, SharpDX.Direct2D1.AlphaMode.Premultiplied))); RenderTarget2D.AntialiasMode = SharpDX.Direct2D1.AntialiasMode.Aliased; I did some research on this error message and all similar problems I found were around six to seven years old, when people tried to work with DirectX 11 3D graphics and Dirext 10.1 2D graphics. However, I am using DirectX 11 for all visual stuff. The game runs very well on the computers of all other 2500 players. So I am trying to figure out, why the source code crashes on this player's computer. He used Windows 7 with all Windows Updates, 17179 MB memory and a NVIDIA GeForce GTX 870M graphics card. This is more than enough to run my game. Below, you can see the code I use for creating the 3D device and the swap chain. I made sure to use BGRA-Support when creating the device, because it is required when using Direct2D in a 3D game in DirectX 11. The same DXGI format is used in creating 2D and 3D content. The refresh rate is read from the used adapter. // Set swap chain flags, DXGI format and default refresh rate. _swapChainFlags = SharpDX.DXGI.SwapChainFlags.None; _dxgiFormat = SharpDX.DXGI.Format.B8G8R8A8_UNorm; SharpDX.DXGI.Rational refreshRate = new SharpDX.DXGI.Rational(60, 1); // Get proper video adapter and create device and swap chain. using (var factory = new SharpDX.DXGI.Factory1()) { SharpDX.DXGI.Adapter adapter = GetAdapter(factory); if (adapter != null) { // Get refresh rate. refreshRate = GetRefreshRate(adapter, _dxgiFormat, refreshRate); // Create Device and SwapChain _device = new SharpDX.Direct3D11.Device(adapter, SharpDX.Direct3D11.DeviceCreationFlags.BgraSupport, new SharpDX.Direct3D.FeatureLevel[] { SharpDX.Direct3D.FeatureLevel.Level_10_1 }); _swapChain = new SharpDX.DXGI.SwapChain(factory, _device, GetSwapChainDescription(clientSize, outputHandle, refreshRate)); _deviceContext = _device.ImmediateContext; } }
  10. C# Basic C# quiz

    I've been interviewing a few job candidates recently. I wrote a short list of what I could consider pretty basic C# questions for them. My intention with these questions was to use them as a jumping off point for more interesting discussions, but so far, people have struggled to answer them. So I thought I'd post them here to get some feedback from people. Basically, am I expecting too much? These are pitched at mid-senior developer level. All feedback much appreciated. Technical Interview questions.pdf
  11. So I am building a turn based rogue-like (think CDDA). The game is going to have a very large map (up to 1000's x 1000's) however to alleviate most of that I obviously can't render everything so there will just be render a certain radius around the player and just load in and out data as the player moves. The next major system I am prototyping is making interactive tiles destructible and pretty much everything will be destructible besides basic landscape (cars, doors, windows, structures, etc. will be destructible) While I am only rendering a certain amount of tiles around the player, I want to keep the amount of colliders active at one time to be as small as possible for performance and currently the tilemap tool I use automatically merges colliders together. So instead of creating a separate colliders for each of these tiles and having the destructible behavior tied to that object (which my tilemap tool would allow me to do) I was thinking that I would store an array of all the X and Y locations for the interactive tilemap layer and let the tilemap manage the colliders. Then when I hit a collider on the interactive tilemap layer, instead of of getting the behavior for how to deal with the destruction for that tile from that game object, I would pull it from the array I mentioned earlier based on the tile I attempt to interact with which I already have. Does this sound like a good approach? Any other recommendations would be welcomed.
  12. Hello Everyone, I write COLLADA Importer and my next goal was to import rigged Characters, so check up the file ,but don't understand one step. I see where the joints and the weigts are, but not where the file say which vertex has which weight. So maybe you guys can help me and explain it? <vertex_weights> has only the indices of the joints and weights Here's a part of my COLLADA file: <library_controllers> <controller id="pCube1Controller"> <skin source="#pCube1-lib"> <bind_shape_matrix>1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 </bind_shape_matrix> <source id="pCube1Controller-Joints"> <Name_array id="pCube1Controller-Joints-array" count="18"> Hip LegL FootL ToeL LegR FootR ToeR Belly ShoulderR ArmR HandR FingerR ShoulderL ArmL HandL FingerL Neck Head</Name_array> <technique_common> <accessor source="#pCube1Controller-Joints-array" count="18"> <param type="name"/> </accessor> </technique_common> </source> <source id="pCube1Controller-Matrices"> <float_array id="pCube1Controller-Matrices-array" count="288"> -0.941340 -0.337461 -0.000000 -0.139955 -0.337461 0.941340 -0.000000 0.371721 0.000000 -0.000000 -1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 -0.248803 -0.968554 -0.000000 -0.585359 -0.968554 0.248803 -0.000000 -0.201095 0.000000 0.000000 -1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 -0.034984 -0.999388 -0.000000 -1.221391 -0.999388 0.034984 -0.000000 -0.474481 0.000000 0.000000 -1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 1.000000 -0.000000 0.000000 0.541746 0.000000 1.000000 0.000000 1.913253 -0.000000 -0.000000 1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 -0.248802 0.968554 0.000000 0.585358 -0.968554 -0.248802 -0.000000 0.201094 -0.000000 -0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 -0.034983 0.999388 0.000000 1.221387 -0.999388 -0.034983 -0.000000 0.474481 -0.000000 -0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 1.000000 -0.000001 0.000000 -0.541746 -0.000001 -1.000000 -0.000000 -1.913249 0.000000 0.000000 -1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.043672 0.999046 0.000000 -0.000137 -0.999046 0.043672 -0.000000 0.003133 -0.000000 -0.000000 1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 -0.995861 0.090881 -0.000000 -0.021829 -0.090881 -0.995861 -0.000000 0.184414 -0.000000 -0.000000 1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 -0.987330 0.158679 -0.000000 0.470613 -0.158679 -0.987330 -0.000000 0.217060 -0.000000 -0.000000 1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 -1.000000 0.000001 -0.000000 1.419031 -0.000001 -1.000000 -0.000000 -0.008213 -0.000000 -0.000000 1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 -0.941340 0.337462 -0.000000 1.988030 -0.337462 -0.941340 -0.000000 0.703965 -0.000000 -0.000000 1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 -0.995861 -0.090881 -0.000000 0.028074 -0.090881 0.995861 0.000000 -0.183843 0.000000 0.000000 -1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 -0.987330 -0.158678 -0.000000 -0.464421 -0.158678 0.987330 0.000000 -0.216064 0.000000 0.000000 -1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 -1.000000 -0.000000 -0.000000 -1.412754 -0.000000 1.000000 0.000000 0.008213 0.000000 0.000000 -1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 -0.941340 -0.337462 -0.000000 -1.982131 -0.337462 0.941340 0.000000 -0.701850 0.000000 0.000000 -1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 0.043673 0.999046 0.000000 -0.483504 -0.999046 0.043673 -0.000000 -0.018032 -0.000000 -0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.043673 0.999046 0.000000 -0.963774 -0.999046 0.043673 -0.000000 -0.039026 -0.000000 -0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000</float_array> <technique_common> <accessor source="#pCube1Controller-Matrices-array" count="18" stride="16"> <param type="float4x4"/> </accessor> </technique_common> </source> <source id="pCube1Controller-Weights"> <float_array id="pCube1Controller-Weights-array" count="534"> 1.000000 0.446680 0.448446 0.061039 0.006715 0.037120 0.423137 0.341108 0.035586 0.104220 0.095948 0.430593 0.105918 0.018535 0.346667 0.098287 0.446679 0.037120 0.448446 0.061040 0.006715 0.163148 0.388913 0.396025 0.037444 0.014469 0.396151 0.187946 0.014532 0.076902 0.324469 0.394204 0.076828 0.187766 0.328622 0.012580 0.166741 0.388259 0.393852 0.036607 0.014542 0.108793 0.424549 0.424576 0.021527 0.020555 0.255692 0.255431 0.312440 0.153135 0.023302 0.258375 0.311167 0.149047 0.258097 0.023313 0.102002 0.388360 0.388353 0.019283 0.102002 0.174648 0.125476 0.307658 0.306598 0.085620 0.287311 0.159158 0.174218 0.287850 0.091463 0.288312 0.172606 0.159037 0.288857 0.091188 0.177388 0.305490 0.303861 0.126946 0.086316 0.120822 0.069144 0.387268 0.384055 0.038711 0.422697 0.058575 0.073700 0.426612 0.018416 0.426332 0.069409 0.056317 0.430430 0.017513 0.124944 0.385012 0.380074 0.070711 0.039259 0.120822 0.069144 0.387268 0.384055 0.038711 0.422697 0.058575 0.073700 0.426612 0.018416 0.426332 0.069409 0.056317 0.430430 0.017513 0.124944 0.385012 0.380074 0.070711 0.039259 0.174648 0.125476 0.307658 0.306598 0.085620 0.287311 0.159158 0.174218 0.287850 0.091463 0.288312 0.172606 0.159037 0.288857 0.091188 0.177388 0.305490 0.303861 0.126946 0.086316 0.108793 0.424549 0.424576 0.021527 0.020555 0.255692 0.255431 0.312440 0.153135 0.023302 0.258375 0.311167 0.149047 0.258097 0.023313 0.102002 0.388360 0.388353 0.019283 0.102002 0.163148 0.388913 0.396025 0.037444 0.014469 0.396151 0.187946 0.014532 0.076902 0.324469 0.394204 0.076828 0.187766 0.328622 0.012580 0.166741 0.388259 0.393852 0.036607 0.014542 0.446680 0.448446 0.061039 0.006715 0.037120 0.423137 0.341108 0.035586 0.104220 0.095948 0.430593 0.105918 0.018535 0.346667 0.098287 0.446679 0.037120 0.448446 0.061040 0.006715 0.490897 0.501024 0.005129 0.002609 0.780985 0.201682 0.001639 0.008414 0.007279 0.783532 0.008348 0.200106 0.007322 0.490896 0.002609 0.501024 0.005129 0.490897 0.501024 0.005129 0.002609 0.780985 0.201682 0.001639 0.008414 0.007279 0.783532 0.008348 0.200106 0.007322 0.490896 0.002609 0.501024 0.005129 0.072569 0.448896 0.467547 0.008240 0.002747 0.072569 0.448896 0.467547 0.008240 0.002747 0.005633 0.494163 0.494079 0.005633 0.005633 0.494163 0.494079 0.005633 0.069536 0.447783 0.471519 0.008441 0.002721 0.069536 0.447783 0.471519 0.008441 0.002721 0.005428 0.496654 0.496927 0.005428 0.496654 0.496927 0.027277 0.465805 0.466166 0.034322 0.006429 0.032529 0.465155 0.458960 0.027694 0.015662 0.001002 0.524597 0.473182 0.002078 0.496491 0.498270 0.002770 0.015604 0.487493 0.476849 0.013049 0.007005 0.014109 0.482061 0.482639 0.018164 0.003027 0.086141 0.395004 0.392832 0.076562 0.049460 0.072924 0.408978 0.409117 0.086668 0.022313 0.025344 0.009121 0.470943 0.470334 0.024259 0.034082 0.007470 0.455706 0.456255 0.046487 0.007387 0.001314 0.489449 0.491035 0.010816 0.510801 0.489110 0.021297 0.004277 0.471874 0.472667 0.029885 0.010295 0.003391 0.488816 0.487692 0.009806 0.075808 0.021321 0.403240 0.403478 0.096154 0.078335 0.035448 0.405277 0.405075 0.075866 0.101905 0.429125 0.429095 0.016145 0.023730 0.099890 0.407814 0.407384 0.030245 0.054666 0.023975 0.481476 0.479747 0.004706 0.010096 0.023316 0.485651 0.485533 0.002137 0.003363 0.001426 0.503487 0.494347 0.001458 0.499436 0.498840 0.023912 0.481531 0.479799 0.004692 0.010066 0.023254 0.485691 0.485573 0.002130 0.003352 0.023299 0.039289 0.097061 0.420322 0.420031 0.016873 0.022080 0.108912 0.426068 0.426067 0.003085 0.004216 0.033460 0.479621 0.479618 0.002649 0.005089 0.018149 0.487709 0.486404 0.007248 0.495761 0.495752 0.515491 0.484439 0.003078 0.004206 0.033395 0.479662 0.479659 0.002639 0.005071 0.018089 0.487755 0.486447 0.001437 0.495838 0.497206 0.005199 0.001437 0.495838 0.497206 0.005199 0.002118 0.498222 0.493106 0.006148 0.002118 0.498222 0.493106 0.006148 0.001407 0.494389 0.498501 0.005388 0.001407 0.494389 0.498501 0.005388 0.002075 0.495166 0.495968 0.006390 0.002075 0.495166 0.495968 0.006390 0.001348 0.499290 0.499290 0.001654 0.029342 0.484184 0.484184 0.001867 0.499012 0.499012 0.001874 0.030698 0.483368 0.483368 0.001352 0.499287 0.499287 0.001642 0.028780 0.484473 0.484473 0.001859 0.030111 0.483671 0.483671 0.001863 0.499013 0.499013 0.017793 0.003436 0.003494 0.487638 0.487638 0.016776 0.003258 0.003214 0.488376 0.488376 0.016776 0.003258 0.003214 0.488376 0.488376 0.017793 0.003436 0.003494 0.487638 0.487638 0.080146 0.034481 0.036694 0.424340 0.424340 0.079527 0.036205 0.034127 0.425070 0.425070 0.079527 0.036205 0.034127 0.425070 0.425070 0.080146 0.034481 0.036694 0.424340 0.424340 0.106011 0.033886 0.040327 0.409888 0.409888 0.104594 0.039175 0.033170 0.411531 0.411531 0.104594 0.039175 0.033170 0.411531 0.411531 0.106011 0.033886 0.040327 0.409888 0.409888</float_array> <technique_common> <accessor source="#pCube1Controller-Weights-array" count="534"> <param type="float"/> </accessor> </technique_common> </source> <joints> <input semantic="JOINT" source="#pCube1Controller-Joints"/> <input semantic="INV_BIND_MATRIX" source="#pCube1Controller-Matrices"/> </joints> <vertex_weights count="116"> <input semantic="JOINT" offset="0" source="#pCube1Controller-Joints"/> <input semantic="WEIGHT" offset="1" source="#pCube1Controller-Weights"/> <vcount>5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 5 4 4 4 5 4 4 5 5 4 4 5 5 3 3 5 5 3 4 5 5 5 5 5 5 5 2 5 5 5 5 5 5 5 5 3 3 5 5 5 5 5 5 3 2 5 5 4 4 4 4 4 4 4 4 3 4 3 4 3 4 4 3 5 5 5 5 5 5 5 5 5 5 5 5</vcount> <v>0 1 1 2 2 3 3 4 4 5 0 6 1 7 2 8 4 9 7 10 0 11 1 12 2 13 4 14 7 15 0 16 1 17 4 18 5 19 6 20 7 21 12 22 13 23 14 24 17 25 0 26 1 27 2 28 4 29 7 30 0 31 1 32 4 33 7 34 17 35 7 36 8 37 9 38 10 39 17 40 7 41 12 42 13 43 14 44 17 45 7 46 8 47 12 48 13 49 17 50 7 51 8 52 9 53 12 54 17 55 7 56 8 57 9 58 10 59 12 60 7 61 8 62 12 63 13 64 17 65 7 66 8 67 12 68 16 69 17 70 7 71 8 72 12 73 16 74 17 75 7 76 8 77 9 78 12 79 17 80 7 81 8 82 12 83 13 84 17 85 7 86 8 87 12 88 16 89 17 90 7 91 8 92 12 93 16 94 17 95 7 96 8 97 9 98 12 99 17 100 7 101 8 102 12 103 13 104 17 105 7 106 8 107 12 108 16 109 17 110 7 111 8 112 12 113 16 114 17 115 7 116 8 117 9 118 12 119 17 120 7 121 8 122 12 123 13 124 17 125 7 126 8 127 12 128 16 129 17 130 7 131 8 132 12 133 16 134 17 135 7 136 8 137 9 138 12 139 17 140 7 141 12 142 13 143 14 144 17 145 7 146 8 147 12 148 13 149 17 150 7 151 8 152 9 153 12 154 17 155 7 156 8 157 9 158 10 159 12 160 7 161 12 162 13 163 14 164 17 165 0 166 1 167 2 168 4 169 7 170 0 171 1 172 4 173 7 174 17 175 7 176 8 177 9 178 10 179 17 180 0 181 1 182 2 183 3 184 4 185 0 186 1 187 2 188 4 189 7 190 0 191 1 192 2 193 4 194 7 195 0 196 1 197 4 198 5 199 6 200 0 201 1 202 2 203 4 204 0 205 1 206 2 207 4 208 7 209 0 210 1 211 4 212 7 213 0 214 1 215 4 216 5 217 0 218 1 219 2 220 4 221 0 222 1 223 2 224 4 225 7 226 0 227 1 228 4 229 7 230 0 231 1 232 4 233 5 234 7 235 8 236 9 237 10 238 17 239 7 240 8 241 9 242 10 243 17 244 7 245 8 246 9 247 12 248 7 249 8 250 9 251 12 252 7 253 12 254 13 255 14 256 17 257 7 258 12 259 13 260 14 261 17 262 7 263 12 264 13 265 7 266 12 267 13 268 0 269 1 270 2 271 3 272 4 273 0 274 1 275 2 276 3 277 4 278 0 279 1 280 2 281 0 282 1 283 2 284 3 285 0 286 1 287 2 288 3 289 4 290 0 291 1 292 2 293 3 294 4 295 0 296 1 297 2 298 3 299 4 300 0 301 1 302 2 303 3 304 4 305 0 306 1 307 4 308 5 309 6 310 0 311 1 312 4 313 5 314 6 315 0 316 1 317 4 318 5 319 6 320 4 321 5 322 0 323 1 324 4 325 5 326 6 327 0 328 1 329 4 330 5 331 6 332 0 333 1 334 4 335 5 336 6 337 0 338 1 339 4 340 5 341 6 342 1 343 2 344 3 345 4 346 6 347 1 348 2 349 3 350 4 351 6 352 1 353 2 354 3 355 4 356 6 357 1 358 2 359 3 360 4 361 6 362 1 363 2 364 3 365 1 366 2 367 3 368 1 369 2 370 3 371 4 372 6 373 1 374 2 375 3 376 4 377 6 378 1 379 3 380 4 381 5 382 6 383 0 384 3 385 4 386 5 387 6 388 0 389 3 390 4 391 5 392 6 393 1 394 3 395 4 396 5 397 6 398 4 399 5 400 6 401 5 402 6 403 0 404 3 405 4 406 5 407 6 408 1 409 3 410 4 411 5 412 6 413 8 414 9 415 10 416 11 417 8 418 9 419 10 420 11 421 8 422 9 423 10 424 11 425 8 426 9 427 10 428 11 429 12 430 13 431 14 432 15 433 12 434 13 435 14 436 15 437 12 438 13 439 14 440 15 441 12 442 13 443 14 444 15 445 9 446 10 447 11 448 8 449 9 450 10 451 11 452 9 453 10 454 11 455 8 456 9 457 10 458 11 459 13 460 14 461 15 462 12 463 13 464 14 465 15 466 12 467 13 468 14 469 15 470 13 471 14 472 15 473 7 474 8 475 12 476 16 477 17 478 7 479 8 480 12 481 16 482 17 483 7 484 8 485 12 486 16 487 17 488 7 489 8 490 12 491 16 492 17 493 7 494 8 495 12 496 16 497 17 498 7 499 8 500 12 501 16 502 17 503 7 504 8 505 12 506 16 507 17 508 7 509 8 510 12 511 16 512 17 513 7 514 8 515 12 516 16 517 17 518 7 519 8 520 12 521 16 522 17 523 7 524 8 525 12 526 16 527 17 528 7 529 8 530 12 531 16 532 17 533</v> </vertex_weights> </skin> </controller> </library_controllers> Greets Benjamin
  13. I'm using WriteableBitmaps in my project, and the tiffbitmapencoder and tiffbitmapdecoder classes to save off and restore a certain large graphic file from a WriteableBitmap to hard disc (the image is too big for the PNGbitmapencoder/decoder). This is working ok, but I'd like to encode to and decode from memory if possible, instead of having to save to disc. This is because, as part of the user experience this massive image can get wiped/cut down, and it takes a few precious seconds to reconstruct it again from scratch (which is also part of the user experience), but I can't afford the memory to just clone the whole image into another bitmap and clone it back again when needed, instead of rebuilding. Compressing it to TIF and holding in memory until it's needed again seems a viable option, but currently I can only compress/decompress to/from a file on disc. I've tried using MemoryStream instead of FileStream, and even though the encoder seems to like it, the decoder doesn't. Is it possible for me to achieve this?
  14. Hi everyone. I need some help with my project. It's a 2D-graphics-heavy WPF front-end app written in C#, which talks to two Access 2000 databases (yes I know, it's all I've got). It will be distributed freely on the internet, and so will be being used by Windows users of various installations/versions of Windows, Office, etc. One of the two databases (let's call it A), is intended to be read-only, and will be distributed with the app. It has half a dozen relational tables which I as the developer have populated, and is connected to in the app via OleDB Jet 4 with SQL querying the data now and then as the user uses the front-end. The database will be replaced whenever I release an update to the app. Database B is read/write, and contains end-user preferences, for example when they favourite something in my front-end, a Favourites table in here gets appended to. This database is not distributed with my app, and should not be overwritten, as it will lose user prefs, etc. and annoy my users. Whenever my app is run by a user, during initialisation database A will suck in the user data from database B (using simple SQL SELECT * INTO...), so that all the tables can be joined together by the SQL in database A (to include user prefs/favourites in SQL queries), and whenever the user favourites something, a record is created both in A (for the short-term session) and B (permanently). Database B isn't just about holding favourites, there is other user data in here as well, so there are 3 or 4 tables in B. So far, this is all working fine and I'm happy... Unfortunately my app is currently 32-bit, and it now needs to break the 32-bit memory barrier what with the size and volume of the graphics I'm pulling in (using the HDD is not really an option, as different graphics are needed kind of instantly and the hard disc would be being hosed and the app dog-slow otherwise, I suspect even off an SSD). I'm using VS2015, and switching to 64-bit will probably fix the memory problem, but it breaks Jet 4.0. I'm sure this is old news to most of you. To try to keep with 32-bit (and Jet4) but get the memory I need I've tried the -largeaddressaware toggle, and I've tried the editbin suggestion, but I just can't get these solutions to work in VS2015 no matter how hard I try. Are these definitely 100% solutions to 2gb memory limit in 32-bit applications? Should they always work? Am I dumb in being unable to get this to work? So otherwise I'm resigned to migrating to 64-bit, and having to get around the database issue, not the memory issue. My users will be using a variety of Windows versions (probably 7 and 10), and I'm sure various versions of Office, and so my solution for querying my two Access databases needs to be pretty open if possible. Googling has suggested I switch from JET4 to ACE12, but this is apparently requiring me to uninstall Office 2000 and install a 64-bit version (which I don't have), so I can't use it, and I suspect any users who also have an old version of Office installed won't be able to use it either? Googling has also suggested I use MS SQL Server. This sounds fine if there's such a thing as a "lite" local version which can manage database access, but I still need to somehow get the data from the databases (A.mdb and B.mdb) into the SQL Server each time the users fire up my app. The only solution I can think of at the minute, is to export all the tables from database A into CSVs every time I update the data in there, and have the app import them in a lame way, and also convert database B into some crappy text file which gets written to whenever the user changes a preference. I'd much rather use SQL to do all this if possible, as when the user browses around the app, queries involving joining several tables in A are regularly created and executed to adjust the user's experience/return search results/etc. So to summarise my misery, is there either an easy reliable way for me to keep with 32-bit/Jet4 and be able to address >2gb. Or is there instead an easy reliable way for me to switch to 64-bit and successfully query two Access databases without requiring all my users to have 64-bit Office installed? Thanks for reading and I hope someone can help.
  15. We're looking for programmers for our project. Our project is being made in Unity Requirements: -Skills in Unity -C# -Javascript -Node.js We're looking for programmers who can perform a variety of functions on our project. Project is a top-down hack-and-slash pvp dungeon-crawler like game. Game is entirely multiplayer based, using randomized dungeons, and a unique combat system with emphasis on gameplay. We have a GDD to work off of, and a Lead Programmer you would work under. Assignments may include: -Creating new scripts of varying degrees specific to the project (mostly server-side, but sometimes client-side) -Assembling already created monsters/characters with existing or non-existing code. -Creating VFX -Assembling already created environment models If interested, please contact: eldwin11929@yahoo.com This project is unpaid, but with royalties. --- Additional Project Info: Summary: Bassetune Reapers is a Player-verus-Player, competitive dungeon crawler. This basically takes on aspects of dungeon crawling, but with a more aggressive setting. Players will have the option to play as the "dungeon-crawlers" (called the 'Knights', or "Knight Class", in-game) or as the "dungeon" itself (literally called the 'Bosses', or "Boss Class", in-game). What this means is that players can choose to play as the people invading the dungeon, or as the dungeon-holders themselves. Key Features: -Intense, fast-paced combat -Multiple skills, weapons, and ways to play the game -Tons of different Bosses, Minibosses, creatures and traps to utilize throughout the dungeon -Multiple unique environments -Interesting, detailed lore behind both the game and world -Intricate RPG system -Ladder and ranking system -Lots of customization for both classes s of customization for both classes
  16. BenchmarkNet is a console application for testing the reliable UDP networking solutions. Features: Asynchronous simulation of a large number of clients Stable under high loads Simple and flexible simulation setup Detailed session information Supported networking libraries: ENet (C# Wrapper) UNet LiteNetLib Lidgren MiniUDP Hazel Photon Neutrino DarkRift More information and source code on GitHub. You can find the latest benchmark results on the wiki page.
  17. Hello guys, I just want to share some of my findings after more than 10 years of software development. During my last project, I made the decision for our dev team to go against what is quite commonly the default programming behaviour in Unity and most likely many other game engines. What we put all persistent data (as serialisable JSON) in a separate layer and use static functions to operate on those. This is more similar how C would operate, or most functional programming languages. It worked very well and caused no problem for us, so now I decided to take it one step further and make a sub system in Unity that facilitates that coding style in a more generalised way. I call this system AOEngine. This sub system looks like this: Model -> Stores data as json serialisable objects, dictionaries or both. View -> Listens to model, reacts when data is create, changed or destroyed and tries to render the object. The view is a monobehaviour and can be seen in the Unity Editor unlike the model and the controller. Controller -> Runs a state machine which executes game specific code that creates, updates or destroys data. State Machine -> Switches/keep/updates the global state of the game. The model, view and controllers are standard OOP classes communicating with interfaces using a observer pattern. So far everything is pretty standard. But when you realise that after separating the logic and data, what you have left are logic classes that always the same, just executing on different types of data. This means there is no need to instantiate pure logic and using static classes is actually a pretty neat idea. The reason static classes are getting quite a bad reputation is that in most cases they are used to share some global state, and easily become a tight dependency to many other areas in the code. But when the static class is just pure logic, we do not have this problem. The AO engine provides one point of entry, a GameInit prefab which is used to create the model, view and controller, the user have to provide an initial state for the state machine to run. When you import the AO Engine as a Unity package, you just need to drop one prefab into your scene, and that is the only prefab you need to start. Here is the code for the GameInit: { public class GameInit : MonoBehaviour { public GameObject viewPrefab; public string InitialState; void Start() { IModel model = new AOEngine.Model.Model(); IView view = CreateUnityViewFromPrefab(); IController controller = new AOEngine.Controller.Controller(); view.Setup(model); controller.Setup(model, view); StateMachine.Setup(model); GameState initialGameState = TryCreateInitialGameState(); StateMachine.SwitchState(initialGameState); } The InitialState have to be defined in the Unity editor, you give it the full name to the initial game state for your game, for example MyGame.MenuGameState, then you have to make sure this class exists (goes without saying) and it must inherit AOEngine.StateMachine.GameState. This is how the a game state would look like: namespace MyGame { public class MenuGameState : GameState { public override void OnEnter() { GameObjectData uiCamera = new GameObjectData { {"uid", "camera"}, {"prefab", "Cameras/UICamera"} }; model.CreateData<GameObjectData>(uiCamera); UIData mainMenuData = new UIData { {"uid", GameUids.MAIN_MENU_DATA}, {"prefab", "UI/Prefabs/MainMenuCanvas"} }; model.CreateData<UIData>(mainMenuData); controller.BindLogic(typeof(MainMenuLogic), mainMenuData); And here is where things get interesting, first I create the some data, all data should have a unique uid to identify it, if no uid is given the model will generate an uid automatically. Optionally, a piece of data can be bound to one or more logic classes, which are static, using the controller.BindLogic providing the logic class and the data uid to bind it to. This is basically a component system, but not using monobehaviours or standard OOP. The static logic class would look something like this: namespace MyGame { public static class MainMenuLogic { private static IModel model; [OnLogicSetup] public static void Setup(IModel _model) { model = _model; } [OnLogicCreate] public static void OnCreate(string dataUid) { UIData data = model.GetData<UIData>(dataUid); model.UpdateProperty(data, new Dictionary<string, object> { { "ui_callbacks", new Dictionary<string, object> { {"OnButtonClicked", "MyGame.MainMenuLogic#OnButtonClicked"} }} }); } [OnLogicUpdate] public static void OnUpdate(string dataUid) { UnityEngine.Debug.Log("MainMenuLogic.OnUpdate"); } [OnLogicDestroy] public static void OnDestroy(string dataUid) { model.DestroyData(GameUids.MAIN_MENU_DATA); } public static void OnButtonClicked(string buttonName) { if(buttonName == "QuitButton") UnityEngine.Application.Quit(); if(buttonName == "StoryButton") { StateMachine.SwitchState(new StoryGameState()); } } } } So not being a fan of monobehaviours, I use them to a minimum, only for position translations, particle systems, collision detection and audio playing, and then these monobehaviours would be bare components without any logic or state. I need to figure how communication between my static components, I will probably use a game event system for this. So far I am quite happy with system where all my logic are running in static classes. I wonder if there are any other people out there that reached the same conclusions, what are your opinions of this approach?
  18. I am a game development student working on a 2.5D beat 'em up brawler game in Unity as my final year project and I've been working on the ai for the enemies in the game. However, I've been unable to get the enemies to working properly as the enemies would be constantly stuttering and jerking while trying to follow the player. I've created a foreach statement and added some conditions that call for the robots to spread out and stay away from the player if it is not in an engaging enum state. This has been an issue plaguing the ai for a while now, analysing the animator, it seems like the robot's movement is instantaneously stopping and going which might be the reason causing this stuttering. But I'm not sure how to prevent the robot's movement from stopping and going. If anyone knows the reason why this is happening to the robots it would be much appreciated as my project is due soon and I'm still unable to fix such a game breaking bug! I've included a few videos below showing what is happening to my robots and also the stuttering shown inside the animator. I've also included the full script for my robots. Robots Stuttering Robots Stuttering Animator Robot.cs
  19. Alright, I'm not even sure if I write my first post in the right sub category. Basically I'm creating some browser game based on .net and you got there an inventory with a bunch of potions. I'm just not really sure how to handle different potions and its usage on the backend to not make it into a spagetti. So, whenever user clicks on the potion, it sends an id of the potion to the api endpoint, I'm checking there the type and just getting the info about potion. I got an enum which describes the type, like mana, hp, energy, exp or you name it. So what now. Do I make like a huge switch statment and just pass it to a different methods or something and do there what has to be done with the potion? Sorry for not showcasing any code, but I do not have any for this, just trying to brainstorm how to implement some potion usage mechanics. Am I going the right direction or I just missed the path and heading to the dead end?
  20. Hey so, i need help in how to sync animations using Forge Networking i tried sometings but nothing
  21. Hi, I am currently trying to learn the basics of Unity - most of the decent tutorials I have found imply that you have at least a basic knowledge of C#, so I am busy trying to pick up the basics of that first. Initially, I just downloaded the free version of Unity which happens to come with 'MonoDevelop-Unity' - so I am using this to write my code and play along with the C# tutorials I have found. The problems I am having are this (Disclaimer: I am using a Mac for this) 1) I am not sure what the differences between 'running' and 'building' code are. In MonoDevelop-Unity, there is a little play button at the top which seems to cause a little 'Terminal' box to pop up when you press it. The code seems to do it's job and the terminal box returns the following message: Hello World! Press any key to continue... Have I built or run my code? 2) There are several bits of jargon that keep being thrown around, without much in the way of explanation: 'Classes', 'The Main Method', 'Namespace'. These are the main confusing terms - what do they mean and how do they apply to my code? 3) This is the main one, I would be super grateful if someone were able to provide a line-by-line explanation of what each line of this code is doing/means? I wrote it, and it makes a message appear on screen, which is fine - but I want to know what is happening (i.e. which words/parenthesis are doing what)? Here's my code: using System; namespace HelloWorldTwo { class MainClass { public static void Main (string[] args) { Console.WriteLine ("Hello World!"); } } } Console.Writeline (); is presumably telling the machine to "Write whatever is in these brackets () to the console (I assume 'console' is C# lingo for the terminal dialogue box?). Any feedback here would be greatly appreciated. Thanks!
  22. PC Create UI

  23. So, im trying to make a camera collision, like any other game so the camera does not pass through walls, i have the camera attached to the player i tried a lot o different things but nothing, if anyone knows a way it would be very helpfull
  24. [GAME] Space Station X

    Space Station X is live and FREE on the App Store. Download Link: https://itunes.apple.com/us/app/space-station-x/id1320649812?mt=8 • Space Station X • Tap on incoming objects to keep the Space Station intact. Use different pickups to help with the defense. Defend the last deep space station at all cost ! Download Link: https://itunes.apple.com/us/app/space-station-x/id1320649812?mt=8
  25. Hi there, here is a little experiment I wanted to show. I developed this controller as help for a guy from the german Unity forum. He wanted a 1st person view controller (with 3rd person character in the background ) and using the Unity CC (character controller) component as base. Its a complete different style of controller but only to show whats possible. At the end, I liked the dynamics of this controller. It was also an exercise for IK and using animations in Unity for me again. For this i changed the original 1st person controller of Unity with the "Ethan" character model. There were some problems, among other things, because this controller uses the CC as a component and if you now just puts "Ethan" the axe in his hand, then he blows the weapon when hitting through the walls. To solve this, we added a backspin to the character at a collision. Additionally i mixed a slay animation, an axe animation and IK. We had started completely without a slay animation, this was also because the movement of the axe was controlled by a self-created axe animation. Ethan's hand is held in position via IK. I just did not really like the mix of idle animation and axe animation, so I added a slay animation to Ethan. For hitting the slay animation and the axe animation is now mixed. The hand follows the axe animation and Ethan plays a suitable slay animation. This allowed us to better control the position of the axe in front of the player. I had further problems with the clipping of the body of Ethan. For this I had to slightly modify the original controller, so that the camera is always nicely in front of his face. In addition, the camera is now partly controlled by the bone of the player animation, which, like me, creates a very nice dynamic effect: Video: https://streamable.com/4xvx5
  • Advertisement