Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

138 Neutral

About bnf

  • Rank
  1. Ok, working now, stupid error was preventing it. The issue now is that the circle starts at the origin and sweeps around towards positive X axis, but sweeps Y in both positive and negative. Meaning, the center of the circle is not the origin, which is what I want.
  2. Quote:Original post by Tom Sounds like rounding errors. If you're using ints, try using floats instead. Yeah I'm using floats and still having the problem. One thing worth noting is that sin(angle * i), cos(angle * i)) does not create a value large enough for the size of the spheres i'm trying to render, so I multiplied it by 10. That shouldn't be an issue though.
  3. Quote:Original post by SiCrane In terms of computer programming, take 2 Pi, divide by the number of points, and use sin and cos on multiples of that angle to create the points. e.g.: angle = 2 PI / 7 point = [] for i in range(0, 6) point.append( Point(sin(angle * i), cos(angle * i)) ) Yeah this is what I have and its creating a circle, but when I place objects at those points by translating them there, they are not perfectly spaced. Some are showing up closer than others.
  4. What's the quickest way to arrange a set of points or objects in a circle, evenly spaced?
  5. I meant rectangles because yeah you'd need to change the sides of them to even get close to having no gaps, but it sounds like its not possible or if it is it would be a problem that could take a very long time to solve with large sets of rectangles.
  6. The title for this post was hard to word. Here's what I'm trying to do. I have a collection of rectangles, their sum of their area equals 100% and should fit inside a parent square. How can I figure out the position and dimensions of all these squares so that they fit inside the master square, perfectly filling it up with no gaps, so that there is adjecency between all squares? The percentages that these squares represent will change over time so I need to keep updating their size in length and width along with the neighboring square. Am I making sense?
  7. Quote:Original post by Cygon Uhm, template support MSVC .NET 2003 (aka 7.1) is more standards conformant than Intel C++ 8.1. And what you're doing is pretty basic stuff, don't see why it should even require templates. Did you leave it out or is there no general "pushclass" template ? Because you can't specialize a class for which no generic template is available (even an empty one would suffice). -Markus- I left out the pushclass template. And secondly, this is from a library that I did not write. I am not aware that 7.1 is more standard compliant when it comes to templates. I had heard differently from Intel, but maybe they are blowing smoke in my face.
  8. bnf

    future of .NET

    Quote:Original post by MENTAL Quote:Original post by MikeyO I find half life 2 locks up for a second or two quite a bit while it loads resources like sounds, if they haven't fixed it by now, it's usually right after a loading screen or going into a new room. What does loading a resource from the hard drive have to do with automatic garbage collection which happens in RAM? Quote:Original post by MikeyO Saying you shouldn't make a half life 2 in C# is like saying you shouldn't win the olympic gold medal in ski jumping: most people couldn't win the gold medal if they tried. Most people here are not going to be able to make a half-life 2 anyway, maybe use all the CPU and GPU power half-life 2 does, but they would probably be used wastefully and inefficiently. Is it just me or does that not make much sense? #1: Agreed. I fail to see the connection between disk access times for HL2 and GC in .NET. #2: It's not you.
  9. bnf

    future of .NET

    Quote: Even with that, there were still minor hiccups during LOD transitions, GUI transitions, etc. The biggest pauses were during song transitions, and that's just because you can't work around DVD seek times. No, not "even with that", the point is it took them a lot of time and sweaty paranoid evenings to make sure that the biggest problems were during song transitions. The dev I spoke to bemoaned the GC in Lua for that reason. So if its a problem in a controlled evironment, then I'm failing to see how it gets easier to deal with on a PC? But again, you are clinging to the GC issue, and avoiding the points made about address space management and custom allocation. Look, if your app doesn't need it, then that's fine. And moreover, I think the common sense approach here is that if you are not shipping a high calibur title then .NET is fine for now. It will probably get beter. But its definitely a matter of opinion as to whether its "infinitely better" than tracking down memory leaks. I know that I don't have to work very hard anymore to avoid memory leaks in C++ with all of the tools and techniques. Its easy to start doing things in .NET where allocations are happening behind your back and this rule is harder to enforce. Judging by the reactions to this thread, there is a mixed opinion on this. So go and use what works for you.
  10. bnf

    future of .NET

    Quote:Original post by Trap Only a full collect can stop the app longer than 0.1 s. If your app does full collects it's your fault. In non-gc apps you have to manage freeing memory, in gc-apps you have to manage allocating memory. No full collects will be necessary if you don't allocate memory after loading your data. The GC is more forgiving though, it only stops you app for some time, a missing free/delete will kill your app over time. Whats wrong with IDisposable and using? Like I said, its not just GC, its the ability to control allocation, address space. .NET would have done well to have included an option for reference counting, unobtrusively, unlike AddRef.. in COM.
  11. bnf

    future of .NET

    First, equating the OS's multitasking with the GC pausing your app is innacurate. The time devoted to the latter can and often will be longer. Furthermore, if a gamer is running any significantly taxing processes other than the game, they are inviting the perf hit and can resolve it by shutting down uneeded apps. I don't know many gamers that play Halflife 2 with active apps in the background. Secondly, many of you here who in one sentence say "you're over estimating GC perf hit" then go on to say in the next breath "sure I wouldn't use .NET for a Halflife 2 or Doom 3 engine". Well, you've made the original detractor's point exactly. There is a calibur of engine technology that cannot afford the possibility of the GC effecting their runtime framerate. I know from speaking with one of the leads on the XBox Amped snowboarding title that even with the prescribed suggestions here (hold onto your refs, allocate pre-level, etc.) you are still just asking for trouble. You end up having to go through all your code and make sure you're not missing anything and this costs efficiency of your time. Another thing to consider here is that the word commercial is subjective. THere are commercially downloadable puzzle games that will not be held to the standards of consoles or other games like Halflife 2. By all means .NET is appropriate. But again, if you're building the foundation of your technology for a high calibur game, I prefer to have as near to 100% control over these types of issues, and this includes allocations. You cannot override the way .NET does allocations, you cannot control your own memory address space, and so on and so forth. Granted these are advanced techniques, but they become relevent when writing technology that has to work on multiple systems (XBox, with unified memory limited to 64MB) and when every ounce of performance and determinism is critical.
  12. I am having trouble with these two little template specializations. I'm running on Intel's 8.1 C++ compiler because MS VC 7.1 won't even compile the rest of this library. Hopefully this is a gernal enough C++ template specialization issue that non Intel users can take a look at this. The two offending pieces of code are the last two template specializations at the end of the code segment below, and part of the macro called SQUADD_DEFINE_CLASS_LOCATION_IN_REGISTRY: I'm praying someone can help solve this as I've spent several weeks looking for a solution. template <class Class> struct push_class_from_registry { inline static void onto(HSQUIRRELVM v) { } static const char * table; static const char * name; }; template<class Class> const char * push_class_from_registry<Class>::table = NULL; template<class Class> struct store_in_registry { inline static void perform(HSQUIRRELVM v) { } }; #define SQUADD_DEFINE_CLASS_LOCATION_IN_REGISTRY(Class, Table, Index) template<> class pushclass< Class > : public push_class_from_registry< Class > {}; template<> const char * push_class_from_registry< Class >::table = Table; template<> const char * push_class_from_registry< Class >::name = Index; By the way, this modification doesn't work either: #define SQUADD_DEFINE_CLASS_LOCATION_IN_REGISTRY(Class, Table, Index) template<> class pushclass< Class > : public push_class_from_registry< Class > {}; template<> const char * push_class_from_registry< Class >::table = Table; template<> const char * push_class_from_registry< Class >::name = Index;
  • 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!