Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

906 Good

About mychii

  • Rank

Personal Information

  • Role
    Amateur / Hobbyist
  • Interests

Recent Profile Visitors

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

  1. If there should be entities that would interact with the other entities, then yes. If inventory is just data, then no, as it should be just collection of data in your inventory component. It's usually both though. You need inventory component (if you will) to store each item information/data in the inventory, and use it whenever you wanna display it, like guns to select. In your design, since entity is nothing but numbers, component is nothing but data, then system should be the only one that would deal with the inventory list owned by the entity, including spawning new entity(es) if needed. How you will inter-connect that with other entities and how these may affect the complexities when the game scales up, I honestly do not know cause I never scale a game architecture like that until today, but I can only smell it due to the restrictions given by such design. I think that sounds about right already. It shouldn't be too complex I believe (not in terms of saying it should be easy, but in terms of it shouldn't be over-engineered to explain direct relation of 0..* or 1..*). Player has zero to many inventory objects stored in Player's inventory list. I think that's one way to phrase it. How you derive it to your architecture (or other architecture), you can re-read my previous post, paragraph 2. For example, Player is-a game object (entity) that has-an inventory list containing inventory objects, for object-centric model. Another example, Player is-a game object that has-an inventory list component that its job is to store inventory objects, for entity-component model. The inventory object should only store information about the object, which when you want to use it can either be just data to exchange or something to display. When it comes to something to display, it may contain information to display it in form of new entity.
  2. mychii

    I didnt know who to ask.

    Of course you can. Define two players that collects its own input (or one input if the game uses only a keyboard for two) then assign each Player to call the avatar's behaviors each. Since it's not clear if this is a video game or not, there's another method to have fun with this: Get a human-like doll that has a scope (or attach a scope) as the avatar, then have a Player to move the avatar (and the legs for movement aesthetics), then the other Player to use the scope, aiming at something. Human hands connected to the brain are the user input. 😃
  3. Fist is clearly an entity, so you should generate a new entity that contains 2 components. Player itself must be able to relate to the fist. To relate those two, there are multiple ways, including your ECS method. Traditionally, with normal entity (game object) with non-component based model (either class mixins or bloated inheritance), it's done inside the game object class, which is the Player. In hybrid component-based model, it can be done inside a component that is attached to that Player class or just like the traditional one you can still do it in the game object. In Unity classic model it's even more restrictive because everything has to be inside a component. Now in your case with your ECS method, it gets even more complicated, as their interaction data should be defined on a component attached to a player, but the interaction of those two, is dictated by a (new?) system. When your entities got tons of complex behaviors inter-connected to each other, which usually always will in the end after you're done defining your entities, you can already guess where you're going, hence this question. The reason is because "pure ECS" is too restrictive and now you're stuck to define the interaction, which is logical. Again that doesn't mean it doesn't work, but you already realized yourself where this is going to. I'm not sure why you need multiple instances though. Based on your example, I don't see why multiple usage would require multiple instances of the same component. Inheritance doesn't defeat the purpose of ECS, it's that ECS method that defeats the purpose of inheritance I think.
  4. Yes, that is what the object handle I have in the picture does, a simple wrapper that handles relocatable objects in memory, which I'm trying to inject to STL container through custom STL allocator rather than making custom container using that object handle.
  5. mychii

    What’s the future of internet?

    I deleted my social media as well since 2015. I did have close to a thousand friends (real living friends I know throughout my life, not found online), but interaction inside is close to zero lately at that time. I'm more into content-first websites now, like you. However, I do keep a Twitter account (not related to this account) just to have a mini blog; a place where I just speak whatever I want and doesn't even need to be long, though I keep my words cause it's still a public space. I'm okay with ads to be honest as long as they aren't that intrusive. For me the ads in YouTube isn't that bad (except the one in home), they are user-generated and can be funny (and related) sometimes. I've also adjusted and picked whichever websites and videos (in YouTube) that aren't clickbait. As for YouTube, I simply mark it as "I don't like this video" and "I don't want to see videos from X" so I don't need to see more from them anymore. Usually I report the misleading ones, not only beacuse it's really misleading, but I think reporting gives a better effect on what is recommended to you. As for monetization, well, businesses seek money so, they do whatever to get it. They make something so interested that people can't live without, then they make something that some people can tolerate with, which they have them. So I don't see a problem with that. In the end it gets mutual (some prefer to choose the word "manipulated"). You and me can hate these but they have numbers to keep, and we are not one of them, and for them, that's fine (and calculated). Most people will always fall to, for example, "Meghan Markle killed a deer" than "Meghan Markle having a roasted venison she hunted for dinner" as headline, and sadly it will always be like that. I'm not sure what future of the internet is related to mining bitcoin or good contents, but the future of the internet is what people can bring into it and how they enjoy to use it. Social media was one of them. Right now I think it's still moving towards to content-based websites. Instagram, pinterest, YouTube, etc.
  6. I agree with that. Good to hear that the registrations keep going on. It is indeed the oldest one I know and well moderated.
  7. Sorry for the late reply, thanks for the effort of the code. Sorry I don't quite understand, if it isn't solved by the allocator, so how does this work for? I actually wrap the object handle in form of smart pointers (and soon the custom containers as well) quite similar like this. Is that what you mean? Fragmentation isn't a real concern, the way I do it is just a gc technique which anyone can replace with any other technique they wishes to (that's why I'm so lazy to debate about it as there is no single answer), but what I'm asking right now is one of technique I do that leads to this, the only one that couldn't be integrated to STL containers, somehow. My main concern was ease of usage. It is meant for high level codes such as gameplay codes, where users don't/expected to not care much about memory management and just produce features. It's a C# kind of thing (which I don't know, where some people kinda allergic about when they hear "managed, garbage-collected code", when I believe it is necessary in such particular issue, but AGAIN this is a different matter to debate about). It's in C++ cause if the users want to do something outside of the managed environment, they can, like allocating their own memory and manage it from there, with their own way or other memory allocators I have, and then/or turn it off entirely when they reached to the point they can optimize it after rapid iterations for the features or if they feel they can code safe enough in unsafe environment. This has nothing to do with other modules/subsystems, especially low level ones.
  8. I see, good to know. I thought there might be a crash or somethin. Maybe cause the lounge community moved to Discord somehow? 😝
  9. Guys, what's the hold up? It's falling. 😮
  10. mychii

    Keyboards for Programmers

    I like Apple's keyboard or similar, it's less tiring and noisy. I happen to use Logitech K120 now I feel that.
  11. Oh I see. I have to admit that yes, it expects a memory location and that's it. Yeah I doubt it too. It's more about being too hacky and too specific if I do that, maybe, haha. Just wanna do either the legal one like replacing the default allocator or make my own. Yeah I'm trying to avoid more overhead just to make that work. I guess I'm set to just carry on with making my own containers. Thanks everyone!
  12. You're welcome. I've been trying my best to ensure it's easier to get to the point. I actually just realized what you thought about after I posted mine, that you probably thought "object" as in per element. So I quickly put a lot of edits on the second quote of my last response to make sure that wasn't the case. I'm glad the picture quite hopefully explained more than words (I should've done this earlier!) So I guess it gets to this point after all. I'd love to to discuss about how I shouldn't (or I should) get to this point ( like what Fulcrum.013 seem to be very interested to discuss more than the question itself), but I guess I'll just open a new thread for it later when it doesn't work in the end when it scales. It's just so far I haven't found any real problem (yet) with my current way of doing it except this exact question. Yes the idea is interesting but the implementation could be done automatically if only the indirect memory access (the object handle) can work along with the custom STL allocator.
  13. Yes! Yes! Good analysis of where this is going though specific to vector, which I agree. Yes, so far I agree. This I don't understand a bit. Template wrapper as in, I concretely wrap the vector? Okay just trying to summarize, please correct me if I misinterpret. So according to you, it's impossible to sneak my object handle in through the custom STL allocator in any way unless I forge the STL implementation to work for my will, in case I'm still holding up with the paradigm of this relocatable memory for such things. So up to this point I conclude that it is impossible, with the case I gave, to provide a custom STL allocator through the indirect memory access (the object handle)? I get your idea I think, but in general this does not matter. If the vector chunk shrinks/grows due to resize, then what it does is, as you said (also according to the "Complexity" section in the link you gave), the chunk should be "updated" with new size info (as in capacity) where it means that it is reallocated to a new chunk with new size. In short basically it performs allocation/deallocation (if it will depending on the conditions). This is what this thread is about; I want my memory allocator to capture this moment, which I think (so far) should be done by intercepting the default allocator using custom STL allocator and inject it with my memory allocator that handing object handle, which as you see in the picture, I couldn't able to. If you see figure 2 in my picture, there's an unused block (colored in grey). Whenever the vector grows beyond its current capacity or do what you proposed due to resize, if it uses the custom memory allocation I provided, the vector array will abandon its position 0x00 (a.k.a deallocate) and then "move to" (a.k.a allocate new chunk to) the unused block, whether with bigger size array or resized smaller array. It will be given a new object handle upon allocation. The abandoned (freed) 0x00 will be defragmented sometime later. This keeps going on the same with other objects too whenever there's any allocation/deallocation. So in short it should be done automatically anyway, again, if the STL allocator is successfully customized with my memory allocator with the object handle thingy.
  14. Anyway thanks lawnjelly for replying, but I guess let me try again to clarify with picture since the replies have been clearly being troubled with what I'm getting at. It's probably the topic is a bit difficult (or weird) with addition me simply being so bad at explaining what I'm trying to get to or missing some (or using some bad) terms or even wrongly explained the underlying stuff. So please let me try this again, and please correct me if I'm wrong. This time with picture: Hopefully this can clear things up to help you guys with less trouble... 😫
  • 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!