Re: Irrlicht Port

#301
It's grayed out because it's in a "#if 0" preprocessor block. That code is skipped by the compiler, so CodeBlocks grays it out so you know it's being skipped. This behavior doesn't always work right, so it can also happen with preprocessor blocks that are compiled.

The reason I put those small block comments in front of each of those lines was just to make sure that the script I used to generate that code was working properly. It's always easier to look at the beginning of the line, rather than try reading a string in the middle of it.
MWATTT wrote:It seems that some things are missing in the lastest git. There is no reference to the "irrToBtVec" function and no fragment shader for FogBillboard.
Also, a strange thing in the entAmount loop of the loadRMesh function is I always get a segfault in the last itteration because the value of entType is 10. Everything works correctly if I remove the last itteration.
I made some small changes to the RM2 format, because my RMESH to RM2 converter was broken (that's what I get for writing spaghetti code) so some data was missing. Here are the new files: https://www.mediafire.com/?gs115si6i0maa77
When Irrlicht finds the end of a file, it doesn't make changes to the variables that you give to the reading functions. So the RM2 loader would duplicate the last point entity because it tried reading too much data. Now I reset the entType variable to 10, so if Irrlicht fails to read the file, the loader will crash.

As for the irrToBtVec function, yeah I forgot to commit some changes to irrDynamics. I'm not sure how I forgot to commit FogBillboardFrag. Thanks for telling me, I fixed it just now.
InnocentSam wrote:Now, it sets the Stamina variable fine, but I'm not sure if it loops and keeps re-setting it, or whether you've got infinite sprint turned on for testing purposes (again, half one in the morning). Either way, it works, and worst case scenario is that the code that sets the Stamina needs to be moved.
3dworld.cpp, line 556:

Code: Select all

mainPlayer->boostStamina(10.f,-1.f);
I added this so I could sprint indefinitely for the 096 video.

Re: Irrlicht Port

#303
CLgaming wrote:Question, could you give a rough percentage (decimal values allowed) on this thing's completion? I have that post-hype-train-image fever again.
If you want hype, look at the comments under the pathfinding video. It's ten times better than any percent you could get.
𝙱𝚕𝚒𝚝𝚣𝟹𝙳 𝙴𝚛𝚛𝚘𝚛(!): 𝙿𝚛𝚎𝚜𝚜𝚒𝚗𝚐 𝚝𝚑𝚎 𝚋𝚞𝚝𝚝𝚘𝚗 𝚛𝚊𝚙𝚒𝚍𝚕𝚢 𝚒𝚜𝚗'𝚝 𝚐𝚘𝚒𝚗𝚐 𝚝𝚘 𝚖𝚊𝚔𝚎 𝚝𝚑𝚎 𝚎𝚕𝚎𝚟𝚊𝚝𝚘𝚛 𝚖𝚘𝚟𝚎 𝚏𝚊𝚜𝚝𝚎𝚛.

Re: Irrlicht Port

#304
CLgaming wrote:Question, could you give a rough percentage (decimal values allowed) on this thing's completion? I have that post-hype-train-image fever again.
When it's done, I'd imagine that'll be when it is done.

I've not had much chance to work on anything today but I have learnt how to register functions in C/C++ for use in Lua scripts. Will probably, at some point, have to make a separate code that just is a lot of Lua function registers. For example, I want to eventually be able to have a standard Lua script for every item that contains functions that are run when things happen, like onPickup, and if I wanted it to (for a random example) run createMap when it is picked up, I'd need the function createMap to be registered for Lua use.

Still getting a feel for things in C++ but once I pick it up this should gain speed :)

Current in-progress code:

Code: Select all

int set_variable_via_lua(lua_State *L)
{
  int argc = lua_gettop(L);

  std::cerr << "-- set_variable_via_lua() called with "<<argc<< " arguments:" << std::endl;

  for ( int n=1; n<=argc; ++n ) {
    std::cerr << "-- argument " << n <<": "<< lua_tostring(L, n) << std::endl;
  }

  float testvar = lua_tonumber(L, 2);
  lua_pushnumber(L, testvar); // return value
  return 1; // number of return values
}

Code: Select all

    lua_State *L = lua_open();

    luaL_openlibs(L);
    lua_register(L, "set_variable_via_lua", set_variable_via_lua);
    char* file = "test.lua";
    std::cerr << "-- Loading file: " << file << std::endl;
    int s = luaL_loadfile(L, file);
    if ( s==0 ) {
      // execute Lua program
      s = lua_pcall(L, 0, LUA_MULTRET, 0);
    }
    lua_close(L);
Lua code:

Code: Select all

io.write("Running ", _VERSION, "\n")
a = set_variable_via_lua("Stamina", 100.0)
io.write("set_variable_via_lua() returned ", a, "\n")
SCP - Box of Horrors v0.8.0b
Twitter
Github Profile

Re: Irrlicht Port

#305
Looking good guys. I'm learning how to model and I'm looking for extra practice. I don't know what format Irrlicht uses but I'm sure it's something common. If you guys need some programmer art or updated models/animations shoot me a PM or something. I've been a lurker here for a looong time, figured I'd make and account and start to contribute.

Re: Irrlicht Port

#307
Right now I don't need any help with modelling, so far I have everything I need.

Last week I've been implementing shadow mapping:
Spoiler
Image
I'm still trying to optimize it, right now rendering more than 4 point lights (24 spotlights) brings the framerate down very quickly. I'm not sure what else I can do to keep optimizing, so I'll keep lightmaps and use dynamic lights for very few effects.

Re: Irrlicht Port

#308
juanjpro wrote:Right now I don't need any help with modelling, so far I have everything I need.

Last week I've been implementing shadow mapping:
Spoiler
Image
I'm still trying to optimize it, right now rendering more than 4 point lights (24 spotlights) brings the framerate down very quickly. I'm not sure what else I can do to keep optimizing, so I'll keep lightmaps and use dynamic lights for very few effects.
Dynamic shadows? Nice. It could be usefull for producing effects we cant make with pre-rendered shadows, and keep the pre-rendered for every thing else.
I got an idea. Making anything not map related (Objects, npcs) produce dynamic shadows based on the lights, while the map related objects (Rooms) keep using the pre-rendered shadows.
Image

Re: Irrlicht Port

#310
juanjpro wrote:Right now I don't need any help with modelling, so far I have everything I need.

Last week I've been implementing shadow mapping:
Spoiler
Image
I'm still trying to optimize it, right now rendering more than 4 point lights (24 spotlights) brings the framerate down very quickly. I'm not sure what else I can do to keep optimizing, so I'll keep lightmaps and use dynamic lights for very few effects.
It's like a Hubbawubba64 dream come true.
𝙱𝚕𝚒𝚝𝚣𝟹𝙳 𝙴𝚛𝚛𝚘𝚛(!): 𝙿𝚛𝚎𝚜𝚜𝚒𝚗𝚐 𝚝𝚑𝚎 𝚋𝚞𝚝𝚝𝚘𝚗 𝚛𝚊𝚙𝚒𝚍𝚕𝚢 𝚒𝚜𝚗'𝚝 𝚐𝚘𝚒𝚗𝚐 𝚝𝚘 𝚖𝚊𝚔𝚎 𝚝𝚑𝚎 𝚎𝚕𝚎𝚟𝚊𝚝𝚘𝚛 𝚖𝚘𝚟𝚎 𝚏𝚊𝚜𝚝𝚎𝚛.