Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

  • Days Won


Nypyren last won the day on August 21

Nypyren had the most liked content!

Community Reputation

12308 Excellent


About Nypyren

  • Rank

Personal Information

  • Role
  • Interests

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I wouldn't think that Nagle would affect high bandwidth streaming at all. I was under the impression that you'd only notice its effects if sending small pieces of data infrequently.
  2. Nypyren

    move ship

    If you're making a spacewar game, then: Make vector3 variables for position and velocity and initialize them to appropriate starting values any time the ship spawns. When you detect input that applies thrust, say: velocity += shipForwardVector * thrustAcceleration * deltaTime; shipForwardVector can be calculated from a rotation angle by using x = cos(angle), y = sin(angle), z = 0 You may want to clamp velocity to a maximum length. To do this, check (velocity dot velocity) > (max speed squared) and if true, set velocity = velocity * max speed / velocity.Length; If you want your velocity to slow down automatically over time, every frame say velocity *= 0.99f; Every frame, say position += velocity; Use position for your glTranslatef instead of any of the hardcoded numbers you have in the glTranslatef line right now. If you don't have vector3 types then look up the long way of writing them and make your own vector multiply, add, length, dot product, etc functions.
  3. One of C++'s fundamental design philosophies is that the runtime cost of things should be minimized, even if that means omitting something that makes life easier for the programmer, if there is a chance that the convenience feature could lead to unexpected runtime overhead. I work almost exclusively on C# projects, and our team is full of programmers who don't fully understand the ramifications of the language features they're using. I see code where every single member access has been changed to use ?. even when the objects can be trivially shown to never be null at that point in execution. Every single one of those gets expanded into a runtime null comparison and potentially complex branching. I suspect that this being heavily abused is one of the reasons that C# 8.0 introduced support for non-nullable reference types, but I haven't had experience actually using that to see if it solves this abuse or not. Of course it's always possible that programmers can misuse C++ to the same extent, but if the language has fewer convenience features then a programmer has less stuff to potentially abuse. In my opinion C++ is better off if it sticks to its fundamental strengths and doesn't sacrifice those strengths trying to appease everyone.
  4. Nypyren

    how to test my Task Scheduler

    for (i = 0; i < some big number; ++i) { schedule task; } However, since this answer is trivially simple, I doubt it's what you are looking for. Perhaps you should clarify what you mean.
  5. Nypyren

    Lotcheck compliance

    Nintendo, Sony, and Microsoft should provide the requirement checklist documentation you need, and I believe it is all under NDA, so we can't discuss it publicly.
  6. Avoid static variables. Avoid the Noid.
  7. Nypyren

    How to make a top down 2D ball rolling

    For a pool or soccer game, you can probably get away with a sprite sheet line in Zakwayda's first link, but limit it to just one row. You can rotate the sprite when you render it to get the rolling effect to follow the direction of movement. It's unlikely that players would notice the inaccuracy.
  8. Nypyren

    fill fixed byte with values

    You do 'fixed' stuff like you do in C; LIKE A BOSS. public unsafe void Foo() { byte[] array = new byte[1024]; // for example; I assume you get your byte* from elsewhere. fixed (byte* ptr = array) { int* i = (int*)ptr; // cast pointer types to whatever you want // ^ you see that BLASPHEMY with the asterisk associated with the int? // That's different than C: int *i *i = 0x12345678; // moving the pointer works the same as C - advancing by the data type's size. // if you want to mix types, keep a byte* around to position things correctly. i++; *i = 0x23456789; // getting things back out is the same. int value = *i; // value is now 0x23456789 --i; int value2 = *i; // value2 becomes 0x12345678 } // array is now 78 56 34 12 89 67 45 23 00 00 00 ...... } You can also use the Marshal class to be (slightly) less of a BOSS.
  9. Something that I wish most languages had was a way to define and use a domain-specific language within the primary language itself. For example, I have a C# project with a GLR-based natural language parser. Writing the grammar productions could be done as plaintext data, but if I define them in C# I get benefits from the compiler and IDE: I can find-all-references to specific terminals and non-terminals I've defined, I can extend the productions with C# lambda expressions to perform reductions, etc. The downside is that since I have to call functions to set everything up, defining the grammar is extremely verbose. What I really want is a way to extend the C# language with my own DSL.
  10. Nypyren

    Has C# replaced C++?

    Each time C# comes out with a new version with new syntax sugar, I get excited about it all over again. Same with C++'s new stuff. Sometimes the improvements that one language makes inspires other languages to improve as well. As long as the various languages continue evolving to make programming nicer, everyone wins. (edit) ...except for the compiler programmers...
  11. Nypyren

    Unity C# Basics learning

    I agree that Component references should be cached as members, but a float isn't a Component. We need to be careful to provide advice which makes sense for the specific situation.
  12. Nypyren

    Unity C# Basics learning

    I disagree with declaring Dirx as a member variable. In my experience, limiting variables to the narrowest possible scope keeps code cleaner and reduces the possibility of introducing bugs.
  13. Nypyren

    Has C# replaced C++?

    This is misleading. C# typically compiles to intermediate bytecode which then must be converted to native code in order to run on a processor. However, you have the choice of whether you want to do the final native conversion at runtime (this is typically called just-in-time or "JIT") or do the conversion before shipping the product, which is typically called ahead-of-time or AOT compilation. For example, if you use the Unity game engine, you have the option to use their "IL2CPP" conversion pipeline which produces native binaries on your build machines instead of on the end user devices. We use this at work for our Android and iOS games. You could theoretically take a native binary generated in this manner and use it for system drivers. I know that Microsoft was researching this for a while. I don't know if they ever decided to use it, though.
  14. Nypyren

    Has C# replaced C++?

    I can't say. We only run Unity on our developer machines (OSX, Windows) and end-user devices (iOS, Android, and WebGL). Our Linux servers don't run Unity at all.
  15. Nypyren

    Has C# replaced C++?

    This is very outdated. .Net Core is fully supported on (at least) Windows, OSX and Linux. At work we've been using it heavily on Linux to run an ASP.Net Core server with all of our code in C#, and haven't had any issues yet. Our individual developers use OSX and Windows and we can run the same exact ASP.Net Core server on our own machines without having to write any platform specific code whatsoever. The Unity game engine supports Windows, OSX, Linux, iOS, Android, WebGL, several of the modern gaming consoles. Occasionally you need to write platform-specific code, but C# runs on all of them. Unity has a custom version of .Net which has been updated to be (mostly) in line with .Net Standard 2.0 (NOT related to .Net Framework 2.0)
  • 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!