Jump to content

Canardia

Developers
  • Posts

    4,127
  • Joined

  • Last visited

Everything posted by Canardia

  1. You can use EntityVisible(enemy,player) and if it returns 1, then the enemy can see the player, and then he can shoot. You can see the tutorial for this, I think it was called the RayCasting Tutorial. Then you can have a hitpoints counter for the enemy and player, which is first like 100, and each shot reduces the hitpoints by 50, or a headshot sets the hitpoints to 0 at once. And then you can check if player.hitpoints<=0 or enemy.hitpoints<=0 then they die.
  2. I have no idea what the Base Texture field is used for, doesn't seem to have any effect when I put a texture there. I use always texture slot 1 (there are 5 slots) for the base texture.
  3. I would look on google for grid navigation, I think it's somekind of modern way to do pathfinding AI. This might be useful: http://www.vbforums.com/showthread.php?t=566060
  4. It works fine for me, except that it's black because you didn't save the MipMaps. Then I opened the DDS in Paint.NET and saved it as A8R8G8B8+MipMaps and it showed a nice bright green grass in Editor when I put it in texture slot 1. The error "Failed to load grassdot3.dds" has nothing to do with your texture, but Editor tries to load also a normal map, which most people don't have.
  5. I just downloaded Sculptris Alpha 6, and this is what I finished in 1 minute
  6. Can you upload your test dds file so I can try if it works for me?
  7. At the same time when I write the Fortran headers, I'm making also a UnitTest for LE2 which tests every command in LE2, because I need to test that each command works in Fortran too. It will be like a sandbox showroom demo, where the player can walk around and see different stands with different commands of the engine. The full source code of the demo will be available too, so it might be even useful as an example how to do certain things in LE2, or also generally how to make game logic.
  8. 1) Try to make test texture which is 1024x1024 2) Try to save DDS with options: A8R8G8B8+MipMaps from Paint.NET, and not from MakeDDS.exe 3) If you have ATI graphics card, try to use older drivers
  9. 1) See 2) 2) You can save it in the SDK directory under the subfolder Materials/Terrain/TheSaint/Terrain_TheSaint_Sand.dds
  10. 1) You must enable "Save MipMaps" in MakeDDS Options 2) LE2 does not use folders, but it has own tree system which comes from filename. For example terrain textures must be named like terrain_havannah_dirt.dds
  11. Example code please in Fortran or C++ or both (I can translate to either if you have only one language example), but without code there is no evidence. In theory everything works fine, but in practice things are often different. For example Intel put some delay code into their C++ compiler which made it create on purpose slower machine code on AMD CPUs than on Intel CPUs, and they got sued for that I would love to code in Motorola 68060 assembler, but the problem is that barely any computer has those CPUs anymore.
  12. One single reason why Fortran is faster than C/C++ is that the Fortran compiler will load the values once and store them in registers. It can do so because in Fortran pointers/arrays cannot overlap in memory, not even in multi-threading, while in C/C++ the compiler doesn't know if they do, and it takes a seperate copy into memory of all pointer values which might overlap. In C99 and C++0x there is a new register keyword, which should overcome this slowness problem in C/C++, but most C/C++ compilers do the register keyword automatically and it is not adviced that the programmer uses it, because he might put pointer values as register which disturb the compiler's optimizations and thus make the code even slower. However, even with the automatic or manual register keyword, Fortran still makes faster code, so there must be a lot of other reasons too why it's faster.
  13. Yes, you only need to install the latest mingw, and add c:\mingw\bin to your system path, and it works. I downloaded this mingw-get-inst-20110530.exe (only 562KB) and it asks what you want to install, so you can choose only Fortran if you want a minimal Fortran compiler setup, but I would choose also C++, because you need it sometimes too (also here it's similar to BlitzMax: BlitzMax needs MinGW C++ too, to compile some BlitzMax programs which use C++ also): http://sourceforge.net/projects/mingw/files/MinGW/ When it's installed you can compile your Fortran program like this: gfortran game.f And if you want to compile a C++ program it goes like this: g++ game.c Both will create a.exe, so you can rename it as game.exe, or you can add: -f game to the compiling lines above, then it creates game.exe directly.
  14. You can do the AI in C++ (or Fortran ), and read/write control information from the Lua model scripts using GetEntityKey/SetEntityKey.
  15. Yeah, also in the company I work, business goes before elegance, so I don't usually have time to optimize stuff completely, but just make it working sufficiently fast enough. Then it's understandable that companies also look for simpler languages, since they don't have time to develop with C++, and Fortran was indeed not updated to fit the market needs until recently in the 2003 and 2008 edition. The 2008 spec was only finished in September 2010 by the ISO/IEC committee, so it's probably not completely implemented in GNU Fortran yet, but it won't take long I think. I was glad to find out that GNU Fortran has already OOP inheritance and submodules. The built-in multi-threading support is also very cool, and it might even work with LE2 since it's part of the language. So far everything works fine, but I'm a bit excited when I get to test and implement the callback functions and other advanced functions, but from what I read it basically needs only _stdcall convention, which is what is needed in C++ also, so it should work. Thanks for your wish
  16. Well, I'm still young, only 42! I started programming already before I had a computer, so I made some logic machines with LEGO elements, where you could for example drop a marble in, and the program decided from which hole the marble came out. My first computer at age 9 or so, was a industrial paper machine processing unit which had Nova Advanced BASIC.
  17. You can copy ProcessScene from gamelib also. It does a bit more than the bare LoadScene, for example it cleans up the invisible placeholder models of lights and other stuff which Editor creates, and loads additional stuff from the sbx file which LoadScene doesn't.
  18. An example how modules are used to contain a collection of your own functions. Interestingly it creates automatically also a demolib.mod file, which can be shared with other users. Kinda neat! Also switched to use the latest Fortran 2008 version now (MinGW gfortran): module demolib use leadwerks contains subroutine populateworld(cube) integer sun, ground integer,dimension(3) :: cube sun = CreateDirectionalLight(0) call TurnEntity (sun, Vec3(45.0,0.0,0.0), 1) call EntityColor(sun, Vec4(1.0,1.0,0.0,1.0), 1) cube(1) = CreateCube(0) cube(2) = CreateCube(0) cube(3) = CopyEntity(cube(1),1) call MoveEntity (cube(1), Vec3( 0.0, 0.0, 5.0), 1) call MoveEntity (cube(2), Vec3( 2.0, 0.0, 5.0), 1) call MoveEntity (cube(3), Vec3(-2.0, 0.0, 5.0), 1) call ScaleMesh (cube(2), Vec3( 2.0, 1.0, 1.0), 1) call EntityColor(cube(2), Vec4( 1.0, 0.0, 0.0, 0.5), 1) call EntityColor(cube(3), Vec4( 0.0, 1.0, 0.0, 1.0), 1) ground = CreateCube(0) call MoveEntity (ground, Vec3( 0.0,-2.0, 0.0), 1) call ScaleMesh (ground, Vec3(100.0, 1.0,100.0) ) call EntityColor(ground, Vec4( 0.5, 0.5, 0.0, 1.0), 1) call setupathmosphere() endsubroutine subroutine setupathmosphere call SetSaturation(0.5) call SetAntialias(1) call SetBackgroundColor( Vec4(0.3,0.4,0.7,1.0) ) call SetWater(1) call SetDistanceFogRange(5.0,20.0) call SetDistanceFogColor( Vec4(1.0,1.0,1.0,0.8) ) call SetDistanceFogAngle(15.0,20.0) call SetDistanceFog(1) call SetHDR(1) call SetWaterHeight(-0.2) call SetWaterSoftness(10.1) call SetReflectionElements(ENTITY_MESH) call SetWaterAmplitude(0.16) call SetWaterColor( Vec4(0.1,0.1,0.1,0.7) ) call SetBloom(1) endsubroutine endmodule program main use demolib integer result,fw,layer,camera integer,dimension(3) :: cube result = Initialize(0) call SetAppTitle("FORTRAN STATEMENT"//char(0)) result = Graphics(800,600,0,60,10) fw = CreateFramework() call populateworld(cube) do call UpdateFramework() call TurnEntity(cube(1), Vec3(0.1,0.1,0.1), 1) call RenderFramework() if (KeyHit(KEY_ESCAPE)==1) exit call Flip(0) enddo result = Terminate(0) end
  19. And of course the realtime lights can be also set as static lights, if you need more FPS. And then you can still update the shadows when needed.
  20. 1) Everyone has his own point of view, including me 2) I examine thoroughly every language. I used BASIC for 10 years, then Pascal for 10 years, then C++ for 20 years, now it's time to use Fortran. Between the main languages I try of course all kind of new languages too, but so far none has established itself as a long-term universal language. 3) Smiling is good
  21. I'm no expert in Fortran yet, since I only started to learn it 2 days ago, but I got something working which matches your example: There is also a "class" statement in Fortran, but I haven't tried that one yet. module stuff type node integer a endtype type node_child type(node) parent integer b endtype endmodule program main use stuff type(node_child) :: nc nc%parent%a = 1 nc%b = 2 print *,"nc =",nc end Output: nc = 1 2 However, Fortran 2003 implements true inheritance, but it doesn't work in G95 yet, or maybe I can try another Fortran compiler: module stuff type node integer a endtype type,extends(node) :: node_child integer b endtype endmodule program main use stuff type(node_child) :: nc nc.a = 1 nc.b = 2 print *,"nc =",nc end EDIT: Ah ok, I just tried MinGW gfortran which supports also Fortran 2008, and with it, the true inheritance works like in the 2nd example. The speed is also the same as with G95.
  22. Wow! I just found out that I don't need to rewrite each LE2 command in Fortran, but I can use the .o file compiled from the C headers directly. This is what I call reusable code! In C/C++ and other languages you would need to write a seperate header file when using a .o file, but in Fortran you don't need that. The engine.o alone is enough to use the commands directly. OMG, and this means also that I can use all existing C/C++ code directly in Fortran, without writing any kind of module files. So the LE2 Fortran headers will be much less work than I originally thought
  23. Wiki says in the 1950s, so it could be also 1950 or 1951, because FORTRAN II appeared in 1958. In late 1953, John W. Backus submitted a proposal to his superiors at IBM to develop a more practical alternative to assembly language for programming their IBM 704 mainframe computer, so John must have developed FORTRAN I already since 1950 or earlier. I bet the alpha and beta version worked just fine too, long before it was released to the public. FORTRAN I was originally developed by IBM at their campus in south San Jose, California[1], near the Leadwerks Headquarters, in the 1950s for scientific and engineering applications, it then came to dominate this area of programming early on and has been in continual use for over half a century in computationally intensive areas such as numerical weather prediction, finite element analysis, computational fluid dynamics, computational physics and computational chemistry, and of course recently also realtime 3D video game and simulation development using the Leadwerks Engine 2 [3]. It is one of the most popular languages in the area of high-performance computing [2] and is the language used for programs that benchmark and rank the world's fastest supercomputers. How come Fortran is the easiest language then also, besides being the fastest? Look, array and matrix math is super easy: "a = c / b", now a, b and c can be arrays or matrices and it just works. Or this: "a = 1", fills up the array or matrix a with values 1. The expression: "Z(1) = Y + W(1) ! PROJ039" can be easily written also on a punchcard if your company hasn't upgraded their mainframes in a while:
  24. For example in F1 races, the fastest car wins, and when it wins with a huge distance the to 2nd car, it's even more fun than just winning the race Of course my graphics card is also not the fastest, but it costs money to buy a faster one, and I don't really need one since it runs Crysis 2 and DNF just fine. With software, especially free software you can choose the fastest anytime and don't need get stuck on some slower software. Funny though that Fortran is the oldest language, since it was invented in 1950, so all newer languages only got worse? What a waste of time to develop new languages since the first is the best!
  25. Not according to my tests. I've done simple and complex iterations and also disk I/O. I wanted to make some disk tool first with BlitzMax, but when I saw that it was like 3 minutes slower than C++ with a simple 3GB file, I did it with C++. I heard that Fortran's disk I/O is even faster, so I need to test that too. And why would I want that any language is better or worse than another? I was a big fan of C++ because it was the fastest I had seen, and now I can throw it away at once because G95 is faster. So I don't really care about what brand or anything something has, as long it's the best. When something else is better I change immediately to the better. Have you made made some tests too, where you saw that BlitzMax was same speed as C++? Where can I read about it, and copy the source code, so I can verify it on my computers?
×
×
  • Create New...