Jump to content
  • Advertisement

colossal

Member
  • Content Count

    75
  • Joined

  • Last visited

Community Reputation

633 Good

About colossal

  • Rank
    Member
  1. colossal

    Best C# engine for beginners

    Why is Unity not your style?
  2. colossal

    Growing Projects - An Odyssey into Complex Code

    Not to be rude but I really don't understand the point of this article at all. Your article is dealing far too much in the abstracts and almost nothing tangible. Your naming convention suggestions are completely arbitrary and have almost no explanation.   How does this scale among 1 developer? 10 developers? 100? How do you come to the decision of what naming conventions best serve your projects needs? What are some pitfalls or common mistakes that you can run into when deciding on a convention? What do you define as complex code? Why does that complexity cause pain? When does it make sense in a project to pursue this? What if you are inheriting this code?   Further on you start mixing code and file layout with class design, and never fully explore any of them. Your example that you provided does not address any material questions either. You talk a lot about what you personally like to do and some reasons, but you never address how you fully came to your conclusions.   Again, how well does this scale? Isn't this an article about GROWING projects and complex code? What value does defining this ruleset result in for your team? for yourself? Is that value worth pursuing within your constraints? What is a material example relevant to games that would illustrate your point?   I really can't give the article in its current state a thumbs up.
  3. colossal

    Chamois - Fluent Assertion Syntax for C++

      Completely agree with you. The proposed syntax in this article is FAR too verbose. If an individual really has problem reading just simple assertions, then they need more experience in the language. If the assertions are too complex to be readable, then the assertions need to be broken up into simpler statements that are asserted individually.   Code readability comes from isolating statements of computation and keeping them simple. That might be more lines of code, but it is far easier to read than just appending more and more function calls to make the code look like a sentence
  4. The reason is because I am looking to write a simple renderer that supports much older hardware before OGL 3 and 4, or preferably find one that already exists.
  5. Any suggestions? I am a bit unfamiliar in research for this area.
  6.     Hodgman,    Thank you for the comments -- regarding the linear allocator, I do in fact believe that this is an oversight on my part. The purpose of the allocator is to have a lot of objects at once all with the same lifetime. I am going to change destroy_all() to fit this, and loop through the allocated objects invoking their destructors.   The pool allocator should ABSOLUTELY be asserting that particular oversight as well.   And I agree that my assertion code needs more work. I already have enough preprocessor work as it is and should aim to make the code more readable. I certainly would like to isolate preprocessor directives as much as I can, as you have suggested.
  7. That is the whole point of those RAII wrapper classes. Never take a lock without them. So far as allocators and threading in general: High-performance algorithms and locking/synchronization don't play well together. Every time you take a lock you're hitting some overhead (how much depends on the type of lock) and every time a thread is stuck waiting on a lock you're throwing away CPU cycles. When working with multiple threads you really really want to isolate the threads as much as possible; not doing this is one of the reasons people think threading is so hard (it's really not). Use algorithms that allow the threads to work as independently of each other as possible. Typical modern general-purpose memory allocators make use of per-thread caches. This allows most allocations/deallocations on a thread to operate without every needing to touch a lock or any shared data structure. A more thorough overview of one such allocator is http://jamesgolick.com/2013/5/19/how-tcmalloc-works.html. See also the excellent jemalloc More constrained platforms might not be able to pay the overhead in memory "waste" of thread caches. Heavy threading or memory allocation aren't super ocmmon on such platforms (in games, anyway), though. Specific allocators for various needs are often single-threaded in games since each instance of an allocator is typically only used by a single system running on a specific thread. Thread safety in these kinds of allocators is mostly just about ensuring only a single thread uses them, not allowing multiple threads to use them.     Sean,   Thank you for the great advice. I have actually been asking myself the question, "Do I want to support threaded allocations/deallocations at all?" The entire purpose of this library is to provide functionality for specific types of allocation patterns, and I think that limiting their use to "same thread context" allocations might be only beneficial to my design choices. I found in performance tests that the introduction of mutex locks to my allocation algorithms basically proved that I should just use malloc and new anyway.   Thank you for the links, definitely going to look into them.
  8. Just for purposes of education, one of the issues I have found is that my use of lock and unlock inside my concrete allocate() and deallocate() functions, currently can result result in a deadlock due to the fact that I have a return branch right after unlocking a mutex. To solve this I have to follow the principle of RAII and use std::lock_guard from the concurrency library of C++11. I'll probably end up still functionally using my hybrid_lock as a mutex concept for the lock_guard so that I can use spin locking via atomics.
  9. Last year there was a great article on custom general memory allocators: http://www.gamedev.net/page/resources/_/technical/general-programming/c-custom-memory-allocation-r3010   I decided to take a hand at modernizing and fully implementing the article for my own use: https://github.com/cgikoray/Nemesis-Memory I am looking to see if anyone has comments or criticisms of my work thus far, as I would love to improve it as much as I can. Thank you anyone in advance, I am open to all opinions. Be as harsh as you wish!
  10. colossal

    C++: Custom memory allocation

    I've been authoring a more modern version of this article for personal use, I have it under MIT if anybody would like to use it! :)   https://github.com/cgikoray/Nemesis-Memory
  11. colossal

    You Don't Need to Hide Your Source Code

    The only thing delusional I have seen suggested regarding sharing source code is this entire article. There are plenty of avenues where sharing of source is appropriate, but this is simply not the case in terms of entirety for modern games. Games with ANY online component would completely fail under this nonsense for two obvious reasons. 1) Cheating 2) Private Servers.    Perfect example, NCSoft's Lineage 2. Take a look at this website: http://www.gamesites200.com/lineage2/ This site is a collection of all of the most popular private servers that are operated in the world for Lineage 2. NCSoft is not affiliated, nor receives any sort of compensation from these servers. In effect, all of these instances of Lineage 2 are pocketing money from NCSoft's work, resulting in MILLIONS of potential revenue lost. All of this was the result of NCSoft accidentally losing the source to the game server code some time ago into the public. Feel free to look into this http://news.mmosite.com/content/2006-11-20/20061120190829155.shtml.    This article is completely out of touch with reality.
  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!