Jump to content
  • Advertisement

All Activity

This stream auto-updates     

  1. Past hour
  2. Karzan

    tilting screen in unity

    Hello Kamal, I dont know much about developing for Android with unity but I have some experience with native Android development. What you want is to utilize the Accelerometer of the device, a quick search lead me to this video which should help you. It is quite simple. https://unity3d.com/pt/learn/tutorials/topics/mobile-touch/accelerometer-input
  3. Gnollrunner

    Share a pointer

    Well just add a level of de-referencing and you would get: #include <iostream> struct A { int **p; A(int **ap) { p = ap; } }; struct Main { int* p; A member1, member2; Main() : p(0), member1(&p), member2(&p) { } void SetVal(int *pVal) { p = pVal; } }; int main() { Main clMain; int *pVal1 = new int(666); clMain.SetVal(pVal1); std::cout << "member1 value = " << **clMain.member1.p << std::endl; std::cout << "member2 value = " << **clMain.member2.p << std::endl << std::endl; int *pVal2 = new int(444); clMain.SetVal(pVal2); std::cout << "member1 value = " << **clMain.member1.p << std::endl; std::cout << "member2 value = " << **clMain.member2.p << std::endl; delete pVal1; delete pVal2; return 0; } You can and probably should use smart pointers for this. However I loath the C++ standard library shared_ptr because it creates extra objects you woudn't need if you simply implement a reference counted object base class. This can cause a major performance hit.
  4. mr_tawan

    Share a pointer

    What about using conversion ? https://en.cppreference.com/w/cpp/language/cast_operator
  5. Pilpel

    Assimp bones' relation to nodes

    So what's the deal with the bones that don't have corresponding nodes?
  6. Kamal Wafi

    tilting screen in unity

    Hi there, i recently start learning unity and im working in my first game , I was wondering if unity had functions to support the motion control effect (tilting screen to move character) you see in doodle jump (which is 2d game) ? If it exists, what are they called? and how it works ? Thanks
  7. GWDev

    Hello, new here.

    Hi Wild dog, depending on your knowledge of Python you could start by making some small games without any graphics or pick a game engine / framework with python support. Pygame and Panda3D come to mind, but there are probably a lot more available. Blender had a python game engine, but removed it with version 2.8. Just pick one that's still maintained and has a good documentation / tutorials. Start with a small game and if you have questions, you can ask them here and people will be able to help you.
  8. I've never heard it called that, but yes, that seems roughly equivalent to an Entity/Component system.
  9. _WeirdCat_

    Share a pointer

    Well, welll.... hmmm............. Not to mention i cant properly edit my post above so ill leave it like it is now... But subclass wont be derived from mainclass, thats not going to happen, i only made an example which is not the exact tthing i have if you really need to know main class is TMainFramework class which is of class TGLForm which is of class TVCLComponent which is of class TPhysicalElement<float, float, float, float, float> And it stores a list of forms 6 side projection forms and one perspective projection forms which are the type of TGLForm which is of type of... and so on so its irrevelant. Anyway in main class i used an int * p; description which is actually model3f * face_model; anyway this doesnt matter Since i would like to create a pointer in main class from the subclass i call it So if subclass has int ** p; And during initialization (in subclass space) i call (*subclass.p) = mainclass.p; Where before anything happens like initialization mainclass int * p is set to be 0. I would rather want to stay like it is unless i will have no chocie and have to change it. So (*subclass.p) = mainclass.p; for me it seems like i dereference an unknown address and try to make it 0; However in some other subclass code i would like to do something like (*p) = new int();//new model3f(); So int * p in main class points to that newly created var, And int **p in that other subclass point to int * p from main class which is now not a 0 butnsomething created.. i hope i described that
  10. @cosmopath Clicking on GDNet chat redirects me to the same page as Community->Chat. From here you need to click discord link and it opens a new tab (requesting login/password). I've never been on Discord here yet, as I personally don't like that software. It may actually behave a bit differently if you have Discord desktop software installed - it may just add you GameDev channel (or ask in browser whether you want to run Discord desktop software). Off Topic: Is that CC in your profile pic?
  11. Today
  12. One more thing: in your test, did all of your pawns calculate a path at the same time? And then all of them updated their paths at the same time after 2 seconds? This is usually not the way it will work in-game. Different pawns will move at different times, so you will have less path calculations at the same time than you have pawns.
  13. 1024

    Assimp bones' relation to nodes

    I don't have code around so I can't tell you for sure, but I believe that for each aiBone there is an aiNode with the same name. An aiNode has a parent and children, so you would need to match bones with nodes and then you can traverse the skeleton through the nodes (and get the corresponding bones from the nodes).
  14. I might be interested. I will be somewhat off until 2nd October (as I noted the internet here may be the problem) - as I'm on holiday (and average hotel connection is not really something you can use to setup a call). As long as the above isn't a problem I'd prefer to stay on VFX side - as I enjoy that kind of work (I'd have just one condition - that some effects could make it here on GameDev in form of an article).
  15. I noticed that when importing animated meshes, the total number of bones (aiBone) in the scene might be less than the total number of nodes (aiNode), so my initial thought was "okay their hierarchies are probably not related.. whatever", but then I noticed that an aiBone object doesn't contain a pointer to a parent bone. So my question is how do I calculate the final matrix palette for the bones, not knowing the hierarchy between them? Edit: I forgot to mention that according to some book I read every joint (bone) must store an index to its parent joint.
  16. stealth1997

    Video game soundtrack

    Hi there! We are an independent heavy metal band and we are working on 2 new songs that we would propose as soundtrack for a video game. A demo version of one of the songs is attached If interested please do get in touch here or at info@stealthattack.it and let us know. mixdown demo 4 del 22_8.mp3
  17. Gnollrunner

    Share a pointer

    First it's always very helpful when you indent your code. You can use the code box button <> to help you out. Second subclass usually means a derived class. So for instance: class A { ...... }; class B : public A { ..... }; So here B is a subclass of A. What you have are two instances of class A which are members of class Main. Of course you can name them subclass1 and subclass2 if you want but there is probably a better choice of names. Finally, I'm not sure where you intend to put the actual integer. All I can see is pointers to integers. You could put the integer in Main itself, like this: struct A { int* p; void init(int * ap) { p = ap; } }; struct Main { int iInt; A subclass1, subclass2; void init() { subclass1.init(&iInt); subclass2.init(&iInt); } }; Now you can actually have a place for your number. Also you might want to use constructors instead of init functions. Sometimes init functions come in handy in odd cases but here you really don't need them. So that gives us: #include <iostream> struct A { int* p; A(int * ap) { p = ap; } }; struct Main { int iInt; A member1, member2; Main(int iVal) : iInt(iVal), member1(&iInt), member2(&iInt) { } }; int main() { Main clMain(666); std::cout << "member1 value = " << *clMain.member1.p << std::endl; std::cout << "member2 value = " << *clMain.member2.p << std::endl << std::endl; clMain.iInt = 444; std::cout << "member1 value = " << *clMain.member1.p << std::endl; std::cout << "member2 value = " << *clMain.member2.p << std::endl; return 0; } Which outputs: member1 value = 666 member2 value = 666 member1 value = 444 member2 value = 444 I'm not really commenting your design here. There might be some better way of doing what you are trying to do.
  18. I'm sure some AI specialists will chime in but some typical things you might want to look at are: spreading the path calculation over multiple frames hierarchical path finding sharing routes between units reusing path information if several are trying to get to the same goal To go further on the FPS not being a good measure, what you also want to avoid is 'frame spikes' where one frame takes a lot longer to complete than others, causing a dropped frame. This can often cause problems with things like AI, where you have a decent frame rate but you get stutters when particular frames do lots of calculations.
  19. 1024

    Hello, new here.

    Hello, you have to ask specific questions to get answers. Just saying "can you help me" is not enough.
  20. Wild dog

    Hello, new here.

    Im excited to learn Game development,but Im learning Python at the moment. Anyway you can help me out
  21. Ok, thanks all of you guys for your advices! I just accidentally googled on "service-oriented architecture", that suggests not to add any behaviour to the Items, but markers what they can do, and, if somebody will use the item it will be passed to the Service class that will handle all behaviour and Item data changes. Is that may be a good choice to handle this kind of problem? Something like this: class InventoryItem { public: bool isEquipable; bool isUsable; string itemName; string dispName; string someData; //Some methods shared across all items //GetUsages(); }; class ItemProcessor { public: //Will pass parameters struct to usage if any such as caller, target or something else. //Probably should be replaced with a map<actionname, actionReference>. static void UseItem(InventoryItem* item,int useIndex,void* usageData) { switch (useIndex) { case 1: UsageOne(item,usageData); return; default: return; } } private: static void UsageOne(InventoryItem* item, void* usageData) { if(!item->isUsable) //and if item contains this usage marker return; //do something item->someData = "NewData"; } }; class PlayerClass { InventoryItem* Inventory = new InventoryItem[5]; void UseItem(int userInput1, int userInput2) { ItemProcessor::UseItem(&Inventory[userInput1],userInput2, nullptr); } };
  22. You said that pawns don't block each other. So, once you calculate and cache a path, it can only become invalid if you build something over it, right? In that case, you don't need to update your path every 2 seconds. Only update the paths when the map changes. Another thing to note is that FPS is not a good measure of performance. Frame time (the inverse of FPS) is a much better metric. For example, if the calculation for one pawn takes 1 millisecond, with one pawn you will have 1000FPS and with two pawns you will have 500FPS. That can make you think that "omg, adding another pawn loses me 500FPS, it's so unoptimized", but that is not the case.
  23. Hello. Sorry that I did not reply for a while. I've been doing this game a very long time. Demo version of point & click adventure "One helluva day" is available on Steam. http://store.steampowered.com/app/603680/One_helluva_day/
  24. so I have 3 classes main class which stores a pointer struct Main { int * p; A subclass1, subclass2; void init() { subclass1.init(p); subclass2.init(p); } }; and two subclasses struct A { int * p; void init(int * ap) { p = ap; } }; Now I would like to create a pointer from subclass1 or subclass2 that will actually create a pointer in Main class, so subclasses can use the same int from main class heres what im trying to achieve in first scenario you see same windows so you see that on phone1 and phone2 theres a blue wireframed object that im trying to share between multiple windows, but when I change projection window I cant see it, so I need a shared pointer https://youtu.be/9HLDsrm7R2w I already messed with int ** p; for subclasses but im missing something (maybe because int * p in main class is 0) and I cant assign it by int ** subp = (*mainclass.p); struct Main { int * p; A subclass1, subclass2; void init() { subclass1.init(p); subclass2.init(p); } }; and two subclasses struct A { int * p; void init(int * ap) { p = ap; } } if someone tells me that I could use shared ptr then I ask him to provide some example code for me cause I never used it and have no xp with it. However pointer to pointer c style would be the best approach for me thus theres something wrong in the code I dont fully understand so far, int * p in main class has to be 0 until its not created by subclass... maybe I somewhere use it where I shouldnt, well I just changed the code from * to ** and just switched from if (p ==0) return; to if ( (*p) == 0) return; etc. but theres few thousands lines I need to check so a short brief of handling such types would be appreciated..
  25. Alberth

    shooting bullets

    It helps if post questions instead of statements, as I cannot given an answer to the latter. Anyway, assuming your plane has an direction of flight and a position, you can use those to compute the path where the bullet should fly.
  26. Hi Vilem, Chrome is slightly slower again but the main issue is we have not optimised the game yet so it will take a long time to load if you are on a slow connection (webGL does not support mobile devices either). We are still in development and i would have preferred not to show the project yet but there is a bit of a catch-22 with getting people involved so we can finish and showing them what we have so they want to get involved. It can very time consuming to optimise early content that may well be changed based on player-feedback. If you are interested in helping us clean the site up or creating VFX for the game, we could have a call where i show you the game in the editor. Otherwise, stay tuned and we will soon be releasing a public Alpha. Thanks
  27. Steven Ford


    Ah ok, never used it myself. Just raw Win32 calls - maybe that's why I've been able to overcome my initial dislike of UWP as it is somewhat nicer than what I've been used to ūüėČ
  1. Load more activity
  • 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!