• Advertisement

Psilobe

Member
  • Content count

    71
  • Joined

  • Last visited

Community Reputation

193 Neutral

About Psilobe

  • Rank
    Member
  1. I'm using unity combined with c# but I'm having trouble with navigating the hierarchy from within my scripts to get access to specific components.   For example my hierarchy looks like this:     Ship    Box01    Box02      Cylinder02    Cylinder01    Main Camera     Box02 got a component in which needs access to the camera component in the Main Camera.    I've figured that what I need to do should be to somehow navigate to the Main Camera gameObject and then use the getComponent function but I'm not sure how to do it. I tried getting to the Ship gameObject by using transform.parent but that didn't seem to work.   I've been trying to find a good resource which explains this but I cant find one.     I finally found something that helped me.   http://answers.unity3d.com/questions/125847/trouble-accessing-child.html   The first answer here helped my immensely so if anyone else runs in to similar trouble then go here.
  2. Interesting. At first I thought using csg for this would be a good idea but as it would seem that implementing csg from scratch would be out of the question because it would probably take too much time. But experimenting with this using a ready made library might be a fun thing to do if I have the time sometime.   That last article was really interesting and took up several interesting topics, thanks!
  3. HI I'm considering different ways to implementing mesh fragmentation. One example would be fracture in the unreal engine. I've found a few interesting reads about this using vornoi.   http://www.joesfer.com/?p=60 https://sites.google.com/site/shusenliuspage/course-work/voronoi-based-shatter-effects   One approach was intersecting the object with a plane, displace a few vertexes on the plane and cut the mesh using it. Creating multiple planes and rotating them would resulting in several fragments.   I'm not very well traversed in graphics but I also came upon constructive solid geometry and figured that using intersection operations could result in a fragmented mesh.   I was something something along the lines that first you separate all/some of the faces of the mesh from each other or rather create copies of these. Then you extrude these inwards. Then using different CSG operations you create the fragments using intersection operations and kinda carve out the original mesh. And to avoid too much fragmentation you only carve from the original and not the fragments so that even if the extruded faces would overlap at times this would not result in extra fragmentation.   I'm curious if this could work? One problem I foresee is if you have a rectangle mesh it wouldn't produce very interesting results but if you subdivided the mesh first and then pick the order of faces to intersect at random it could produce better results.      
  4. How does Google know about my GameDev.net profile?

    Does Google Chrome gather any "extra" information? Also doesnt google use bots, crawlers, zerglings etc... to gather information even if you are avoid their services like the scourge? This discussions got me thinking, is it possible to avoid directed adds and lessen the data gathering by using vpn or tor?
  5. What coding do you do outside of video games?

    I started coding to solve the problems found at project euler and I've written a simple chat program to learn networking. Simple encryption/decryption programs. I love data compression and written programs for doing this.
  6. Is it worth investing time to learn 3D modeling.

    Once you get the hang of the basics in any modeling program it's easy to do quite a lot. Generally it's the simple tools you use the most, or I do.   It's fun and addicting but just like MarkS I just can't get the hang of organic modeling. Anyway you should try it, if not just for the fun.
  7. Game from Scratch ? C++

    Learning a language is important but what is even more so is that you understand different programming principles. Functions, variables, comparisons, operators, containers, loops etc. I suggest starting with writing small programs that do different things, not just games. Find different ways to manipulate data. Find and solve your own small problems. Try to implement a basic sorting algorithm, that sort of stuff. When it comes to simple games that doesn't require anything fancy I generally divide the code in to three parts. Input, read user input and handle it accordingly. Update, update the game state accordingly to the game rules. Drawing, draw everything to the screen. If I want to put together a simple game I just need to figure out how to represent the game state and then fill in these three functions.
  8. Can relate to this subject quite a lot. My motivation always seem to wander away. Sometimes I realize that my design was faulty and the game isn't fun which require reworking the design. Or I come up with another game idea I want to explore. I work alone so I also usually derail when I cant create the sounds/graphics I want or lack of encouragement. To counter this I've started to document my ideas much more before staring working on them. Creating some concept art work to go as well as deeper analysis of the idea and where the fun is. Even if I abandon a project I still got the idea and work I've put in if I wish to continue or revive the idea at a later point. I've also started refraining from jumping the gun and start coding without some rough sketch of the code and how to handle everything. This has also resulted in better quality of my games as well as much more reusable code/design. Solid code is easier to change which also helps preventing abandonment of the project because I cant be bothered to redo what I've already done. Having some design sketches also makes it easier to go back to an old project since you don't have to remember all the details about it. And last but not least I've started to work a bit more with a few friends, getting help bouncing ideas and getting graphics done. This also helps with the motivation part.
  9. Newbie with questions!

    I must recommend sfml. I love it, it's easy to set up and use and you can do a lot with it. SDL always gave me a headache when I used it but with sfml everything is so straightforward. It also got an easy to use system for sound and networking.
  10. I don't want to swap the entire content of the vectors just up to a certain point. Ex, if I got 50 elements in both vectors i might want to swap the first 25.
  11. I'm curios about swapping data between two vectors and what will happen in the following code. Will the switch affect both vectors or just the one calling swap()? [CODE] std::vector<bool>::iterator i; std::vector<bool>::iterator j; j = b.begin(); for(i = a.begin();i != a.end();i++) { a.swap(i,j); j++; } [/CODE]
  12. I'm trying to teach a neural network to play pong and so far it's not going very well. I'm using supervised training where I play against myself and every time I move the pad that the AI is going to use I save away some data and when I decide I've gathered enough data I use that for the training. The data I save away is the balls x,y position as well as ball direction x and y. The y position of the pad. This is what I use for input. If the pad moves up then I set target outputs for the two output neurons to 1 and 0 and if I move down I set it to 0 and 1. Its a feed forward network and so far the best results has been that if the ball is moving downwards the AI moves downwards and the ball goes upwards the pad moves upwards. But it wont take in consideration of the balls current position meaning that the pad moves either towards the bottom or the top of the screen.
  13. Lua troubles

    nox_pp I've also found that site when searching for info. Anyway thanks, got it to work after switching place with luaL_dofile() and init() and changed the number of arguments. I thought there were three arguments since the c++ function I want to call from lua takes three arguments bat the call was for the lua function which only took one. And I needed the lua function to deliver a class pointer as argument when calling my spawn function from lua. So a big thanks to you! [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img]
  14. There seems to be a bug when you add cpp code to a post. All code after << disappears. Noticed this after two sections of code I posted when blank. First after std::cout<<"whatever" and std::cerr<<"sumtingwong". Both sections just showed std::cout and std::cerr and all subsequent code went missing. Example: [source lang="cpp"]std::cout<<"Rawr"<<std::endl;[/source] inside my source tags I wrote std::cout<<"Rawr"<<std::endl; but only the first was there Another example: [source lang="cpp"]Trollol << wrong[/source] Here I wrote Trollol << wrong
  15. Lua troubles

    Here is the rest of the code, somehow it won t show everything in the op even thou all code is there when I edit. I found a section about lua in one of my books and it seems I'm going the wrong way with this and combines calling a lua function in c++ while at the same time trying to call a c++ function in lua so I'm currently reading up on the subject. [source lang="cpp"]cMap::cMap() { //should be a std::cout here int stack = -1; L = luaL_newstate(); luaL_openlibs(L); typedef int (*lua_CFunction) (lua_State *L); lua_register(L, "spawnTree", spTrWra); init(); luaL_dofile(L,"map.lua"); } void cMap::init() { lua_getglobal(L,"init"); lua_pushlightuserdata(L,this); const int s = -1; if(!lua_isfunction(L,s)) { //another buggy cout } const int a = 3; const int r = 0; lua_call(L,a,r); }[/source]
  • Advertisement