Jump to content
  • Advertisement

Leaderboard

The search index is currently processing. Leaderboard results may not be complete.

Popular Content

Showing content with the highest reputation on 10/09/19 in all areas

  1. 3 points
    Definitely not the case. There are still tons of very useful data structures other than linked lists which aren't represented as (purely) sequential elements in memory. One exceedingly-common-in-games examples: chunked arrays. An "array" that is a list of fixed-sized chunks, where those chunks might be sequenced in another array or in (gasp) a linked list. This is a _very_ common data structure for storing _large_ "arrays" of items since it allows much more efficient handling of memory blocks/pages and mutation of contents, and it's still very cache-friendly so long as the chunks are of an appropriate size. Such a data structure can still be random-access (if the chunks are stored in an array) and hence can be efficiently `std::sort`d, etc. Even in the standard library itself, types like `std::deque` or `std::map`/`std::unordered_map` make use of iterators for such _basic_ functionality as "debug print all the values." There's tons and tons and tons more uses here. Database query responses. File I/O. Lazy computation or generators. Filters and transformation pipelines. etc. There's a very valid argument to make that the incoming ranges feature could long-term supersede iterators (since the idea is that almost every pair of iterators could be replace by a range, and even most raw pointers can be replaced by `std::span`, for improvements both in ergonomics and safety). That's a very different discussion and has abolutely nothing to do with linked lists, though.
  2. 2 points
    Hi gamedevs, We are happy to announce the release of Nanotale in early access on the 23rd of October 2019. http://www.youtube.com/watch?v=5IohCH2aCx8 Wishlist the game on Steam Why in Early Access? The initial plan was to release the full game in September 2019 but then, we noticed that if we really wanted to release the game we dreamed of along with our community, it would take a little bit more time. So, we decided to polish the first 35% of the game and put it in your hands to make sure that we are on the right track while finishing Nanotale. We give more info about the early access and its content in the following video. http://www.youtube.com/watch?v=Z2kd_ams2fo&t=4s The more feedback we get, the better our game will be at release. So, thank you in advance for your support! Have a wonderful week. -VirginRedemption
  3. 2 points
    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. 1 point
    Thanks Dirk, box2dlite is exactly what I needed. Thanks for your help, your presentations have been very helpful.
  5. 1 point
    Haven't worked with parallax mapping myself so far, so I can't help you with the details but it looks to me like it only works in the horizontal direction. If you compare the edges of the learnopengl picture with yours, you 'll see what I mean. So I would narrow down the debugging to every instruction that affects the vertical direction. Greetings
  6. 1 point
    Do you have any bias towards the engine you are going to use? Actually, I would suggest to use Unity3D(C#). This is perfect way to create 2d platformer from scratch. And it will not be time consuming to come up with something and implement because there are tons of framework for Unity3D with explanations how to do that. And in the past I built and released some projects including 2d platformer on Unity3d. Now I am more interested in multiplayer games. Couple days ago I started learning this part of game development. There is the second reason why to choose unity3d. Because in case with java you will have to find third parties tools for level editor. As usual it will be MapEditor. I am not sure that this way is more convenient than to have built-in level editor in Unity3D. Java is one of the best way for server part of games. But of course it is up to you.
  7. 1 point
    No magic - it's just math, which can be replicated in pretty much any environment as needed. (Not to say it's trivial necessarily - just that is can be done.) Although I've read the whole thread, I don't remember everything that's been discussed, so I may be repeating some things. But, what you'll need to do obviously depends on some variables, like how the environment is represented and so on. I gather from your initial post that this is 3-d and that therefore purely 2-d solutions won't suffice. It also sounds like there are two problems you want to solve: being visible or not based on position and orientation (ignoring obstacles), and whether there's an unobstructed line of sight between two entities. For the first problem, you could do what a typical camera system does, which usually involves a frustum built out of planes. There are other options though, such as a visibility cone or some other ad hoc solution. That's probably the easier of the two problems to solve (determining line of sight can be more demanding). In any case, if you run into problems you can always post back here.
  8. 1 point
    The list nodes can in theory be scattered all over the memory. If that's the case, multiple successive accesses to the same list can cause more cache misses, if the distance between the nodes is to far. Arrays on the other hand are always stored in a single block of memory.
  9. 1 point
    Well, your post wasn't helpful at all. Instead of just saying "You got brainwashed by microsoft", one should look at the advantages and disadvantages of a certain feature, and how well it could be integrated into an existing language/system.
  10. 1 point
    Yes, but do not confuse colors and normals. The color gradient is a result of interpolated normals and using them for shading to get the color. (So dpending on shading, there may be other unknown factors that affect colors and how smooth they change over the surface) Finally it's also worth to know that even if normals form a nice gradient over a single triangle, the gradient (or slope, or derivative) itself is not continuous accross edges. Se even with interpolation and per pixel shading the tessellation can become visible unfortunately (would be too expensive to fix).
  11. 1 point
    Most triangle meshes are a discrete approximation of a continuous, curved surface, so interpolated normals are just a visual trick to make them appear smooth and curvy again.
  12. 1 point
  13. 1 point
    Yeah C++ doesn't have those in the 'core' language, mainly because they're the kind of functionality that can be provided through libraries. For example instead of events you might use Boost Signals2. For delegates the C++ standard library has std::function that you can use. For properties I would just say it's something that is typically achieved by writing member functions. https://en.cppreference.com and http://www.cplusplus.com/reference are pretty good for learning about what's in the core language and what's in the standard library. While https://www.boost.org/doc/libs/ is a large set of high-quality community libraries and one of the most influential projects in the C++ world. Several libraries from Boost have since been standardised into the C++ standard library (e.g. boost::shared_ptr became std::shared_ptr).
  14. 1 point
    No C++ doesn't has these features because they are something that is bound to the runtime and languge model. It starts with having delegates (because events are in fact just delegates). In C++ you don't have delegates, just function pointers. The reason is simple, a function pointer points to an address in the assembly binary. The compiler will perform just a jmp instruction as same as if you call the function directly. Those functions can have and for the kind of instruction the compiler uses need different calling conventions. A static function is just a cdecl/ stdcall, this determines how the stack is created and cleaned after the call returnes. The you have member functions that have a different calling convention: thiscall. It is again some special kind of stack creation, member functions are also statically called except that there is an additional parameter on the stack, the pointer to the object you call it for. It isn't possible to interchange calling conventions to store them in the same variable because the compiler has to ensure correct stack management. This is different for C# because in C# the CLR is able to deduce the function calls at runtime, so you can store whatever you like static or member function in a delegate. However, there are tricks in C++ using templates to create such kind of delegate too. If you are interested in how this works, I provide delegates in my common C++ source at GitHub. It works because you store two pointers in the dynamic delegate instance, an optional object that will be used for thiscall convention and a calling proxy that is a templated function. If you assign a static function, the cdecl version call guard is used, if you use a thiscall member function, the thiscall version call guard is used. This works because those template functions are static functions and just route the arguments passed to the target function you add in there. So in fact the delegate calls the call guard passing the functions arguments and the object pointer allways and then the call guard decides how to exactly execute the function pointer given in the template argument. Properties is another topic, they are compiler convinience for function calls. If you declare a property in C#, the compiler will add hidden functions to your class that are named get<PropertyName> and/or set<PropertyName>. You can investigate this if you use reflection to inspect the classes functions. So you can have this in C++ too, just add a function to your class the same way the C# compiler does or more simple inline void PropertyName(PropertyType const& type) { myVariable = type; } inline PropertyType PropertyName() const { return myVariable; } I use this practise in my code base all the time, the only difference is in calling it //C# MyType m = myClassInstance.PropertyName; //C++ MyType m = myClassInstance.PropertyName(); There are of course more topics that aren't implemented in C++ right now, for example reflection. The potentially most usefull thing in C# is tricky to do in C++ because of the CLR C# runs at. The CLR knows at runtime the type and consistency of each class and so each object. This isn't possible in C++ because objects are just memory, they don't have any information about their name, fields and methods. Yes, there is the function table in an object which inherits from another class but this only contains function pointers for derived functions and virtual overrides. There are some patterns how to implement reflection in C++ but keep in mind, reflection means storing meta information for every type in your assembly, so your code will increase in size. Some solutions generate code for more complex reflection including fields, functions and their arguments, some other are just a lookup of a typeID or type code like in C#. It is up to you here how complex your reflection support should be. I decided for a mixed version in my code base, have a typeID for every type I use in my code, regardless of if it is built-in or mine and have generated more detailed information for some chosen types I declared by my own
  15. 1 point
    ▼ Watch the Devlog on YouTube ▼ ▲ Watch the Devlog on YouTube ▲ Hey everyone! I recently started the development of N.E.S.T, an action-packed, looter-shooter mobile game, and have been logging the progress through videos on YouTube every week! You can view the full playlist here. I would greatly appreciate if you could support the development of this game by subscribing to me on YouTube here, or by following me on itch.io here. Thanks for your time, and hope to see you all there!
  16. 1 point
    It's not about re-inventing the wheel or using pre-made libraries (which many of us do), it's about understanding how things work. Using other people's code with zero understanding of what is going on will never develop you into a good programmer. If you don't want to "re-invent" the wheel then stop working with OpenGL and pick up Game Maker Studio and work with pre-made templates. You've been at this for over 14+ years now and have almost nothing to show for it. If you continue to stay on this track by copying and pasting other people's code and coming to the forums looking for help you will only create additional frustrations for yourself and other people. You're also robbing yourself of time which you'll never get back. I would suggest aligning yourself with something you're good at and something you have passion for as I'm extremely confused on your end goal here... I genuinely would like to see you succeed but it's very apparent programming isn't for you, but at the end of the day you'll do what you want regardless.
  17. 1 point
    The issue here is that Phil has been known to copy and paste code without actually understanding what is going on and how to reproduce the same result without references. This is why we're seeing the same issues popup since 2006... This is also why I don't provide him with actual code examples anymore and in the past I provided either pseudocode examples or in layman terms but he could not take those examples and actually code it. https://www.google.com/search?q=phil67rpg+opengl+site%3Agamedev.net If Phil cannot explain in his own words why something works then he really shouldn't be moving forward. If this is too complex for him then he should just use something like Game Maker Studio. We're doing no service to Phil by spoon feeding.
  18. 1 point
    Hello. I'm a complete beginner with absolutely 0 experience. Before I continue, I must say right now I am not ready to work on a team, but very soon, a project like what you envision would be absolutely perfect for me (actually for us, great for building a portfolio) I am currently learning C# and the Unity Engine, from what I gather Unity is currently the better platform currently for 2D games (complexity wise). I have a passion for learning and gaming, and have reached a point in my life where I am able to peruse a serious career in game development. I have LOTS of time on my hands, I worked for years to allow my partner to peruse their dreams, since achieving that reality, its my turn now to peruse my dream. I believe I have successfully tackled the motivation and stress parts of learning to program, and summed it up into this sentence: "If your not failing, your not learning". My current path of education is: Learn C# basics through Unity Develop reasonably polished prototypes to practice and cement down certain concepts Practice with the goal of mastering intermediate and advanced C# coding, (starting with advanced RPG mechanics) Learn Unity networking, AI, and other advanced topics. Deploy a game or tech demo that demonstrates intermediate and advanced C# and Unity concepts. Perhaps a complex RPG Eventually move on to C++ and Unreal. To my understanding, the "speed" benefit of C++ over C# is only if you are writing your own engine, or editing an existing one. In terms of gameplay and mechanics, C++ (and unreal engine) will only create stress for beginners, and really demotivate you to learn further. IMHO, from someone who tried to learn C++ and/or Unreal first (unless you become a blueprinter which wont get you very according to job listings), its definitely like trying to learn Advanced Calculus before working your way up from Algebra. TLDR; Who I am: Beginner C# Unity Coder. Passionate, Motivated Self-Learner. Team Player. Someone who doesn't sacrifice quality for speed. Who I am not: Team Leader(this is your project, I'm here to build my skills, portfolio, and do what I love), Graphic Artist, Artist, Sound/Audio, Someone who mindlessly "figures it out along the way" on something without an end goal, and pathway to get there written on paper (this is the responsibility of a Lead). If you find yourself struggling down the line in a few weeks/months, or having issues with your team, or looking for someone like me please contact me here or at scipiox64@gmail.com Best of luck to you!
  19. 1 point
    @asdfzitro I was just wondering. Seems like we have a couple people with 3D programming/modeling experience. No 3D artists yet...
  20. 1 point
    I don't understand your first example approach. If turns are simultaneous, there shouldn't be a "first to move" player. If you mean that units move immediately as players move them, without waiting for the turn to end, then it's no longer turn based, it's just real time with extra steps. It would also be imbalanced towards the player that moves early, or late, depending on the rest of the game. Simultaneous turn based games that I have seen so far would have both players plan their entire turns, and then everything would resolve at once.
  21. 1 point
    In a good OO design, this doesn't happen. The Circle class Must be the representation of a circle in the geometric sense and nothing else. It cannot be allowed to depend on something that isn't geometry, such as a spatial index, a Canvas, or a file. This is called the "single responsibility principle": forcing together multiple responsibilities means creating tensions when anything changes. Should derive from a Shape interface or abstract class, together with other shape types. This makes clear that there are functions that apply to any shape (e.g. computing area, perimeter, bounding shapes), and operations that only make sense for circles (e.g. construct a regular polygon with the same center and the same area and a given number of sides, which can be useful as an approximation) In practical terms: The renderer should find a way to treat all shapes the same way (e.g. if the Shape interface offers a point containment test and a bounding convex polygon the renderer can test samples inside the region of interest) or segregate different Shape subclasses by their different rendering methods (e.g. scanline rendering of circles, scanline rendering of whole convex polygons and scanline rendering of a triangle decomposition of nonconvex polygons) A spatial index should probably deal with Shapes and their bounding shapes only. Serialization could be allowed in Shape classes because it's so basic and intrusive, but keeping it outside would be cleaner.
  22. 0 points
    Linked lists are obsolete because they: * Create serial dependencies instead of using multiple memory loads at the same time. * Fragment the cache with pointers possibly larger than the element itself. * Create cache misses when iterating over all the elements, because each element is a heap allocation on an unspecified memory location and the cache predictor wants linear order. * Are difficult to split into multi-threaded workers. * Are many times slower than arrays for the common uses no matter the size. The creator of C++ had an in depth presentation about how linked lists have become horribly slow. https://www.youtube.com/watch?v=YQs6IC-vgmo Iterators lost their original design purpose because of linked lists They are an abstract interface for handling collections without knowing if it's a linked list or array under the hood. With linked lists out of the picture, you might as well specialize for the case of consistent memory blocks and make faster and safer abstraction layers. The main problem with iterators is that they are essentially just pointers, but not the modern ones that have reference counting, have zero-overhead safety features, or iterate in strides of many elements for SIMD operations. I might be missing some favorite feature of yours, but from my perspective it's not worth the risks posed by using two raw pointers like that, the cost of porting between languages, and the learning curve for new C++ developers. Regarding std::vector, it's possible that you compiler's implementation used calloc instead of malloc and memset, which is faster by not fetching garbage data into the cache.
  23. 0 points
    C++ is a long term language for huge projects If C++ somehow added all those high-level features into the standard library, there would be even more legacy to maintain until C++ has to break backward compatibility or die. If you want a fresh start, there are many competing languages with a better balance of safety, speed and readability, but their elegance comes at the cost of being forgotten when the next shiny language arrives with adaptations for the next hardware or abstract platform. STD is already bloated and outdated The C++ standard collections belong to a museum by having older parts optimized for single-core computers with small but fast memory that's insignificant compared to computation. Today we have huge but slow memory with fast computation and using a linked list as a default container is like a bad joke about cache misses. This obsoletes iterators and the whole system that relies on them. Third-party libraries can be changed with every new project, adapt for custom needs using operand overloads and take advantage of the latest hardware using SIMD extensions and GPU features.
  24. -1 points
    Microsoft brainwashed you with C#, now you belong to microsoft.
  25. -3 points
  • Advertisement
  • Advertisement
  • Popular Contributors

  • Member Statistics

    • Total Members
      260759
    • Most Online
      6110

    Newest Member
    lTiMeSl
    Joined
  • 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!