Jump to content

Canardia

Developers
  • Posts

    4,127
  • Joined

  • Last visited

Everything posted by Canardia

  1. The GameLib Cube template produces a source code like this: The idea behind the new overridable methods in the Application class is, that you can use the built-in default methods, then you don't have to code anything, or you can override them partially or fully as you like. For example the Run method is the whole main loop, which can be overridden, or you can start with overriding parts of it, which are the RenderActive, RenderSuspended methods, or you can even override those partially by overriding the contained RenderActive3D, RenderActive2D, RenderSuspended3D, RenderSuspended2D methods. Cube4.h #pragma once #include "GameLib.h" // GameLib #define APPNAME "Cube4" #define APPVER "0.0.0.0" class Cube4 : public Application { public: Cube4(int argc, char* argv[]); // Constructor void RenderActive3D(); // Overridden 3D rendering void RenderActive2D(); // Overridden 2D rendering Cube cube, ground; // Create cube and ground void Load(); // Overridden scene loading and population stuff Material material; // Material for cube and ground DirectionalLight sun; // Create sun }; Cube4.cpp #include "Cube4.h" Cube4::Cube4(int argc, char* argv[]): Application("data",APPNAME" "APPVER) { // TODO: Add stuff here which is done once per application launch } void Cube4::Load() { game.scene.cam.Move(0,0,-2); sun.Turn(Vec3(45)); material.Load("Models/CobbleStones/CobbleStones.mat"); cube.Paint(material); ground.Paint(material); ground.Scale(Vec3(10,1,10)); ground.SetPosition(Vec3(0,-2,0)); } void Cube4::RenderActive3D() { if(Keyboard::I****()) Quit(); double n=AppSpeed(); cube.Turn(n,n*2,0); } void Cube4::RenderActive2D() { Draw::Text(50,50,"%0.0f",FPS()); } RunClass(Cube4);
  2. File Name: GameLib Templates for LEBuilder File Submitter: Metatron File Submitted: 04 Sep 2011 File Category: C++ Contains the following LEBuilder templates: GameLib Cube Click here to download this file
  3. Canardia

    SQLite3

    File Name: SQLite3 File Submitter: Metatron File Submitted: 04 Sep 2011 File Updated: 04 Sep 2011 File Category: C++ This is needed by GameLib. I recommend putting all C++ libraries under one C:/lib folder (or whatever drive letter you prefer). Then you would have for example the following folders: C:/lib/Leadwerks C:/lib/GameLib C:/lib/sqlite3 C:/lib/SDL C:/lib/SDL_net I have included a compile.bat with SQLite3, which produces a sqlite3.o file, which you can then add to your GameLib project. You can also use LEBuilder, and run the GameLib Cube template, and it creates everything automatically for you. I recommend to download also the SQLite3 Database Browser, which is a GUI based database editor for SQLite3 databases: http://sourceforge.net/projects/sqlitebrowser/ I uploaded SQLite3 here just incase a future official version has some problems with GameLib, or the site is down, so you can instead also download the official version (the first link: amalgamation): http://www.sqlite.org/download.html Click here to download this file
  4. LoadModel() does automatically CopyEntity(), when the same model is loaded more than once.
  5. CopyEntity(cube) makes a new GPU instanced cube, so it's much faster than CreateCube. For games with lots of cubes, the best is to remove all inner faces. You only need to do this once when a new cube is added or removed, so there is no FPS loss per frame, and the FPS gain is huge, since you then only have the outer hull left. The easiest way to remove inner faces, is to check which faces are overlapping. This won't remove all inner faces, but at least half of them.
  6. Canardia

    New Stuff

    LEO 2.5 has been sent to Josh, there was a few commands missing, and a few bugs were fixed. GameLib 0.1.2.0 should be ready soon, I'm still testing the new additions to the Application class. It can get quite deep to make a simple spinning cube template, if you want to make it perfect. For example the window size needs to be read from a config file rather than from LEBuilder, so that it is not hardcoded into the game code. I ended up with the decision to make all config, gamesave, etc... files as sqlite3 databases. It makes things more standardized, as I found out that Apache PHP5 has also built-in sqlite3 support. Since GameLib's Window class supports also a seperate viewport area which can have a different resolution than the windows/fullscreen mode, that should be put into the config.db also. The idea behind the viewport area is that people want to play games in fullscreen mode, but sometimes their GPU is too slow to run 1920x1080 or even 1680x1050 fullscreen modes, so they can still run in fullscreen mode with a lower resolution viewport. It then also allows some GUI elements to be in full resolution. Next comes a GameLib Spinning Cube template for LEBuilder, and after that a simple FPS template also. And even after that a simple RTS template. I'm trying to keep GameLib as simple as possible to use, but it can be difficult at times, because it needs to stay universal, and not hardcoded for a specific game/application style. LEBuilder will help me a lot to keep things easy to understand for new users, as they only need to know how to achieve things, and not how it internally works. In the same way as I find STL easy to use, the way how it internally works is way too deep for anyone to understand. I just need concrete, compilable examples, and documentation, and it's easy to use. And right now we got a new version of LEBuilder tested and done with ZioRed. It supports auto-quit after building a project (you have to set the flag to True in the config xml), and it remembers the last project root directory. ZioRed sent the exe and source to Josh too, so this will be included in the official SDK also.
  7. MS Visual Studio for what? It's the most slowest compiler I've ever seen. People say they use Lua because it's instant, but instant is also MinGW compiling times. Plus MinGW creates faster code than VC. VC is totally useless, and LE2 supports MinGW 100%, since I use it every day with MinGW, and GameLib is also tested on MinGW. And for LE3, it's essential to have MinGW support on Windows, because it's 1:1 with GNU C++ on Linux, Mac and Android. LE3 development is looking damn good now, just keep doing it, I will then add Linux support, if it's not in the initial release. I know you don't like to support Linux, because it's not tied to money. Although the Linux people are willing to spend more money than any Mac or Windows people. They just don't have a target to spend it on. They had the indie packs, where it showed how crazy the Linux people are, they offered the most money for games, which were free. That means something. You would be a fool, not to respect a big number of people. There is no such thing as the one big market, but you have to support several markets to get the big market.
  8. Canardia

    speech?

    Look at my Guess A Number game in the Werkspace Games downloads, it has quite realistic synthetic speech It uses AT&T Natural Speech engine, but it's not built-in, because it would require a commercial license, so I only baked them with NCH WavePad, which should be legal.
  9. Yeah, Android was mostly Java in the earlier versions, but since Oracle bought Java, and sues everyone who uses it, Google/Samsung decided to move more and more accessibility, features and programming into the C++ side (NDK). The goal is to have it 100% NDK, but it takes some time.
  10. Canardia

    Greetings

    ShiVa3D doesn't have GPU instancing, so if LE3 comes even close with it's GUI, it will rock the world! Unity3D is totally out of the race, since it's slow as hell, and it's slow even without the support of ANY shadows on Android and iPhone, iPad. So the rendering engine of Unity3D must be the biggest **** ever made. And on top of that, they charge you extra to publish on Android, iPhone, and other platforms, how gay is that? ShiVa3D has all in the price of one. I like ShiVa3D because of its Authoring Tool, it's one mouseclick and you have your game on 20 different platforms. The programming side of ShiVa3D is horrible though, it's a in-house Lua wannabe version, which doesn't support half of the Lua features, and you have to code more than in C++, because you need to put some copy/paste code in every damn entity. It doesn't even have #include directives so you could reuse your code and make standard libraries, but you always have to copy and paste everything. But yeah, it's still good because you can make Android apps with shadows with it.
  11. I guess LE3 will run on Linux then too, since Android is Linux also.
  12. Aren't there already tons of public demos for LE2? For example on www.magiam.com and Werkspace Demos.
  13. That's what I said, adjusting includes the Move/Turn statement, since there is either no bone, but just an close-by mesh, or the bone is not exactly at the right position or rotation.
  14. Attaching is not the same as adjusting Attaching is like weapon.SetMatrix(lefthandbone.GetMatrix()); weapon.SetParent(lefthandbone); and adjusting is like weapon.SetMatrix(leftarm.GetMatrix()); weapon.Move(0.107,-0.212,1.2394); weapon.SetParent(leftarm);
  15. Canardia

    Memory Usage

    It's normal for Garbage Collected languages like BlitzMax, that they pump the memory usage up and then release it after a minute or so. You can see the memory usage also with SetStats(2). It's fixed in LE3, which has no GC.
  16. GetTerrainNormal() returns a vector which a terrain triangle is facing, so the slope is orthogonal to that. There's probably some Linear Algebra formula to calculate the orthogonal to a Vec3, perhaps like this: TVec3 GetOrthogonal( const TVec3& v ) // Return a non-zero vector orthogonal to A. { if( 0 == v.X ) return Vec3( 1, 0, 0 ); return Vec3( v.Y, -v.X, 0 ); }
  17. FreeEntity(emitter) works fine in BlitzMax.
  18. 1) A joint is always created at a absolute global position. For example, if your body is at 0,0,10, then you must create the joint also at 0,0,10, if you want the joint to be at the center of the body. 2) The pin of a joint is not a position, but a direction vector. If your ball A is a position 0,0,0, and ball B is a at positon 0,0,1, then you create a ball joint from ballA to ballB at position 0,0,0 with pin 0,0,1. It's usually good to use normalized vectors for the pin, so Length(pin)==1.
  19. Cool, then we can make a game by combining those 3: A Karateka who kills Zombies with his bare hands and feet, and he can also climb ladders and open doors
  20. I want a Karateka character, which has the basic moves like in the C64 game Karateka: http://www.c64gg.com/Gameinfo/Karateka.html
  21. Use Entity::GetPick, it works much better than Camera::GetPick, and you can cast it from anywhere to anywhere. LEO is completely finished.
  22. It seems your DayNight script is causing the most FPS slowdown, at some points it eats 50% of your FPS. You are moving the sun in each frame, although there is no need to move it in each frame, since it moves so little per frame that there is no visual difference. Also moving the sun in each frame makes the shadows flicker which looks ugly. You should make it so that the sun moves only once per minute, or every 3600 frame. And I think in your code you also update a lot of things in each frame, although you should use timers and update them much less frequently than in each frame. There's nothing wrong with the models, textures, lights, emitters, and coronas, they don't eat much FPS at all. I get like 80-130 FPS in Editor with a 8800 GTS. It's only your bad code which eats all FPS
  23. It's hard to say what you're doing wrong, without having access to the assets. You could do various things to test what assets are causing the low fps, for example by hiding everything, and then unhiding each asset individually in the game.
  24. Canardia

    Lua Version

    Print(_VERSION) Output: Lua 5.1
  25. Yeah quantum and paq8l have the best compression, but they are way too slow for any practical use. 7-zip and freearc have the highest compression rates, and freearc is actually faster than zip or any other packer too. 7-zip has a slightly better compression rate than freearc though, but of course not always, and sometimes freearc packs better. Actually then arc should be added to the allowed upload formats too. Restricting the upload format is a bit silly, since exe is allowed, which is kinda like the worst disaster which can happen
×
×
  • Create New...