Jump to content

Shard

Members
  • Posts

    293
  • Joined

  • Last visited

Everything posted by Shard

  1. Didn't help. I didn't include RegisterAbstractPath() in my other programs and they work fine and after I included it in my program, the program still crashed. I have not done any updates on my copy of 2.3 since its release.
  2. I'm using Framewerk but when I call this->frameWerk.Create(); the program crashes when it reaches CreateWorld() in engine.cpp and I'm not sure why it does that, even though my other Leadwerks program works fine. What am I doing wrong? Main.cpp #include "engine.h" #include "World.h" int WINAPI WinMain( HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nShowCmd ) { Initialize(); SetAppTitle( "Test" ) ; Graphics( 1024, 768 ) ; World world; // Game loop while( !KeyHit() && !AppTerminate() ) { if( !AppSuspended() ) // We are not in focus! { world.Update(); } } // Done return Terminate() ; } World.h #pragma once #include "engine.h" #include <vector> #include <string> #include <math.h> #include <fstream> //#include <windows.h> using namespace std; #include "framewerk.h" using namespace leadwerks; class World { public: //Framewerk Framewerk frameWerk; char *fileName; World(); void Load(char *fileName); void Update(); }; World.cpp World::World() { //Create this->frameWerk.Create(); //<---- crashes here fileName = new char[_MAX_PATH]; GetCurrentDirectory(MAX_PATH,fileName); strcat(fileName,"\\Default.txt"); Load(fileName); //Collisions HideMouse(); MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2); } void World::Update() { frameWerk.Update(); frameWerk.Render(); //Swap the front and back buffer Flip(); }
  3. I'm new to casting (never done it before). Could you give some example code please?
  4. I've been watching the Raycasting tutorial video and looking over the article and its lead to me a critical question: how do you trace back the entity to a programmer created class? For example, my player controller is inside my Player class, which has his health, jump height, shields, etc in it. When I do a raycast it will give me an entity pointer. Using this, how would I check to see if the entity pointer is my player class or just a random crate? One possible solution would be to compare all my player objects pointers with the pointer result from the raycast to see if they point to the same block of memory but this seems like an awful lot of processing to do. Is there another way?
  5. Shard

    Smooth Zooming

    After about a weeks time to trying to make this work I've come up with nothing that works properly. I hate to have to ask this, but could someone post an example or sample code of how I should be doing it?
  6. Shard

    Smooth Zooming

    After making every component switch by itself, it seemed to work fine until the angle was changed. When facing north, it works just fine. But if I face any other direction, it jumps to the wrong direction. void Switch() { switching = true; TVec3 newPos = cameraPos; cameraPos = EntityPosition(world->frameWerk.GetMain().GetCamera()); newPos.Y += 5; newPos.Z -= 10; if(cameraPos == newPos) { switching = false; } else { cameraPos.X = Curve(cameraPos.X,newPos.X,3); cameraPos.Y = Curve(cameraPos.Y,newPos.Y,3); cameraPos.Z = Curve(cameraPos.Z,newPos.Z,3); PositionEntity(world->frameWerk.GetMain().GetCamera(),cameraPos); } } I think this means that I need to adjust which component I'm changing based on direction, but I have no idea how to do that. Note: This particular piece of code is just supposed to switch between first person and third person. The RTS/FPS switch I will code later by using the same principles.
  7. Shard

    Smooth Zooming

    Curve only takes in a float as its parameters. How would I give it a Vec3() destination coordinates?
  8. Shard

    Smooth Zooming

    For the time being, linear motion is just fine. How do I use the curve? From what I've seen, MoveEntity just sends the camera flying away from the map, not stopping.
  9. Hey guys. Been a while since I've posted. Hope ya'll are having great holidays. So my question is about zooming. In my game, the player can go into overhead view, which allows the camera to fly above the battlefield so that the players can see more of the field. Then they can hit a key and zoom back into their character bodies. While I have the most if it figured out, I'm not sure how to do the transition. Currently, I'm using the code below but that just sends the camera flying away from the screen. Has anyone ever tried this before? What should I do? void Switch() { switching = true; TVec3 newPos = EntityPosition(player->player); cameraPos = EntityPosition(world->frameWerk.GetMain().GetCamera()); newPos.Y += 5; newPos.Z -= 10; if(cameraPos == newPos) { switching = false; } else { MoveEntity(world->frameWerk.GetMain().GetCamera(), Vec3(0,5,10)); } } void Update() { if(switching) { Switch(); } else { //Do other stuff } }
  10. I'm gonna go ahead and contradict you on that one. Facebook is a social networking site. LinkedIn is a professional networking site. On Facebook I talk to friends and family to know what they are up to. On LinkedIn, I talk to industry professionals about what jobs they are offering, what techniques are working these days and whats going to be happening in the industry within the next few days. There is a dedicated section for just jobs that have been posted on LinkedIn. I've already joined the societies like IDGA, Level UP and GameDev. I've already connected to a Lead Designer who has worked at Red Storm, Bungie and now at WB Games, who coincidentally posted for an opening at WB Games. Plus LinkedIn has a who profile sections, which is much like a personal resume that potential employers can look at and even download. As for blogs, I think they are somewhat unprofessional, but that may just be because of the number of nonprofessional blogs out there. My main reason for disliking them is that people have to go to your site to look at your blog, whereas LinkedIn, I could look at your profile as well as someone elses profile all on the same site and I could see how your connected to that person. Ofcourse, none of this means that I will quit using Facebook, its still a portal to my friends and family. But now that I've discovered LinkedIn, it will be my portal to the professional world. -Shard
  11. Does this mean that using this method I would have to tell my AI Manager class how many enemies are around them and if they are within visible range? I ask this because I plan to have more than one "good player", like teammates following the player around. Also, what if I want to check the amount of a character is visible? Like if only an arm or hand is seen, then I want the AI to be suspicious and investigate, etc.
  12. Dear lord does that look confusing. I tried to follow through the code but I ended up getting lost and confused. I'm not sure at which part he does the actual ray casting to check if anything is seen or not.
  13. Hey everyone. So I am working on ray casting for my AI to see whether they can see the player or not and I want to do a three dimensional ray cast so that AI on rooftops, etc, can see the player below and I'm not sure how to implement this without calculating the shape of a cone and then ray casting in the shape of a cone, which would be an extremely expensive operation. Also, I only care about the first thing that they see, so I can compare the results to my player to see if it was my player that the AI saw or not. Any ideas?
  14. Hey everyone. I'm moving on to the next part of my World class which is the Day-Night Cycle. Now I've seen quite a few videos and have a small idea, I haven't seen a tutorial for it or sample code. What I'm guessing I will have to do is create a directional light and rotate it as the day passes, but I'm not sure what to do at night. I'm also unsure about how to create the sun and the moon in the sky to make it look realistic. Also I've tried to make my directional light rotate in code but none of the shadows moved at all so I'm not sure whats up with that. //Creation code PositionEntity(this->sunLight, Vec3(0,1,0)); RotateEntity(this->sunLight,Vec3(10)); //Update code RotateEntity(this->sunLight,Vec3(60),1); Any tips or words of advice before I begin? How do you all implement the day-night cycles?
  15. Thanks Josh. I've tried multiple values but it seems like its not working. If I use 10 for the first value, the shadow quality is perfect but the distance is very short. If I change it to 20, the distance increases but the quality drops. What exactly do these numbers mean? As in what is the first number do and the second number and the third number? I looked it up in the wiki but it only references the BlitzMax code version of it, not Lua/Ini or editor. http://www.leadwerks.com/wiki/index.php?title=SetShadowDistance
  16. Thanks Lazlo. Quick question. Seems like I'm having a little trouble running SSAO. When updating SSAO, I get the following error Unhandled exception at 0x10128026 in MyGame-Debug.exe: 0xC0000005: Access violation reading location 0x00000068. After this piece of code runs: // Render SSAO image if( (ssaoenabled) && (ssaostrength>0) ) { SetBuffer( blurbuffer[0] ); TextureFilter( GetColorBuffer(gbuffer), TEXFILTER_SMOOTH ); DrawEffectSSAO( GetColorBuffer(gbuffer,0), GetDepthBuffer(gbuffer), GetColorBuffer(gbuffer,1) ); BindTexture( GetColorBuffer( blurbuffer[0],0), 11 ); //<=============================================================Here } And breaks to this line: inline void BindTexture(TTexture texture, int texunit) { leBindTexture(texture, texunit); } Why is it doing that?
  17. Hey all. So I just discovered Framewerk and I have to say that I am excited. It gives me the ability to do a lot more game programming than setup programming although I won't be relying on it solely. I plan to combine it with my own Framework. Do you have any tips/advice for me? Also are there any [planned] tutorials for this?
  18. Thanks Marley! And no troubles macklebee. It looks good now. I do have another question: shadows have different qualities that they switch between, the high and the low. Which value can I change so that the switch between low-high happens at a further distance? Right now I can move and see the change happen and it looks kinda bad.
  19. Hey everyone. This is a continuation of the previous thread to a more specific question: Shadows Not Rendering Correctly. http://leadwerks.com/werkspace/index.php?/topic/287-24-lights-not-loading/ Video of Problem: http://www.youtube.com/watch?v=G6yd85tgP70 I'm not sure if this is a code error on my part or the engine because I recall the engine demo that I downloaded doing some strange things with shadows too. Directional Light Ini File classname=light_directional color=255,255,255,255 intensity=1 range=10 resolution=2 linearoffset=0.31,0.4,0.7 shadowdistance=6.0,20.0,100.0 inversesquarefalloff=1 From the sbx Model { path="light_directional.gmf" position=19.9999981,54.0000000,-82.9999924 rotation=55.0000076,-179.999985,179.999985 scale=0.999999881,1.00000036,1.00000036 id=328282888 "class"="Model" "classname"="light_directional" "intensity"="1" "inversesquarefalloff"="1" "linearoffset"="0.31,0.4,0.7" "name"="directional_2" "range"="10" "reloadafterscript"="1" "resolution"="2" "shadowdistance"="6.0,20.0,100.0" }
  20. I did exactly as that code said but the directional light didn't appear until I created the ini file. The problem now is figuring out why the shadows are doing what they are doing. http://www.youtube.com/watch?v=G6yd85tgP70
  21. Can I get an example of the values you generally use?
  22. Hahah, definitely. I'm not the artist of our team so I focus mostly on code and since the stuff hasn't been working, I figured it was on my end I do agree with you though, I should really be as easy as LoadScene(); and thats what I'm trying to figure how to do. Hopefully with this new knowledge of the ini files, I can make all my objects more modularized.
  23. Ah, excellent. That makes much more sense now. So if I set default values in the ini files, can I still override them in code?
  24. Thanks, macklebee. After doing as you said, I ran the program and got a shadow rendering error which a Frapped for you: http://www.youtube.com/watch?v=G6yd85tgP70
×
×
  • Create New...