Jump to content

aiaf

Members
  • Posts

    720
  • Joined

  • Last visited

Everything posted by aiaf

  1. 1.First paragraph contains steps to reproduce, it results in a project that doesn't run. 2.I use a Leadwerks sln project, and put the Source.zip I attached into Source dir, project compiles.When running it creates the window that remains in not responding state Hope is more clear now
  2. Want to report this problem again: Documents\Leadwerks\Projects\ delete all projects Create a new project, in Maps directory nothing gets created. Project wont start. And what is the standard way to create a project without lua interpreter ? just c++ I use the same project and add the c++ code from Source.zip i attached. But it still doesnt work, is something wrong with that code ? it creates the window and its in not responding state. I have a sln that is working for my game , but im not able to create another from scratch that is working. Please help with this its annoying. Source.zip
  3. This works, managed to make a game build on windows.
  4. Yes got same problems. I deleted Leadwerks from steam and reinstalled the beta. Now i tried it simpler, just copied the App.cpp from above over the project created by Leadwerks. Severity Code Description Project File Line Suppression State Error C1083 Cannot open include file: 'corecrt.h': No such file or directory nt C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.24629\include\crtdefs.h 10 I have both SDK for 10 and 8.1 installed. Maybe is something with my Visual Studio, the default project cant find the Windows SDK include it seems.
  5. With Leadwerks closed i delete the project in Documents\Leadwerks\Projects. I create a new project Tutorial Sample, game doesnt start: Error: Failed to read file "C:/Users/alex/Documents/Leadwerks/Projects/tes1/Maps/start.map". In Maps there is a temp.map. If i change to start.map it will start. And for your question reepblue yes with stock code it works. This is the code i use and have issues: bool App::Start() { //GAME BASIC INITIALIZATION System::Print("lep start\n"); tick = 0; int WindowFlags = 0; WindowFlags = Leadwerks::Window::Titlebar; vs = true; window = Leadwerks::Window::Create("lep", 0, 0, 1024, 768, WindowFlags); context = Context::Create(window); world = World::Create(); camera = Camera::Create(); camera->SetPosition(2, 3, -1); camera->SetClearColor(0.1, 0.1, 0.2); //GAME SPECIFIC Light* light1 = DirectionalLight::Create(); light1->SetPosition(100, 100, 0); light1->SetColor(2.9,2.9,3.0); world->SetAmbientLight(1.0,1.0,1.18); //window->HideMouse(); return true; } bool App::Loop() { Leadwerks::Time::Update(); world->Update(); world->Render(); context->Sync(vs); return true; } Maybe it needs something more im not aware of ?
  6. Im on windows 10 updated to beta branch and visual studio 17 I took a sln project from Documents\Leadwerks\Projects and added some simple code i was using earlier for testing: App.cpp App.h and main.cpp. Project builds ok. But i get this kind on errors when running: Exception thrown at 0x00202616 in test.debug.exe: 0xC0000005: Access violation reading location 0x40000004. This looks like memory corruption to me. But im not able to track what is the cause of this. Seems is not related to the code it happens anyway. Any idea ?
  7. i participated twice to ludum dare its quite nice, i would advise using some software/library you are familiar with , otherwise it will be hard to finish a game
  8. I get this link error with beta: Leadwerks.lib(window.win32.obj) : error LNK2019: unresolved external symbol __imp__GradientFill@24 refe renced in function "public: void __thiscall Leadwerks::Window::DrawRect(int,int,int,int,int,int)" (?Dra wRect@Window@Leadwerks@@QAEXHHHHHH@Z) Linked the right libraries i think. Directory for libs C:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\ucrt\x86 Any idea ?
  9. aiaf

    Analytics

    I can see this being useful, but i will only use this in a beta or play test version.
  10. Nevermind this post, this was me not passing a parameter by reference, didnt need the Project function Vec3 cu = currentUnit->GetModel()->GetPosition(true); camera->SetPosition(cu.x, cu.y, cu.z - 7); camRotation->x = 0; camRotation->y = 0; camera->SetRotation(*camRotation);
  11. Good step , i like the support for modern c++. Can we get same treatment for gcc ? but guess there is also dependent on steam os support.
  12. This is in the camera constructor: centerMouse = Vec2(Math::Round(context->GetWidth()/2), Math::Round(context->GetHeight()/2)); The camera update occurs in player->Loop and the space is pressed in console->Loop. running = console->Loop(); player->Loop(window); SetMousePosition is getting executed every loop in player->Loop. Someone press space one call in consoleLoop, then it goes on until closed in player->Loop.
  13. I select a model in the scene then move around, rotate camera, then i want to move the mouse over the previous selection In some class i have this code for the camera, called in the main loop: camera->Move(camMovement); currentMousePosition = window->GetMousePosition(); mouseDifference.x = currentMousePosition.x - centerMouse.x; mouseDifference.y = currentMousePosition.y - centerMouse.y; camRotation.x += Math::Round(mouseDifference.y / mouseSensitivity); camRotation.y += Math::Round(mouseDifference.x / mouseSensitivity); camera->SetRotation(camRotation); window->SetMousePosition(centerMouse.x, centerMouse.y); Currently i try like this, this code is only executed once when i press space: Vec3 cu = currentUnit->GetModel()->GetPosition(true); Vec3 sp = camera->Project(cu); window->SetMousePosition(sp.x, sp.y); System::Print(String(sp.x) + " " + String(sp.y)); This kind of works but it moves the cursor sligthly off the model (seems related to SetMousePosition being called in the main loop).If i press space 3 4 times it gets in the right position. Anyone can help with this ? run out of ideas maybe i should try another approach Thanks
  14. Draws a box from one vector to another. To be used as some kind of arrow. Need feedback if its a better way to do this, but so far seem to be ok for my purposes. Example usage: ArrowUi *t = new ArrowUi(Vec3(0.0, 0.0, 0.0), testshadow->GetModel()->GetPosition()); class ArrowUi { private: Model *model; Entity *pivot; Vec3 from; Vec3 to; float distance; public: ArrowUi(); ArrowUi(Vec3 from, Vec3 to); void From(Vec3 from); void To(Vec3 to); void Draw(); }; ArrowUi::ArrowUi() { model = NULL; surface = NULL; pivot = NULL; from = NULL; to = NULL; } ArrowUi::ArrowUi(Vec3 from, Vec3 to) { this->from = from; this->to = to; Draw(); } void ArrowUi::From(Vec3 from) { this->from = from; } void ArrowUi::To(Vec3 to) { this->to = to; } void ArrowUi::Draw() { pivot = Pivot::Create(); pivot->SetPosition(from, true); distance = from.DistanceToPoint(to); model = Model::Box(0.05, 0.05, distance, pivot); model->Move(0, 0, distance/2); pivot->AlignToVector(to - from, 0); pivot->AlignToVector(to - from, 1); pivot->AlignToVector(to - from, 2); }
  15. im using bit bucket and tortoise git
  16. good work , heh this entry was fun to read , old code but still doing the needed stuff
  17. Good idea, maybe have a locked post in forums that will serve as an index for the entries/winners for easy access. Something like this: Year 2016 month 11 - descriptive title all entries Year 2016 month 12 - title etc Please make this for both lua and c++.
  18. Congrats! reminds me of revolt game
  19. Want to share this maybe will help someone. Its pretty basic but it has missile effect by distance and at certain time. Should be easy to extend. trigger the missile: tm3 = new Missile(Vec3(5.0f, 5.0f, 0.0f)); tm2 = new Missile(Vec3(0.0f, 0.0f, 0.0f), tm3->GetPosition(), true); and call the Loop method in the game loop #ifndef __S_MISSILE_H__ #define __S_MISSILE_H__ #include "Leadwerks.h" using namespace Leadwerks; class Missile { private: Emitter *mem; Material* unitexpmat; Model *model; Vec3 targetDirection; float mass; long creationTime; long detonationTime; void Init(); void Effect(Material* mat); public: Missile(); Missile(Vec3 pos); Missile(Vec3 pos, Vec3 targetDirection, bool launch); void SetDetonationTime(long detonationTime); void SetPosition(Vec3 pos); void SetDirection(Vec3 targetDirection); void SetMass(float mass); Vec3 GetPosition(); Vec3 GetTargetPosition(); void Launch(); void Loop(Material* mat); }; #endif #include "Missile.h" void Missile::Init() { model = Model::Box(0.1, 0.1, 0.1); model->SetColor(0.1, 0.1, 0.1); mass = 0.01; model->SetMass(mass); model->SetGravityMode(false); Shape* shape = Shape::Box(0,0,0,0,0,0,0.1, 0.1, 0.1); model->SetShape(shape); shape->Release(); creationTime = Time::Millisecs(); detonationTime = -1; } Missile::Missile() { Init(); } Missile::Missile(Vec3 pos, Vec3 direction, bool launch) { Init(); SetPosition(pos); SetDirection(direction); if(launch == true) { model->AddForce(direction[0], direction[1], direction[2], true); } } Missile::Missile(Vec3 pos) { Init(); SetPosition(pos); } void Missile::SetPosition(Vec3 pos) { model->SetPosition(pos); } void Missile::SetDirection(Vec3 targetDirection) { this->targetDirection = targetDirection; } void Missile::SetMass(float mass) { this->mass = mass; } void Missile::SetDetonationTime(long detonationTime) { this->detonationTime = (creationTime + detonationTime); } Vec3 Missile::GetPosition() { return model->GetPosition(); } Vec3 Missile::GetTargetPosition() { return targetDirection; } void Missile::Launch() { model->AddForce(targetDirection[0], targetDirection[1], targetDirection[2], false); } void Missile::Effect(Material* mat) { Vec3 nd = targetDirection.Normalize(); mem = Emitter::Create(200); mem->SetMaterial(mat); mem->SetEmissionShape(1); mem->SetEmissionVolume(Vec3(.50,.50,.50)); mem->SetDuration(300); mem->SetVelocity(nd[0],nd[1],nd[2],0); mem->SetColor(.30,.0,.0,.5,0); mem->SetColor(.20,.10,.10,0.4,1); mem->AddScaleControlPoint(0,0); mem->AddScaleControlPoint(.9,3); mem->AddScaleControlPoint(0.1,0); mem->SetLoopMode(false); } void Missile::Loop(Material* mat) { if(detonationTime > 0) { if(Time::Millisecs() >= detonationTime) { Effect(mat); mem->SetPosition(GetPosition()[0], GetPosition()[1], GetPosition()[2],true); model->Hide(); detonationTime = -1; } } else { if(model->GetPosition().DistanceToPoint(targetDirection) < 0.5) { Effect(mat); mem->SetPosition(targetDirection[0], targetDirection[1], targetDirection[2],true); model->Hide(); } } }
  20. Tried Visual Studio Code lately , the debugger is just awesome.
  21. Maybe community should be more active on the wiki front. There is good content on forums if you search, but maybe not enough visibility. Also the reference documentation and code examples are simply great. Had no problem to start using leaders from c++.
  22. You pose valid question I want to keep the economy management minimal, this will be a war game. Have to finish the story but this base is actually some kind of creature, there will be factions of enemies.Universe will be inhabited by this creatures no humans around. Challenge for the player will be to survive.You will start in a war zone and need to escape at all costs.You will simply not have the time to build up. Some kind of warp/jump mechanics, there will be a timer until you can activate the jump drive that i hope will create some tension.So you'll have the chance to defend or attack weeker targets. Also the fighting gameplay should be intreasting in itself i plan on having only missiles as weapons.So will be lots of missiles/explosions flying around. When a jump is executed there will be a early warning from the sensors, so you can launch missiles attacks or just go out. Also some kind of trap that will not let you jump away. Hope this fighting tactics will be interesting enough. So much work to do.
  23. A progress report on Structura First i want to say im glad i choose Leadwerks engine, easy to use and freedom to choose how you develop. This will be a single player rts game, is a long term project (written in c++, 11k lines of code at moment). Have some ideas that will differentiate this game from others: Game is controlled by a command line and some kind of rudimentary ui.Will see how far i can go with this, its around 100 commands implemented at the moment. I added game persistence on disk, want to have a persistent game world that wont restart, your actions should have consequences.Dont know if this would be feasible but i will try. You start with a unit that can have components attached to it and other units. Components that can be built: socket, tunnel, battery, unit, power_plant, logistic_center, recycler, mine, accelerator, platform, armor, barrier, standard_adapter, fortress_adapter, recon_adapter, deathstar_adapter, jump_drive, scanner A big part already have some kind of gameplay attached to them.They consume resources when built. Resources can be transfered from unit to unit etc. Code for building units/components is done and well tested you can build a potential infinite graph of this things if you have resources. Its some kind of limited minecraft. So far i dont know what will be the performance implications, i just go with it and will try some optimizations later. On the art department its not good, i use Model::Box , have to make time to learn blender, but i will not use textures it takes too long and i better use time for more gameplay. Video: Any feedback is welcome, i know it seems i went overboard with this but im making a game i would enjoy playing , if others will like it at some time will be a bonus. Regards
  24. great plan, good to see engine going in the right direction
×
×
  • Create New...