Jump to content

f13rce

Members
  • Posts

    510
  • Joined

  • Last visited

Everything posted by f13rce

  1. This problem sounds familiar, had it once when I was using source control with Leadwerks projects where the Leadwerks directory was different on my other machine. Check out the PropertySheets.props file in the "PROJECTNAME/Projects/Windows/" folder (you can open it with notepad). You can check if the file paths are correct (for tags LeadwerksHeaderPath and LeadwerksLibPath). If not you can edit them and restart Visual Studio - that should do the trick.
  2. f13rce

    Relocation

    I don't really know anything about the locations you want to move to but I hope you will find a place that suits you. Big cities usually give more way more stress as there is noise all the time. Although smaller places can have less connectivity with the industry you're focusing on. Fortunately you still have the freedom to locate wherever you want
  3. f13rce

    sync

    Setting it to true enables VSync. This means that you will not have any screen tearing, but the FramesPerSecond counter will not raise above the maximum amount of Hertz that the monitor can take (usually 60). The consequence is that it's harder to do optimizations, as you might not know the exact amount of FPS in certain situations. Both are fine for performance. Although, I'd recommend VSync enabled as it prevents screen tearing.
  4. Debugging might be enabled, which slows the game down but gives you specific information when the application crashes (like how and where it crashed). Before you make a build in Visual Studio, try putting it from "Debug" to "Release". Maybe that helps
  5. I can confirm this. I also use C++ and load assets like model = Model::Load("./Models/model.mdl"). After publishing your game, all of your assets are in a zip and password protected.
  6. This is debugging without the major FPS drop, just sometimes not as accurate.
  7. Are you using Visual Studio? I found a workaround but it might not always be 100% accurate: Open up Visual Studio Select 'Release' instead of 'Debug' Click Project -> [ProjectName] Properties (a new window should pop up) Open up "Configuration Properties" Open up "Linker" Click on "Debugging" inside Linker Change "Generate Debug Info" to "Yes (/DEBUG)" What this does it that the program will remember the flow of the application so when it crashes/reaches a breakpoint, you can still see where it came from. Although, because this is on Release mode, anyone who has your .exe can read your source code. So remember to disable the generation of debug info when you release your game or give it to your friends.
  8. Congrats Josh! Glad too see it working out for you
  9. Try something like this after calling Point: Vec3 newRot = self.entity:GetRotation(true) self.enitity:SetRotation( Vec3( newRot.x, -newRot.y, newRot.z ), true) This will negate the Y rotation for you. If this rotates the turret on the wrong axis then you can try adding a - before newRot.x or newRot.z.
  10. You can try to disable player movement while it's doing the animation. Having a boolean to check whether the player can move or not should do the trick here.
  11. Instead of drawing on the mouse you can try to draw it on the center of the window width and height. This way it will be drawn from the center. Simply use window->GetWidth() / 2 and window->GetHeight() / 2
  12. Assuming you're loading stuff in one big chunk, you can do something like: Texture *background = Texture::Load("./path"); context->SetColor(Vec4(1)); context->DrawTexture(background); context->DrawText("Loading...", 25, 25); context->Sync(); LoadAssets(); But if you want to have a progress bar for loading, you can seperate the loading part into functions like LoadModel(std::string path) and do: void LoadModel(std::string path) { models[ modelIndex ] = LoadModel(path); modelIndex += 1; RedrawScreen(); } void RedrawScreen() { itemsLoaded += 1; // Draw background here context->DrawRect(startX, startY, barLength / totalItems * itemsLoaded, barHeight); context->Sync(); } With the above code I'm assuming you pre-load your assets in a class where you can retrieve them from later. You could make the class static so that every class can reach it without having a reference, but that's kinda ugly
  13. Maybe you're still calling peasant->GetPosition(), peasant->SetRotation() or anything similar. You can't do that anymore after releasing.
  14. In a grid-based game you might want to skip the navigation of Leadwerks and use an algorithm like A*. It's probably easier in the long run as it is designed for grids. All you need is to make a variable for a tile whether it's walkable or not. The algorithm can do the rest. Also to have physics-like behaviour, you can use forces to move an object instead of using GoToPoint(). If you really want Leadwerks' navigation then you can rebuild navigation on specific positions (if I recall correctly). Then you can keep using GoToPoint() and everything should be working from there. However, building navigation might take some processing time which can freeze your game for the duration.
  15. Btw, are you using the diffuse shader for animated models for your material? The default diffuse shader is for non-animated objects.
  16. f13rce

    Spawning

    I'm not sure if FPSPlayer has this, but can you try to assign its model and/or camera's position and rotation instead?
  17. I don't have Blender, but can you somehow bake the animation on the character? I'd focus on exporting it with FBX first because that's the most reliable option. Also, is this problem occuring as well when you open the FBX in something else like 3DS Max / Maya / another engine? Then you know whether it's Leadwerks or the exporting.
  18. f13rce

    Spawning

    You can try the functions SetRotation and Point. You can also take the pivot it's spawning on and set the player to the rotation of the pivot. You'd have to rotate the pivot to the desired rotation though.
  19. What you can do as well is to create empty pivots in the scene and name them something like SPAWN_ENEMY. Then you can have a C++ class that does something like this: // Pre-define variables we need bool foundNewPivot = false; Entity *e = NULL; // Start the search for every pivot named "SPAWN_ENEMY" do { foundNewPivot = false; // Default on 'not found' e = world->FindEntity("SPAWN_ENEMY"); // Find a pivot named like this if (e != NULL) // If it exists { /* Create an object, in this case an enemy. It is recommended to store enemy in a list (like a vector) so you can update it later */ Enemy *enemy = new Enemy(args); enemy->SetPosition( e->GetPosition() ); enemy->SetRotation( e->GetRotation() ); // enemies.push_back(enemy); // Like this, assuming you made std::vector<Enemy*> enemies before e->SetKeyValue("name", "SPAWN_ENEMY_PROCESSED"); // You can also store this in an array/vector for later use (like respawning). // The reason you need to rename the pivot is that it cannot be found anymore during this loop. foundNewPivot = true; // Keep searching for spawns } } while (foundNewPivot == true); // End this while loop when no new pivot was found You can use this for units, pickups, respawns or anything else you want to do with it.
  20. Whenever you use Map::Load, a new map enters the current existing world. So if you load map1 and map2, both will be merged into the world. Alternatively, you can do something like this: Terrain *mTerrain = Terrain::Create(); And work from there. I haven't seen any documentation of it on the wiki about it though. I'd recommend making a terrain in the editor (as seperate map) if you know what you want for your world.
  21. f13rce

    Vegetation Demo

    Cool, got about 380-450 fps with my GTX 970. But I'm seeing the "pixel flickering" as well on trees far away.
  22. Hmm in that case, you can take the average position of two points (like start and center) and set the height to 75% of the highest value. Then you can repeat this process for other points untill you have a clear curve. Roughly sketched, you'd get something like this Or are you in need of a perfect curve? You could use this method an X amount of times till it looks smooth enough
  23. I have some code laying around from uhm.. a different engine when we were in class and practising this topic. Fortunately I still have the code: Vector3 mvGravity; Vector3 mvInitialVelocity; Vector3 mvVelocity; Vector3 mvInitialPosition; Vector3 mvPosition; float mfBounciness = 1.0f; float mfTimeAtImpact = 0; GameObject mgPivot; // Use this for initialization void Start () { mvVelocity = mvInitialVelocity; mvInitialPosition = mvPosition = transform.position; CalculateLandingPosition(); DisplayTrailPath(); } void CalculateLandingPosition() { mgPivot.transform.position = CalculatePositionAtTime(CalculateLandingTime()); } void DisplayTrailPath() { float landingTime = CalculateLandingTime(); for (float i = 0.0f; i < landingTime; i += Time.fixedDeltaTime) // You use fixed deltatime when it comes to physics { Debug.DrawRay(CalculatePositionAtTime(i), Vector3.up, Color.black, 5); } } float CalculateLandingTime() { // Calculate per second per second return ABCFormula(.5f * mvGravity.y, mvInitialVelocity.y, mvInitialPosition.y)[1]; } Vector3 CalculatePositionAtTime(float afTime) { return .5f * mvGravity * afTime * afTime + mvInitialVelocity * afTime + mvInitialPosition; } Vector3 CalculateVelocityAtTime(float afTime) { return mvGravity * afTime + mvInitialVelocity; } float[] ABCFormula(float A, float B, float C) { float det = B * B - 4 * A * C; if (det < 0) return null; float DetSqrt = Mathf.Sqrt(det); return new float[] { (-B + DetSqrt) / (2*A), (-B - DetSqrt) / (2*A) }; } // Update is called once per frame void FixedUpdate () { // Move ball mvVelocity += mvGravity * Time.fixedDeltaTime; mvPosition += mvVelocity * Time.fixedDeltaTime; transform.position = mvPosition; Debug.DrawRay(transform.position, Vector3.up, Color.blue, CalculateLandingTime()); // Bounce float fYPos = transform.localPosition.y; float fRadius = .5f; if (fYPos - fRadius <= 0) { mvVelocity.y *= -mfBounciness; if (mfTimeAtImpact == 0) { mfTimeAtImpact = Time.time; Debug.Log(Time.time + " seconds"); } } } Which simulated this
  24. f13rce

    Cobra

    Nice try josk... Try to beat it now It could be cool if you could shoot the enemy bullets to protect yourself, the ones going wide are hard to dodge
  25. f13rce

    Cobra

    Cool game Got the highscore with 4400
×
×
  • Create New...