-
Content Count
362 -
Joined
-
Last visited
Content Type
Marketplace
Profiles
Blogs
Forums
API Reference
Games
Store
Everything posted by tipforeveryone
-
Hmm.. I found out the problem is not Time functions stuff, it is Point() and AllignToAxis() which I used to make character model turn to player position. are they expensive ?
-
please give me an example and yes, single player game
-
Situation: I have 20 enemy characters in a map. Goal: Everytime I fire a weapon, some of enemy who are in range from my position can hear and reaction after a small period of time (ex: 2 seconds - 2000ms) Current solution: Each fire shot calls a function Gun_Sound(), this function will scan all enemy character and if in range, call character's function Sound_Reaction() for (auto it = enemyList.begin(); it != enemyList.end(); it++){ if ((*it)->GetDistance(myPosition) < range){ (*it)->Sound_Reaction(); (*it)->reactionActive = true; (*it)->timeMark = Time::GetCurrent(); } } To simulate "reaction" feature of character, I use this popular method //This function is put in UpdateWorld() of each Character Actor Class void Character::Sound_Reaction(){ if (reactionActive){ if (Time::GetCurrent() - timeMark > reactionDuration){ //reactionDuration can be 2000 for example reactionActive = false; //stop and finish reaction process //Do some code } } } Problem: iterating through characterList each shot is ok, but each time I fire weapon, that Sound_Reaction() with Time calculation stuff drops my FPS dramaticaly. As my expectation, I don't think it can make FPS worse like this. Questions: Is there any better solution to scan enemy in range ? I wonder if I have more enemy (50?), must I iterate through all of them each time I shoot to collect in-range one? Is there any better solution for character reaction ? depend on time like I need
-
I use ifstream to read a file which I used to save some configuration data ifstream weaponData("Data/Weapons.dat"); while (weaponData >> configVariable1 >> configVariable2 > ...){ //Some code } I included *.dat files in to publish process and I got them in data.zip succesfully. But it seems published game can not read those files. But if I create a same folder structure outside zipped package, my game can read it normally How can I use ifstream to read files in zipped package ?
-
I spent a whole week for learning UE4 with cpp, yep, UE4 is a great engine for sure, but I found out that my mind could not understand the way UE4 works easily. It is too complex and made me tired. Then I returned to my Leadwerks project and felt so familiar. Soooo... sweet, everything is simple as it is It felt like I have had a long trip to UE city then return to my hometown. I miss Leadwerks indeed. Last year, I thought I could only use Leadwerks with LUA and never touch its CPP side. But I tried my best, learned Cpp for 8 months. Now I am not a cpp pro but I am confident in using this language. At least I can rewrite my whole project in CPP instead. this 3-years project helped me to understand my potential and interest in gamedev. I wish Josh be successful in progress of making Turbo, a new hope for much better Leadwerks. To all people who are using Leadwerks and help me these years, love you. ... Peace!
-
Leadwerks has some disadvantages but overall being a perfect choice for 3d Indie game developer. For a remaster of Fallout New Vegas, I don't think Leadwerks can handle
-
Official GUI Tutorial shoud be put in Learn Section
tipforeveryone replied to tipforeveryone's topic in Suggestion Box
LOL I have built my own UI system in C++ which can handle any type of language. i dont even use Leadwerks GUI -
Please make UI editor happen
-
Turbo Game Engine (Leadwerks 5) beta updated
tipforeveryone commented on Josh's blog entry in Josh's Dev Blog
wow, welcome back Jen !! -
How can I delete a vector of Pointer ?
tipforeveryone replied to tipforeveryone's topic in Programming
Thanks !! additional question, with vector.clear(), will the vector be wiped out from memory ? -
I have this code std::vector<Texture*> spriteSequences; for (int i = 1; i <= 20; i++) { Texture* texture = nullptr; texture = Texture::Load(folderPath + "/" + String(i) + ".tex"); spriteSequences.push_back(texture); } in Destructor of my class MyClass::~MyClass() { delete[] spriteSequences; //this is not working } How can I delete a vector of Pointer ?
-
DrawImage() can not display what I want on game window
tipforeveryone replied to tipforeveryone's question in Technical Assistance
I realized that actual window size is smaller than input size in Window::Create(), why ? This does not happen in Lua game -
DrawImage() can not display what I want on game window
tipforeveryone posted a question in Technical Assistance
I created my project in cpp from scratch, and here is the code I used in main.cpp #include "Leadwerks.h" #include "GameControl.h" using namespace Leadwerks; int main() { iVec2 gfxmode = System::GetGraphicsMode(System::CountGraphicsModes() - 1); gfxmode.x = Math::Min(700, gfxmode.x); gfxmode.y = Math::Round(gfxmode.x * 9 / 16); Window* window = Window::Create("CSCDVMP cpp", 600, 600, gfxmode.x, gfxmode.y, Window::Titlebar); Context* context = Context::Create(window, 0); World* world = World::Create(); Pivot* gameControl = Pivot::Create(); GameControl* actor = new GameControl(); //this actor has PostRender() which I used to draw image gameControl->SetActor(actor); while (true) { if (window->Closed() || window->KeyDown(Key::Escape)) return false; Time::Update(); world->Update(); world->Render(); context->Sync(); } return 0; } In PostRender() function of my actor Context::GetCurrent()->DrawImage( myimage, Window::GetCurrent()->GetWidth() - myimage->GetWidth(), 0, myimage->GetWidth(), myimage->GetHeight() ); as my expectation, myimage will be displayed on the top right corner of screen, but this look like this instead window size seems to be larger than actual game display. It is ok if I use Window::FullScreen in Window::Create() -
Little racing car game demo
tipforeveryone commented on Marcousik's blog entry in Marcousik's Creations Blog
wow how could you create that road !! look awesome -
I put some Pivots in Editor around my map and attach a script to each of them, here is the script function Script:Start() self.entity:SetKeyValue("type","spawnPosition") end In spawn.php //#include <iostream> was on top //#include <list> was on top std::list<Entity> spawnPosition; for (int x = 0; x < world->CountEntities(); x++) { Entity* entity = world->GetEntity(x); if (entity->GetKeyValue("type") == "spawnPosition") { spawnPosition.push_back(entity); } } and I got this error Severity Code Description Project File Line Suppression State Error C2664 'void std::list<int,std::allocator<_Ty>>::push_back(const _Ty &)': cannot convert argument 1 from 'Leadwerks::Entity *' to '_Ty &&' CSCDVMP d:\google drive\w3ateam\game development\cscdvmp\projects\windows\playerclass.cpp 160 what is the right way?
- 1 reply
-
- 1
-
-
Anyone give me example of using Actor in CPP
tipforeveryone replied to tipforeveryone's question in Technical Assistance
I return to leadwerks cpp learning process and I did not find any example file like in tutorial, so that I can't learn from it https://www.leadwerks.com/learn?page=Tutorials_CPP_Actors This should be fixed. or the example code should be put into this tutorial page, maybe Josh is too busy to fix this -
Anyone give me example of using Actor in CPP
tipforeveryone posted a question in Technical Assistance
I stuck at document tutorial. -
Anyone remind me a function which returns animation ID of a model by input Animation name? something like this: local animID = model:GetAnimationID("running_loop") I think this function is not in document but it exists I remember that Josh told me about it once
-
copy that "Failed to load texture..." line here. I don't get which texture loaded fail
-
He put "Sol" entity to the input, this is really weird. What is that Sol object ? a pivot ?
-
I have more simple one, only for detecting mouse scroll up/down, not for calculating HOW much scroll in Main.lua, add this at the bottom of main while loop (right above "end") lastMouseZ = window:GetMousePosition().z and add this as a Global function MouseScrollDirection = function() if window:GetMousePosition().z < lastMouseZ then return 1 --scolled up elseif window:GetMousePosition().z > lastMouseZ then return 2 --scrolled down elseif window:GetMousePosition().z == lastMouseZ then return 0 end --no scroll end Use this function in any Script:UpdateWorld() function to detect mouse scroll function Script:UpdateWorld() if MouseScrollDirection == 1 then --do something with scroll up --example: camera:Move(0,0,1) end if MouseScrollDirection == 2 then --do something with scroll down --example: camera:Move(0,0,-1) end end
-
Finally, I finished creating a Dynamic AI Behavior System, that means there won't be a same combat situation each time player replay the map.
-
sometime it just happens because you change model with a new bones structure/name in scene
-
My new AI cover/fire system, AI now can choose his own target and fire from cover