Jump to content
  • Advertisement

hyyou

Member
  • Content count

    53
  • Joined

  • Last visited

Community Reputation

225 Neutral

About hyyou

  • Rank
    Member

Personal Information

  • Role
    3D Animator
  • Interests
    Programming
  1. Thank Hodgman! Are there any feature of Bullet that you like but not exist in PhysX (except those related to legal/license/fee)? Did you use much time to port your code from Bullet to PhysX?
  2. Do you happen to know any Physic Engine that is not bad in such situation?
  3. I have a game loop in Entity-Component-System architecture (heavily simplified) :- spawn some enemy Turret, only in some timesteps; every Turret : try to shoot -> create new Bullet(); every Bullet : destroy itself if lifeTime = 0; every Turret : destroy itself if hp = 0; entity_component_system->cleanUpAsNeed(); It works, but to make it complete, I am supposed to delete entity at the last time step myself. Thus, I add many condition involving ☁lastFrame☁ :- if(!☁lastFrame☁ ) spawn some enemy Turret, only in some timesteps; if(!☁lastFrame☁) every Turret : try to shoot -> create new Bullet(); every Bullet : destroy itself if (lifeTime = 0 || ☁lastFrame☁); every Turret : destroy itself if (hp = 0 || ☁lastFrame☁); entity_component_system->cleanUpAsNeed(); It works but it is very dirty and error-prone. I imagine that this will also happen when room/scene changes. How to solve it elegantly? How do good games solve this problem typically? Are there any related "design pattern" I should read? Is it already OK, i.e. am I too nervous? Some days, I had nightmare because of it .... ... a nightmare that my code become ☁lastFrame☁-flavor spaghetti.
  4. That totally sounds reasonable, thank.
  5. Thank. As a follow-up question, assume a below situation :- Mr.B1,B2,B3,..., and Mr.B1000 signs contract to use a game engine from Mr.C. In the contract, Mr.C get 10% of revenue of every game that Mr.Bx developed using the game engine. Mr.C send header files and .lib to every Mr.B via email. Some Bs successfully deployed the game and paid C, but some Bs abandoned and used other engines instead. However, B1 is different from other Bs. Using C's game engine, B1 has developed a game without any collaborator. (^ Thus evidence is very hard to find.) After finishing the game, Mr.B1 wanted to cheat. Mr.B1 obfuscated C's header and .lib, and sell a game using the engine without paying C. Furthermore, Mr.B1 accidentally leaked C's obfuscated game engine in the internet. A random Mr.D found the copy. Mr.D knew that it is actually C's, but decided to use it. It is free. How can C detect such case? It is practically impossible to detect, right? Reason :- C can't access to source of every game in the market, including B1's game and D's game. Suppose that C can, there are a lot of game sold every day! If C's engine is also open-sourced (not free; it is like some contract of Unity/Unreal; easier to obfuscate), possibility to detect is almost zero. Correct?
  6. Questions :- To sell a C++ game library/framework/engine, does it usually have to be open-sourced? For a C++ template class (real template), it is quite hard not to be open-sourced, correct? If it is open-sourced, how to protect the copyright? How to enforce people to just use it, but not copy? ... I think it is practically very hard, because people can see the source code, and "rewrite" it. Does a shop like Unity's asset store make thing safer? If so, how? Arrogant assumption :- The game library/framework/engine is high-quality, well-documented, and it would be marvellously sell well. Besides some free libraries like Bullet and Ogre, it is developed all by myself. The library/framework/engine is not bound to any legal obligation (e.g. the most restriction is MIT). I have these questions after reading a news :- Muhagames develop a game named Thea Awakening (C#). The company use its own Honey Hex Framework (C#) as a library to develop the game. The company sell Honey Hex Framework via Unity's asset store to boost its financial position. There are also others old examples e.g. Unity itself or Unreal, which is now open-source ... How do they protect it? Actually, I don't plan to sell any library. I am just curious.
  7. hyyou

    Writer looking for team

    If only you show your previous works ...
  8. I am trying to encapsulate a Physics Engine (to support fracturing). I want to know whether my below semantic is bad smell. [Approach 1] My current design is :- Programmer can create 2 types of Physics body : Parent, and Child Parent is a body that can't have any shape or mass, but can contain some Parents or Children. Child is a body that can't contain any other physic body, it always has shape and mass. For the implementation :- Both Parent and Child are inherite d from a class PhysicBody. PhysicBody has some fields. One of them is mass, as an example. Mass of a Parent is the total mass of every children. Mass of a Child is the mass of itself. Suppose that I want to simulate a jar that can explode into several pieces. I will :- Create a Parent named x Create many Child that denote fractures e.g. y1 y2 y3. x.add(y1); x.add(y2); x.add(y3); The steps are very similar to BulletPhysics's. So far, it works well in all demos. Coding is easy and fun. Today, I want to implement a tank like this :- (a crappy tank shown in top-view) Here is how it can be created :- x is a Child : x = createCube(); y is a Child : y = createSphere(); z is a Child : z = createCylinder(); p is a Parent : p.add(x); p.add(y); p.add(z); It works, but I think it is counter-intuitive :- The tank is p which is an relatively (too) abstract physic body. [Approach 2] Thus, I plan to make it like :- x = createCube() y = createSphere(); x.add(y); z = createCylinder(); z.add(y); The new sematic demand me to re-design Physics class, e.g. to be :- Old parent and child will become the same type - all of them can now has shape, mass and contain children! I think it would work well, but I am still too scared. Question Is it make sense to allow non-empty physic body to contain some other physic bodies? Are Approach 1 and Approach 2 bad designs? Can Approach 2 be considered an improvement? Did you spot something (potentially) wrong? How to improve it? Am I a problem myself?
  9. Hi! From the video, It looks like a demo-reel of a game engine / pre-alpha of a game. The mentioned idea and graphic is similar to many games in the genre. Thus, it depends how well it is executed. Hope to see more progress when it is more done.
  10. I don't know much about the "commandblocks", but .... Here is an opensource Minecraft-like game engine (Terasology) I found several months ago :- https://github.com/MovingBlocks/Terasology/wiki/Entity-System-Architecture Here is a related discussion about it :- http://forum.terasology.org/threads/block-entity-behavior.792/
  11. hyyou

    3d Physics and 2d Game-objects

    I mean ... Do you want a thing like this :- ? If so, use an external physic engine (e.g. Box2D) would probably be more suitable. If you just want a thing like :- It is not so hard to write physic engine yourself. (But I will still use Box2D for this case.) Just a random concern : AABB is not the hardest part of a general-purpose Physics engine. There are a lot of different way to do it. It depends on format of your 3D transform and 2D transform ... and your taste. First, let try your approach. It is not hard. You probably don't need any transform matrix to do that. If you face any specific difficulty about it, feel free to ask more.
  12. hyyou

    3d Physics and 2d Game-objects

    It doesn't sound bad. Ray-cast is not so hard to code either - I believe it is a correct approach.. Is it your own game engine, and what is the physics engine that you selected? Will you implement the Physics yourself? .... Beware that if you happen to need proper collision response (bouncing cube , not snap to grid), it can take a lot of time and there are a lot of problems on the ways. I am not sure what you mean. Is 4x4 matrix OK for you?
  13. I never thought of this approach. Yes, Bullet doesn't support it, but it is possible and not too hard. Thank!
  14. Thank you everyone for many useful advises. Thank. It is my "default" mindset. I had implemented like this. It is very easy to understand and debug. However, in some rare cases (10% for me), the deletion is required to be delayed. For Bullet physics engine, it is the best to invoke collision callback in a batch manner. - update game logic --- MARK delete a rocket - propagate the MARK to physic object - update physic --- collision callback -> discover that the manifold between ... ... physic object p1-vs-p2 is no longer exist -> invoke Physic::collisionEnd(p1->userData,p2->userData) - delete every thing that was MARK-ed I believe that the correct approach is to delay to deletion of everything. Otherwise, the p1 can be a dangling pointer. It is also very handy to know for sure that p1->userData (which is Rocket instance) is not a dangling pointer. Thus, I adopt the "delay deletion" practice into everything. An alternative simpler approach is to let a system that handle rocket 1.broadcast and 2.invoke object deletion manually (like your example), but I prefer a more automatic way. I am not sure how game engine should support ownership relation that need the delay. I may think too much. The question makes me reconsider about many things. Thank. I am using semantic like this. It has run-time assertion. I am OK about it, but not sure if it is good :- relation_ownership->add(rocket, physicTriangle); relation_ownership->add(rocket, graphicWing); relation_ownership->add(rocket, barrier); relation_ownership->add(barrier, graphicLightSphere); I try to avoid share_pointer, because it is quite notorious - hard to debug / circle reference / slow. I also don't need it because I know the clear ownership.
  • 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!