Re: Irrlicht Port

#31
Skin_ wrote:Great work, looks like its running nice and smoothly with the new physics and everything. By the way, assuming that your using the room I sent you, whats up with the textures? Did something break or is it just to do with the port and you haven't gotten to it yet?
Every opaque surface of the room has the tilebump.jpg texture applied for testing purposes, because it's the most noticeable. I'll change that later.

Re: Irrlicht Port

#32
juanjpro wrote: Every opaque surface of the room has the tilebump.jpg texture applied for testing purposes, because it's the most noticeable. I'll change that later.
Ah I see, thanks. I wanted to know in case I had messed something up with the room.
Image

Re: Irrlicht Port

#33
You are doing a lot of progress :D great job ;) I really like where this is going. It sure does have more potential than Blitz and maybe in the future this will be updated and made as the real deal. It seems to have the ability to display more stuff, which allows the addition of new SCPs

Re: Irrlicht Port

#34
This is just me nitpicking, but wouldn't it be a better idea to put items in a class hierarchy rather than relying on itemtemplates? It might be a little bit too OO, but if you're going to re-write the game, you mightaswell take advantage of the fact that you're using an OO language.
M-x dingus-mode

Re: Irrlicht Port

#35
MonocleBios wrote:This is just me nitpicking, but wouldn't it be a better idea to put items in a class hierarchy rather than relying on itemtemplates? It might be a little bit too OO, but if you're going to re-write the game, you mightaswell take advantage of the fact that you're using an OO language.
You mean something like this?

Code: Select all

class item {
	//general items stuff
};

class itemEyedrops : public item {
	//eyedrops specific stuff
};

class itemGasmask : public item {
	//gasmask specific stuff
};
Most of the code was quickly made to have a simple demo going on, but I'll improve it. This should be safer, because one could get the itemtemp and delete it.

Re: Irrlicht Port

#36
juanjpro wrote: You mean something like this?
Pretty much. It doesn't matter all that much for performance but I prefer writing lots of small, overridden functions rather than writing one huge-ass function with tons of cases. Look at DrawGUI in the B3D code. The item handling portion of that function is over 700 lines long.
Most of the code was quickly made to have a simple demo going on
By all means write it the way you want to write it. I write awkwardly structured code to get something done quickly all the time. (Wish I could for school though)
M-x dingus-mode

Re: Irrlicht Port

#37
Okay, I rewrote the item code to take advantage of inheritance. To test it, I added the Gas Mask. It looks pretty bad, especially if it's flipped over:
Spoiler
Image
I'm not a good modeler, so if anyone wants to help out with a better looking model, send it to me and I'll add it.

Edit: For those who want to know a bit about how items work now, here's the code needed to initialize them:

Code: Select all

irr::scene::IMeshSceneNode* node = nullptr;
dynRegister* itemDyn = new dynRegister(dynamics); //dynRegister is a class that only provides access to register/unregisterRBody, needed to show/hide items properly

node = irrSmgr->addMeshSceneNode(irrSmgr->getMesh("test/eyedrops.b3d"));
node->setMaterialFlag(irr::video::EMF_NORMALIZE_NORMALS, true);

node->setScale(irr::core::vector3df(0.06*RoomScale,0.06*RoomScale,0.06*RoomScale));
itemEyedrops::setMeshNode(node); //the mesh node is stored in a static member
itemEyedrops::setDynamics(itemDyn); //same for dynRegister

node = irrSmgr->addMeshSceneNode(irrSmgr->getMesh("test/gasmask.b3d"));
node->setMaterialFlag(irr::video::EMF_NORMALIZE_NORMALS, true);

node->setScale(irr::core::vector3df(0.6*RoomScale,0.6*RoomScale,0.6*RoomScale));
itemGasMask::setMeshNode(node);
itemGasMask::setDynamics(itemDyn);

for (irr::u32 ui=0;ui<10000;ui++) {
	item* it = itemEyedrops::createItemEyedrops(); //don't call "new itemEyedrops();", use this function instead
	itemList.push_back(it);

	it = itemGasMask::createItemGasMask();
	itemList.push_back(it);
}

//use item::Unpick to show the items

Re: Irrlicht Port

#38
juanjpro wrote:I'm not a good modeler, so if anyone wants to help out with a better looking model, send it to me and I'll add it.
The model is actually probably ok. The reason it looks bad when flipped over is because the polygons that compose the straps are single sided, since in containment breach they are only ever viewed from one side anyway. I am away from my machine right now but if anybody is up to it it should only take a few seconds to select the polygons that compose the mask's straps, clone them, and flip their normals. If not, I will hop on and do it in the morning :)

On a somewhat unrelated note, nice work so far juan. I completely agree with the notion of utilizing the advantages of OO programming as much as possible with this port. It will really make a huge difference down the road.

Re: Irrlicht Port

#39
risingstar64 wrote:The model is actually probably ok. The reason it looks bad when flipped over is because the polygons that compose the straps are single sided, since in containment breach they are only ever viewed from one side anyway. I am away from my machine right now but if anybody is up to it it should only take a few seconds to select the polygons that compose the mask's straps, clone them, and flip their normals. If not, I will hop on and do it in the morning :)
I imagined that wouldn't look too good either, but it actually turned out pretty well. Still, it looks kinda "flat":
Spoiler
Image
I may be able to change that myself, but I can't promise anything.

Re: Irrlicht Port

#40
juanjpro wrote:I imagined that wouldn't look too good either, but it actually turned out pretty well. Still, it looks kinda "flat":
[image]
I may be able to change that myself, but I can't promise anything.
I see what you're saying. With the polygons that you effectively made double sided it definitely looks much better, but since it wasn't designed to be viewed from that angle it still feels like it is lacking some detail. Honestly I wouldn't worry about this sort of thing beyond the effort you already put in until later down the line (or until a dedicated modeler offers to do it) just because it feels like a low priority concern in the scope of this port.