HexDump

Members
  • Content count

    524
  • Joined

  • Last visited

Community Reputation

233 Neutral

About HexDump

  • Rank
    Advanced Member
  1. Hi, I'm a programmer making his efforts to get a bit into art. I have basic drawing and animation knoledge that think is enough to have some simple games rolling. I have used several programs to create contect for unity like aseprite (pixel art), photoshop, spine, etc... but these last days I discovered Animate CC (aka old Flash) and it seems to be a really nice tool. The ability to animate + create vector graphics in the same program really attracts me. The thing is, is anyone using Animate CC in his workflow? Is it easy to import assets into unity? I imagine I won't be able to import the svg animation but I think it is possible to build a sprite sheet from it and import it into unity. Could anyone please explain a bit how you use it with Unity or on the other hand why you don't like it to be used with unity? Thanks in advance.
  2. Online game design degree

    Well, I think I will go for the self-studying option... again :).
  3. Online game design degree

    @Gian-Reto: Good point about small courses at university and not going for a full degree. I will try to get information around my country (I'm from Spain).   Cheers.
  4. Online game design degree

    Hi,   Thanks for bringing your point of view to the table. I agree with some parts of your answer. Perhaps, a degree is not the best thing to learn the meat of what I want.   The main problem, is that I have a day job that eats 8 hours of my "awake time". Then I have some other duties like my child, etc... So, I don't have time to waste trying to look around for the information I need , sort it in a sensible way and then learn it. The main problem with the information on the internet is that it is scattered around, there is not a defined path to learn about something. You have to look for the information, process it , get rid of the one that is not what you are looking for, etc.   What I am really seeking is material that will keep me focused on the subject to learn with some kind of exercises, etc... to prove I'm understanding and correctly applying the concepts, etc. I think this is something really difficult to get if you do not apply for a university degree or something like that.   Anyway, I could be wrong so, I'm opened to any suggestion.   Cheers.
  5. Hi!   I'm a developer that has been creating games for more than 15 years. Now, I feel the need to leave the techy side and get into game design. Mainly because I feel not comfortable when I try to come up with good designs for my own games.   I would like to know if there exist any reputable online degree on game design that could help me  build up and improve skills in this subject.   Thanks in advance.
  6. Hi,   Yes I have profiled it. The main problem is the bus bottleneck. Uploading & downloading the texture every 0.1 seconds (this is the delay time I have set for adding new points to a line when drawing) is pretty slow on mobile. This is why I thought about the tiling solution.   On the other hand, I was thinking about doing the flood fill by the cpu because I guessed it could be hard to implement / debug on gpu and I don't mind if it takes a little time to do it and upload the texture to the gpu. The main constraint is found when painting / deleting with the finger. This has to be smooth.   So, do you recomend going with the image tiling solution istead of the GPU one?   P.D: Let me explain the conclusions I have come across while reading about shaders and trying to apply them to my project:   1) Drawing seems simple. I could just make the shader draw the selected brush on a texture I would reserve for the painting without cleaning it every frame and I think everything would work. This texture will then be applied to a cuad covering all screen space. 2) Flood fill. I would do this as I told you using the CPU instead of the gpu. 3) Erasing: This is something I don't know how to do. Perhaps just lowering the alpha of the pixels I want to delete could do the trick? 4) Undo/Redo:     - When undoing and redoing I could keep  a list of the lines used for painting or deleting and redo or undo the action. For example, if it is a deletion and I want to redo I would apply the alpha changing values to the positions uploaded to the gpu that represent the path points the user draw while deleting. For the flood fill actions... they will agin be undo/redo on the cpu.   Obviously for 1,3 and 4 I would need a line drawing algorithm on gpu. Don't really know if all mobile devices can do this.   What do you think?   Cheers.
  7. Hi, I have been playing around with a CPU implementation of a painting application. The tools I want to implement are pretty basic paint, floodfill, eraser and do/redo. My platform is android so I'm using opengl-es.   My implementation is pretty  slow when using large images because CPU/GPU work is not balanced and we have the always dreaded  bus bottleneck when downloading/uploading textures. I could try to implement some kind of "Tiled" implementation to split the canvas I want to draw on in smaller textures and consume gpu bandwith in a more optimized way but I think it is time to start learning a bit about how to do this on the gpu.   Could anyone be so kind to point me in the right direction here? I don't want/need the exact implementation but some guidelines on how to implement this tools. Paint seems to be pretty straightforward. I think I could use my drawing line code to generate geometry for my lines, but for example, how could I implement the eraser tool? I guess some kind of black shading program magic could do the work, but again I'm lost on this subject.   Come'n guys let's discuss best techniques to build this little app.   Cheers.
  8. Component-Entity game design issue

    Hi!,   Really good explanation and ideas about the component system model. I have a doubt though. Everyone says that components must not rely on other components.  The problem is that components ussually need data from other components. An example is the animated mesh & animation controller component you exposed before. In this example, both components are really tied. Others examples not so simple are for example the data that must share an animation controller component with a physics component becuase physics are driving the animation, the Brain component with the animation system, etc... One big global dependency is the Frame component or Transfrom. I have seen this one being integrated in the "container" object because it is used a lot, so, it is accesed by almost all components.   Would you mind recomending what to do in this cases? Because get the needed components from the current component and check if they exist or not doesn't seem good.   Thanks in advance.
  9. Hi!,       Yes, you're right I missed to defien the virtual destructor in the interface. About the single inheritance, Which class are you refering to here? I think this is exactly what I have done. haven't I? GameObjects like ZombieBunny inherit directly from IPoolable interface. ObjectPool from IObjectPool interface. Am I missing something?       Well, you are right that the pool can be mainly seen as a wrapped container but it does a bit more work, for example it  makes the container grow if more objects are needed.It limits maximum number of instances (this has not been implemeted but the intention can be found in the init() signature ). This is why I created the Object Pool class.       This is a good point. Could you elaborate a bit more how would you use the Adapter pattern here? I have used this pattern to adapt an interface to another, can't see the relationship in this example. On the other hand I'm interested in that sentence "Any class named Manager is instantly suspect". Do you mean that it doesn't give any good information about what it does? For me PoolManager is different from PoolContainer. PoolManager is something that get ownership over created pools and is the responsible of deletion, etc... PoolContainer is just something that contains pools without any more logic about them. This is why it is called PoolManager .   Sorry to be so picky but I like to discuss this kind of things and understand other's point of view. Cheers.
  10. Thanks for the tips achild.   Think about this post as an exercise I was doing to refresh my C++. Just wanted to know if there could be some design flaws or better ways to achieve same result with a different design using C++   Sorry for the confusion.
  11. Hi,   I will try to answer your question: I'm designing this that way because I'm trying to mimic a pool manager I had in C# and Java. These languages base their allocations in the heap and there's no access to low level memory management methods/functions.   I know the weakness of my aproach related to memory management. Anyway, for the kind of games I'm trying to do I don't mind creating x objects at the beginning an reuse them for the different game objects I may have. As you suggested, This solution is not cache friendly either, etc... But what I really was expecting was someone to bring some ideas to improve the design of the system (as it is). For example improving the interface, removing dynamic_casts, etc... because I need to refresh my c++ and I'm not 100% confident about my code.   Summarizing: I know this is not best way to do pooling. I just was trying to build a system with this dependencies among classes and interface (As an example).If I were going to create a pooling system now, I would create it around a std::vector that provides contiguos memory and would create a Factory for that knew the differents game objects that I need to pool to avoid map lookup, etc... But this was not my question. You were right about your critics though and I accept them .   Edit: So, to clear things up, is there a better way to aproach this system in a better way (not making pooling more eficient) but making the interface simpler, avoiding dynamic_casts, etc...?   Cheers.
  12. Hi,   I spent today playing with object pools in C++ and got to a solution that works but have little quirks. I would like to hear opinions from other pals about this design (not if the pooling is efficient or not, but the system structure) based in some requisites I imposed at first. This are:   1) I want a centralized place for managing my object pools 2) I want my object pool to be a template. 3) As I want to have a pool manager and my pool class is templatized I need a class to inherit from. This class must be the an interface and must have 3 methods. init, newObject and deleteObject.   What I don't like from the solution I'm providing is the dynamic_casts I must do to create and object and to return an object to the pool. This is mainly the main problem I see. Another thing I don't like but I think that there's no solution (beside providing a custom allocator in the init method) is that Object pools and PoolMgr rely on some static methods that the IPoolables must implement like getClassId() and create(). What I don't like is that there's no information in the interfaces to force the user to implement in the specific classes.   Think that all this code has been written in a little rush while I was designing so it could contain bugs. I'm just interested in the idea, ussability and how classes play.   Well here is my solution. If anyone could give any idea, different aproach, or confirm you like it (I doubt it ) I would be really happy.     #IPoolable interface //IPoolable class. All objects that want to be pooled must inherit from this class IPoolable { public: virtual void reset() = 0; virtual void create() = 0; }; # ObjectPool interface class IObjectPool { public:     virtual void init(unsigned int initialCapacity, unsigned int chunkSize, unsigned int maxCapacity)=0;     virtual void deleteObj(IPoolable* obj)=0;     virtual IPoolable* newObj()=0; }; #ObjectPool //Object pool that contains specific IPoolables template <typename T> class ObjectPool : public IObjectPool { public: ObjectPool() { CCLOG("CocosObjectPool created..."); } ~ObjectPool() { CCLOG("CocosObjectPool destroyed..."); } virtual void init(unsigned int initialCapacity, unsigned int chunkSize, unsigned int maxCapacity); virtual void deleteObj(IPoolable* obj); virtual IPoolable* newObj(); protected: private: void _GrowStack(int growSize); private: int _initialCapacity=0; int _maxCapacity=0; int _chunkSize = 0; std::queue<T*> _objects; }; template <typename T> void ObjectPool<T>::init(unsigned int initialCapacity, unsigned int chunkSize, unsigned int maxCapacity) { _initialCapacity = initialCapacity; _chunkSize = chunkSize; _maxCapacity = maxCapacity; if (_initialCapacity != 0) { _GrowStack(initialCapacity); } } template <typename T> void ObjectPool<T>::_GrowStack(int growSize) { for (int i = 0; i < growSize; ++i) { _objects.push(T::create()); } } template <typename T> void ObjectPool<T>::deleteObj(IPoolable* obj) { T* t = dynamic_cast<T*>(obj); _objects.push(t); } template <typename T> IPoolable* ObjectPool<T>::newObj() { if (_objects.size() == 0) _GrowStack(_chunkSize); T* obj = _objects.front(); _objects.pop(); return obj; } #PoolMgr //PoolMgr class PoolMgr { public: PoolMgr(){}; virtual ~PoolMgr(){}; void init(){}; template <typename T> void registerType(unsigned int initialCapacity, unsigned int chunkSize, unsigned int maxCapacity); template <typename T> T* createObj(); template <typename T> void deleteObj(IPoolable* obj); protected: private: std::map<size_t, unique_ptr<IObjectPool>> _pools; }; template <typename T> void PoolMgr::registerType(unsigned int initialCapacity, unsigned int chunkSize, unsigned int maxCapacity) { unique_ptr<ObjectPool<T>> op(new ObjectPool<T>()); op->init(initialCapacity,chunkSize,maxCapacity); _pools.insert(make_pair(T::getClassId(), std::move(op))); } template <typename T> T* PoolMgr::createObj() { auto it = _pools.find(T::getClassId()); return dynamic_cast<T*> ( it->second->newObj() ); } template <typename T> void PoolMgr::deleteObj(IPoolable* obj) { auto it = _pools.find(T::getClassId()); return it->second->deleteObj(obj); } This is how it is used from client code: using namespace FosforeEngine; //Using Pool manager FosforeEngine::PoolMgr* poolMgr = new FosforeEngine::PoolMgr(); poolMgr->registerType<ZombieBunny>(5,5,10); ZombieBunny* bunny = poolMgr->createObj<ZombieBunny>(); //Without registering the pool to a pool manager ObjectPool<ZombieBunny>* objectPool = new ObjectPool<ZombieBunny>(); objectPool->init(5, 5, 10); ZombieBunny* zombie=dynamic_cast<ZombieBunny*>(objectPool->newObj()); objectPool->deleteObj(zombie); Well here you are, sorry for the long post.   Cheers.
  13. Thanks for all the answers. Very informative.
  14. Thanks, good answer.   More or less this is the way I was explaining. The problem with a single vector is reallocation handling. This is why I suggested to use an array of pools. This way reallocs of vectors won't be proced.   Cheers.
  15. I'm inclined to move that to an external system instead of putting in the related class type.   Could you explain a bit how your system work? I was thinking about implementing something simple based on std::vector. I mean allocating for example vectors of 10 or 20 objects on demand. This way I would not  get too deep into this difficult subject and would get rid of reallocation problems ivalidating all previously created pointers.   Cheers.