Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

260 Neutral

About electrolysing

  • Rank

Personal Information

  • Interests
  1. electrolysing

    How to synchronize a Scene Graph?

    Well... is multithreading a bad choice for games?
  2. electrolysing

    How to synchronize a Scene Graph?

    This is an interesting approach. Reminds me of a worker thread based system. I am wondering about the stability - in theory the render thread could potentially try to steal heavy loaded work and stalls its actual work. I would rather not trying to lock/unlock*. As I see it, that kind of defeats the purpose of Multithreading. At least on a bigger scale (methods, objects), especially when locking the whole scene graph. If I got that correctly (from all your answers), all threads should be synced aka running at the same hz rate? At first I was under the impression that all threads should be decoupled from each other, so that i.e. the physics engine can continue to run normally while another thread renders a very complex scene. This would, at least, allow a double buffered approach. - In pass n: All threads read from var1 and write to var2. - In pass n+1: All threads read from var2 and write to var1. Buffering data was what I was doing before (and right now) inside of an object, because I had control of all the data. When the calculations were ready, I made an atomic pointer swap to publish them. This approach doesn't work with variables scattered over multiple objects - at least none I could come up with. However, syncing the threads after every loop could solve this problem. If I am understanding you correctly, your solution would be to use two sync points/two passes(read&write): [sync] -> [read and buffer needed data] -> [sync] -> [compute and write results] -> [repeat] ?
  3. Hello, when I have multiple Threads, reading and writing to a scene graph, how do I synchronize data over several nodes? I.e. when a character with a gun moves, the gun moves with him. A thread dedicated to calculating matrices of both objects might update the character first but before it is able to recalculate the gun's matrix the render thread is already drawing both. Inevitably this causes the character and the gun to be out of sync... Now this doesn't only apply to the renderer but for the other threads, too.
  4. electrolysing

    Newline doesn't get parsed

    Hi,   not really the right forum or website at all I guess but I don't know where to ask else.   I am using XML files to read and write settings in my program. For this task I am using an XMLStreamLibrary which works fine and perfect.   However, when I am trying to write an attribute containing newline characters the library just writes the newline characters into the xml file like this <content text="Line1 Line2"></content> but actually it should look like this <content text="Line1&#13;&#10;Line2"></content> when I am manually replacing the "newline characters" in my string with "&#13;&#10;" it is writing this <content text="Line1&amp;#13;&amp;#10;Line2"></content> because the library is parsing the "&" into "&amp;" which is kind of counter productive in this case. (It works the other way around though, when I am reading the file in it replaces "&#13;&#10;" with the appropriate newline characters.)   Any idea how I can overcome this dilemma?   Thanks Best Regards   *Edit: I am using the XMLStreamWriter in Java, I left this information out because I hoped there is an XML based solution for any kind of library.
  5. electrolysing

    Create Public File

    Hi,   I want my android game to be moddable which means that some files need to be accessable by the user to change. I can't expect them to root their device.   When I create a file with the attribute Context.MODE_PRIVATE the file is created in the root directory.   The attribute Context.MODE_WORLD_WRITEABLE is deprecated. So what is the alternative? They say they made it deprecated because of security reasons (I personally can't think of any possibilities when this would be a security hole) but they haven't thought of the situation when I want to make files public for the user to access and not by other programs, as all the alternatives they list are for communication with other programs. What is the alternative to provide public files to the user to modify?   Thank you very much ~AUN
  6. electrolysing

    AI Interface

    Okay that is 2vs1 The reason this question came up was because of steering a car by an AI or a player. While the player either presses left or right to turn its car left or right. The UI translates those button presses then in appropriate data like degrees to determine the turn rate per calculation around the x axis. An AI now hasn't the capabilities of examining the situation visually as fast as we do. At least as long as standard gaming computers doesn't come with ANN-Processing Units. So an AI has to determine the situation based on data it gets for example from path finding algorithms to get the car from A to B. - Using the UI would mean the AI uses left() and right() as the player does. That would of course head to calculating if the car should turn left or right or not at all every turn - On the other hand this could also be accomplished by just using the data already available and just turn the car in the wanted direction and move forward. The last case maybe leads to programming errors i.e. the AI just turns its car by 180° immeadiatly because of an unexpected behaviour or data. Long story short: AI and player might behavebdifferently because of UI limitations.
  7. electrolysing

    AI Interface

    Hi, I have basically a player, network and ai class which make inputs to the game. - The player class basically translates (g)ui input into usable commands Now AIs are simulating human players but I wonder how I should possibly implement the ai into the code? - Should I make the AI use the player UI to simulate player behaviour or should the AI use direct commands but simulate as if it would be limited to the same UI restrictions as the player? I guess the first attempt using the UI would result in a lot of computations as I had to calculate first what to do and how I achieve it by using the player UI, however I would get an AI behavour like an actual player. For example the UI limits the player not be able to shoot while running, the AI would be limited to the same. On the other hand just calculating directly what to do and simulating then the limits by the player ui might be way more straight forward but maybe result in errors as the player for example can't turn the hero in a certain situation while the ai behaviour was never adjusted to simulate the same behaviour which might led then to the ai cheating and frustration of the players. So, what do you think?
  8. electrolysing

    Getting Visual Studio and Dreamspark

    Thanks for the advice, I used Visual Studio before already at work and at Universtity. In both cases there always already was a Visual Studio version installed. Just log in at a computer and it installs VS automatically.   I just wanted to code something in my free time as a hobby doing stuff I actually wanted to do / try out. :)   Your advice is still something I can just underline. They teached us at one point how to use the command line compiler after a year and it changed a lot of views on that matter.
  9. electrolysing

    C# seems good, but....

    Developing games in Java on Android works very well. When thinking about low-end devices and high computations. At the end Java code gets JIT compiled to the same machine code as C++ and then it is only a question of which code got more optimizations - The syntax of Java and C++ is not that different.   I didn't had any problems of actualy make performance optimizations neither in Java nor in C++, at the end it is the usual stuff: Profiling and see if you can somehow get rid of the bottlenecks, but that is not really a question of the language at all. Though I sometimes miss some "nasty code tricks" in C++ to quickly get to a result which are in Java strictly prohibited.   The really useful Garbage Collector can get a pain as you always have to count him in. On Desktop you wont notice him at all ever, on Android a memory leak gets very painful causing the GC to run constantly and noticably.   What makes Java somehow incapable of running games is that the Java JIT compiler needs a lot of time to analyze your code, increase its performance and at the end compile it finally. You need to invoke the same code part a few thousand times before something happens. This is really unsuitable for games as you don't want to start a game lagging around and you have to play a while before it gets decently playable (talking in the AA(A) area here). At least it doesn't do it everytime again but only once but you can't tell your customers: "Look, after installing then just run this demo-playback in the background for like an hour and then you can start playing the game, okay?". Personally I still prefer JIT compiling nonetheless because of Stuff like this http://www.javacodegeeks.com/2013/06/jvm-performance-magic-tricks.html That said you might want to precompile code in Java or C# which you consider to be already performing best no matter the environment (propably mostly plain math calculations) and for this you need to bind direct C++ again into your C# and Java Code.     >>> At the end it doesn't matter if you take C#, C++ or Java as all three of them are capable of everything the other language is but one performs slightly better then the other two in certain situations. The only decision you have made is on which side of this religion-like war absolutly non-biased discussions you stand.
  10. electrolysing

    Getting Visual Studio and Dreamspark

      Thanks :) Downloading right now, 2hours left. Internet is so bad.   Best part was that after selecting Ultimate I got like 10 more options to choose from. I just said f*ck it and downloaded a random of those Ultimate versions which will hopefully do xD
  11. Hi,   I wanted to get more involved into C++ development. So I get Visual Studio for free as a student, but the overall problem with Dreamspark ist that Microsoft always offers you 30 versions and you don't know what to take.   When I tried to install Windows 8 it offered me 4 versions without an explanation of the differences and just with the same name... o.O   Well here I go again with VS2013, what do I need to download? When I click on download it offers me these (like wtf, really?): Feedback Client for Microsoft Visual Studio Team Foundation Server 2013 Preview Feedback Client for Microsoft Visual Studio Team Foundation Server 2013 Preview Language Pack Microsoft Agents for Visual Studio 2013 Microsoft Agents for Visual Studio 2013 Language Pack Microsoft Build Tools 2013 Microsoft IntelliTrace Collector for Visual Studio 2013 Preview Microsoft Multibyte MFC Library for Visual Studio 2013 Microsoft Remote Tools for Visual Studio 2013 Microsoft Team Explorer for Visual Studio 2013 Microsoft Team Explorer for Visual Studio 2013 Language Pack Microsoft Visual C++ Redistributable for Visual Studio 2013 Microsoft Visual Studio 2013 Language Pack Microsoft Visual Studio 2013 Preview Shell (Integrated) Language Pack Microsoft Visual Studio 2013 Preview Shell (Integrated) Redistributable Package Microsoft Visual Studio 2013 Preview Shell (Isolated) Language Pack Microsoft Visual Studio 2013 Preview Shell (Isolated) Redistributable Package Microsoft Visual Studio 2013 SDK Microsoft Visual Studio 2013 Update 1 Microsoft Visual Studio 2013 Update 2 Microsoft Visual Studio 2013 Update 3 Microsoft Visual Studio 2013 Update 4 Microsoft Visual Studio 2013 Visualization and Modeling SDK Microsoft Visual Studio Express 2013 for Web Microsoft Visual Studio Express 2013 for Windows Microsoft Visual Studio Express 2013 for Windows Desktop Microsoft Visual Studio Premium 2013 Microsoft Visual Studio Professional 2013 Microsoft Visual Studio Team Foundation Server 2013 Microsoft Visual Studio Team Foundation Server Express 2013 Microsoft Visual Studio Test Professional 2013 Microsoft Visual Studio Test Professional 2013 Language Pack Microsoft Visual Studio Ultimate 2013 Microsoft Web Tools Extensions for Visual Studio 2013 Microsoft Web Tools Extensions for Visual Web Developer 2013 My bets would go to "Microsoft Visual Studio Ultimate 2013" (or PRemium or Professional or Express) or "Microsoft Visual Studio 2013 SDK" however maybe I need "Microsoft Visual Studio 2013 Update 4" to get the latest version? Or do I need to update it manually after?   Do I need to download multiple of them? That is exactly what always stopped me from actually diving in .NET because installation is to complex and unexplained. For you it might be "obvious" but for me these are just a lot of words I don't know. :/   Thanks for your help Best Regards   *Edit: The downloads are taking about ~an hour for me, so just downloading everything and trying it out is not the best solution and would result in worst case finding the right version in over 2 days.
  12. Well, on Android App Store (Google Play) your App got 1Star and all reviews are saying it doesn't work. iTunes sadly doesn't show anything, wonder if it is any different there.   Sadly this doesn't compliment your article here. I don't want to insult you but that is what this whole article is all about and that is what makes your article worth reading or not :/
  13. electrolysing

    Triangles can't keep up?

    What Hodgman suggested can also achieved by only using one vertice (the position of the quad) using the draw state "GL_POINTS". The point size can be adjusted as well as the points can be textured. This technique is also called "point sprites" (google it) and often used for particle systems and saves lots of bandwidth. Only disadvantage of this (and Hodgmans) method is that the quads are getting culled when their vertex is out of screen. In most cases the user shouldn't notice it as long as the particles are small enough, the action takes as usual place in the center of the screen and your program isn't called 'Find The Graphic Glitches III (Hint: look at the edges)'. However you have to see for yourself if it fits.
  14. electrolysing

    Frustum Culling

    Hi, as in another post in this forum Spiro L. told me that frustum culling is done on the CPU (and has to be implemented therefore manually). I wonder if this is correct, as in my OGL book it says without direct context (roughly translated): "Frustum culling should be done by the GPU and not on the CPU because vertex data doesn't belong on the latter one. If you are doing such operations on the CPU it is most likely a sign that your code doesn't utilize the GPU correctly." This was written to an code example were a lot of stuff (exactly 100.000 draw calls) was drawn in a circle in different densities around the player and you can rotate the camera. And I thought frustum culling is really basic and abstract and therefore really useful for any drawn application and therefore again a standard implementation in OGL and accepted the cotation above plainly as truth. Now I am surprised by Spiro L's statement it isn't... It would be great because I could implement this in all my existing projects as a performance upgrade to increase performance even more! However I am unsure if this is now true or not.
  15. electrolysing

    Instanced rendering and frustum culling.

    I didn't know that. Thanks.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!