Jump to content

Gandi

Members
  • Posts

    295
  • Joined

  • Last visited

Everything posted by Gandi

  1. Title says it all I think. I could play the sound until the sound state is no longer "Playing" but that's kind of an ugly way since I would need to know the duration before I play it.
  2. Is there a easy way to show the physics shape for a single entity? If I turn on DebugPhysics with the terrain in view my FPS rate drops to something that should rather be measurd in frames per day.
  3. Hey, I'm currently working on an attachment system and ran into some weird problems when I started attaching models to the main character. This is what it should look like: If I rotate the camera a little it looks like this: If I keep rotating it up, th artifacts are gone... but the character becomes invisible: Usually I'd say this is a bug, but I tried this out in another test program with the animated model and the scene.sbx and it works like a charm. I would guess that this is some kind of problem with the terrain, or do you have any ideas what I might be doing wrong?
  4. That' neat How do the vegetation functions work? Are you manually creating .sbx and raw files and then loading them with LoadScene()?
  5. Ah, thanks. I'll take care of that as soon as I can find time... pretty busy at the moment.
  6. Post 1: On 'Beyond Civilization' Hey guys! After lurking around in the Leadwerks forums for quite a while now, I thought it was time to present what I am actually working on. The team: I am the lead programmer and teamleader of a group of people developing a video game (well, who isn't^^). Our team is called ' Clockwise Studios ' and currently consists of 8 people - 2 Programmers, 2 Leveldesigners, 1 concept artist, a modeller and two people doing web design, management and game design. The game: Beyond Civilization is a 3D role playing game set in 1628. You play the young Jan Walraven who is stranded on a seemingly deserted island, together with the crew of his ship and a troup of spanish mercenaries. Soon the group discovers that they are definately not alone on the island and an exciting adventure begins... Our clear role model for Beyond Civilzation is Gothic 1 / 2 . This doesn't mean we're just copying it though - rather we want to create a unique RPG with a rough world , gripping story , distinctive NPC's and challenging gameplay which somewhat feels like our favourite game. The main focus of Beyond Civilization is on realism . There is no magic (at least not in the conventional sense), no respawning enemies and no magic volcano stones - instead there are quests that go further than a "get me 10 wolf hides" and that can be solved in many ways. You can either scheme a giant intrigue to accomplish your mission - or just beat the stuff out of your target. But even the last option is not always as boring as it seems since the fighting system requires a lot of skill, so that even a player with bad equipment can defeat almost any enemy. The game also contains survival elements as you might know them from games as Stranded I/II. Especially in the beginning of the story, water and food are rare. The only weapons and "buildings" are pieced together from parts of the wreckage. So you will have to hunt, trade or plant stuff so that you don't die of hunger or thirst. Items can be combined to new ones so that you can tinker new wepaons, a hut or a collection container for water. We also want to include an extensive multiplayer part where groups of players can compete in short matches. Here, classic game modes as King Of The Hill or Deathmatch will be available as well as selfmade creations which will put focus on the survival part of the game, for example. Development: Obviously selfmade player model, huh? We're using the latest LE version with a custom C# wrapper that is based on the old one by Lazlo and Tyler (I think?) and a modified version of the LETKControl that klepto2 once did... so thanks to you, guys. The back and forth with LE.NET, Leadwerks.NET etc. was not so cool though, so I guess we'll stick with our own wrapper for now. We also have a few Lua editor scripts (you might know my or the , but we prefer to do scripting in C# , too. @RekindledPhoenix: Yep I will re-publish those soon That should be enough for now, I can tell you more about the stuff we are doing in future blog posts , in case you are interested This blog: Not so sure what I want to post on this blog in the future. I thought it would be a good idea to post a mixture of game concept, some story pieces, some code snippets we wrote and other development related stuff regularily. But hopefully someone in here is interested in this project, so maybe you could tell me what you want to know about youself Greetings from Bavaria Gandi
  7. Object* o; int pointer = *(int*)o; When doing this, you only store the first 4 Bytes of your Object data (not the pointer to the object!) in the pointer-variable. There is no way to get back the original object from this int, because you do not store the adress of you object anywhere. If you do: int pointer = (int)o; it might work, but only if the size of int matches the size of a pointer. This is not the case on x64 systems.
  8. Are you joking?!?! I might be wrong - but my guess would be that basically everyone here would _love_ to have a multithreaded LoadModel - command...
  9. In former versions of Leadwerks Editor I could place single vegetations with brush size 0 quite precisely. With the current LE version (2.42) I can't place anything with that brush size anymore. While usining brush size 1 I often place more than one vegetation and that's annoying. If there isn't a solution for this I would be glad if Josh would accept this as an important suggestion for the improvement of Leadwerks and eliminate this bug.
  10. The Core function here also won't work since the declaration is obviously not working, although I dunno exactly why. If you open up Leadwerks.dll with the .NET Reflector ( yeah I know I shouldn't do this^^ ) you can see that Core.CameraUnproject looks like this: [DllImport("Engine.dll", CallingConvention=CallingConvention.StdCall)] public static extern void CameraUnproject(IntPtr camera, float[] p); Okay, replace the words "probably not the best solution" with "definately not the best solution" I just tried to make everything excactly like it is in C++ to make sure it works. You version is a little smarter of course.
  11. Okay, this is probably not the perfect solution but it works: public static class PInvoke { [structLayout(LayoutKind.Explicit)] public struct TVec3 { [FieldOffset(0)] public float X; [FieldOffset(4)] public float Y; [FieldOffset(8)] public float Z; } [DllImport("Engine.dll", CallingConvention = CallingConvention.StdCall)] unsafe public static extern void CameraUnproject(IntPtr camera, TVec3* addr); } public void SomeFunction() { Vector3 v = SomeGlobalPositionInHere; unsafe { PInvoke.TVec3 result; result.X = v.X; result.Y = v.Y; result.Z = v.Z; PInvoke.CameraUnproject(Framework.Camera.Pointer, &result); v.X = result.X; v.Y = result.Y; v.Z = result.Z; } Draw.Text("TEEEEEEEEEEEEST", (int)v.X, (int)v.Y); } I guess there is something wrong with the float[] beeing passed in the wrapper... would be nice if someone could fix this.
  12. I did... but Reflector says that that it does not even matter. Just made a fresh test with some code frome the tutorials: using Leadwerks; public static class Game { private static void Main() { try { Engine.Initialize(DisplayMode.Window,800,600,60); Framework.Initialize(); } catch (LeadwerksException e) { Debug.Alert(e); Engine.Terminate(); } Framework.Camera.Position.Z -= 5; Mesh cube = new Mesh.Cube(); Light sun = new Light.Directional(); sun.Rotation = 45; sun.Rotation.Y = 120; Mesh ground = new Mesh.Cube(); ground.Scale = new Vector3(5, 0.2f, 5); ground.Position.Y -= 1; ground.Color = Color.SandyBrown; Framework.Effects.Bloom.Enabled = true; Framework.Effects.Water.Enabled = true; Framework.Effects.Water.Height = -1; Framework.Adjustments.Saturation = 0.5f; Filtering.Optimize(); while (!Window.HasRequestedClose) { cube.Rotation += Timing.Speed; Timing.Update(); Framework.Update(); Framework.Render(); Vector3 loc = ground.Position.Clone(); Vector3 newloc = Framework.Camera.Unproject(loc); // newloc is the same as ground.Position now Draw.Text("Test", (int)newloc.X, (int)newloc.Y); Graphics.Flip(); } Framework.Terminate(); Engine.Terminate(); } }
  13. It seems that Camera.Project and Unproject are not working. The point I throw in as parameter just stays unchanged.
  14. Hi! Do you know if its possible to use LE without calling Graphics(). By creating the OpenGL device by myself. If yes, which Parameters do i have to use for the Pixelformat e.g.? I just want to pass the HWND to my window to my application and then want to get the OpenGL window, which resizes with the Window.
  15. Could it be, that i recently cant create a Terrain with Terrain.Create(resoultion) with the current wrapper??
  16. Ok, I know know where the error occures.. seems like he cant find my functions.. if(leGuiInitialize==NULL) printf("Error: GuiInitialize=NULL\n"); (leGuiTerminate) = (TGuiTerminate) GetProcAddress(gui_hlib,"terminateGui"); if(leGuiTerminate==NULL) printf("Error: leGuiTerminate=NULL\n"); (leGuiGetHandle) = (TGuiGetHandle) GetProcAddress(gui_hlib,"getLEHandle"); if(leGuiGetHandle==NULL) printf("Error: leGuiGetHandle=NULL\n"); all three are null....
  17. ok.. thats what i got now: #define DLLEXPORT(s) __declspec(dllexport) ##s _stdcall extern "C" { DLLEXPORT(int) initializeGui(int debug) { return Initialize(debug); }; DLLEXPORT(HMODULE) getLEHandle(void) { return le_hlib; }; DLLEXPORT(int) terminateGui(void) { return Terminate(); }; }; in my .dll header and then i copied the engine.cpp renamed it and included it into my project instead of the engine.cpp here are the changes i made in the "engine.cpp" i added: typedef int (__stdcall *TGuiInitialize) (int); typedef HMODULE (__stdcall *TGuiGetHandle) (void); typedef int (__stdcall *TGuiTerminate) (void); leDeclareFunc(GuiInitialize); leDeclareFunc(GuiGetHandle); leDeclareFunc(GuiTerminate); and edited the Initialize()-function: inline int Initialize(int allowenginedebug) { LPCSTR dllfilename; if(1==allowenginedebug) { #ifdef DEBUG dllfilename = (LPCSTR) "CWGui.dll"; #else dllfilename = (LPCSTR) "CWGui.dll"; #endif } else if(2==allowenginedebug) dllfilename = (LPCSTR) "CWGui.dll"; else dllfilename = (LPCSTR) "CWGui.dll"; gui_hlib = LoadLibraryA(dllfilename); (leGuiInitialize) = (TGuiInitialize) GetProcAddress(gui_hlib,"initializeGui"); (leGuiTerminate) = (TGuiTerminate) GetProcAddress(gui_hlib,"terminateGui"); (leGuiGetHandle) = (TGuiGetHandle) GetProcAddress(gui_hlib,"getLEHandle"); leGuiInitialize(allowenginedebug); le_hlib = leGuiGetHandle(); if (le_hlib != 0) { /*printf("%s loaded.\n", dllfilename)*/; leLoadFuncs();\ }\ else\ printf("%s failed to load.\n", dllfilename); return NULL!=le_hlib; } and the Terminate(): inline int Terminate(void) { return leGuiTerminate(); } but it seems like im doin something wrong.. everything compiles fine, but when i try to run it i recently get an error message before even anything is written into the log
  18. let's see if i got it right 1) i have to load the LE functions in my dll (the Initialize() function of engine.h, if im right) 2) i have to link the LE functions from my own dll to the main programm ( so i link to my dll which links to the LE dll???) (writing my own engine.cpp, right?) I'm sry, but i just haven't done a lot with dll's and linking so far ..
  19. Hi! Is it possible to use LE-commands from a selfmade .dll file? I tried is today, but always got errors, as the dll seems to load in its own thread. Or is there any other way of doing it? i want to use this dll in some of my projects and maybe share it with the community, but i dont want to recompile/include/share the whole source code..
  20. Atm im rendering every frame.. the system aint far atm.. but i got a problem now .. I'm creating a .dll and .lib file and when including my classes from the dll i cant run any LE-commands anymore (guess it's another thread?) anyone got an idea how i can get all my classes from the dll into main project??
  21. Ok, i think i got a pretty nice solution now (i hope creating and freeing buffers aint take too much performance) I create the buffer, render the component, render the buffer to the main window and then free the buffer.
  22. I'm just gonna give it a try.. also gonna try to Free the buffers everytime after painting all childs gonna get interresting
  23. i think you kinda missunderstood my problem look at the picture. When my child component is badly placed, so it doesnt fit into the parent-component i want it to be rendered same size as usual, just it gets cut at the edge of the parent-container.
  24. the advantage would be, that components which are to big for its parents components dont get rendered out of the bounds of the parent. a little picture: black: parent red: child top: how i dont want it to be bottom: how i want it to be and yes that would be a bunch of buffers.. thats why im asking € @macklebee: ok.. that sucks^^ as i wanted to render the text into buffers ( with freetype) because always rendering it with freetype seems to slow down everything a bit.. €2: or do you know a way for rendering an image to a specific size without stretching it?
×
×
  • Create New...